You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Answer is now type hinted as str | int | ... but we know it should be MyModel.
When I explicitly define answer: MyModel = generator(prompt) it also says the types do not match.
How would you like it to behave?
SequenceGenerator could be generic over the provided pydantic model when using outlines.generate.json, so the return value of __call__ would be the right data structure.
This would probably be harder to do for other outlines.generate methods, but for pydantic it would be very nice.
The text was updated successfully, but these errors were encountered:
If this conflicts with other behavior of generate.json, perhaps it would be wise to split the pydantic generation into something like generate.pydantic?
What behavior of the library made you think about the improvement?
Answer is now type hinted as
str | int | ...
but we know it should beMyModel
.When I explicitly define
answer: MyModel = generator(prompt)
it also says the types do not match.How would you like it to behave?
SequenceGenerator
could be generic over the provided pydantic model when usingoutlines.generate.json
, so the return value of__call__
would be the right data structure.This would probably be harder to do for other
outlines.generate
methods, but for pydantic it would be very nice.The text was updated successfully, but these errors were encountered: