fix gemini

This commit is contained in:
Andrew Pareles
2025-01-22 03:25:27 -08:00
parent 4dc0f608ed
commit 3f6dc91e27
2 changed files with 4 additions and 7 deletions
@@ -3,7 +3,7 @@
* Licensed under the Apache License, Version 2.0. See LICENSE.txt for more information.
*--------------------------------------------------------------------------------------*/
import { Content, GoogleGenerativeAI, GoogleGenerativeAIFetchError } from '@google/generative-ai';
import { Content, GoogleGenerativeAI } from '@google/generative-ai';
import { _InternalSendLLMMessageFnType } from '../../common/llmMessageTypes.js';
// Gemini
@@ -43,11 +43,6 @@ export const sendGeminiMsg: _InternalSendLLMMessageFnType = async ({ messages, o
onFinalMessage({ fullText });
})
.catch((error) => {
if (error instanceof GoogleGenerativeAIFetchError && error.status === 400) {
onError({ message: 'Invalid API key.', fullError: null });
}
else {
onError({ message: error + '', fullError: error });
}
onError({ message: error + '', fullError: error })
})
}
@@ -277,7 +277,9 @@ Please finish writing the new file by applying the diff to the original file. Re
// this should probably be longer
export const ctrlKStream_systemMessage = `\
You are an AI assistant tasked with filling in the middle.
`