改进 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

@ -60,7 +60,7 @@
</n-scrollbar>
</div>
<div class="min-w-full pt-2 relative " style="max-height: 120px">
<div class="min-w-full pt-2 relative" style="max-height: 120px">
<div class="relative bottom-0 pr-2 pl-2 min-w-full" ref="textContainer">
<div
class="mx-auto w-2xl max-w-2xl text-center mb-3 animate__animated animate__pulse text-lg"
@ -674,11 +674,36 @@ function streamChat(streamId: String, redirect = false) {
});
break;
case "tool_calling":
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;
chatStore.toolName =
data.tool_call_message.tool_name +
" 中的 " +
data.tool_call_message.function_name;
// 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>