correctly streaming the response. see #204

This commit is contained in:
mic 2025-01-06 00:40:04 +01:00
parent 3073cf69a3
commit e2da812dfc

View file

@ -84,7 +84,7 @@ export class GoogleGemini {
console.log("[ThunderAI] Google Gemini API request: " + JSON.stringify(google_gemini_body));
const response = await fetch("https://generativelanguage.googleapis.com/v1beta/models/" + this.model + ":generateContent?key=" + this.apiKey + (this.stream ? '&alt=sse' : ''), {
const response = await fetch("https://generativelanguage.googleapis.com/v1beta/models/" + this.model + ":" + (this.stream ? 'streamGenerateContent?alt=sse&' : 'generateContent?') + "key=" + this.apiKey, {
method: "POST",
headers: {
"Content-Type": "application/json"