Skip to content

Improve the positional args error message for dspy.Predict #8152

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

chenmoneygithub
Copy link
Collaborator

@chenmoneygithub chenmoneygithub commented May 1, 2025

To make that even more actionable. A sample code and error:

dspy.Predict("question, context -> answer")("What is the capital of France?")

error:

ValueError: Positional arguments are not allowed when calling `dspy.Predict`, must use keyword arguments that match your signature input fields: 'question, context'. For example: `predict(question=input_value, ...)`.

@okhat okhat merged commit 85a9126 into stanfordnlp:main May 1, 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