.TOOLS
Mode Breaking with Enums in response_model
— Any insights?
#1447
Unanswered
ashoknimiwal
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
I'm running into a problem with the
instructor
library when using.TOOLS
mode, and I’m hoping the community can help me figure this out.🚨 Issue Summary
I recently noticed that
.TOOLS
mode is throwing an error when usingEnum
types in theresponse_model
. Interestingly, this setup was working perfectly fine about 4-5 days ago.Here’s the error I’m getting:
InstructorRetryException: Error code: 400 - {'object': 'error', 'message': 'The provided JSON schema contains features not supported by xgrammar.', 'type': 'BadRequestError', 'param': None, 'code': 400}
After testing different variations, I found that the error only occurs when using
Enum
in the response model.If I switch to
.JSON
mode instead of.TOOLS
, it works without any errors — but:.JSON
mode.🔍 Minimal Example to Reproduce
Here’s a simple dummy example that replicates the issue:
Error Output:
Beta Was this translation helpful? Give feedback.
All reactions