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

Allow passing instructions to @model #856

Merged
merged 4 commits into from
Mar 15, 2024
Merged

Allow passing instructions to @model #856

merged 4 commits into from
Mar 15, 2024

Conversation

jlowin
Copy link
Member

@jlowin jlowin commented Feb 18, 2024

You can pass instructions to steer model transformation via the instructions parameter:

@marvin.model(instructions='Always generate locations in California')
class Location(BaseModel):
    city: str
    state: str

Location('a large city')   
# Location(city='Los Angeles', state='California')

Note that instructions are set at the class level, so they will apply to all instances of the model. To customize instructions on a per-instance basis, use cast with the instructions parameter instead.

@jlowin jlowin merged commit a77dfa1 into main Mar 15, 2024
15 checks passed
@jlowin jlowin deleted the instructions branch March 15, 2024 14:06
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.

None yet

1 participant