Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions integrations/google_genai/tests/test_chat_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -1300,17 +1300,14 @@ def test_aggregate_streaming_chunks_with_reasoning(monkeypatch):
chunk1.tool_calls = []
chunk1.meta = {"usage": {"prompt_tokens": 10, "completion_tokens": 5}}
chunk1.component_info = component_info
chunk1.reasoning = None

chunk2 = Mock()
chunk2.content = " world"
chunk2.tool_calls = []
chunk2.meta = {"usage": {"prompt_tokens": 10, "completion_tokens": 8}}
chunk2.component_info = component_info

# Mock the reasoning content that would be extracted
mock_reasoning = Mock()
mock_reasoning.reasoning_text = "I should greet the user politely"
mock_reasoning.reasoning_type = "REASONING_TYPE_UNSPECIFIED"
chunk2.reasoning = None

# Mock the final chunk with reasoning
final_chunk = Mock()
Expand All @@ -1321,6 +1318,7 @@ def test_aggregate_streaming_chunks_with_reasoning(monkeypatch):
"model": "gemini-2.5-pro",
}
final_chunk.component_info = component_info
final_chunk.reasoning = ReasoningContent(reasoning_text="I should greet the user politely")

# Add reasoning deltas to the final chunk meta (this is how the real method works)
final_chunk.meta["reasoning_deltas"] = [{"type": "reasoning", "content": "I should greet the user politely"}]
Expand Down
Loading