Skip to content

Support kwargs in dspy Tool #8102

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 2 commits into from
Apr 24, 2025
Merged

Conversation

TomeHirata
Copy link
Collaborator

Allow using callables that accept arbitrary keyword args.

def a(**kwargs):
    """arguments are c:int and d:int"""
    return kwargs.get("c", 1) * kwargs.get("d", 1)

tool = dspy.Tool(a)
tool(c=5, d=4)

@okhat okhat merged commit bc3648a into stanfordnlp:main Apr 24, 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