跳到正文
本页尚未翻译成中文,以下为英文原文。 查看英文版

Get an agent ​

Introduced 2.12

WARNING

This is an experimental feature and is not recommended for use in a production environment. For updates on the progress of the feature or if you want to leave feedback, see the associated GitHub issue.

You can retrieve agent information using the agent_id.

Path and HTTP methods ​

json
GET /_plugins/_ml/agents/<agent_id>

Path parameters ​

The following table lists the available path parameters.

ParameterData typeDescription
agent_idStringThe agent ID of the agent to retrieve.

Example request ​

json
GET /_plugins/_ml/agents/N8AE1osB0jLkkocYjz7D

Example response ​

json
{
  "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
}

Response fields ​

For response field descriptions, see Register Agent API request fields.