LLM 请求透明化

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
2026-05-06 11:03:07 +08:00
parent fb2b4fad9f
commit 883faa2d54
12 changed files with 144 additions and 0 deletions
+2
View File
@@ -14,3 +14,5 @@ temperature: 0.2
4. 仅将前端工具视为显示/交互工具,不要假设它们返回数据。
5. 保持回复准确、简洁,对供水网络用户在操作上有用。
6. 尊重用户授权和项目隔离,工具调用失败或无可用数据时,切勿编造后端结果。
7. 每次调用任意工具时,必须在工具参数 `reason` 字段中填写本次调用理由,理由需具体且与当前用户问题直接相关。
8. 每次按需加载技能(skills)前,先明确说明加载理由,并只加载与当前任务直接相关的最小技能集合。
+4
View File
@@ -7,6 +7,9 @@ export default tool({
description:
"通过本地 Agent 桥接调用 TJWater 后端 API。需提供 API 路径、可选的请求方法以及查询参数。",
args: {
reason: tool.schema
.string()
.describe("Why this tool call is required for the current user request."),
path: tool.schema.string().describe("Target backend API path, starting with '/'."),
method: tool.schema
.string()
@@ -27,6 +30,7 @@ export default tool({
},
body: JSON.stringify({
sessionId: context.sessionID,
reason: args.reason,
path: args.path,
method: args.method,
arguments: args.arguments,
+3
View File
@@ -3,6 +3,9 @@ import { tool } from "@opencode-ai/plugin";
export default tool({
description: "在前端地图上定位并高亮指定的管网要素。",
args: {
reason: tool.schema
.string()
.describe("Why this map positioning action is needed for the user request."),
ids: tool.schema.array(tool.schema.string()).describe("Feature ids to locate."),
feature_type: tool.schema
.enum(["junction", "pipe", "valve", "reservoir", "pump", "tank"])
+3
View File
@@ -3,6 +3,9 @@ import { tool } from "@opencode-ai/plugin";
export default tool({
description: "在前端对话界面中渲染图表。",
args: {
reason: tool.schema
.string()
.describe("Why this chart should be rendered for the user request."),
title: tool.schema.string().optional().describe("Chart title."),
chart_type: tool.schema
.enum(["line", "bar", "pie"])
+3
View File
@@ -3,6 +3,9 @@ import { tool } from "@opencode-ai/plugin";
export default tool({
description: "为选定的管网要素打开前端的历史记录或计算结果面板。",
args: {
reason: tool.schema
.string()
.describe("Why this history panel should be opened for the current task."),
feature_infos: tool.schema
.array(tool.schema.tuple([tool.schema.string(), tool.schema.string()]))
.describe("List of [id, type] pairs."),
+3
View File
@@ -3,6 +3,9 @@ import { tool } from "@opencode-ai/plugin";
export default tool({
description: "打开前端的 SCADA 监测数据历史面板。",
args: {
reason: tool.schema
.string()
.describe("Why SCADA panel interaction is required for this request."),
device_ids: tool.schema
.array(tool.schema.string())
.optional()