改进 Header 状态显示

This commit is contained in:
ivamp 2024-10-14 23:56:39 +08:00
parent a53f1b1710
commit f3c7c40f1e
2 changed files with 31 additions and 6 deletions

View File

@ -674,11 +674,36 @@ function streamChat(streamId: String, redirect = false) {
});
break;
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 =
"正在执行 " +
data.tool_call_message.tool_name +
" 中的 " +
data.tool_call_message.function_name;
}
// toolCalling.value = true;
// toolName.value =
// data.tool_call_message.tool_name +
// " " +

View File

@ -69,7 +69,7 @@
<div v-else-if="chatStore.toolName != ''">
<n-gradient-text type="info">
正在执行 {{ chatStore.toolName }}
{{ chatStore.toolName }}
</n-gradient-text>
</div>
<div v-else>