diff --git a/feat.md b/feat.md index 4507b2c..de939ef 100644 --- a/feat.md +++ b/feat.md @@ -1,8 +1,51 @@ # 任务目标 -改一下"E:\gitlab\mis-dev\mis-modules\mis-agent\src\main\java\com\lcfc\agent\stats\domain\vo\ProjectStatsTotalVo.java"里面的`formatRate(long numerator, long denominator)`方法。 -## 现状 -输入:numerator=4,denominator=192,输出:"2.00" - -## 预期结果 -输入:numerator=4,denominator=192,输出:"2.08" \ No newline at end of file +探索一下"E:\gitlab\mis-qas\mis-modules\mis-agent\src\main\java\com\lcfc\agent\monitor\MisMcpToolMetadataCtl.java"里面的`public List get(Long agentId)`方法,还有"E:\gitlab\mis-qas\mis-modules\mis-agent\src\main\java\com\lcfc\agent\monitor\AgentChatMetricsCtx.java"的`public void addToolUse(String toolName, String content)`方法。为什么没有收集到`workflowNames`,也就是`MisMcpToolMetadata.ToolCategory.WORKFLOW == d.getCategory()`条件没有成立。`addToolUse`的调用入口在"E:\gitlab\mis-qas\mis-modules\mis-agent\src\main\java\com\lcfc\agent\agents\saa\ctl\SAAgentChatMetricsCtl.java"里面的`public void addToolUse(RunnableConfig config, ToolCallRequest request)`方法。关联MCPServer的信息如下: +```json +{"mcp_server_uuid":2084832591415877633,"mcp_server_source_uuid":2011699902312255490,复制|复制路径|下载|删除"name":"getappliedlist-mingyan-1785897794303","serve_aliases":"GetAppliedList-Mingyan","description":"查询GetAppliedList的数据",复制|复制路径|下载|删除"service_picture":0,"mcp_service_type":3,"workflow":1,复制|复制路径|下载|删除"sort":null,"create_by":7,"create_time":"2026-08-05 10:43:19","create_dept":1889219366819864580,"update_time":"2026-08-05 14:04:48","update_by":7,"del_flag":0,"auth_name":"","auth":"","auth_type":0,"private_flags":0,"address":null,"mcp_state":2,"mcp_state_reason":null,"environment":1,"mcp_file":null,"mcp_param":null,"usage_type":7} +``` +MCPServer里的tool信息如下: +```json +{ + "tools_uuid": 2084832573384683521, + "mcp_server_uuid": 2084832591415877633, + "tools_name": "GetAppliedList-Mingyan", + "tools_image": 0, + "tools_state": 2, + "tools_llm_description": "查询GetAppliedList的数据", + "tools_state_reason": null, + "mcp_access_mode": 1, + "sort": null, + "create_by": 7, + "create_time": "2026-08-05 10:43:14", + "create_dept": 1889219366819864580, + "update_time": "2026-08-05 14:04:53", + "update_by": 7, + "del_flag": 0 +} +``` +最终收集到的数据如下: +```json +[ + { + "id": 4504, + "chat_window_id": 2084834209154785281, + "user_message_id": 2084834320765214721, + "main_agent_id": 0, + "agent_id": 2084833763950399489, + "agent_type": "single", + "tokens": 1118, + "input_tokens": 624, + "output_tokens": 494, + "kb_name": "", + "tool_name": "", + "tool_use_info": "[{\"name\":\"GetAppliedList_Mingyan\",\"input\":\"{\\n \\\"chat_history\\\": [],\\n \\\"chat_history_rounds\\\": 0,\\n \\\"current_time\\\": \\\"2026-08-05T00:00:00Z\\\",\\n \\\"flow_id\\\": \\\"\\\",\\n \\\"session_id\\\": \\\"\\\",\\n \\\"uid\\\": \\\"\\\",\\n \\\"usr_input\\\": \\\"\\\"\\n}\",\"output\":\"\"},{\"name\":\"GetAppliedList_Mingyan\",\"input\":\"\",\"output\":\"[{\\\"text\\\":\\\"# 以下数据数tool的返回信息\\\\n\\\\n- **工作流输出结果**: \\\\n\\\"}]\"}]", + "skill_name": "", + "workflow_name": "", + "user_name": "mingyan.li", + "create_time": "2026-08-05 10:50:14", + "begin_time": "2026-08-05 10:50:11", + "agent_message": null + } +] +``` \ No newline at end of file