fix(ai-chat): 跳过健康检查避免服务误判
This commit is contained in:
@@ -906,15 +906,8 @@ async loadChatHistoryIfExist() {
|
|||||||
this.messages.push(loadingMessage)
|
this.messages.push(loadingMessage)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// 检查AI服务状态
|
// 直接发送消息(跳过健康检查,避免健康检查接口格式不匹配导致误判)
|
||||||
const status = await aiService.getServiceStatus()
|
// 如果服务不可用,实际发送时会抛出异常,由 catch 块处理
|
||||||
this.isAIServiceAvailable = status.available
|
|
||||||
|
|
||||||
if (!this.isAIServiceAvailable) {
|
|
||||||
throw new Error('AI服务暂不可用')
|
|
||||||
}
|
|
||||||
|
|
||||||
// 使用AI服务获取回复
|
|
||||||
const enhancedMessage = this.enhanceEmojiMessage(userMessage.content)
|
const enhancedMessage = this.enhanceEmojiMessage(userMessage.content)
|
||||||
if (this.enableStreaming) {
|
if (this.enableStreaming) {
|
||||||
await this.sendStreamMessage(enhancedMessage)
|
await this.sendStreamMessage(enhancedMessage)
|
||||||
|
|||||||
Reference in New Issue
Block a user