-
Notifications
You must be signed in to change notification settings - Fork 123
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
What are you really trying to do?
Use the Temporal Python SDK’s openai agents integration with the latest openai-agents
python library to run agents.
Describe the bug
When running a workflow _TemporalModelStub.get_response
, raises a TypeError
because the method signature does not accept the new conversation_id
argument recently added upstream in openai-agents-python
.
Error trace:
TypeError: _TemporalModelStub.get_response() got an unexpected keyword argument 'conversation_id'
/.venv/lib/python3.13/site-packages/agents/run.py", line 1398, in _get_new_response
new_response = await model.get_response(
system_instructions=filtered.instructions,
prompt=prompt_config,
conversation_id=conversation_id,
)
^
Upstream change that introduced this parameter:
- openai/openai-agents-python@164acb5
- PR: [Fix #1564 Add conversations API support (#1587)](Fix #1564 Add conversations API support openai/openai-agents-python#1587)
Minimal Reproduction
- Install the latest
openai-agents
python (post conversations API support). - Run a sample agents workflow.
- Observe
TypeError
.
Relevant code in SDK:
[_temporal_model_stub.py#L60](https://github.com/temporalio/sdk-python/blob/44f0c42fa8b0d48c2d13bb9b238023eb983dc07f/temporalio/contrib/openai_agents/_temporal_model_stub.py#L60)
Environment/Versions
- OS and processor: e.g. macOS 14.5 (M1)
- Python version: 3.13
- Temporal SDK version: 1.4.1
- **OpenAI Agents Python version: >0.2.10. (conversation_id was added in 0.2.10)
Additional context
This bug was introduced due to drift between the Temporal stub and the upstream openai-agents
python model interface.
Possible fixes:
- Update
_TemporalModelStub.get_response
to acceptconversation_id: Optional[str] = None
. - Consider adding
**kwargs
passthrough to reduce future breakage.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working