Open timothyasp opened 3 months ago
ty!
Hitting this issue too 👍
Same here, getting this issue too - unable to use claude (but openai works fine!)
Very similar thing needs to happen as https://github.com/jxnl/instructor/pull/524. I've added this to my test cases but the current structure needs to be revamped.
Added support for Literal https://github.com/jxnl/instructor/pull/534 here. Union (|) not supported yet but getting there.
What Model are you using?
Describe the bug
Here's some sample code that fails:
with error:
And a different error when allowing anyOf with
List[Literal] | None
Code:With error:
Expected behavior This works well with OpenAI with instructor, so I'd expect the same results. It looks like it's an edge case in the
json_to_xml
function. I'll work on a fix, but opening this just in case someone already has a fix or idea how best to fix it.