8000 feat(handlers): add reasoning text to callback handler and related tests by josephgultekin · Pull Request #109 · strands-agents/sdk-python · GitHub
[go: up one dir, main page]

Skip to content

feat(handlers): add reasoning text to callback handler and related tests #109

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

Merged

Conversation

josephgultekin
Copy link
Contributor

Description

Summary of Changes

Handler Implementation (callback_handler.py):

  • The PrintingCallbackHandler now checks for the reasoningText argument and prints it if present.
  • The handler’s logic for printing data, handling completion, and tracking tool usage remains consistent with the updated tests.
  • No breaking changes to the handler logic; changes ensure the implementation matches the new and clarified test expectations.

Unit Test Improvements for Callback Handler (test_callback_handler.py):

  • Added and clarified tests for the reasoningText argument in the PrintingCallbackHandler.
  • Explicitly test the handler’s behavior when reasoningText is present (should print the text) and when it is absent (should not print reasoning text).
  • Ensured that combinations of reasoningText and data are tested, verifying correct print calls and order.
  • Maintained and improved coverage for other handler behaviors, including tool use tracking and composite handler forwarding.

.gitignore:

  • Added path .vscode

These changes improve test coverage and clarity for the callback handler’s handling of the reasoningText argument and related output logic.

Related Issues

Issue #98

Documentation PR

N/A

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Other (please describe):

[Choose one of the above types of changes]

Testing

Yes. Ran all following with no errors.

  • hatch fmt --linter
  • hatch fmt --formatter
  • hatch test --all
  • Verify that the changes do not break functionality or introduce warnings in consuming repositories: agents-docs, agents-tools, agents-cli

Checklist

  • I have read the CONTRIBUTING document
  • I have added tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have added an appropriate example to the documentation to outline the feature
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@josephgultekin josephgultekin requested a review from a team as a code owner May 25, 2025 13:52
@awsarron awsarron enabled auto-merge (squash) May 25, 2025 14:50
Copy link
Member
@awsarron awsarron left a comment

Choose a reason for hiding this comment

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

Thanks @josephgultekin, the changes work great!

I added a couple of minor comments, then we'll get this merged.

auto-merge was automatically disabled May 25, 2025 15:35

Head branch was pushed to by a user without write access

@josephgultekin josephgultekin requested a review from awsarron May 25, 2025 15:56
@awsarron awsarron merged commit 7042af1 into strands-agents:main May 25, 2025
20 checks passed
@awsarron
Copy link
Member

Awesome, thanks @josephgultekin 🚀

We'll get this published in the next version release.

awsarron pushed a commit to awsarron/sdk-python that referenced this pull request May 26, 2025
…sts (strands-agents#109)

* feat(handlers): add reasoning text to callback handler and related tests

* feat(handlers): removed redundant comment in .gitignore file

* feat(handlers): Updated reasoningText type as (Optional[str]
awsarron added a commit that referenced this pull request May 26, 2025
* models - openai - argument none (#97)

* docs(readme): add open PRs badge + link to samples repo + change 'Docs' to 'Documentation' (#100)

* docs(readme): add logo (#101)

* docs(readme): add logo, title, badges, links to other repos, standardize headings (#102)

* style(readme): use dark logo for clearer visibility when system is using light color scheme (#104)

* fix(readme): use logo that changes color automatically depending on user's color preference scheme (#105)

* feat(handlers): add reasoning text to callback handler and related tests (#109)

* feat(handlers): add reasoning text to callback handler and related tests

* feat(handlers): removed redundant comment in .gitignore file

* feat(handlers): Updated reasoningText type as (Optional[str]

* feat: Add dynamic system prompt override functionality (#108)

* Modularizing Event Loop (#106)

* fix(telemetry): fix agent span start and end when using Agent.stream_async() (#119)

* feat: Update SlidingWindowConversationManager (#120)

* v0.1.5

---------

Co-authored-by: Patrick Gray <pgrayy@amazon.com>
Co-authored-by: Gokhan (Joe) Gultekin <joseph.gueltekin@gmail.com>
Co-authored-by: Shubham Raut <shubhamrao12321@gmail.com>
Co-authored-by: fede-dash <fede.kamelhar@doordash.com>
Co-authored-by: Nick Clegg <nac542@gmail.com>
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.

2 participants
0