Skip to content

Commit 1c38709

Browse files
committed
using getattr to access reasoning_content
1 parent 03b3f29 commit 1c38709

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Diff for: src/agents/models/openai_chatcompletions.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,8 @@ async def stream_response(
208208
continue
209209

210210
delta = chunk.choices[0].delta
211-
if delta.reasoning_content:
212-
content = delta.reasoning_content
213-
else:
214-
content = delta.content
211+
reasoning_content = getattr(delta, "reasoning_content")
212+
content = reasoning_content if reasoning_content else delta.content
215213

216214
# Handle text
217215
if content:

0 commit comments

Comments
 (0)