-
Notifications
You must be signed in to change notification settings - Fork 49
feat: add requirements and preconditions to gen slots #226
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
base: main
Are you sure you want to change the base?
Conversation
…ecorated func params as positional args
Merge ProtectionsYour pull request matches the following merge protections and will not be merged until they are valid. 🟢 Enforce conventional commitWonderful, this rule succeeded.Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
|
| # Reqs to use with the strategy. You could also just remove "unknown" from the structured output for this. | ||
| requirements=["avoid classifying the sentiment as unknown"], | ||
| strategy=RejectionSamplingStrategy(), # Must specify a strategy for gen slots | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking of these parameters as parameters to the decorator. Was. there a reason to add it to the function call?
| m, | ||
| text="I love this!", | ||
| # Preconditions are only checked with basic validation. Don't use the strategy. | ||
| precondition_requirements=["the text arg should be less than 100 words"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's cool. Is there a scenario where a precondition_check would be helpful for m.instruct as well?
Generative slot tests and examples all passed / ran.
Closes #190 and #216
Features:
def test((one: int, two: bool, three:str) -> int:)previous:
Arguments:... - three: (type: <class 'str'>)now:
Arguments:... - three: "" (type: <class 'str'>)Semi-related changes and open questions:
outputparameter.Examples of the templated output: