Skip to content

Commit 384a302

Browse files
committed
fix version introduced ListIndexTool
Signed-off-by: zane-neo <[email protected]>
1 parent 0762cd9 commit 384a302

File tree

7 files changed

+35
-34
lines changed

7 files changed

+35
-34
lines changed

_automating-configurations/workflow-tutorial.md

+20-20
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ The setup requires the following sequence of API requests, with provisioned reso
1616
* [`deploy_model_3`](#deploy_model_3): Deploy the model.
1717
1. **Use the deployed model for inference**
1818
* Set up several tools that perform specific tasks:
19-
* [`cat_index_tool`](#cat_index_tool): Set up a tool to obtain index information.
19+
* [`list_index_tool`](#list_index_tool): Set up a tool to obtain index information.
2020
* [`ml_model_tool`](#ml_model_tool): Set up a machine learning (ML) model tool.
2121
* Set up one or more agents that use some combination of the tools:
22-
* [`sub_agent`](#sub_agent): Create an agent that uses the `cat_index_tool`.
22+
* [`sub_agent`](#sub_agent): Create an agent that uses the `list_index_tool`.
2323
* Set up tools representing these agents:
2424
* [`agent_tool`](#agent_tool): Wrap the `sub_agent` so that you can use it as a tool.
2525
* [`root_agent`](#root_agent): Set up a root agent that may delegate the task to either a tool or another agent.
@@ -119,17 +119,17 @@ If you define `previous_node_inputs`, then defining edges is optional.
119119
A CoT agent can use the deployed model in a tool. This step doesn’t strictly correspond to an API but represents a component of the body required by the [Register Agent API]({{site.url}}{{site.baseurl}}/ml-commons-plugin/). This simplifies the register request and allows reuse of the same tool in multiple agents. For more information about agents and tools, see [Agents and tools]({{site.url}}{{site.baseurl}}/ml-commons-plugin/).
120120

121121
<!-- vale off -->
122-
### cat_index_tool
122+
### list_index_tool
123123
<!-- vale on -->
124124

125-
You can configure other tools to be used by the CoT agent. For example, you can configure a `cat_index_tool` as follows. This tool does not depend on any previous steps:
125+
You can configure other tools to be used by the CoT agent. For example, you can configure a `list_index_tool` as follows. This tool does not depend on any previous steps:
126126

127127
```yaml
128-
- id: cat_index_tool
128+
- id: list_index_tool
129129
type: create_tool
130130
user_inputs:
131-
name: CatIndexTool
132-
type: CatIndexTool
131+
name: ListIndexTool
132+
type: ListIndexTool
133133
parameters:
134134
max_iteration: 5
135135
```
@@ -138,15 +138,15 @@ You can configure other tools to be used by the CoT agent. For example, you can
138138
### sub_agent
139139
<!-- vale on -->
140140

141-
To use the `cat_index_tool` in the agent configuration, specify it as one of the tools in the `previous_node_inputs` field of the agent. You can add other tools to `previous_node_inputs` as necessary. The agent also needs a large language model (LLM) in order to reason with the tools. The LLM is defined by the `llm.model_id` field. This example assumes that the `model_id` from the `deploy_model_3` step will be used. However, if another model is already deployed, the `model_id` of that previously deployed model could be included in the `user_inputs` field instead:
141+
To use the `list_index_tool` in the agent configuration, specify it as one of the tools in the `previous_node_inputs` field of the agent. You can add other tools to `previous_node_inputs` as necessary. The agent also needs a large language model (LLM) in order to reason with the tools. The LLM is defined by the `llm.model_id` field. This example assumes that the `model_id` from the `deploy_model_3` step will be used. However, if another model is already deployed, the `model_id` of that previously deployed model could be included in the `user_inputs` field instead:
142142

143143
```yaml
144144
- id: sub_agent
145145
type: register_agent
146146
previous_node_inputs:
147147
# When llm.model_id is not present this can be used as a fallback value
148148
deploy-model-3: model_id
149-
cat_index_tool: tools
149+
list_index_tool: tools
150150
user_inputs:
151151
name: Sub Agent
152152
type: conversational
@@ -164,7 +164,7 @@ To use the `cat_index_tool` in the agent configuration, specify it as one of the
164164
OpenSearch will automatically create the following edges so that the agent can retrieve the fields from the previous node:
165165

166166
```yaml
167-
- source: cat_index_tool
167+
- source: list_index_tool
168168
dest: sub_agent
169169
- source: deploy_model_3
170170
dest: sub_agent
@@ -322,19 +322,19 @@ workflows:
322322
# For example purposes, the model_id obtained as the output of the deploy_model_3 step will be used
323323
# for several below steps. However, any other deployed model_id can be used for those steps.
324324
# This is one example tool from the Agent Framework.
325-
- id: cat_index_tool
325+
- id: list_index_tool
326326
type: create_tool
327327
user_inputs:
328-
name: CatIndexTool
329-
type: CatIndexTool
328+
name: ListIndexTool
329+
type: ListIndexTool
330330
parameters:
331331
max_iteration: 5
332332
# This simple agent only has one tool, but could be configured with many tools
333333
- id: sub_agent
334334
type: register_agent
335335
previous_node_inputs:
336336
deploy-model-3: model_id
337-
cat_index_tool: tools
337+
list_index_tool: tools
338338
user_inputs:
339339
name: Sub Agent
340340
type: conversational
@@ -394,7 +394,7 @@ workflows:
394394
dest: register_model_2
395395
- source: register_model_2
396396
dest: deploy_model_3
397-
- source: cat_index_tool
397+
- source: list_index_tool
398398
dest: sub_agent
399399
- source: deploy_model_3
400400
dest: sub_agent
@@ -479,11 +479,11 @@ The following is the same template in JSON format:
479479
}
480480
},
481481
{
482-
"id": "cat_index_tool",
482+
"id": "list_index_tool",
483483
"type": "create_tool",
484484
"user_inputs": {
485-
"name": "CatIndexTool",
486-
"type": "CatIndexTool",
485+
"name": "ListIndexTool",
486+
"type": "ListIndexTool",
487487
"parameters": {
488488
"max_iteration": 5
489489
}
@@ -494,7 +494,7 @@ The following is the same template in JSON format:
494494
"type": "register_agent",
495495
"previous_node_inputs": {
496496
"deploy-model-3": "llm.model_id",
497-
"cat_index_tool": "tools"
497+
"list_index_tool": "tools"
498498
},
499499
"user_inputs": {
500500
"name": "Sub Agent",
@@ -581,7 +581,7 @@ The following is the same template in JSON format:
581581
"dest": "deploy_model_3"
582582
},
583583
{
584-
"source": "cat_index_tool",
584+
"source": "list_index_tool",
585585
"dest": "sub_agent"
586586
},
587587
{

_ml-commons-plugin/agents-tools/index.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ redirect_from:
1212
**Introduced 2.13**
1313
{: .label .label-purple }
1414

15-
You can automate machine learning (ML) tasks using agents and tools. An _agent_ orchestrates and runs ML models and tools. A _tool_ performs a set of specific tasks. Some examples of tools are the `VectorDBTool`, which supports vector search, and the `CATIndexTool`, which executes the `cat indices` operation. For a list of supported tools, see [Tools]({{site.url}}{{site.baseurl}}/ml-commons-plugin/agents-tools/tools/index/).
15+
You can automate machine learning (ML) tasks using agents and tools. An _agent_ orchestrates and runs ML models and tools. A _tool_ performs a set of specific tasks. Some examples of tools are the `VectorDBTool`, which supports vector search, and the `ListIndexTool`, which executes the `cat indices` operation. For a list of supported tools, see [Tools]({{site.url}}{{site.baseurl}}/ml-commons-plugin/agents-tools/tools/index/).
1616

1717
## Agents
1818

@@ -109,7 +109,7 @@ Assistant:"""
109109

110110
### Conversational agents
111111

112-
Similarly to a conversational flow agent, a conversational agent stores the conversation in an index, in the following example, the `conversation_index`. A conversational agent can be configured with an LLM and a set of supplementary tools that perform specific jobs. For example, you can set up an LLM and a `CATIndexTool` when configuring an agent. When you send a question to the model, the agent also includes the `CATIndexTool` as context. The LLM then decides whether it needs to use the `CATIndexTool` to answer questions like "How many indexes are in my cluster?" The context allows an LLM to answer specific questions that are outside of its knowledge base. For example, the following agent is configured with an LLM and a `CATIndexTool` that retrieves information about your OpenSearch indexes:
112+
Similarly to a conversational flow agent, a conversational agent stores the conversation in an index, in the following example, the `conversation_index`. A conversational agent can be configured with an LLM and a set of supplementary tools that perform specific jobs. For example, you can set up an LLM and a `ListIndexTool` when configuring an agent. When you send a question to the model, the agent also includes the `ListIndexTool` as context. The LLM then decides whether it needs to use the `ListIndexTool` to answer questions like "How many indexes are in my cluster?" The context allows an LLM to answer specific questions that are outside of its knowledge base. For example, the following agent is configured with an LLM and a `ListIndexTool` that retrieves information about your OpenSearch indexes:
113113

114114
```json
115115
POST /_plugins/_ml/agents/_register
@@ -142,7 +142,7 @@ POST /_plugins/_ml/agents/_register
142142
}
143143
},
144144
{
145-
"type": "CatIndexTool",
145+
"type": "ListIndexTool",
146146
"name": "RetrieveIndexMetaTool",
147147
"description": "Use this tool to get OpenSearch index information: (health, status, index, uuid, primary count, replica count, docs.count, docs.deleted, store.size, primary.store.size)."
148148
}

_ml-commons-plugin/agents-tools/tools/cat-index-tool.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ grand_parent: Agents and tools
1616
**This tool is deprecated in OpenSearch 3.0**
1717
{: .label .label-red }
1818

19-
The `CatIndexTool` retrieves index information for the OpenSearch cluster, similarly to the [CAT Indices API]({{site.url}}{{site.baseurl}}/api-reference/cat/cat-indices/).
19+
The `ListIndexTool` retrieves index information for the OpenSearch cluster, similarly to the [CAT Indices API]({{site.url}}{{site.baseurl}}/api-reference/cat/cat-indices/).
2020

21-
## Step 1: Register a flow agent that will run the CatIndexTool
21+
## Step 1: Register a flow agent that will run the ListIndexTool
2222

2323
A flow agent runs a sequence of tools in order and returns the last tool's output. To create a flow agent, send the following register agent request:
2424

@@ -27,11 +27,11 @@ POST /_plugins/_ml/agents/_register
2727
{
2828
"name": "Test_Agent_For_CatIndex_tool",
2929
"type": "flow",
30-
"description": "this is a test agent for the CatIndexTool",
30+
"description": "this is a test agent for the ListIndexTool",
3131
"tools": [
3232
{
33-
"type": "CatIndexTool",
34-
"name": "DemoCatIndexTool",
33+
"type": "ListIndexTool",
34+
"name": "DemoListIndexTool",
3535
"parameters": {
3636
"input": "${parameters.question}"
3737
}

_ml-commons-plugin/agents-tools/tools/index.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ Each tool takes a list of parameters specific to that tool. In the preceding exa
3232
|Tool | Description |
3333
|:--- |:--- |
3434
|[`AgentTool`]({{site.url}}{{site.baseurl}}/ml-commons-plugin/agents-tools/tools/agent-tool/) |Runs any agent. |
35-
|[`CatIndexTool`]({{site.url}}{{site.baseurl}}/ml-commons-plugin/agents-tools/tools/cat-index-tool/) |Retrieves index information for the OpenSearch cluster. |
35+
|[`CatIndexTool`]({{site.url}}{{site.baseurl}}/ml-commons-plugin/agents-tools/tools/cat-index-tool/) |Retrieves index information for the OpenSearch cluster, deprecated in OpenSearch 3.0 |
36+
|[`ListIndexTool`]({{site.url}}{{site.baseurl}}/ml-commons-plugin/agents-tools/tools/list-index-tool/) |Retrieves index information for the OpenSearch cluster, introduced in OpenSearch 3.0 as CatIndexTool's replacement |
3637
|[`ConnectorTool`]({{site.url}}{{site.baseurl}}/ml-commons-plugin/agents-tools/tools/connector-tool/) | Uses a [connector]({{site.url}}{{site.baseurl}}/ml-commons-plugin/remote-models/connectors/) to call any REST API function. |
3738
|[`IndexMappingTool`]({{site.url}}{{site.baseurl}}/ml-commons-plugin/agents-tools/tools/index-mapping-tool/) |Retrieves index mapping and setting information for an index. |
3839
|[`CreateAnomalyDetectorTool`]({{site.url}}{{site.baseurl}}/ml-commons-plugin/agents-tools/tools/create-anomaly-detector/) | Enables an LLM to suggest required parameters for creating an anomaly detector. |

_ml-commons-plugin/api/agent-apis/register-agent.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ POST /_plugins/_ml/agents/_register
173173
}
174174
},
175175
{
176-
"type": "CatIndexTool",
176+
"type": "ListIndexTool",
177177
"name": "RetrieveIndexMetaTool",
178178
"description": "Use this tool to get OpenSearch index information: (health, status, index, uuid, primary count, replica count, docs.count, docs.deleted, store.size, primary.store.size)."
179179
}

_ml-commons-plugin/api/memory-apis/get-message-traces.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ green open opensearch_dashboards_sample_data_flights pJde0irnTce4-uobHw
9292
green open my_test_data T4hwNs7CTJGIfw2QpCqQ_Q 1 1 6 0 91.7kb 45.8kb
9393
green open .opendistro-job-scheduler-lock XjgmXAVKQ4e8Y-ac54VBzg 1 1 3 0 38.7kb 19.4kb
9494
""",
95-
"origin": "CatIndexTool",
95+
"origin": "ListIndexTool",
9696
"additional_info": {},
9797
"parent_message_id": "TAuCZY0BT2tRrkdmCPqZ",
9898
"trace_number": 2

_tutorials/gen-ai/chatbots/build-chatbot.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ POST _plugins/_ml/agents/_register
279279
}
280280
},
281281
{
282-
"type": "CatIndexTool",
282+
"type": "ListIndexTool",
283283
"description": "Use this tool to get OpenSearch index information: (health, status, index, uuid, primary count, replica count, docs.count, docs.deleted, store.size, primary.store.size). \nIt takes 2 optional arguments named `index` which is a comma-delimited list of one or more indices to get information from (default is an empty list meaning all indices), and `local` which means whether to return information from the local node only instead of the cluster manager node (default is false)."
284284
},
285285
{
@@ -313,7 +313,7 @@ Note the following testing tips:
313313
- Avoid configuring many tools in an agent.
314314
- Provide a detailed tool description clarifying what the tool can do.
315315
- Specify the tool to use in the LLM question, for example, `Can you use the PPLTool to query the opensearch_dashboards_sample_data_ecommerce index so it can calculate how many orders were placed last week?`.
316-
- Specify the tool to use when executing an agent. For example, specify that only `PPLTool` and `CatIndexTool` should be used to process the current request.
316+
- Specify the tool to use when executing an agent. For example, specify that only `PPLTool` and `ListIndexTool` should be used to process the current request.
317317

318318
Test the agent:
319319

@@ -323,7 +323,7 @@ POST _plugins/_ml/agents/your_agent_id/_execute
323323
"parameters": {
324324
"question": "Can you query with index opensearch_dashboards_sample_data_ecommerce to calculate how many orders in last week?",
325325
"verbose": false,
326-
"selected_tools": ["PPLTool", "CatIndexTool"]
326+
"selected_tools": ["PPLTool", "ListIndexTool"]
327327
}
328328
}
329329
```

0 commit comments

Comments
 (0)