feat!: require user to provide LLM api. do not fallback to demo LLM

BREAKING CHANGE: LLM API will be required for agent constructor
This commit is contained in:
Simon
2026-01-14 18:49:23 +08:00
parent 62519416bb
commit 4f6249a252
8 changed files with 54 additions and 42 deletions

View File

@@ -95,7 +95,7 @@ export class PageAgent extends EventTarget {
/** History records */
history: AgentHistory[] = []
constructor(config: PageAgentConfig = {}) {
constructor(config: PageAgentConfig) {
super()
this.config = config

View File

@@ -35,7 +35,12 @@ setTimeout(() => {
window.pageAgent = new PageAgent(config)
} else {
console.log('🚀 page-agent.js no current script detected, using default demo config')
window.pageAgent = new PageAgent()
const config: PageAgentConfig = {
model: DEMO_MODEL,
baseURL: DEMO_BASE_URL,
apiKey: DEMO_API_KEY,
}
window.pageAgent = new PageAgent(config)
}
console.log('🚀 page-agent.js initialized with config:', window.pageAgent.config)