Skip to content

Commit ebd166e

Browse files
committed
fix(agent):调整代理最大步骤数并修复前端显示逻辑
- 减少代理工具调用的最大步骤数计算方式 - 启用并修复前端聊天组件中的推理内容显示 - 修复删除分组时传递正确参数类型 - 更新依赖项,移除旧版本的 chromedp 和 golang.org/x/sys
1 parent 494a60d commit ebd166e

File tree

4 files changed

+8
-14
lines changed

4 files changed

+8
-14
lines changed

backend/agent/agent.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func GetStockAiAgent(ctx *context.Context, aiConfig data.AIConfig) *react.Agent
7979
agent, err := react.NewAgent(*ctx, &react.AgentConfig{
8080
ToolCallingModel: toolableChatModel,
8181
ToolsConfig: aiTools,
82-
MaxStep: len(aiTools.Tools)*3 + 2,
82+
MaxStep: len(aiTools.Tools)*1 + 3,
8383
MessageModifier: func(ctx context.Context, input []*schema.Message) []*schema.Message {
8484
return input
8585
},

frontend/src/components/agent-chat.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<template #content="{ item, index }">
1515
<t-chat-reasoning v-if="item.role === 'assistant'" expand-icon-placement="right">
1616
<t-chat-loading v-if="isStreamLoad" text="思考中..." />
17-
<!-- <t-chat-content v-if="item.reasoning.length > 0" :content="item.reasoning" />-->
17+
<t-chat-content v-if="item.reasoning.length > 0" :content="item.reasoning" />
1818
</t-chat-reasoning>
1919
<t-chat-content v-if="item.content.length > 0" :content="item.content" />
2020
</template>
@@ -97,9 +97,9 @@ EventsOn("agent-message", (data) => {
9797
if(data['role']==="assistant"){
9898
loading.value = false;
9999
const lastItem = chatList.value[0];
100-
// if (data['reasoning_content']){
101-
// lastItem.reasoning = data['reasoning_content'];
102-
// }
100+
if (data['reasoning_content']){
101+
lastItem.reasoning += data['reasoning_content'];
102+
}
103103
if (data['content']){
104104
lastItem.content +=data['content'];
105105
}

frontend/src/components/stock.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1853,16 +1853,16 @@ function updateTab(name) {
18531853
})
18541854
}
18551855
1856-
function delTab(name) {
1857-
let infos = groupList.value = groupList.value.filter(item => item.ID === Number(name))
1856+
function delTab(groupId) {
1857+
let infos = groupList.value = groupList.value.filter(item => item.ID === Number(groupId))
18581858
dialog.create({
18591859
title: '删除分组',
18601860
type: 'warning',
18611861
content: '确定要删除[' + infos[0].name + ']分组吗?分组数据将不能恢复哟!',
18621862
positiveText: '确定',
18631863
negativeText: '取消',
18641864
onPositiveClick: () => {
1865-
RemoveGroup(name).then(result => {
1865+
RemoveGroup(Number(groupId)).then(result => {
18661866
message.info(result)
18671867
GetGroupList().then(result => {
18681868
groupList.value = result

go.sum

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,8 @@ github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA
2424
github.com/certifi/gocertifi v0.0.0-20190105021004-abcd57078448/go.mod h1:GJKEexRPVJrBSOjoqN5VNOIKJ5Q3RViH6eu3puDRwx4=
2525
github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE=
2626
github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
27-
github.com/chromedp/cdproto v0.0.0-20241022234722-4d5d5faf59fb h1:noKVm2SsG4v0Yd0lHNtFYc9EUxIVvrr4kJ6hM8wvIYU=
28-
github.com/chromedp/cdproto v0.0.0-20241022234722-4d5d5faf59fb/go.mod h1:4XqMl3iIW08jtieURWL6Tt5924w21pxirC6th662XUM=
2927
github.com/chromedp/cdproto v0.0.0-20250803210736-d308e07a266d h1:ZtA1sedVbEW7EW80Iz2GR3Ye6PwbJAJXjv7D74xG6HU=
3028
github.com/chromedp/cdproto v0.0.0-20250803210736-d308e07a266d/go.mod h1:NItd7aLkcfOA/dcMXvl8p1u+lQqioRMq/SqDp71Pb/k=
31-
github.com/chromedp/chromedp v0.11.2 h1:ZRHTh7DjbNTlfIv3NFTbB7eVeu5XCNkgrpcGSpn2oX0=
32-
github.com/chromedp/chromedp v0.11.2/go.mod h1:lr8dFRLKsdTTWb75C/Ttol2vnBKOSnt0BW8R9Xaupi8=
3329
github.com/chromedp/chromedp v0.14.1 h1:0uAbnxewy/Q+Bg7oafVePE/6EXEho9hnaC38f+TTENg=
3430
github.com/chromedp/chromedp v0.14.1/go.mod h1:rHzAv60xDE7VNy/MYtTUrYreSc0ujt2O1/C3bzctYBo=
3531
github.com/chromedp/sysutil v1.1.0 h1:PUFNv5EcprjqXZD9nJb9b/c9ibAbxiYo4exNWZyipwM=
@@ -415,8 +411,6 @@ golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
415411
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
416412
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
417413
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
418-
golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI=
419-
golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
420414
golang.org/x/sys v0.36.0 h1:KVRy2GtZBrk1cBYA7MKu5bEZFxQk4NIDV6RLVcC8o0k=
421415
golang.org/x/sys v0.36.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
422416
golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE=

0 commit comments

Comments
 (0)