Skip to content

Commit

Permalink
Update sendLLMMessage.ts
Browse files Browse the repository at this point in the history
In order to take the enpoint specified for the OpenAICompatible setting - the openai class needs to be instanciated with the baseURL setting from apiConfig
  • Loading branch information
IDLe-Engineering authored Oct 14, 2024
1 parent 69d848f commit 7f81836
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion extensions/void/src/common/sendLLMMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down

0 comments on commit 7f81836

Please sign in to comment.