Skip to content

Commit 7d57659

Browse files
kolchfa-awsdbwiddisNaarcha-AWS
authored andcommitted
Change math tool to CAT index tool in the workflow tutorial (opensearch-project#6401)
* Change math tool to CAT index tool in workflow tutorial Signed-off-by: Fanit Kolchina <[email protected]> * Removed some tool descriptions Signed-off-by: Fanit Kolchina <[email protected]> * Update _automating-workflows/workflow-tutorial.md Co-authored-by: Daniel Widdis <[email protected]> Signed-off-by: kolchfa-aws <[email protected]> --------- Signed-off-by: Fanit Kolchina <[email protected]> Signed-off-by: kolchfa-aws <[email protected]> Co-authored-by: Daniel Widdis <[email protected]> Co-authored-by: Naarcha-AWS <[email protected]>
1 parent e1686c3 commit 7d57659

File tree

1 file changed

+20
-33
lines changed

1 file changed

+20
-33
lines changed

_automating-workflows/workflow-tutorial.md

Lines changed: 20 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ The setup requires the following sequence of API requests, with provisioned reso
1919
* [`deploy_model_3`](#deploy_model_3): Deploy the model.
2020
1. **Use the deployed model for inference**
2121
* Set up several tools that perform specific tasks:
22-
* [`math_tool`](#math_tool): Set up a math tool.
22+
* [`cat_index_tool`](#cat_index_tool): Set up a tool to obtain index information.
2323
* [`ml_model_tool`](#ml_model_tool): Set up a machine learning (ML) model tool.
2424
* Set up one or more agents that use some combination of the tools:
25-
* [`sub_agent`](#sub_agent): Create an agent that uses the math tool.
25+
* [`sub_agent`](#sub_agent): Create an agent that uses the `cat_index_tool`.
2626
* Set up tools representing these agents:
2727
* [`agent_tool`](#agent_tool): Wrap the `sub_agent` so that you can use it as a tool.
2828
* [`root_agent`](#root_agent): Set up a root agent that may delegate the task to either a tool or another agent.
@@ -122,19 +122,17 @@ If you define `previous_node_inputs`, then defining edges is optional.
122122
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/).
123123

124124
<!-- vale off -->
125-
### math_tool
125+
### cat_index_tool
126126
<!-- vale on -->
127127

128-
You can configure other tools to be used by the CoT agent. For example, you can configure a math tool as follows. This tool does not depend on any previous steps:
128+
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:
129129

130130
```yaml
131-
- id: math_tool
131+
- id: cat_index_tool
132132
type: create_tool
133133
user_inputs:
134-
name: MathTool
135-
type: MathTool
136-
description: A general tool to calculate any math problem. The action input
137-
must be a valid math expression, like 2+3
134+
name: CatIndexTool
135+
type: CatIndexTool
138136
parameters:
139137
max_iteration: 5
140138
```
@@ -143,15 +141,15 @@ You can configure other tools to be used by the CoT agent. For example, you can
143141
### sub_agent
144142
<!-- vale on -->
145143

146-
To use the math 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:
144+
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:
147145

148146
```yaml
149147
- id: sub_agent
150148
type: register_agent
151149
previous_node_inputs:
152150
# When llm.model_id is not present this can be used as a fallback value
153151
deploy-model-3: model_id
154-
math_tool: tools
152+
cat_index_tool: tools
155153
user_inputs:
156154
name: Sub Agent
157155
type: conversational
@@ -169,7 +167,7 @@ To use the math tool in the agent configuration, specify it as one of the tools
169167
OpenSearch will automatically create the following edges so that the agent can retrieve the fields from the previous node:
170168

171169
```yaml
172-
- source: math_tool
170+
- source: cat_index_tool
173171
dest: sub_agent
174172
- source: deploy_model_3
175173
dest: sub_agent
@@ -327,25 +325,22 @@ workflows:
327325
# For example purposes, the model_id obtained as the output of the deploy_model_3 step will be used
328326
# for several below steps. However, any other deployed model_id can be used for those steps.
329327
# This is one example tool from the Agent Framework.
330-
- id: math_tool
328+
- id: cat_index_tool
331329
type: create_tool
332330
user_inputs:
333-
name: MathTool
334-
type: MathTool
335-
description: A general tool to calculate any math problem. The action input
336-
must be a valid math expression, like 2+3
331+
name: CatIndexTool
332+
type: CatIndexTool
337333
parameters:
338334
max_iteration: 5
339335
# This simple agent only has one tool, but could be configured with many tools
340336
- id: sub_agent
341337
type: register_agent
342338
previous_node_inputs:
343339
deploy-model-3: model_id
344-
math_tool: tools
340+
cat_index_tool: tools
345341
user_inputs:
346342
name: Sub Agent
347343
type: conversational
348-
description: this is a test agent
349344
parameters:
350345
hello: world
351346
llm.parameters:
@@ -362,7 +357,6 @@ workflows:
362357
user_inputs:
363358
name: AgentTool
364359
type: AgentTool
365-
description: Agent Tool
366360
parameters:
367361
max_iteration: 5
368362
# An ML Model can be used as a tool
@@ -374,7 +368,6 @@ workflows:
374368
name: MLModelTool
375369
type: MLModelTool
376370
alias: language_model_tool
377-
description: A general tool to answer any question.
378371
parameters:
379372
prompt: Answer the question as best you can.
380373
response_filter: choices[0].message.content
@@ -389,7 +382,6 @@ workflows:
389382
user_inputs:
390383
name: DEMO-Test_Agent
391384
type: flow
392-
description: this is a test agent
393385
parameters:
394386
prompt: Answer the question as best you can.
395387
llm.parameters:
@@ -405,7 +397,7 @@ workflows:
405397
dest: register_model_2
406398
- source: register_model_2
407399
dest: deploy_model_3
408-
- source: math_tool
400+
- source: cat_index_tool
409401
dest: sub_agent
410402
- source: deploy_model_3
411403
dest: sub_agent
@@ -490,12 +482,11 @@ The following is the same template in JSON format:
490482
}
491483
},
492484
{
493-
"id": "math_tool",
485+
"id": "cat_index_tool",
494486
"type": "create_tool",
495487
"user_inputs": {
496-
"name": "MathTool",
497-
"type": "MathTool",
498-
"description": "A general tool to calculate any math problem. The action input must be a valid math expression, like 2+3",
488+
"name": "CatIndexTool",
489+
"type": "CatIndexTool",
499490
"parameters": {
500491
"max_iteration": 5
501492
}
@@ -506,12 +497,11 @@ The following is the same template in JSON format:
506497
"type": "register_agent",
507498
"previous_node_inputs": {
508499
"deploy-model-3": "llm.model_id",
509-
"math_tool": "tools"
500+
"cat_index_tool": "tools"
510501
},
511502
"user_inputs": {
512503
"name": "Sub Agent",
513504
"type": "conversational",
514-
"description": "this is a test agent",
515505
"parameters": {
516506
"hello": "world"
517507
},
@@ -534,7 +524,6 @@ The following is the same template in JSON format:
534524
"user_inputs": {
535525
"name": "AgentTool",
536526
"type": "AgentTool",
537-
"description": "Agent Tool",
538527
"parameters": {
539528
"max_iteration": 5
540529
}
@@ -550,7 +539,6 @@ The following is the same template in JSON format:
550539
"name": "MLModelTool",
551540
"type": "MLModelTool",
552541
"alias": "language_model_tool",
553-
"description": "A general tool to answer any question.",
554542
"parameters": {
555543
"prompt": "Answer the question as best you can.",
556544
"response_filter": "choices[0].message.content"
@@ -568,7 +556,6 @@ The following is the same template in JSON format:
568556
"user_inputs": {
569557
"name": "DEMO-Test_Agent",
570558
"type": "flow",
571-
"description": "this is a test agent",
572559
"parameters": {
573560
"prompt": "Answer the question as best you can."
574561
},
@@ -597,7 +584,7 @@ The following is the same template in JSON format:
597584
"dest": "deploy_model_3"
598585
},
599586
{
600-
"source": "math_tool",
587+
"source": "cat_index_tool",
601588
"dest": "sub_agent"
602589
},
603590
{

0 commit comments

Comments
 (0)