add
This commit is contained in:
57
certification-v1.2.md
Normal file
57
certification-v1.2.md
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
# 需求描述
|
||||||
|
|
||||||
|
结合文档[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"|
|
||||||
Reference in New Issue
Block a user