处理键盘ai功能
This commit is contained in:
@@ -1073,7 +1073,7 @@ static void KBSkinInstallNotificationCallback(CFNotificationCenterRef center,
|
||||
__strong typeof(weakSelf) self = weakSelf;
|
||||
if (!self) return;
|
||||
|
||||
if (!response.success) {
|
||||
if (response.code != 0) {
|
||||
if (response.code == 50030) {
|
||||
NSLog(@"[KB] ⚠️ 次数用尽: %@", response.message);
|
||||
[self.chatPanelView kb_removeLoadingAssistantMessage];
|
||||
@@ -1086,9 +1086,9 @@ static void KBSkinInstallNotificationCallback(CFNotificationCenterRef center,
|
||||
return;
|
||||
}
|
||||
|
||||
NSLog(@"[KB] ✅ 收到回复: %@", response.text);
|
||||
NSLog(@"[KB] ✅ 收到回复: %@", response.data.aiResponse);
|
||||
|
||||
if (response.text.length == 0) {
|
||||
if (response.data.aiResponse.length == 0) {
|
||||
[self.chatPanelView kb_removeLoadingAssistantMessage];
|
||||
[KBHUD showInfo:KBLocalized(@"未获取到回复内容")];
|
||||
return;
|
||||
@@ -1096,12 +1096,12 @@ static void KBSkinInstallNotificationCallback(CFNotificationCenterRef center,
|
||||
|
||||
// 添加 AI 消息(带打字机效果)
|
||||
NSLog(@"[KB] 准备添加 AI 消息");
|
||||
[self.chatPanelView kb_addAssistantMessage:response.text audioId:response.audioId];
|
||||
[self.chatPanelView kb_addAssistantMessage:response.data.aiResponse audioId:response.data.audioId];
|
||||
NSLog(@"[KB] AI 消息添加完成");
|
||||
|
||||
// 如果有 audioId,开始预加载音频
|
||||
if (response.audioId.length > 0) {
|
||||
[self kb_preloadAudioWithAudioId:response.audioId];
|
||||
if (response.data.audioId.length > 0) {
|
||||
[self kb_preloadAudioWithAudioId:response.data.audioId];
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user