Skip to content
Discussion options

You must be logged in to vote

Hi @Antonio-ISA, OpenAI’s structured output format does not support free-form dictionaries because it requires a schema with explicitly defined keys and no unbounded additional properties. You will need to model your data using one or more fixed schema objects tailored to the structure you expect.

Here's a working example:

# Copyright (c) Microsoft. All rights reserved.

import asyncio

from agent_framework.openai import OpenAIResponsesClient
from pydantic import BaseModel, Field

"""
OpenAI Responses Client with Dictionary-like Structured Output Example

This sample demonstrates how to work around OpenAI's structured output limitations
when you need dictionary-like results. Instead of us…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Antonio-ISA
Comment options

Answer selected by moonbox3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
python agents Issues related to single agents
2 participants