mirror of
https://github.com/voideditor/void
synced 2026-05-24 09:58:23 +00:00
Update sendLLMMessage.ts
In order to take the enpoint specified for the OpenAICompatible setting - the openai class needs to be instanciated with the baseURL setting from apiConfig
This commit is contained in:
parent
69d848f22b
commit
7f81836d9f
1 changed files with 2 additions and 1 deletions
|
|
@ -119,7 +119,8 @@ const sendOpenAIMsg: SendLLMMessageFnTypeInternal = ({ messages, onText, onFinal
|
|||
didAbort = true;
|
||||
};
|
||||
|
||||
const openai = new OpenAI({ apiKey: apiConfig.openAI.apikey, dangerouslyAllowBrowser: true });
|
||||
//const openai = new OpenAI({ apiKey: apiConfig.openAI.apikey, dangerouslyAllowBrowser: true });
|
||||
const openai = apiConfig.whichApi === 'openAICompatible' ? new OpenAI({ baseURL: apiConfig.openAICompatible.endpoint, apiKey: apiConfig.openAICompatible.apikey, dangerouslyAllowBrowser: true }) : new OpenAI({ apiKey: apiConfig.openAI.apikey, dangerouslyAllowBrowser: true });
|
||||
|
||||
let options: OpenAI.Chat.Completions.ChatCompletionCreateParamsStreaming
|
||||
if (apiConfig.whichApi === 'openAI') {
|
||||
|
|
|
|||
Loading…
Reference in a new issue