修复自定义模型的对话问题

This commit is contained in:
Wenjie Zhang 2025-03-30 19:26:43 +08:00
parent 63d124bf03
commit f23583f2fa
3 changed files with 4 additions and 9 deletions

6
package-lock.json generated
View File

@ -1,6 +0,0 @@
{
"name": "Yuxi-Know",
"lockfileVersion": 3,
"requires": true,
"packages": {}
}

View File

@ -28,7 +28,8 @@ class OpenAIBase():
stream=True, stream=True,
) )
for chunk in response: for chunk in response:
yield chunk.choices[0].delta if len(chunk.choices) > 0:
yield chunk.choices[0].delta
def _get_response(self, messages): def _get_response(self, messages):
response = self.client.chat.completions.create( response = self.client.chat.completions.create(

View File

@ -183,7 +183,7 @@
type="link" type="link"
> >
<template #icon> <template #icon>
<StopOutlined v-if="isStreaming" /> <PauseOutlined v-if="isStreaming" />
<ArrowUpOutlined v-else /> <ArrowUpOutlined v-else />
</template> </template>
</a-button> </a-button>
@ -220,7 +220,7 @@ import {
BulbOutlined, BulbOutlined,
CaretRightOutlined, CaretRightOutlined,
DeploymentUnitOutlined, DeploymentUnitOutlined,
StopOutlined, PauseOutlined,
ReloadOutlined, ReloadOutlined,
CopyOutlined CopyOutlined
} from '@ant-design/icons-vue' } from '@ant-design/icons-vue'