Skip to content

additionalProperties should not be set for object types #608

Open
@PraveenKS30

Description

@PraveenKS30

Please read this first

  • Have you read the docs?Agents SDK docs
  • Have you searched for related issues? Others may have had similar requests

Question

I am trying to get structured output from the Agent using output_type .
My output would be in the JSON format and dynamic in nature so I kept the field as payload : dict.

class FHIRPayload(BaseModel):
    payload : dict

# define agent 
fhir_agent = Agent(
        name = "FHIR agent",
        instructions= fhir_system_prompt,
        model = "gpt-4o",
        output_type= FHIRPayload
    )

  response = Runner.run_sync(fhir_agent, input)
  print("Initial FHIR payload" + response.final_output)

But, keep getting this error :

agents.exceptions.UserError: additionalProperties should not be set for object types. This could be because you're using an older version of Pydantic, or because you configured additional properties to be allowed. If you really need this, update the function or output tool to not use a strict schema.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionQuestion about using the SDK

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions