Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Allow for prompt rewriting in
setup_state. If the returned state contains thepromptfield, then overwritepromptwith the returned value.This enables environments that, for example, contain grounding information in the initial prompt.
Type of Change
This could be considered a breaking change in the sense that if somebody was already mutating the prompt field in
setup_state, then the system behavior would change. I don't know why somebody would be doing that as it would have no effect, but it's possible.Testing
uv run pytestlocally.Checklist
Additional Notes
This resolves a problem for a use-case that I have. Since verifiers doesn't currently support generators for datasets, my other options are:
rolloutin my subclass to modifypromptbeforesuper.rolloutis called. However, I need to store metadata instatethat corresponds to the modification toprompt. So I would then also need to mutateinfoto pipe that data through into thestateobject, which seems kind of lame.rolloutwith a custom implementationBut this seemed like the best approach and I thought that others would find this change useful.