feat(ext): expose extension to main-world and auth with token
This commit is contained in:
@@ -5,9 +5,8 @@ import type { AgentActivity, AgentStatus, HistoricalEvent } from '@page-agent/co
|
||||
import type { LLMConfig } from '@page-agent/llms'
|
||||
import { useCallback, useEffect, useRef, useState } from 'react'
|
||||
|
||||
import { DEMO_API_KEY, DEMO_BASE_URL, DEMO_MODEL } from '@/agent/constants'
|
||||
|
||||
import { MultiPageAgent } from './MultiPageAgent'
|
||||
import { DEMO_CONFIG } from './constants'
|
||||
|
||||
export interface UseAgentResult {
|
||||
status: AgentStatus
|
||||
@@ -20,12 +19,6 @@ export interface UseAgentResult {
|
||||
configure: (config: LLMConfig) => Promise<void>
|
||||
}
|
||||
|
||||
const DEMO_CONFIG: LLMConfig = {
|
||||
apiKey: DEMO_API_KEY,
|
||||
baseURL: DEMO_BASE_URL,
|
||||
model: DEMO_MODEL,
|
||||
}
|
||||
|
||||
export function useAgent(): UseAgentResult {
|
||||
const agentRef = useRef<MultiPageAgent | null>(null)
|
||||
const [status, setStatus] = useState<AgentStatus>('idle')
|
||||
|
||||
Reference in New Issue
Block a user