Skip to content

Move string representation of tool to Tool class #8208

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
merged 4 commits into from
May 15, 2025

Conversation

TomeHirata
Copy link
Collaborator

No description provided.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR centralizes the string representation logic of the Tool class by moving it into its own str method while also adding a new test to verify the output.

  • Added a test for Tool's string representation in tests/primitives/test_tool.py
  • Implemented repr and str methods in dspy/primitives/tool.py

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
tests/primitives/test_tool.py Introduces a test validating the string representation of a Tool instance
dspy/primitives/tool.py Implements repr and str
dspy/predict/react.py Refactors instruction formatting by directly converting the tool to string

@okhat okhat merged commit 21ff0dc into stanfordnlp:main May 15, 2025
3 checks passed
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