4 ms·
OpenAI is using [0] LLGuidance [1]. You need to set strict:true in your request for schema validation to kick in though. [0] https://platform.openai.com/docs/g
by mmoskal 11mo ago
OpenAI is using [0] LLGuidance [1]. You need to set strict:true in your request for schema validation to kick in though.
[0] https://platform.openai.com/docs/guides/function-calling#lark-cfg https://platform.openai.com/docs/guides/function-calling#lar...
[1] https://github.com/guidance-ai/llguidance https://github.com/guidance-ai/llguidance
- jawiggins 11mo agoI don't think that parameter is an option when using pydantic schemas. class FooBar(BaseModel): foo: list[str] bar: list[int] prompt = """#Task Your job is to reply with Foo Bar, a json object with foo, a list of strings, and bar, a list of ints """ response = openai_client.chat.completions.parse( model="gpt-5-nano-2025-08-07", messages=[{"role": "system", "content": FooBar}], max_completion_tokens=4096, seed=123, response_format=CommentAnalysis, strict=True ) TypeError: Completions.parse() got an unexpected keyword argument 'strict'