File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4747
4848 const aiMsg = addMsg ( 'Thinking...' , 'ai' ) ;
4949
50+ const apiKey = window . process ?. env ?. API_KEY ;
51+ if ( ! apiKey ) {
52+ aiMsg . textContent = "Error: API Key not detected. Please verify your system configuration." ;
53+ return ;
54+ }
55+
5056 try {
51- const aiClient = new GoogleGenAI ( { apiKey : window . process ?. env ?. API_KEY } ) ;
57+ const aiClient = new GoogleGenAI ( { apiKey } ) ;
5258 const response = await aiClient . models . generateContent ( {
53- model : 'gemini-2.5 -flash-lite-latest ' ,
59+ model : 'gemini-3 -flash-preview ' ,
5460 contents : query ,
55- config : { systemInstruction : "You are Vision AI, a helpful browser assistant built into the Vision Browser. Be concise and friendly." }
61+ config : {
62+ systemInstruction : "You are Vision AI, a helpful browser assistant built into the Vision Browser. Be concise and friendly." ,
63+ thinkingConfig : { thinkingBudget : 0 }
64+ }
5665 } ) ;
5766 aiMsg . textContent = response . text || "I'm sorry, I couldn't generate a response." ;
5867 } catch ( err ) {
59- aiMsg . textContent = "Error: System connection restricted." ;
68+ aiMsg . textContent = "Error: System connection restricted or model unavailable ." ;
6069 console . error ( err ) ;
6170 }
6271 }
You can’t perform that action at this time.
0 commit comments