Skip to content

Commit b33aef9

Browse files
authored
fix(ai): add properties for OpenAI compat (#3799)
1 parent 618fb6f commit b33aef9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ai-data/generative-apis/how-to/use-structured-outputs.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ extract = client.chat.completions.create(
215215
"items": {"type": "string"}
216216
}
217217
},
218+
"additionalProperties": false,
218219
"required": ["title", "summary", "actionItems"]
219220
}
220221
}
@@ -237,6 +238,10 @@ Output example:
237238
}
238239
```
239240

241+
<Message type="tip">
242+
When using the OpenAI SDKs like in the examples above, you are expected to set `additionalProperties` to false, and to specify all your properties as required.
243+
</Message>
244+
240245
## Conclusion
241246

242247
Using structured outputs with LLMs can significantly enhance data handling in your applications.

0 commit comments

Comments
 (0)