-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Open
Labels
questionQuestion about using the SDKQuestion about using the SDK
Description
Bug: AttributeError: 'Response' object has no attribute 'response_id'
Environment: openai-agents 0.9.1, openai 2.21.0, Python 3.10
Issue: The SDK tries to access response_id on Response objects, but the field is actually named id.
Location: agents/run.py line 1179 (and lines 677, 790, 1118, 1128)
Error:
response_id=turn_result.model_response.response_id # ❌ response_id doesn't exist
AttributeError: 'Response' object has no attribute 'response_id'Root Cause:
The Response class from openai.types.responses has an id field, not response_id:
Response.model_fields.keys() # includes 'id', 'previous_response_id', but NOT 'response_id'Fix:
Change all occurrences from:
turn_result.model_response.response_idto:
turn_result.model_response.idImpact: Affects custom model implementations that return Response objects, particularly when using streaming.
Workaround:
from openai.types.responses import Response
@property
def response_id(self):
return self.id
Response.response_id = response_idReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
questionQuestion about using the SDKQuestion about using the SDK