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(dspy): extend incomplete generations #1613

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

mikeedjones
Copy link
Contributor

@mikeedjones mikeedjones commented Oct 11, 2024

If the output parsed by ChatAdapter.parse does not include all the fields required by the signature, the lm will be called again up to max_extensions times, with the thus-far completed output added to the input fields for the next generation.

Logic is wrapped up as a decorator to allow the logic to be reused by future Adapers.

Added tests for extended generation.

max_extensions defaults to 1 to maintain current behaviour.

Linting and formatting changes from ruff.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Just to double check: this file is not being changed materially right? Just formatting?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

one change in this file - added a comment

demos=demos,
inputs=inputs,
_parse_values=_parse_values,
max_extensions=dspy.settings.max_extensions or 0,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@okhat this is the only real change in this file - everything else is linting/formatting from rust

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