Skip to content

Python: [Bug]: Formats are not working. #5332

@TahaPasa

Description

@TahaPasa

Description

I am trying to use a structured format with agents, but it seems not to be working. I also checked out the code of the client, but I could not find any kind of "format" or "response_format" arguments.

Code Sample

async def run_my_agent(transcript : str):
    agent = client.as_agent(
        name="InfoExtractor",
        instructions=SYSTEM_PROMPT.agent_prompt
    )
    response = await agent.run(
        f"Please provide structured information about the person based on the talks:  '{transcript}'",
        response_format=PersonInfo,
    )
    
    return response

Error Messages / Stack Traces

None of the overloads for "run" match the provided arguments. Argument types: (str, type[PersonInfo])

Package Versions

agent-framework: 1.0.1

Python Version

Python 3.13

Additional Context

No response

Metadata

Metadata

Assignees

Labels

agentsIssues related to single agentsbugSomething isn't workingdocs-onlypython

Type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions