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

feat: Add outputs_to_string to Tool and ComponentTool #9152

Merged
merged 4 commits into from
Apr 1, 2025

Conversation

sjrl
Copy link
Contributor

@sjrl sjrl commented Apr 1, 2025

Related Issues

Proposed Changes:

Adds outputs_to_string to Tool and ComponentTool to allow users to customize how the output of a Tool should be converted into a string so that it can be provided back to the ChatGenerator in a ChatMessage.

If outputs_to_string is not provided a default converter is used within ToolInvoker. The default handler uses the current default behavior.

How did you test it?

Updated tests.

Notes for the reviewer

Checklist

  • I have read the contributors guidelines and the code of conduct
  • I have updated the related issue with new insights and changes
  • I added unit tests and updated the docstrings
  • I've used one of the conventional commit types for my PR title: fix:, feat:, build:, chore:, ci:, docs:, style:, refactor:, perf:, test: and added ! in case the PR includes breaking changes.
  • I documented my code
  • I ran pre-commit hooks and fixed any issue

@sjrl sjrl added this to the 2.12.0 milestone Apr 1, 2025
@github-actions github-actions bot added topic:tests type:documentation Improvements on the docs labels Apr 1, 2025
@coveralls
Copy link
Collaborator

coveralls commented Apr 1, 2025

Pull Request Test Coverage Report for Build 14193875653

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 27 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.09%) to 90.004%

Files with Coverage Reduction New Missed Lines %
tools/tool.py 6 93.68%
tools/component_tool.py 10 93.67%
components/tools/tool_invoker.py 11 90.3%
Totals Coverage Status
Change from base Build 14192152242: -0.09%
Covered Lines: 10282
Relevant Lines: 11424

💛 - Coveralls

@sjrl sjrl marked this pull request as ready for review April 1, 2025 10:01
@sjrl sjrl requested review from a team as code owners April 1, 2025 10:01
@sjrl sjrl requested review from dfokina, davidsbatista and anakin87 and removed request for a team and davidsbatista April 1, 2025 10:01
Copy link
Member

@anakin87 anakin87 left a comment

Choose a reason for hiding this comment

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

I had an initial look...
Please fix the mypy errors

Copy link
Member

@anakin87 anakin87 left a comment

Choose a reason for hiding this comment

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

I think there is room for future improvements for everything related to Agent.

However, this PR is good to go.

@sjrl
Copy link
Contributor Author

sjrl commented Apr 1, 2025

I think there is room for future improvements for everything related to Agent.

However, this PR is good to go.

@anakin87 what ideas do you have for future improvements?

@sjrl sjrl merged commit d15f1b9 into main Apr 1, 2025
17 checks passed
@sjrl sjrl deleted the update-tool-outputs-to-string branch April 1, 2025 12:04
@sjrl sjrl self-assigned this Apr 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic:tests type:documentation Improvements on the docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

State and Tool proposed Changes from feedback
3 participants