fix: 修复工具数据类型转换导致的调用结果无法识别
修复agentStore.availableTools的处理逻辑,统一使用Object.values获取工具列表 将进度条的stroke-width属性改为动态绑定格式
This commit is contained in:
parent
da351df193
commit
b0fa9d249b
@ -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
|
||||
});
|
||||
|
||||
// 配置项信息(管理员可见)
|
||||
|
||||
@ -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') {
|
||||
|
||||
@ -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>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user