fix: pass agents directly as tools in the agents-as-tools lab - #301
Open
manoj-selvakumar5 wants to merge 1 commit into
Open
fix: pass agents directly as tools in the agents-as-tools lab#301manoj-selvakumar5 wants to merge 1 commit into
manoj-selvakumar5 wants to merge 1 commit into
Conversation
Each specialist was wrapped in a @tool function that built a fresh Agent internally and returned str(response). Strands accepts an Agent in tools=[] and converts it using the agent's name and description, so the wrappers are unnecessary. Give each specialist a name and description and pass it to the orchestrator directly. Names match the previous tool names, so the routing guidance in MAIN_SYSTEM_PROMPT still resolves.
|
Latest scan for commit: ✅ Security Scan Report (PR Files Only)Scanned Files
Security Scan Results
Threshold: High No security issues detected in your changes. Great job! This scan only covers files changed in this PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of changes:
Problem
python/01-learn/10-agents-as-tools/agent-as-tools.ipynbwraps every specialist in a@toolfunction that constructs a freshAgentinternally, calls it, and returnsstr(response). The same block is repeated three times.Strands accepts an
Agentdirectly intools=[]and converts it using the agent'snameanddescription, so the wrappers are unnecessary.Fix
Give each specialist a
nameanddescription, and pass it to the orchestrator directly.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.