Closed
Description
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
- I create a public repository to show this problem
https://github.com/JavaProgrammerLB/show-to_input_list-issue
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