Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

test_gpt_5_reasoning_streaming fixes

Ishaan Jaffer7af8acdc2206
diff --git a/tests/llm_translation/test_openai.py b/tests/llm_translation/test_openai.py
index 156c5352958..1b96a996210 100644
--- a/tests/llm_translation/test_openai.py
+++ b/tests/llm_translation/test_openai.py
@@ -796,19 +796,16 @@ def test_gpt_5_reasoning_streaming():
stream=True,
)
- has_reasoning_content = False
+ has_content = False
for chunk in response:
print("chunk: ", chunk)
- if (
- hasattr(chunk.choices[0].delta, "reasoning_content")
- and chunk.choices[0].delta.reasoning_content is not None
- ):
- print("reasoning_content: ", chunk.choices[0].delta.reasoning_content)
- has_reasoning_content = True
+ if chunk.choices[0].delta.content:
+ has_content = True
+ print("content: ", chunk.choices[0].delta.content)
- assert has_reasoning_content
+ assert has_content
- print("✓ gpt_5_reasoning_streaming correctly handled reasoning content")
+ print("✓ gpt_5_reasoning_streaming correctly handled streaming")
def test_gpt_5_pro_reasoning():
@@ -824,7 +821,8 @@ def test_gpt_5_pro_reasoning():
reasoning_effort="high",
)
print("response: ", response)
- assert response.choices[0].message.reasoning_content is not None
+ # reasoning_effort string param does not request summaries (opt-in since #16210)
+ assert response.choices[0].message.content is not None # But we should get content
def test_openai_gpt_5_codex_reasoning():