generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 420
Add agent configuration support with JSON/dict configs and tool name resolution #865
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
Closed
Conversation
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
Unshure
requested changes
Sep 15, 2025
Linking to this issue which requested this feature: #606 |
45531dd
to
f2eadd1
Compare
f2eadd1
to
a2dad11
Compare
08d8812
to
c6712fc
Compare
60d35ab
to
6b4565a
Compare
6b4565a
to
763092a
Compare
dba34ca
to
5bc1cd3
Compare
d07e18c
to
e94a5e5
Compare
Unshure
previously approved these changes
Sep 26, 2025
mkmeral
previously approved these changes
Sep 26, 2025
zastrowm
previously approved these changes
Sep 26, 2025
ba9f05c
47ce51d
to
ba9f05c
Compare
zastrowm
previously approved these changes
Sep 26, 2025
mkmeral
previously approved these changes
Sep 26, 2025
…resolution - Add AgentConfig class for loading configuration from JSON files or dicts - Support model, prompt, and tools configuration options - Update tool registry to resolve tool names from strands_tools package - Maintain backward compatibility with existing Agent constructor - Add comprehensive tests for configuration loading and validation - Fix all linting, type checking, and formatting issues
- Add experimental AgentConfig with to_agent() method for creating Agent instances - Implement ToolPool for managing collections of tools with clean constructor API - Support direct tool function passing: ToolPool([calculator, current_time]) - Add ToolPool.from_module() for importing entire tool modules - Resolve circular import issues with runtime imports (no TYPE_CHECKING needed) - Add comprehensive test coverage for experimental features - Clean up obsolete code and maintain backward compatibility - Remove hacky path manipulation from tests, follow standard import patterns - Use native Python typing (A | B, list[T], any) instead of typing module - Require file:// prefix for file paths to maintain standard interface - Dictionary config only accepts 'prompt' key, not 'system_prompt' - Rename ToolPool methods: to_agent_tools() -> get_tools(), list_tools() -> list_tool_names() - Move imports to top of test files following Python conventions - Add ToolPool integration with tool validation and selection from registry - Implement static FILE_PREFIX and DEFAULT_TOOLS with proper error handling - Require either strands_tools installation or custom ToolPool with your own tools - Remove unnecessary quotes from type hints where imports are available at top - Organize module constants together for better code structure - Separate tool pool registry from configured tools with _tool_pool and _configured_tools - Remove tools parameter from to_agent() - use only configured tools at instantiation - Fix fallback behavior: no tools specified = no tools (not all tools) - Add raise_exception_on_missing_tool flag (defaults to True) for graceful degradation - Apply flag to both default tool loading AND tool validation from ToolPool - When False, skip missing tools instead of raising errors for robust applications - Fix examples to properly demonstrate tool selection from registry 🤖 Assisted by Amazon Q Developer
…ve API - Add AgentConfig class for JSON/dict-based agent configuration - Add ToolBox class for structured tool management and selection - Support file:// prefix for JSON config files with validation - Implement to_agent() method for seamless Agent instantiation - Add comprehensive tool validation with configurable error handling - Support both strands_tools integration and custom ToolBox instances - Include extensive test coverage for all functionality - Add documentation examples for both dictionary and JSON config formats - Rename get_tools to list_tools for API consistency - Clean up import handling with proper TYPE_CHECKING separation - Consolidate test utilities to reduce code duplication - Rename all pool variables to toolbox for consistent terminology - Improve temp file handling in tests with proper cleanup 🤖 Assisted by Amazon Q Developer
- Move toolbox creation before tool validation to enable default toolbox usage - Add test for loading tools from default toolbox without explicit toolbox parameter - Mock strands_tools dependencies in tests to avoid external dependencies - Verify that file_read tool can be loaded from default configuration 🤖 Assisted by Amazon Q Developer
Co-authored-by: Nick Clegg <nac542@gmail.com>
0476544
to
0a02c24
Compare
I'm going to close this in favor of a new one, since the unit tests seem borked. |
auto-merge was automatically disabled
September 26, 2025 19:58
Pull request was closed
7 tasks
7 tasks
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.
Edit: replaced with #935
Description
Usage example
For basic usage with the default set of tools available to choose from the config: file_read, editor, http_request, use_agent, and shell
To configure the set of tools available to the config, you can supply your own tool registry:
You can also load a config from a file:
Documentation PR
strands-agents/docs#252
Type of Change
New feature
Testing
How have you tested the change? Verify that the changes do not break functionality or introduce warnings in consuming repositories: agents-docs, agents-tools, agents-cli
hatch run prepare
Checklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.