8000 result.to_input_list() cause 'Unhandled item type or structure' · Issue #865 · openai/openai-agents-python · GitHub
[go: up one dir, main page]

Skip to content
result.to_input_list() cause 'Unhandled item type or structure' #865
Closed
@JavaProgrammerLB

Description

@JavaProgrammerLB

Please read this first

  • Have you read the docs?Agents SDK docs
    yes
  • Have you searched for related issues? Others may have faced similar issues.
    yes

Describe the bug

I have met a result.to_input_list() generates invalid parameters issue, looking for help

I met this exception(save result.to_input_list() in session and reuse it with same sessionId) I except Runner.run_streamed(starting_agent=chat_agent, input=input_items, run_config=RunConfig(group_id=sessionId)) work well with input=input_items, but this code cause next error

File "/Users/user/Program/show-to_input_list-issue/.venv/lib/python3.12/site-packages/agents/models/chatcmpl_converter.py", line 435, in items_to_messages
    raise UserError(f"Unhandled item type or structure: {item}")
agents.exceptions.UserError: Unhandled item type or structure: [{'role': 'user', 'content': 'tell me a joke'}, {'id': '__fake_id__', 'content': [{'annotations': [], 'text': "Sure! Why don't skeletons fight each other?\n\nBecause they don't have the guts!", 'type': 'output_text'}], 'role': 'assistant', 'status': 'completed', 'type': 'message'}]

Debug information

  • Agents SDK version: 0.0.17
  • Python version 3.12

Repro steps

Expected behavior

I except Runner.run_streamed(starting_agent=chat_agent, input=input_items, run_config=RunConfig(group_id=sessionId)) work well with input=input_items, but this code cause up error

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0