mirror of
https://github.com/voideditor/void
synced 2026-05-24 09:58:23 +00:00
fix gemini
This commit is contained in:
parent
fd4f3c3ab6
commit
387be4db76
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.
|
||||
`
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue