This commit is contained in:
AsafMah 2024-06-13 10:16:15 -07:00 committed by GitHub
commit 9312f58991
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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);