获取代理
2.13 版本引入
您可以使用 agent_id
检索代理信息。
端点
GET /_plugins/_ml/agents/<agent_id>
路径参数
下表列出了可用的路径参数。
参数 | 数据类型 | 描述 |
---|---|---|
agent_id | 字符串 | 要检索的代理的代理 ID。 |
请求示例
GET /_plugins/_ml/agents/N8AE1osB0jLkkocYjz7D
示例响应
{
"name": "Test_Agent_For_RAG",
"type": "flow",
"description": "this is a test agent",
"tools": [
{
"type": "VectorDBTool",
"parameters": {
"input": "${parameters.question}",
"source_field": """["text"]""",
"embedding_field": "embedding",
"index": "my_test_data",
"model_id": "zBRyYIsBls05QaITo5ex"
},
"include_output_in_agent_response": false
},
{
"type": "MLModelTool",
"description": "A general tool to answer any question",
"parameters": {
"model_id": "ygAzT40Bdo8gePIqxk0H",
"prompt": """
Human:You are a professional data analyst. You will always answer question based on the given context first. If the answer is not directly shown in the context, you will analyze the data and find the answer. If you don't know the answer, just say don't know.
Context:
${parameters.VectorDBTool.output}
Human:${parameters.question}
Assistant:"""
},
"include_output_in_agent_response": false
}
],
"created_time": 1706821658743,
"last_updated_time": 1706821658743
}
响应正文字段
有关响应字段说明,请参阅 注册代理 API 请求字段。