File tree Expand file tree Collapse file tree 4 files changed +4
-4
lines changed
Expand file tree Collapse file tree 4 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -261,7 +261,7 @@ async def _parse_ollama_stream_completion_response(
261261 print (f"Error parsing tool call input: { e } " )
262262
263263 # Generate response when there's new content or at final chunk
264- if chunk .done and contents :
264+ if chunk .done or contents :
265265 res = ChatResponse (
266266 content = contents ,
267267 usage = usage ,
Original file line number Diff line number Diff line change @@ -318,7 +318,7 @@ async def mock_stream() -> AsyncGenerator:
318318 async for response in result :
319319 responses .append (response )
320320
321- self .assertGreater (len (responses ), 0 )
321+ self .assertEqual (len (responses ), 2 )
322322 final_response = responses [- 1 ]
323323 self .assertIsInstance (final_response , ChatResponse )
324324 expected_content = [
Original file line number Diff line number Diff line change @@ -281,7 +281,7 @@ async def test_streaming_response_processing(self) -> None:
281281 async for response in result :
282282 responses .append (response )
283283
284- self .assertGreaterEqual (len (responses ), 1 )
284+ self .assertEqual (len (responses ), 2 )
285285 final_response = responses [- 1 ]
286286 expected_content = [TextBlock (type = "text" , text = "Hello there!" )]
287287 self .assertEqual (final_response .content , expected_content )
Original file line number Diff line number Diff line change @@ -244,7 +244,7 @@ async def test_streaming_response_processing(self) -> None:
244244 async for response in result :
245245 responses .append (response )
246246
247- self .assertGreaterEqual (len (responses ), 1 )
247+ self .assertEqual (len (responses ), 2 )
248248 final_response = responses [- 1 ]
249249 expected_content = [TextBlock (type = "text" , text = "Hello there!" )]
250250 self .assertEqual (final_response .content , expected_content )
You can’t perform that action at this time.
0 commit comments