Skip to content

Commit 6f6d0f2

Browse files
authored
Update ai.html
1 parent 6d252bb commit 6f6d0f2

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

ai.html

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,25 @@
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
}

0 commit comments

Comments
 (0)