Link Search Menu Expand Document Documentation Menu

更新代理

于 3.1 版本引入

使用此 API 更新现有代理的配置。

端点

PUT /_plugins/_ml/agents/<agent_id>

路径参数

下表列出了可用的路径参数。

参数 数据类型 描述
agent_id 字符串 要更新的代理的代理 ID。

请求正文字段

下表列出了可用的请求字段。所有请求正文字段均为可选。

字段 数据类型 代理类型 描述
名称 字符串 所有 代理名称。
描述 字符串 所有 代理的描述。
工具 数组 所有 代理要执行的工具列表。
app_type 字符串 所有 指定一个可选的代理类别。
memory.type 字符串 conversational_flow, conversational 指定存储对话记忆的位置。目前,唯一支持的类型是 conversation_index (将记忆存储在对话系统索引中)。
llm.model_id 字符串 对话 用于向大型语言模型 (LLM) 发送问题的模型 ID。
llm.parameters.response_filter 字符串 对话 用于解析 LLM 响应的模式。
llm.parameters.max_iteration 整数 对话 发送到 LLM 的最大消息数。

示例请求:更新工具提示

PUT /_plugins/_ml/agents/N8AE1osB0jLkkocYjz7D
{
  "name": "Updated_Test_Agent_For_RAG",
  "description": "Updated description for test agent",
  "tools": [
    {
      "type": "MLModelTool",
      "description": "Updated general tool to answer any question",
      "parameters": {
        "model_id": "NWR9YIsBUysqmzBdifVJ",
        "prompt": "This is an updated prompt"
      }
    }
  ]
}

示例响应

{
    "_index": ".plugins-ml-agent",
    "_id": "ryN5jpcBfY4uTYhorKvh",
    "_version": 2,
    "result": "updated",
    "_shards": {
        "total": 1,
        "successful": 1,
        "failed": 0
    },
    "_seq_no": 1,
    "_primary_term": 1
}
剩余 350 字符

有问题?

想贡献力量?