Skip to content
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/agent_framework] Registers root agent with an agentId in ToolSteps #242

Merged

Conversation

owaiskazi19
Copy link
Member

@owaiskazi19 owaiskazi19 commented Dec 3, 2023

Description

This PR:

  1. Registers an agent with an agent_id. Ref: [FEATURE] Register Agent Workflow Step #194 (comment)
  2. Integrates the new Util method for ToolSteps and RegisterAgentSteps.

TODO:
#241

Issues Resolved

Closes #194

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@owaiskazi19 owaiskazi19 changed the title [Feature/agent_framework] Registers root agent with an agentId [Feature/agent_framework] Registers root agent with an agentId in ToolSteps Dec 3, 2023
Copy link
Member

@dbwiddis dbwiddis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Would like error messages to be more verbose but that can be handled in another PR

@@ -240,7 +231,7 @@ private String getLlmModelId(Map<String, String> previousNodeInputs, Map<String,

private LLMSpec getLLMSpec(String llmModelId, Map<String, String> llmParameters) {
if (llmModelId == null) {
throw new IllegalArgumentException("model id for llm is null");
throw new FlowFrameworkException("model id for llm is null", RestStatus.BAD_REQUEST);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we pass workflow ID and step ID to this method to include in the exception? (Can handle in a future PR)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to do this for all the exception message for the workflow steps. I can raise a follow up PR for all of them.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// Case when modelId is not present at all
if (llmModelId == null) {
registerAgentModelFuture.completeExceptionally(
new FlowFrameworkException("llm model id is not provided", RestStatus.BAD_REQUEST)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add workflowID and step (node) ID to this error message. (Can handle in a future PR)

Signed-off-by: Owais Kazi <[email protected]>
@dbwiddis dbwiddis linked an issue Dec 3, 2023 that may be closed by this pull request
@dbwiddis dbwiddis merged commit 53daf61 into opensearch-project:feature/agent_framework Dec 4, 2023
10 checks passed
dbwiddis pushed a commit to dbwiddis/flow-framework that referenced this pull request Dec 15, 2023
…lSteps (opensearch-project#242)

* Add agentId to parameters map for root agent

Signed-off-by: Owais Kazi <[email protected]>

* Modified ToolStep with new Util method

Signed-off-by: Owais Kazi <[email protected]>

* Integrated RegisterAgentStep with new Util method

Signed-off-by: Owais Kazi <[email protected]>

* Spotless fixes

Signed-off-by: Owais Kazi <[email protected]>

* Removed TODO

Signed-off-by: Owais Kazi <[email protected]>

---------

Signed-off-by: Owais Kazi <[email protected]>
dbwiddis pushed a commit to dbwiddis/flow-framework that referenced this pull request Dec 15, 2023
…lSteps (opensearch-project#242)

* Add agentId to parameters map for root agent

Signed-off-by: Owais Kazi <[email protected]>

* Modified ToolStep with new Util method

Signed-off-by: Owais Kazi <[email protected]>

* Integrated RegisterAgentStep with new Util method

Signed-off-by: Owais Kazi <[email protected]>

* Spotless fixes

Signed-off-by: Owais Kazi <[email protected]>

* Removed TODO

Signed-off-by: Owais Kazi <[email protected]>

---------

Signed-off-by: Owais Kazi <[email protected]>
dbwiddis pushed a commit that referenced this pull request Dec 18, 2023
…lSteps (#242)

* Add agentId to parameters map for root agent

Signed-off-by: Owais Kazi <[email protected]>

* Modified ToolStep with new Util method

Signed-off-by: Owais Kazi <[email protected]>

* Integrated RegisterAgentStep with new Util method

Signed-off-by: Owais Kazi <[email protected]>

* Spotless fixes

Signed-off-by: Owais Kazi <[email protected]>

* Removed TODO

Signed-off-by: Owais Kazi <[email protected]>

---------

Signed-off-by: Owais Kazi <[email protected]>
dbwiddis pushed a commit to dbwiddis/flow-framework that referenced this pull request Dec 18, 2023
…lSteps (opensearch-project#242)

* Add agentId to parameters map for root agent

Signed-off-by: Owais Kazi <[email protected]>

* Modified ToolStep with new Util method

Signed-off-by: Owais Kazi <[email protected]>

* Integrated RegisterAgentStep with new Util method

Signed-off-by: Owais Kazi <[email protected]>

* Spotless fixes

Signed-off-by: Owais Kazi <[email protected]>

* Removed TODO

Signed-off-by: Owais Kazi <[email protected]>

---------

Signed-off-by: Owais Kazi <[email protected]>
dbwiddis pushed a commit that referenced this pull request Dec 18, 2023
…lSteps (#242)

* Add agentId to parameters map for root agent

Signed-off-by: Owais Kazi <[email protected]>

* Modified ToolStep with new Util method

Signed-off-by: Owais Kazi <[email protected]>

* Integrated RegisterAgentStep with new Util method

Signed-off-by: Owais Kazi <[email protected]>

* Spotless fixes

Signed-off-by: Owais Kazi <[email protected]>

* Removed TODO

Signed-off-by: Owais Kazi <[email protected]>

---------

Signed-off-by: Owais Kazi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Register Agent Workflow Step
3 participants