改进 Header 状态显示
This commit is contained in:
parent
a53f1b1710
commit
f3c7c40f1e
@ -674,11 +674,36 @@ function streamChat(streamId: String, redirect = false) {
|
|||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case "tool_calling":
|
case "tool_calling":
|
||||||
// toolCalling.value = true;
|
if (data.tool_call_message.function_name.startsWith("builtin_")) {
|
||||||
|
if (data.tool_call_message.function_name === "builtin_browser") {
|
||||||
|
let url = data.tool_call_message.args.query_or_url;
|
||||||
|
// 如果是 URL
|
||||||
|
if (url.startsWith("http")) {
|
||||||
|
chatStore.toolName = "正在浏览 " + url;
|
||||||
|
} else {
|
||||||
|
chatStore.toolName = "正在搜索 " + url;
|
||||||
|
}
|
||||||
|
} else if (data.tool_call_message.function_name === "calculator") {
|
||||||
|
chatStore.toolName = "正在计算";
|
||||||
|
} else if (
|
||||||
|
data.tool_call_message.function_name === "generate_image"
|
||||||
|
) {
|
||||||
|
chatStore.toolName = "生成图片中";
|
||||||
|
} else if (
|
||||||
|
data.tool_call_message.function_name === "describe_image"
|
||||||
|
) {
|
||||||
|
chatStore.toolName = "正在理解图片";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
chatStore.toolName =
|
chatStore.toolName =
|
||||||
|
"正在执行 " +
|
||||||
data.tool_call_message.tool_name +
|
data.tool_call_message.tool_name +
|
||||||
" 中的 " +
|
" 中的 " +
|
||||||
data.tool_call_message.function_name;
|
data.tool_call_message.function_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
// toolCalling.value = true;
|
||||||
|
|
||||||
// toolName.value =
|
// toolName.value =
|
||||||
// data.tool_call_message.tool_name +
|
// data.tool_call_message.tool_name +
|
||||||
// " 中的 " +
|
// " 中的 " +
|
||||||
|
@ -69,7 +69,7 @@
|
|||||||
|
|
||||||
<div v-else-if="chatStore.toolName != ''">
|
<div v-else-if="chatStore.toolName != ''">
|
||||||
<n-gradient-text type="info">
|
<n-gradient-text type="info">
|
||||||
正在执行 {{ chatStore.toolName }}
|
{{ chatStore.toolName }}
|
||||||
</n-gradient-text>
|
</n-gradient-text>
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
|
Loading…
Reference in New Issue
Block a user