-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEATURE] Register Agent Workflow Step #194
Comments
From what I see, it would be necessary for us to build the parameters within the
From what I understand about resources created, each resource will be associated with the workflow step ID that creates the resource.
Whenever a workflow step completes, it returns an object of |
I don't think adding a new workflow step for every new There is a What more do we need to track for different tools? |
I think this is really only relevant for the vector db tool, but can't we just throw in the placeholder |
And for this we need the unique step id passed. Alter the |
Sample Template from Creating a connector to Registering an agent:
Agent Registration Logs:
|
Sample Template for Registering an agent:
Response:
|
{
"id": "workflow_step_1",
"type": "create_tool",
"user_inputs": {
"name": "MLModelTool",
"type": "MLModelTool",
"alias": "language_model_tool",
"description": "A general tool to answer any question. But it can't handle math problem",
"parameters": {
"model_id": "ldzS04kBxRPZ5cnWrqpd",
"prompt": "Answer the question as best you can.",
"response_filter": "choices[0].message.content"
}
}
} Tools
|
{
"id": "workflow_step_4",
"type": "create_tool",
"previous_node_inputs": {
"workflow_step_2": "model_id"
},
"user_inputs": {
"name": "MLModelTool",
"type": "MLModelTool",
"alias": "language_model_tool",
"description": "A general tool to answer any question. But it can't handle math problem",
"parameters": {
"model_id": "workflow2.model_id",
"prompt": "Answer the question as best you can.",
"response_filter": "choices[0].message.content"
}
}
}, Tools
|
Root Agent Template (Look for AgentTool, it takes an agent_id):
Response: Look for
|
Multiple tools are added for an agent:
|
Complete template:
|
In YAML ---
name: tool-register-agent
description: test case
use_case: REGISTER_AGENT
version:
template: 1.0.0
compatibility:
- 2.12.0
- 3.0.0
workflows:
provision:
nodes:
- id: workflow_step_1
type: create_connector
user_inputs:
name: OpenAI Chat Connector
description: The connector to public OpenAI model service for GPT 3.5
protocol: http
version: '1'
parameters:
endpoint: api.openai.com
model: flow-register-remote-test-gpt-3.5-turbo
credential:
openAI_key: '12345'
actions:
- action_type: predict
method: POST
url: https://${parameters.endpoint}/v1/chat/completions
- id: workflow_step_2
type: register_remote_model
previous_node_inputs:
workflow_step_1: connector_id
user_inputs:
name: flow-register-remote-test-gpt-3.5-turbo
function_name: remote
description: test model
- id: workflow_step_3
type: deploy_model
previous_node_inputs:
workflow_step_2: model_id
- id: workflow_step_4
type: create_tool
previous_node_inputs:
workflow_step_3: model_id
user_inputs:
name: MLModelTool
type: MLModelTool
alias: language_model_tool
description: A general tool to answer any question. But it can't handle math
problem
parameters:
prompt: Answer the question as best you can.
response_filter: choices[0].message.content
- id: workflow_step_5
type: create_tool
user_inputs:
name: MathTool
type: MathTool
description: A general tool to calculate any math problem. The action input
must be valid math expression, like 2+3
parameters:
max_iteration: 5
- id: workflow_step_6
type: register_agent
previous_node_inputs:
workflow_step_5: tools
user_inputs:
name: Sub Agent
type: cot
description: this is a test agent
parameters:
hello: world
llm.model_id: ldzS04kBxRPZ5cnWrqpd
llm.parameters:
max_iteration: '5'
stop_when_no_tool_found: 'true'
memory:
type: conversation_buffer_window
app_type: chatbot
created_time: 1689793598499
last_updated_time: 1689793598530
- id: workflow_step_7
type: create_tool
previous_node_inputs:
workflow_step_7: agent_id
user_inputs:
name: AgentTool
type: AgentTool
description: Root Agent Tool
parameters:
max_iteration: 5
- id: workflow_step_8
type: register_agent
previous_node_inputs:
workflow_step_3: model_id
workflow_step_4: tools
workflow_step_7: tools
user_inputs:
name: DEMO-Test_Agent_For_CoT
type: cot
description: this is a test agent
parameters:
hello: world
llm.parameters:
max_iteration: '5'
stop_when_no_tool_found: 'true'
memory:
type: conversation_buffer_window
app_type: chatbot
created_time: 1689793598499
last_updated_time: 1689793598530
edges:
- source: workflow_step_1
dest: workflow_step_2
- source: workflow_step_2
dest: workflow_step_3
- source: workflow_step_3
dest: workflow_step_8
- source: workflow_step_3
dest: workflow_step_4
- source: workflow_step_4
dest: workflow_step_8
- source: workflow_step_5
dest: workflow_step_6
- source: workflow_step_6
dest: workflow_step_7
- source: workflow_step_7
dest: workflow_step_8 |
Tested the above template using ml-commons APIs of Get Agent:
Root Agent Response:
|
Taking Owais' template and renaming steps as they might be used by users:
|
Is your feature request related to a problem?
To register an agent through Flow Framework, we need to have an associated workflow step.
Register agent API looks like the below:
To explain the above API further:
What solution would you like?
We can separate it out to 2 different workflow steps:
From the ToolStep we can store the object of the tool i.e.
MLToolSpec
in theWorkflowData
map with the key astools
as it's a list of WorkflowData.Next in the RegisterAgentStep when we encounter the
tools
field, we can look for the keytools
in the WorkflowData and add it to the tools list. Let's call it asmlToolSpecList
and we an pass the same toMLAgentBuilder
to call the register Agent API later.This way we can have a a sub agent to have a list of tools.
But for the tools the
model_id
is the part ofparameters
model_id
from the previous step ofdeploy_model
underparameters
here?What alternatives have you considered?
Another solution would be, to have a separate ToolStep for every tool. For example,
MathToolStep
for a MathTool.Do you have any additional context?
From the
RegisterAgentStep
we would get anagent_id
for every sub agent and the same response for the root agent.2. How can we differentiate the agentIds and store the response in the status API?
3. Does storing different tools in WorkflowData with the key
tools
cause any override? Should we store the tool astool-<type-of-tool>
as the key?The text was updated successfully, but these errors were encountered: