如何在OpenAI Response API Create Response中配置结构化输出?
OpenAI Responses API 结构化输出文档问题
- 在「Create a model response」文档中提到,配置
{ "type": "json_schema" }可启用结构化输出,但并未说明如何为输出指定具体的JSON Schema。
配置
{ "type": "json_schema" }可启用结构化输出
- 「Structured model outputs」文档中包含一段使用
client.responses.parse的Python示例代码,但Responses API的官方接口中并不存在这个parse方法:
response = client.responses.parse( model="gpt-4o-2024-08-06", input=[ {"role": "system", "content": "Extract the event information."}, { "role": "user", "content": "Alice and Bob are going to a science fair on Friday.", }, ], text_format=CalendarEvent, )
- 已有社区反馈指出,Responses API的结构化输出相关文档存在缺失问题。
内容的提问来源于stack exchange,提问作者mon
相关产品推荐
相关产品推荐

