forked from strands-agents/sdk-python
-
Notifications
You must be signed in to change notification settings - Fork 0
sdk main #7
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
Draft
dbschmigelski
wants to merge
47
commits into
main
Choose a base branch
from
sdk-main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
sdk main #7
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
996e86f to
17a2839
Compare
…trands-agents#1419) Previously triggering the agent would always provide the prompt of "review and continue" to the agent; this meant that if you gave the agent explicit commands in the comment it wouldn't necessarily receive/act on those. For example: /strands you didn't do X, please do it It would not actually receive the extra text; this updates it so that everything after the "strands command" is added as the prompt, defaulting to "review and continue" if non is provided --------- Co-authored-by: Mackenzie Zastrow <zastrowm@users.noreply.github.com>
* feat(tools): Add MCP resource operations * feat(tools): Add MCP resource operations * tests: add integ tests for mcp resources * fix: broken merge --------- Co-authored-by: Dean Schmigelski <dbschmigelski+github@gmail.com>
…nds-agents#1383) * add BidiGeminiLiveModel and BidiOpenAIRealtimeModel to the init * Address comments - re-word error message, add return type * Addressed comments: updated imports
* feat(bedrock): add guardrail_last_turn_only option * fix(bedrock): include assistant response in guardrail_last_turn_only context * fix: optimize code * feat: rewrtie the logic, include last user message in guardContent when feature flag is true * fix: remove uncessary integ tests and simplify guardrail logic * fix: rename feature flag, remove uncessary tests,add image to guardcontent block * fix: simplify logic and make tests more reliable --------- Co-authored-by: Aleksei Iancheruk <aianch@amazon.fr> Co-authored-by: Jack Yuan <jackypc@amazon.com>
…#512) --------- Co-authored-by: Daniel Schleicher <dschlei@amazon.de> Co-authored-by: Dean Schmigelski <dbschmigelski+github@gmail.com>
…classes to implement (strands-agents#1126)
…in the dev-dependencies group (strands-agents#1161) * ci: update pytest requirement in the dev-dependencies group Updates the requirements on [pytest](https://github.com/pytest-dev/pytest) to permit the latest version. Updates `pytest` to 9.0.0 - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](pytest-dev/pytest@8.0.0...9.0.0) --- updated-dependencies: - dependency-name: pytest dependency-version: 9.0.0 dependency-type: direct:development dependency-group: dev-dependencies ... Signed-off-by: dependabot[bot] <support@github.com> * bump pytest version floor --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Dean Schmigelski <dbschmigelski+github@gmail.com>
…s#1414) --------- Co-authored-by: Tirth Patel <tirthpat@amazon.com> Co-authored-by: Dean Schmigelski <dbschmigelski+github@gmail.com>
* Create SECURITY.md
Update the release notes SOP that was most effective after several iterations of having it generate the v1.21.0 release notes - final flow is at zastrowm#19. The flow on this was tweaking the SOP and then running the agent, and attempting to have it update in response. The biggest problems to solve was that: - It blindly trusted examples in PRs, resulting in examples that were wrong because of stale PRs - It would not generate useful tests I do not have the step-by-steps results with the different prompt variants as I deleted the older issues to avoid too many references being added to old PRs, but viewing the [final issue with results](zastrowm#19) shows the SOP results with one shot run after verifying which features should go in. --------- Co-authored-by: Mackenzie Zastrow <zastrowm@users.noreply.github.com>
…strands-agents#1445) The test_tool_use_with_structured_output test was flaky because the LLM sometimes uses '+' instead of 'add' as the operation string. The calculator tool now accepts both formats for all operations. Changes: - Accept both word and symbol forms: add/+, subtract/-, multiply/*, divide//, power/** - Also accept common abbreviations: sub, mul, div, pow - Normalize input with lower() and strip() - Fix divide operation (was b/a, now a/b) - Improve docstring with Args section This makes the integ tests more resilient to LLM output variations. Co-authored-by: Strands Coder <strands-coder@users.noreply.github.com>
…trands-agents#1426) Updates the requirements on [sphinx](https://github.com/sphinx-doc/sphinx) to permit the latest version. - [Release notes](https://github.com/sphinx-doc/sphinx/releases) - [Changelog](https://github.com/sphinx-doc/sphinx/blob/master/CHANGES.rst) - [Commits](sphinx-doc/sphinx@v5.0.0...v9.1.0) --- updated-dependencies: - dependency-name: sphinx dependency-version: 9.1.0 dependency-type: direct:development ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…corrupting agent state (strands-agents#1453) When multiple invocations occur concurrently on the same Agent instance the internal agent state can become corrupted, causing subsequent invocations to fail. The most common result is that the number of toolUse blocks end up out of sync with subsequent toolResult blocks, resulting in ValidationExceptions as reported in the bug report (strands-agents#1176). To block multiple conccurrent agent invocations, we'll raise a new ConcurrencyException before any state modification occurs. --------- Co-authored-by: Strands Agent <strands-agent@users.noreply.github.com> Co-authored-by: Mackenzie Zastrow <zastrowm@users.noreply.github.com>
…1444) Fixes strands-agents#1440 The MCP client creates a background thread for connection management. Previously, context variables set in the main thread were not accessible in this background thread. This change copies the context from the main thread when starting the background thread, ensuring that contextvars are properly propagated. This is consistent with the fix in PR strands-agents#1146 which addressed the same issue for tool invocations. Changes: - Add contextvars import - Use contextvars.copy_context() and ctx.run() when creating background thread - Add test to verify context propagation Co-authored-by: Strands Coder <strands-coder@github.com>
Updates the requirements on [sphinx-rtd-theme](https://github.com/readthedocs/sphinx_rtd_theme) to permit the latest version. - [Changelog](https://github.com/readthedocs/sphinx_rtd_theme/blob/master/docs/changelog.rst) - [Commits](readthedocs/sphinx_rtd_theme@1.0.0...3.1.0) --- updated-dependencies: - dependency-name: sphinx-rtd-theme dependency-version: 3.1.0 dependency-type: direct:development ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Updates the requirements on [websockets](https://github.com/python-websockets/websockets) to permit the latest version. - [Release notes](https://github.com/python-websockets/websockets/releases) - [Commits](python-websockets/websockets@15.0...16.0) --- updated-dependencies: - dependency-name: websockets dependency-version: '16.0' dependency-type: direct:development ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
b5a6aeb to
5c4efe2
Compare
…ands-agents#1186) Co-authored-by: Jack Yuan <jackypc@amazon.com> Co-authored-by: Nicholas Clegg <ncclegg@amazon.com>
Co-authored-by: spicadust <spicastre@gmail.com> Co-authored-by: Patrick Gray <pgrayy@amazon.com>
…-agents#1424) The current retry logic for handling ModelThrottledException is hardcoded in event_loop.py with fixed values (6 attempts, exponential backoff starting at 4s). This makes it impossible for users to customize retry behavior for their specific use cases, such as: This refactors the hardcoded retry logic into a `ModelRetryStrategy` class so that folks can customize the parameters. **Not Included**: The does not introduce a `RetryStrategy` base class. I started to do so, but am deferring it because: 1. It requires some additional design work to accommodate the tool-retries, which I anticipate should be accounted for in the design 2. It simplifies this review which refactors how the default retries work internally 3. `ModelRetryStrategy` provides enough benefit to allow folks to customize the agent loop without blocking on a more extensible design ---- Co-authored-by: Strands Agent <strands-agent@users.noreply.github.com> Co-authored-by: Mackenzie Zastrow <zastrowm@users.noreply.github.com>
…trands-agents#1502) Co-authored-by: Strands Agent <217235299+strands-agent@users.noreply.github.com>
abcdff7 to
d7aa0fb
Compare
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.
invoke_asyncfunction inAgentclass. [for better VS Code hover] (docs: improve docstring formatting strands-agents/sdk-python#846)Description
Related Issues
Documentation PR
Type of Change
Bug fix
New feature
Breaking change
Documentation update
Other (please describe):
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 prepareChecklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.