Files
prompts/certification-v1.2.md
V-LiuShuang a8fadde7f5 add
2026-07-27 11:51:18 +08:00

57 lines
2.1 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 需求描述
结合文档[mis-agent.md](./mis-agent.md)为**mis-certification**模块实现以下功能。
## 目录结构说明
### 主目录
```text
mis-modules\mis-certification\src\main\
├── java # Java源文件
└── resources
└── mapper\certification\ # Mybatis Mapper XML
└── application.yml # 配置文件
```
### 需求涉及到的源码
```text
com\lcfc\certification\
├── controller\
└── regulations\
├── AgentStaticLoader.java # 通过"init"方法初始化"certificationAgent"对象
├── CertificationAgent.java # 通过"LlmRoutingAgent"把用户请求分派给子智能体
└── ChatController.java # HTTP请求入口"/certificationChat"
```
## 任务内容
收集"LlmRoutingAgent"的工具调用、知识库调用、token消耗、用户ID等信息。你不必使用"AgentChatMetricsCtx.java"对象来收集数据,你最终要构建的对象是"ProjectAgentChatLifeCyclePayload.java"对象。但是请注意这个智能体是没有集成Skill的也不会触发工作流新建一个DTO按需收集数据使用"certification-agent"作为agentId。以下有一些信息可供你参考
### MCP工具的配置
```yaml
spring:
ai:
mcp:
client:
streamable-http:
connections:
server1:
url: http://10.159.252.27:30080
endpoint: /tool/mcp
```
### 其它模块的数据收集方式
参考**mis-agent**模块下收集单智能体的监控数据,涉及的关键代码如下:
|文件名|关键词|
|:-----|:-----|
|AgentServiceImpl.java|"misAgentChatMetricsCtl.create"|
|MisAgentChatMetricsCtl.java|"public AgentChatMetricsCtx create(Map<String, Object> metadata)"|
|KbModelHook.java|"saAgentChatMetricsCtl.addKnowledgeIds"|
|ToolMonitoringInterceptor.java|"saAgentChatMetricsCtl.addToolUse","saAgentChatMetricsCtl.addToolResult"|
|AgentChatMetricsFinishListener.java|"onMessage","asyncSendOrHandle","saveAgentChatMetrics"|
|ProjectStatsDataExporter.java|"saveAgentChatMetrics"|