diff --git a/api/core/tools/builtin_tool/providers/apo_analysis/_assets/icon.svg b/api/core/tools/builtin_tool/providers/apo_analysis/_assets/icon.svg index 6d7118aed9..19e1ba9895 100644 --- a/api/core/tools/builtin_tool/providers/apo_analysis/_assets/icon.svg +++ b/api/core/tools/builtin_tool/providers/apo_analysis/_assets/icon.svg @@ -1,3 +1 @@ - - - \ No newline at end of file + \ No newline at end of file diff --git a/api/core/tools/builtin_tool/providers/apo_analysis/apo_analysis.yaml b/api/core/tools/builtin_tool/providers/apo_analysis/apo_analysis.yaml index 359ba38799..ab090dd8cc 100644 --- a/api/core/tools/builtin_tool/providers/apo_analysis/apo_analysis.yaml +++ b/api/core/tools/builtin_tool/providers/apo_analysis/apo_analysis.yaml @@ -3,12 +3,12 @@ identity: name: apo_analysis label: en_US: APOAnalysis - zh_Hans: APO异常检测 - pt_BR: APOSelect + zh_Hans: APO数据异常检测&关联 + pt_BR: APOAnalysis description: - en_US: A tool for getting the current time. - zh_Hans: APO异常检测分析。 - pt_BR: A tool for getting the current time. + en_US: Input observable data, identify abnormal data through relevant algorithms, or directly correlate and summarize the data. + zh_Hans: 输入可观测性数据, 通过相关算法识别出现异常数据、或者直接对数据进行关联汇总。 + pt_BR: Input observable data, identify abnormal data through relevant algorithms, or directly correlate and summarize the data. icon: icon.svg tags: - utilities \ No newline at end of file diff --git a/api/core/tools/builtin_tool/providers/apo_analysis/tools/alert_ass.py b/api/core/tools/builtin_tool/providers/apo_analysis/tools/alert_ass.py index a6b40707f8..71ae772a18 100644 --- a/api/core/tools/builtin_tool/providers/apo_analysis/tools/alert_ass.py +++ b/api/core/tools/builtin_tool/providers/apo_analysis/tools/alert_ass.py @@ -15,9 +15,9 @@ class AlertAssociateTool(BuiltinTool): app_id: Optional[str] = None, message_id: Optional[str] = None, ) -> Generator[ToolInvokeMessage, None, None]: - metric = tool_parameters.get('topology_data') + metric = tool_parameters.get('topologyData') topology_data = json.loads(metric)['data'] - alert_data = json.loads(tool_parameters.get('alert_data'))['data'] + alert_data = json.loads(tool_parameters.get('alertData'))['data'] alert = self.process_alert(alert_data) topology = self.process_topology(topology_data, alert) diff --git a/api/core/tools/builtin_tool/providers/apo_analysis/tools/alert_ass.yaml b/api/core/tools/builtin_tool/providers/apo_analysis/tools/alert_ass.yaml index 0bb7449aeb..0d261a0a7f 100644 --- a/api/core/tools/builtin_tool/providers/apo_analysis/tools/alert_ass.yaml +++ b/api/core/tools/builtin_tool/providers/apo_analysis/tools/alert_ass.yaml @@ -8,33 +8,33 @@ identity: description: human: en_US: A tool for alert_associate - zh_Hans: 关联拓扑和告警数据 + zh_Hans: 关联拓扑和告警数据, 用于大模型推理 pt_BR: A tool for alert_associate llm: A tool for alert_associate parameters: - - name: topology_data + - name: topologyData type: string required: true label: - en_US: topology_data - zh_Hans: 拓扑数据 - pt_BR: topology_data + en_US: topologyData + zh_Hans: topologyData + pt_BR: topologyData human_description: - en_US: topology_data - zh_Hans: 拓扑数据 + en_US: topologyData + zh_Hans: 入口服务拓扑结构数据 pt_BR: topology_data llm_description: topology data form: llm - - name: alert_data + - name: alertData type: string - required: false + required: true label: - en_US: alert_data - zh_Hans: 告警事件数据 - pt_BR: alert_data + en_US: alertData + zh_Hans: alertData + pt_BR: alertData human_description: - en_US: alert_data - zh_Hans: 告警事件数据 - pt_BR: alert_data - llm_description: alert event data + en_US: alertData + zh_Hans: 入口服务告警事件数据 + pt_BR: alertData + llm_description: alert data form: llm \ No newline at end of file diff --git a/api/core/tools/builtin_tool/providers/apo_analysis/tools/threshold.py b/api/core/tools/builtin_tool/providers/apo_analysis/tools/threshold.py index 3bb4c97ff9..cb955cf87d 100644 --- a/api/core/tools/builtin_tool/providers/apo_analysis/tools/threshold.py +++ b/api/core/tools/builtin_tool/providers/apo_analysis/tools/threshold.py @@ -15,7 +15,7 @@ class ThresholdTool(BuiltinTool): app_id: Optional[str] = None, message_id: Optional[str] = None, ) -> Generator[ToolInvokeMessage, None, None]: - metric = tool_parameters.get('metric_data') + metric = tool_parameters.get('metricData') metric_data = json.loads(metric) threshold = float(tool_parameters.get('threshold')) res = {} diff --git a/api/core/tools/builtin_tool/providers/apo_analysis/tools/threshold.yaml b/api/core/tools/builtin_tool/providers/apo_analysis/tools/threshold.yaml index e577fbd53a..c12ddda9a6 100644 --- a/api/core/tools/builtin_tool/providers/apo_analysis/tools/threshold.yaml +++ b/api/core/tools/builtin_tool/providers/apo_analysis/tools/threshold.yaml @@ -7,34 +7,34 @@ identity: pt_BR: threshold description: human: - en_US: A tool for getting the current time + en_US: threshold judgement zh_Hans: 阈值判定 - pt_BR: A tool for getting the current time - llm: A tool for getting the current time + pt_BR: threshold judgement + llm: threshold judgement parameters: - - name: metric_data + - name: metricData type: string required: true label: - en_US: metric_data - zh_Hans: 指标数据 - pt_BR: metric_data + en_US: metricData + zh_Hans: metricData + pt_BR: metricData human_description: - en_US: Time format in strftime standard + en_US: time series metric data zh_Hans: 时序指标数据 - pt_BR: Time format in strftime standard - llm_description: metric type data + pt_BR: time series metric data + llm_description: Time series indicator data form: llm - name: threshold type: string - required: false + required: true label: en_US: threshold - zh_Hans: 阈值 + zh_Hans: threshold pt_BR: threshold human_description: - en_US: Time format in strftime standard - zh_Hans: 阈值判定 - pt_BR: Time format in strftime standard - llm_description: data threshold judgement + en_US: threshold + zh_Hans: 检测指标类型数据是否超过阈值 + pt_BR: threshold + llm_description: threshold form: llm \ No newline at end of file diff --git a/api/core/tools/builtin_tool/providers/apo_rule/_assets/icon.svg b/api/core/tools/builtin_tool/providers/apo_rule/_assets/icon.svg index 6d7118aed9..19e1ba9895 100644 --- a/api/core/tools/builtin_tool/providers/apo_rule/_assets/icon.svg +++ b/api/core/tools/builtin_tool/providers/apo_rule/_assets/icon.svg @@ -1,3 +1 @@ - - - \ No newline at end of file + \ No newline at end of file diff --git a/api/core/tools/builtin_tool/providers/apo_rule/apo_rule.yaml b/api/core/tools/builtin_tool/providers/apo_rule/apo_rule.yaml index 506fd95df5..55ba8108bc 100644 --- a/api/core/tools/builtin_tool/providers/apo_rule/apo_rule.yaml +++ b/api/core/tools/builtin_tool/providers/apo_rule/apo_rule.yaml @@ -4,11 +4,11 @@ identity: label: en_US: APORule zh_Hans: APO规则执行 - pt_BR: APOSelect + pt_BR: APORule description: - en_US: APO execute rule. - zh_Hans: APO规则执行 - pt_BR: APO execute rule. + en_US: The user inputs the rules described in natural language for large model reasoning + zh_Hans: 用户输入自然语言描述的规则,用于大模型推理 + pt_BR: The user inputs the rules described in natural language for large model reasoning icon: icon.svg tags: - utilities \ No newline at end of file diff --git a/api/core/tools/builtin_tool/providers/apo_rule/tools/alert_rule.yaml b/api/core/tools/builtin_tool/providers/apo_rule/tools/alert_rule.yaml index 0cdc6f5c7c..3a3b94ef68 100644 --- a/api/core/tools/builtin_tool/providers/apo_rule/tools/alert_rule.yaml +++ b/api/core/tools/builtin_tool/providers/apo_rule/tools/alert_rule.yaml @@ -3,12 +3,12 @@ identity: author: APO label: en_US: alert_rule - zh_Hans: 告警规则执行 + zh_Hans: 规则执行 pt_BR: alert_rule description: human: en_US: alert rule execute - zh_Hans: 告警规则执行 + zh_Hans: 规则执行 pt_BR: alert rule execute llm: alert rule execute parameters: @@ -27,10 +27,10 @@ parameters: # form: llm - name: rule type: string - required: false + required: true label: en_US: rule - zh_Hans: 自然语言描述的规则 + zh_Hans: rule pt_BR: rule human_description: en_US: rule diff --git a/api/core/tools/builtin_tool/providers/apo_rule/tools/root_cause.py b/api/core/tools/builtin_tool/providers/apo_rule/tools/root_cause.py index d122e19982..9e643ad300 100644 --- a/api/core/tools/builtin_tool/providers/apo_rule/tools/root_cause.py +++ b/api/core/tools/builtin_tool/providers/apo_rule/tools/root_cause.py @@ -18,7 +18,7 @@ class RootCauseTool(BuiltinTool): """ invoke tools """ - llm_text = tool_parameters.get("llm_text") + llm_text = tool_parameters.get("text") node_lists, text = self._get_node_list(llm_text) yield self.create_text_message(text) diff --git a/api/core/tools/builtin_tool/providers/apo_rule/tools/root_cause.yaml b/api/core/tools/builtin_tool/providers/apo_rule/tools/root_cause.yaml index 0916bf6ae3..ad2537a6f2 100644 --- a/api/core/tools/builtin_tool/providers/apo_rule/tools/root_cause.yaml +++ b/api/core/tools/builtin_tool/providers/apo_rule/tools/root_cause.yaml @@ -8,20 +8,20 @@ identity: description: human: en_US: get root cause - zh_Hans: 获取根因节点 + zh_Hans: 从大模型返回结果获取根因节点 pt_BR: get root cause llm: get root cause node parameters: - - name: llm_text + - name: text type: string required: false label: - en_US: llm_text - zh_Hans: 大模型返回结果 - pt_BR: llm_text + en_US: text + zh_Hans: text + pt_BR: text human_description: - en_US: llm_text - zh_Hans: 大模型返回结果 - pt_BR: llm_text + en_US: llm text + zh_Hans: 大模型返回文本结果 + pt_BR: llm text llm_description: rule form: llm \ No newline at end of file diff --git a/api/core/tools/builtin_tool/providers/apo_select/_assets/icon.svg b/api/core/tools/builtin_tool/providers/apo_select/_assets/icon.svg index 6d7118aed9..19e1ba9895 100644 --- a/api/core/tools/builtin_tool/providers/apo_select/_assets/icon.svg +++ b/api/core/tools/builtin_tool/providers/apo_select/_assets/icon.svg @@ -1,3 +1 @@ - - - \ No newline at end of file + \ No newline at end of file diff --git a/api/core/tools/builtin_tool/providers/apo_select/apo_select.yaml b/api/core/tools/builtin_tool/providers/apo_select/apo_select.yaml index 84e9300758..5f55644236 100644 --- a/api/core/tools/builtin_tool/providers/apo_select/apo_select.yaml +++ b/api/core/tools/builtin_tool/providers/apo_select/apo_select.yaml @@ -3,12 +3,12 @@ identity: name: apo_select label: en_US: APOSelect - zh_Hans: APO查询数据 + zh_Hans: APO平台查询可观测性数据 pt_BR: APOSelect description: - en_US: APO query data. - zh_Hans: APO查询数据的工具。 - pt_BR: APO query data. + en_US: Query APO data. + zh_Hans: 查询APO平台可观测性数据, 用于进一步分析 + pt_BR: Query APO data. icon: icon.svg tags: - utilities \ No newline at end of file diff --git a/api/core/tools/builtin_tool/providers/apo_select/tools/alert.py b/api/core/tools/builtin_tool/providers/apo_select/tools/alert.py index f465bf0539..1478e589ab 100644 --- a/api/core/tools/builtin_tool/providers/apo_select/tools/alert.py +++ b/api/core/tools/builtin_tool/providers/apo_select/tools/alert.py @@ -20,8 +20,8 @@ class AlertTool(BuiltinTool): ) -> Generator[ToolInvokeMessage, None, None]: service = tool_parameters.get("service") endpoint = tool_parameters.get("endpoint") - start_time = tool_parameters.get("start_time") - end_time = tool_parameters.get("end_time") + start_time = tool_parameters.get("startTime") + end_time = tool_parameters.get("endTime") params = { 'service': service, 'endpoint': endpoint, diff --git a/api/core/tools/builtin_tool/providers/apo_select/tools/alert.yaml b/api/core/tools/builtin_tool/providers/apo_select/tools/alert.yaml index 7d66bc07a8..368ba19581 100644 --- a/api/core/tools/builtin_tool/providers/apo_select/tools/alert.yaml +++ b/api/core/tools/builtin_tool/providers/apo_select/tools/alert.yaml @@ -2,27 +2,30 @@ identity: name: alert author: APO label: - en_US: toplogy - zh_Hans: 获取当前入口拓扑的告警事件 - pt_BR: toplogy + en_US: Query the entry service alert events + zh_Hans: 查询入口服务告警事件 + pt_BR: Query the entry service alert events description: human: - en_US: A tool for getting the current time. - zh_Hans: 获取当前入口拓扑的告警事件 - pt_BR: A tool for getting the current time. - llm: A tool for getting the current time. + en_US: Query the entry service alert events + zh_Hans: 查询入口服务告警事件 + pt_BR: Query the entry service alert events + llm: Query the entry service alert events +display: + type: alert + unit: alert parameters: - name: service type: string required: true label: en_US: service - zh_Hans: 服务名 + zh_Hans: service pt_BR: service human_description: - en_US: Time format in strftime standard. + en_US: entry service zh_Hans: 拓扑入口服务名 - pt_BR: Time format in strftime standard. + pt_BR: entry service llm_description: toplogy service name form: llm - name: endpoint @@ -30,37 +33,37 @@ parameters: required: true label: en_US: endpoint - zh_Hans: 服务端点 + zh_Hans: endpoint pt_BR: endpoint human_description: - en_US: Time format in strftime standard. + en_US: toplogy endpoint zh_Hans: 拓扑入口服务端点 - pt_BR: Time format in strftime standard. + pt_BR: toplogy endpoint llm_description: toplogy endpoint form: llm - - name: start_time + - name: startTime type: number - required: false + required: true label: - en_US: start_time - zh_Hans: 开始时间 - pt_BR: start_time + en_US: startTime + zh_Hans: startTime + pt_BR: startTime human_description: - en_US: Time format in strftime standard. - zh_Hans: 查询开始时间。 - pt_BR: Time format in strftime standard. - llm_description: Time format in strftime standard. + en_US: Data query start time + zh_Hans: 开始时间 (微秒) + pt_BR: Data query start time + llm_description: Data query start time form: llm - - name: end_time + - name: endTime type: number - required: false + required: true label: - en_US: end_time - zh_Hans: 结束时间 - pt_BR: end_time + en_US: endTime + zh_Hans: endTime + pt_BR: endTime human_description: - en_US: Time format in strftime standard. - zh_Hans: 指定查询的结束时间 - pt_BR: Time format in strftime standard. - llm_description: Time format in strftime standard. + en_US: Data query end time + zh_Hans: 结束时间 (微秒) + pt_BR: Data query end time + llm_description: Data query start time form: llm \ No newline at end of file diff --git a/api/core/tools/builtin_tool/providers/apo_select/tools/container_cpu.py b/api/core/tools/builtin_tool/providers/apo_select/tools/container_cpu.py index e522974be8..c0553a6f61 100644 --- a/api/core/tools/builtin_tool/providers/apo_select/tools/container_cpu.py +++ b/api/core/tools/builtin_tool/providers/apo_select/tools/container_cpu.py @@ -18,9 +18,9 @@ class SelectContainerCPUTool(BuiltinTool): app_id: Optional[str] = None, message_id: Optional[str] = None, ) -> Generator[ToolInvokeMessage, None, None]: - container_name = tool_parameters.get("container_name") - start_time = tool_parameters.get("start_time") - end_time = tool_parameters.get("end_time") + container_name = tool_parameters.get("container") + start_time = tool_parameters.get("startTime") + end_time = tool_parameters.get("endTime") pmql = 'rate(container_cpu_usage_seconds_total{container="' + container_name + '"}[1m])' params = { 'query': pmql, diff --git a/api/core/tools/builtin_tool/providers/apo_select/tools/container_cpu.yaml b/api/core/tools/builtin_tool/providers/apo_select/tools/container_cpu.yaml index 9521f29f3c..8ecf8c09e3 100644 --- a/api/core/tools/builtin_tool/providers/apo_select/tools/container_cpu.yaml +++ b/api/core/tools/builtin_tool/providers/apo_select/tools/container_cpu.yaml @@ -2,52 +2,55 @@ identity: name: select_container_cpu author: APO label: - en_US: select_container_cpu - zh_Hans: 查询容器CPU占用 - pt_BR: select_container_cpu + en_US: Query the CPU utilization of the container + zh_Hans: 查询容器CPU利用率 + pt_BR: Query the CPU utilization of the container +display: + type: cpu + unit: precent description: human: - en_US: A tool for getting container cpu. - zh_Hans: 查询容器CPU占用 - pt_BR: A tool for getting container cpu. - llm: A tool for getting container cpu. + en_US: Query the CPU utilization of the container + zh_Hans: 查询容器CPU利用率 + pt_BR: Query the CPU utilization of the container + llm: Query the CPU utilization of the container parameters: - - name: container_name + - name: container type: string required: true label: - en_US: container_name - zh_Hans: 容器名 - pt_BR: container_name + en_US: container + zh_Hans: container + pt_BR: container human_description: - en_US: Time format in strftime standard. - zh_Hans: 查询指定Pod的CPU占用。 - pt_BR: Time format in strftime standard. - llm_description: Time format in strftime standard. + en_US: Specified container name + zh_Hans: 指定的容器名称 + pt_BR: Specified container name + llm_description: Specified container name form: llm - - name: start_time + - name: startTime type: number - required: false + required: true label: - en_US: start_time - zh_Hans: 开始时间 - pt_BR: start_time + en_US: startTime + zh_Hans: startTime + pt_BR: startTime human_description: - en_US: Time format in strftime standard. - zh_Hans: 指定查询CPU指标的开始时间。 - pt_BR: Time format in strftime standard. - llm_description: Time format in strftime standard. + en_US: Data query start time + zh_Hans: 开始时间 (微秒) + pt_BR: Data query start time + llm_description: Data query start time form: llm - - name: end_time + - name: endTime type: number - required: false + required: true label: - en_US: end_time - zh_Hans: 结束时间 - pt_BR: end_time + en_US: endTime + zh_Hans: endTime + pt_BR: endTime human_description: - en_US: Time format in strftime standard. - zh_Hans: 指定查询CPU指标的结束时间。 - pt_BR: Time format in strftime standard. - llm_description: Time format in strftime standard. + en_US: Data query end time + zh_Hans: 结束时间 (微秒) + pt_BR: Data query end time + llm_description: Data query start time form: llm \ No newline at end of file diff --git a/api/core/tools/builtin_tool/providers/apo_select/tools/container_rss.py b/api/core/tools/builtin_tool/providers/apo_select/tools/container_rss.py index b31891a362..588af31957 100644 --- a/api/core/tools/builtin_tool/providers/apo_select/tools/container_rss.py +++ b/api/core/tools/builtin_tool/providers/apo_select/tools/container_rss.py @@ -18,9 +18,9 @@ class SelectContainerRSSTool(BuiltinTool): app_id: Optional[str] = None, message_id: Optional[str] = None, ) -> Generator[ToolInvokeMessage, None, None]: - container_name = tool_parameters.get("container_name") - start_time = tool_parameters.get("start_time") - end_time = tool_parameters.get("end_time") + container_name = tool_parameters.get("container") + start_time = tool_parameters.get("startTime") + end_time = tool_parameters.get("endTime") pmql = 'container_memory_rss{container="' + container_name + '"}' params = { 'query': pmql, diff --git a/api/core/tools/builtin_tool/providers/apo_select/tools/container_rss.yaml b/api/core/tools/builtin_tool/providers/apo_select/tools/container_rss.yaml index 715a1e7769..b452d7ee0c 100644 --- a/api/core/tools/builtin_tool/providers/apo_select/tools/container_rss.yaml +++ b/api/core/tools/builtin_tool/providers/apo_select/tools/container_rss.yaml @@ -2,52 +2,55 @@ identity: name: select_container_rss author: APO label: - en_US: select_container_rss - zh_Hans: 查询容器驻留内存 - pt_BR: select_container_rss + en_US: Query container resident memory usage + zh_Hans: 查询容器驻留内存使用量 + pt_BR: Query container resident memory usage description: human: - en_US: A tool for getting container rss. - zh_Hans: 查询容器CPU占用 - pt_BR: A tool for getting container rss. - llm: A tool for getting container rss. + en_US: Query container resident memory usage + zh_Hans: 查询容器驻留内存使用量 + pt_BR: Query container resident memory usage + llm: Query container resident memory usage +display: + type: memory + unit: bytes parameters: - - name: container_name + - name: container type: string required: true label: - en_US: container_name - zh_Hans: 容器名 - pt_BR: container_name + en_US: container + zh_Hans: container + pt_BR: container human_description: - en_US: Time format in strftime standard. - zh_Hans: 查询指定Pod的CPU占用。 - pt_BR: Time format in strftime standard. - llm_description: Time format in strftime standard. + en_US: Specified container name + zh_Hans: 指定的容器名称 + pt_BR: Specified container name + llm_description: Specified container name form: llm - - name: start_time + - name: startTime type: number - required: false + required: true label: - en_US: start_time - zh_Hans: 开始时间 - pt_BR: start_time + en_US: startTime + zh_Hans: startTime + pt_BR: startTime human_description: - en_US: Time format in strftime standard. - zh_Hans: 指定查询CPU指标的开始时间。 - pt_BR: Time format in strftime standard. - llm_description: Time format in strftime standard. + en_US: Data query start time + zh_Hans: 开始时间 (微秒) + pt_BR: Data query start time + llm_description: Data query start time form: llm - - name: end_time + - name: endTime type: number - required: false + required: true label: - en_US: end_time - zh_Hans: 结束时间 - pt_BR: end_time + en_US: endTime + zh_Hans: endTime + pt_BR: endTime human_description: - en_US: Time format in strftime standard. - zh_Hans: 指定查询CPU指标的结束时间。 - pt_BR: Time format in strftime standard. - llm_description: Time format in strftime standard. + en_US: Data query end time + zh_Hans: 结束时间 (微秒) + pt_BR: Data query end time + llm_description: Data query start time form: llm \ No newline at end of file diff --git a/api/core/tools/builtin_tool/providers/apo_select/tools/fault_log.py b/api/core/tools/builtin_tool/providers/apo_select/tools/fault_log.py index a32231a0b0..7f87766003 100644 --- a/api/core/tools/builtin_tool/providers/apo_select/tools/fault_log.py +++ b/api/core/tools/builtin_tool/providers/apo_select/tools/fault_log.py @@ -19,8 +19,8 @@ class FaultLogTool(BuiltinTool): message_id: Optional[str] = None, ) -> Generator[ToolInvokeMessage, None, None]: service = tool_parameters.get("service") - start_time = tool_parameters.get("start_time") - end_time = tool_parameters.get("end_time") + start_time = tool_parameters.get("startTime") + end_time = tool_parameters.get("endTime") params = { 'service': [service], 'startTime': start_time, diff --git a/api/core/tools/builtin_tool/providers/apo_select/tools/fault_log.yaml b/api/core/tools/builtin_tool/providers/apo_select/tools/fault_log.yaml index dc94a14584..04eaeb0fc0 100644 --- a/api/core/tools/builtin_tool/providers/apo_select/tools/fault_log.yaml +++ b/api/core/tools/builtin_tool/providers/apo_select/tools/fault_log.yaml @@ -2,52 +2,55 @@ identity: name: fault_log author: APO label: - en_US: fault_log - zh_Hans: 获取故障现场日志 - pt_BR: fault_log + en_US: Query service log data + zh_Hans: 查询服务日志数据 + pt_BR: Query service log data description: human: - en_US: A tool for getting fault log. - zh_Hans: 查询容器CPU占用 - pt_BR: A tool for getting fault log. - llm: A tool for getting fault log. + en_US: Query service log data + zh_Hans: 查询服务日志数据 + pt_BR: Query service log data + llm: Query service log data +display: + type: log + unit: log parameters: - name: service type: string required: true label: en_US: service - zh_Hans: 服务名 + zh_Hans: service pt_BR: service human_description: - en_US: Time format in strftime standard. - zh_Hans: 查询指定Pod的CPU占用。 - pt_BR: Time format in strftime standard. - llm_description: Time format in strftime standard. + en_US: service name + zh_Hans: 查询的日志服务名 + pt_BR: service name + llm_description: service name form: llm - - name: start_time + - name: startTime type: number - required: false + required: true label: - en_US: start_time - zh_Hans: 开始时间 - pt_BR: start_time + en_US: startTime + zh_Hans: startTime + pt_BR: startTime human_description: - en_US: Time format in strftime standard. - zh_Hans: 指定查询CPU指标的开始时间。 - pt_BR: Time format in strftime standard. - llm_description: Time format in strftime standard. + en_US: Data query start time + zh_Hans: 开始时间 (微秒) + pt_BR: Data query start time + llm_description: Data query start time form: llm - - name: end_time + - name: endTime type: number - required: false + required: true label: - en_US: end_time - zh_Hans: 结束时间 - pt_BR: end_time + en_US: endTime + zh_Hans: endTime + pt_BR: endTime human_description: - en_US: Time format in strftime standard. - zh_Hans: 指定查询CPU指标的结束时间。 - pt_BR: Time format in strftime standard. - llm_description: Time format in strftime standard. + en_US: Data query end time + zh_Hans: 结束时间 (微秒) + pt_BR: Data query end time + llm_description: Data query start time form: llm \ No newline at end of file diff --git a/api/core/tools/builtin_tool/providers/apo_select/tools/node_info.py b/api/core/tools/builtin_tool/providers/apo_select/tools/node_info.py index 98ab5858c9..32b29aad3b 100644 --- a/api/core/tools/builtin_tool/providers/apo_select/tools/node_info.py +++ b/api/core/tools/builtin_tool/providers/apo_select/tools/node_info.py @@ -22,8 +22,8 @@ class FaultLogTool(BuiltinTool): endpoint = tool_parameters.get("endpoint") entryService = tool_parameters.get("entryService") entryEndpoint = tool_parameters.get("entryEndpoint") - start_time = tool_parameters.get("start_time") - end_time = tool_parameters.get("end_time") + start_time = tool_parameters.get("startTime") + end_time = tool_parameters.get("endTime") type = tool_parameters.get("type") params = { diff --git a/api/core/tools/builtin_tool/providers/apo_select/tools/node_info.yaml b/api/core/tools/builtin_tool/providers/apo_select/tools/node_info.yaml index d14ef21453..d9502b5c10 100644 --- a/api/core/tools/builtin_tool/providers/apo_select/tools/node_info.yaml +++ b/api/core/tools/builtin_tool/providers/apo_select/tools/node_info.yaml @@ -11,6 +11,9 @@ description: zh_Hans: 获取节点信息 pt_BR: A tool for getting fault log. llm: A tool for getting fault log. +display: + type: info + unit: info parameters: - name: entryService type: string @@ -64,31 +67,31 @@ parameters: pt_BR: Time format in strftime standard. llm_description: toplogy endpoint form: llm - - name: start_time + - name: startTime type: number - required: false + required: true label: - en_US: start_time - zh_Hans: 开始时间 - pt_BR: start_time + en_US: startTime + zh_Hans: startTime + pt_BR: startTime human_description: - en_US: Time format in strftime standard. - zh_Hans: 指定查询CPU指标的开始时间。 - pt_BR: Time format in strftime standard. - llm_description: Time format in strftime standard. + en_US: Data query start time + zh_Hans: 开始时间 (微秒) + pt_BR: Data query start time + llm_description: Data query start time form: llm - - name: end_time + - name: endTime type: number - required: false + required: true label: - en_US: end_time - zh_Hans: 结束时间 - pt_BR: end_time + en_US: endTime + zh_Hans: endTime + pt_BR: endTime human_description: - en_US: Time format in strftime standard. - zh_Hans: 指定查询CPU指标的结束时间。 - pt_BR: Time format in strftime standard. - llm_description: Time format in strftime standard. + en_US: Data query end time + zh_Hans: 结束时间 (微秒) + pt_BR: Data query end time + llm_description: Data query start time form: llm - name: type type: string diff --git a/api/core/tools/builtin_tool/providers/apo_select/tools/select_cpu.py b/api/core/tools/builtin_tool/providers/apo_select/tools/select_cpu.py index 43697a0e5a..9eff32aaef 100644 --- a/api/core/tools/builtin_tool/providers/apo_select/tools/select_cpu.py +++ b/api/core/tools/builtin_tool/providers/apo_select/tools/select_cpu.py @@ -18,9 +18,9 @@ class SelectCPUTool(BuiltinTool): app_id: Optional[str] = None, message_id: Optional[str] = None, ) -> Generator[ToolInvokeMessage, None, None]: - node_name = tool_parameters.get("node_name") - start_time = tool_parameters.get("start_time") - end_time = tool_parameters.get("end_time") + node_name = tool_parameters.get("nodeName") + start_time = tool_parameters.get("startTime") + end_time = tool_parameters.get("endTime") sumql = 'sum by (instance_name) (avg by (mode, instance_name)' pmql = sumql + ' (rate(node_cpu_seconds_total{mode!="idle", instance_name="' + node_name + '"}[1m])))' params = { diff --git a/api/core/tools/builtin_tool/providers/apo_select/tools/select_cpu.yaml b/api/core/tools/builtin_tool/providers/apo_select/tools/select_cpu.yaml index b662bff628..531797b961 100644 --- a/api/core/tools/builtin_tool/providers/apo_select/tools/select_cpu.yaml +++ b/api/core/tools/builtin_tool/providers/apo_select/tools/select_cpu.yaml @@ -2,52 +2,55 @@ identity: name: select_cpu author: APO label: - en_US: select_cpu - zh_Hans: 查询CPU主机指标 - pt_BR: select_cpu + en_US: Query the CPU utilization of the host + zh_Hans: 查询主机CPU利用率 + pt_BR: Query the CPU utilization of the host description: human: - en_US: A tool for getting the current time. - zh_Hans: 查询CPU主机指标 - pt_BR: A tool for getting the current time. - llm: A tool for getting the current time. + en_US: Query the CPU utilization of the host + zh_Hans: 查询主机CPU利用率 + pt_BR: Query the CPU utilization of the host + llm: Query the CPU utilization of the host +display: + type: cpu + unit: precent parameters: - - name: node_name + - name: nodeName type: string required: true label: - en_US: node_name - zh_Hans: 主机名 - pt_BR: node_name + en_US: nodeName + zh_Hans: nodeName + pt_BR: nodeName human_description: - en_US: Time format in strftime standard. - zh_Hans: 指定查询CPU所在的主机名。 - pt_BR: Time format in strftime standard. - llm_description: Time format in strftime standard. + en_US: Specified host name + zh_Hans: 指定的主机名 + pt_BR: Specified host name + llm_description: Specified host name form: llm - - name: start_time + - name: startTime type: number - required: false + required: true label: - en_US: start_time - zh_Hans: 开始时间 - pt_BR: start_time + en_US: startTime + zh_Hans: startTime + pt_BR: startTime human_description: - en_US: Time format in strftime standard. - zh_Hans: 指定查询CPU指标的开始时间。 - pt_BR: Time format in strftime standard. - llm_description: Time format in strftime standard. + en_US: Data query start time + zh_Hans: 开始时间 (微秒) + pt_BR: Data query start time + llm_description: Data query start time form: llm - - name: end_time + - name: endTime type: number - required: false + required: true label: - en_US: end_time - zh_Hans: 结束时间 - pt_BR: end_time + en_US: endTime + zh_Hans: endTime + pt_BR: endTime human_description: - en_US: Time format in strftime standard. - zh_Hans: 指定查询CPU指标的结束时间。 - pt_BR: Time format in strftime standard. - llm_description: Time format in strftime standard. + en_US: Data query end time + zh_Hans: 结束时间 (微秒) + pt_BR: Data query end time + llm_description: Data query start time form: llm \ No newline at end of file diff --git a/api/core/tools/builtin_tool/providers/apo_select/tools/topology.py b/api/core/tools/builtin_tool/providers/apo_select/tools/topology.py index e78427627f..9652f99138 100644 --- a/api/core/tools/builtin_tool/providers/apo_select/tools/topology.py +++ b/api/core/tools/builtin_tool/providers/apo_select/tools/topology.py @@ -20,8 +20,8 @@ class TopologyTool(BuiltinTool): ) -> Generator[ToolInvokeMessage, None, None]: service = tool_parameters.get("service") endpoint = tool_parameters.get("endpoint") - start_time = tool_parameters.get("start_time") - end_time = tool_parameters.get("end_time") + start_time = tool_parameters.get("startTime") + end_time = tool_parameters.get("endTime") params = { 'service': service, 'endpoint': endpoint, diff --git a/api/core/tools/builtin_tool/providers/apo_select/tools/topology.yaml b/api/core/tools/builtin_tool/providers/apo_select/tools/topology.yaml index 99d697a328..b370819d13 100644 --- a/api/core/tools/builtin_tool/providers/apo_select/tools/topology.yaml +++ b/api/core/tools/builtin_tool/providers/apo_select/tools/topology.yaml @@ -2,27 +2,30 @@ identity: name: topology author: APO label: - en_US: topology - zh_Hans: 获取当前入口的拓扑结构 - pt_BR: topology + en_US: Query the entry service topology + zh_Hans: 查询入口服务拓扑结构 + pt_BR: Query the entry service topology description: human: - en_US: A tool for getting the current time. - zh_Hans: 获取当前入口的拓扑结构 - pt_BR: A tool for getting the current time. - llm: A tool for getting the current time. + en_US: Query the entry service topology + zh_Hans: 查询入口服务拓扑结构 + pt_BR: Query the entry service topology + llm: Query the entry service topology +display: + type: topology + unit: topology parameters: - name: service type: string required: true label: en_US: service - zh_Hans: 服务名 + zh_Hans: service pt_BR: service human_description: - en_US: Time format in strftime standard. + en_US: entry service zh_Hans: 拓扑入口服务名 - pt_BR: Time format in strftime standard. + pt_BR: entry service llm_description: toplogy service name form: llm - name: endpoint @@ -30,37 +33,37 @@ parameters: required: true label: en_US: endpoint - zh_Hans: 服务端点 + zh_Hans: endpoint pt_BR: endpoint human_description: - en_US: Time format in strftime standard. + en_US: toplogy endpoint zh_Hans: 拓扑入口服务端点 - pt_BR: Time format in strftime standard. + pt_BR: toplogy endpoint llm_description: toplogy endpoint form: llm - - name: start_time + - name: startTime type: number - required: false + required: true label: - en_US: start_time - zh_Hans: 开始时间 - pt_BR: start_time + en_US: startTime + zh_Hans: startTime + pt_BR: startTime human_description: - en_US: Time format in strftime standard. - zh_Hans: 查询开始时间。 - pt_BR: Time format in strftime standard. - llm_description: Time format in strftime standard. + en_US: Data query start time + zh_Hans: 开始时间 (微秒) + pt_BR: Data query start time + llm_description: Data query start time form: llm - - name: end_time + - name: endTime type: number - required: false + required: true label: - en_US: end_time - zh_Hans: 结束时间 - pt_BR: end_time + en_US: endTime + zh_Hans: endTime + pt_BR: endTime human_description: - en_US: Time format in strftime standard. - zh_Hans: 指定查询的结束时间 - pt_BR: Time format in strftime standard. - llm_description: Time format in strftime standard. + en_US: Data query end time + zh_Hans: 结束时间 (微秒) + pt_BR: Data query end time + llm_description: Data query start time form: llm \ No newline at end of file diff --git a/api/core/tools/entities/api_entities.py b/api/core/tools/entities/api_entities.py index b96c994cff..97c77aa2d2 100644 --- a/api/core/tools/entities/api_entities.py +++ b/api/core/tools/entities/api_entities.py @@ -6,6 +6,7 @@ from core.model_runtime.utils.encoders import jsonable_encoder from core.tools.__base.tool import ToolParameter from core.tools.entities.common_entities import I18nObject from core.tools.entities.tool_entities import ToolProviderType +from core.tools.entities.tool_entities import APODisPlay class ToolApiEntity(BaseModel): @@ -16,6 +17,7 @@ class ToolApiEntity(BaseModel): parameters: Optional[list[ToolParameter]] = None labels: list[str] = Field(default_factory=list) output_schema: Optional[dict] = None + display: Optional[APODisPlay] = None ToolProviderTypeApiLiteral = Optional[Literal["builtin", "api", "workflow"]] diff --git a/api/core/tools/entities/tool_entities.py b/api/core/tools/entities/tool_entities.py index 83e69d063d..b72621f871 100644 --- a/api/core/tools/entities/tool_entities.py +++ b/api/core/tools/entities/tool_entities.py @@ -318,10 +318,14 @@ class ToolDescription(BaseModel): human: I18nObject = Field(..., description="The description presented to the user") llm: str = Field(..., description="The description presented to the LLM") +class APODisPlay(BaseModel): + type: str = Field(..., description="The type of the apo data display") + unit: str = Field(..., description="The unit of the apo data display") class ToolEntity(BaseModel): identity: ToolIdentity parameters: list[ToolParameter] = Field(default_factory=list) + display: Optional[APODisPlay] = None description: Optional[ToolDescription] = None output_schema: Optional[dict] = None has_runtime_parameters: bool = Field(default=False, description="Whether the tool has runtime parameters") diff --git a/api/run_api.sh b/api/run_api.sh new file mode 100644 index 0000000000..fd03fc3b9f --- /dev/null +++ b/api/run_api.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +docker run -d --name dify-api --network host --pid host -v /root/workspace/dify/api/.env:/app/api/.env -v /root/workspace/dify/docker/volumes/app/storage:/app/api/storage -e MIGRATION_ENABLED="true" -e DEBUG="true" -e MODE="api" registry.cn-hangzhou.aliyuncs.com/kindlingx/dify-api:apo-1.0.0-9d88021 \ No newline at end of file diff --git a/api/run_worker.sh b/api/run_worker.sh new file mode 100644 index 0000000000..3b22e2dbc4 --- /dev/null +++ b/api/run_worker.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +docker run -d --name dify-worker --network host --pid host -v /root/workspace/dify/api/.env:/app/api/.env -v /root/workspace/dify/docker/volumes/app/storage:/app/api/storage -e MODE="worker" registry.cn-hangzhou.aliyuncs.com/kindlingx/dify-api:apo-1.0.0-9d88021 \ No newline at end of file diff --git a/api/services/tools/builtin_tools_manage_service.py b/api/services/tools/builtin_tools_manage_service.py index ea48309bd7..30bfebfca5 100644 --- a/api/services/tools/builtin_tools_manage_service.py +++ b/api/services/tools/builtin_tools_manage_service.py @@ -359,7 +359,7 @@ class BuiltinToolManageService: match_tools = process.extract( query, [tool.entity.description.human.zh_Hans for tool in tools], - limit=3, + limit=5, ) for match_name, score, index in match_tools or []: tool = tools[index] diff --git a/api/services/tools/tools_transform_service.py b/api/services/tools/tools_transform_service.py index 83a42ddfcb..9bcb0b5d91 100644 --- a/api/services/tools/tools_transform_service.py +++ b/api/services/tools/tools_transform_service.py @@ -286,6 +286,7 @@ class ToolTransformService: name=tool.entity.identity.name, label=tool.entity.identity.label, description=tool.entity.description.human if tool.entity.description else I18nObject(en_US=""), + display=tool.entity.display, output_schema=tool.entity.output_schema, parameters=current_parameters, labels=labels or [],