fix: 修复工具数据类型转换导致的调用结果无法识别

修复agentStore.availableTools的处理逻辑,统一使用Object.values获取工具列表
将进度条的stroke-width属性改为动态绑定格式
This commit is contained in:
Wenjie Zhang 2025-12-28 23:00:53 +08:00
parent da351df193
commit b0fa9d249b
3 changed files with 9 additions and 5 deletions

View File

@ -459,9 +459,10 @@ const printAgentConfig = async () => {
}
//
const toolsList = agentStore.availableTools ? Object.values(agentStore.availableTools) : [];
console.log('可用工具:', {
count: agentStore.availableTools.length,
tools: toRaw(agentStore.availableTools)
count: toolsList.length,
tools: toolsList
});
//

View File

@ -55,7 +55,10 @@ const props = defineProps({
const agentStore = useAgentStore();
const toolName = computed(() => props.toolCall.name || props.toolCall.function?.name || '');
const tool = computed(() => agentStore?.availableTools?.[toolName.value] || null);
const tool = computed(() => {
const toolsList = agentStore?.availableTools ? Object.values(agentStore.availableTools) : [];
return toolsList.find(t => t.name === toolName.value) || null;
});
const parseData = (content) => {
if (typeof content === 'string') {

View File

@ -76,7 +76,7 @@
:percent="getPercent(selectedChunk.data.score)"
:stroke-color="getScoreColor(selectedChunk.data.score)"
:show-info="false"
stroke-width=6
:stroke-width="6"
/>
</div>
<div v-if="selectedChunk.data.rerank_score" class="score-card">
@ -86,7 +86,7 @@
:percent="getPercent(selectedChunk.data.rerank_score)"
:stroke-color="getScoreColor(selectedChunk.data.rerank_score)"
:show-info="false"
stroke-width=6
:stroke-width="6"
/>
</div>
</div>