Fixed api base

This commit is contained in:
AsafMah 2023-07-15 18:35:29 +03:00 committed by GitHub
parent e8240a7bef
commit e8adc27cfb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -28,6 +28,7 @@ export async function createStreamChatCompletion(
) {
const settings = await db.settings.get("general");
const model = settings?.openAiModel ?? config.defaultModel;
const chatCompletionsUrl = settings?.openAiApiBase ? settings?.openAiApiBase + "/chat/completions" : undefined;
return OpenAIExt.streamClientChatCompletion(
{
@ -36,6 +37,7 @@ export async function createStreamChatCompletion(
},
{
apiKey: apiKey,
chatCompletionsUrl: chatCompletionsUrl,
handler: {
onContent(content, isFinal, stream) {
setStreamContent(messageId, content, isFinal);