File tree Expand file tree Collapse file tree 3 files changed +13
-1
lines changed
Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 11[project ]
22name = " weaviate-agents"
3- version = " 0.12.0 "
3+ version = " 0.12.1 "
44description = " The official sub-package for the Weaviate Agents project."
55readme = " README.md"
66requires-python = " >=3.9"
Original file line number Diff line number Diff line change @@ -370,6 +370,8 @@ async def test_async_run_success(monkeypatch):
370370
371371
372372class MockIterSSESuccess :
373+ response = FakeResponse (200 , {})
374+
373375 def iter_sse (self ):
374376 yield ServerSentEvent (
375377 event = "progress_message" ,
@@ -514,6 +516,8 @@ async def test_async_run_failure(monkeypatch):
514516
515517
516518class MockIterSSEFailure :
519+ response = FakeResponse (200 , {})
520+
517521 def iter_sse (self ):
518522 yield ServerSentEvent (
519523 event = "progress_message" ,
Original file line number Diff line number Diff line change @@ -287,6 +287,10 @@ def stream(
287287 headers = self ._headers ,
288288 timeout = self ._timeout ,
289289 ) as events :
290+ if events .response .is_error :
291+ events .response .read ()
292+ raise Exception (events .response .text )
293+
290294 for sse in events .iter_sse ():
291295 output = _parse_sse (sse )
292296 if isinstance (output , ProgressMessage ):
@@ -403,6 +407,10 @@ async def stream(
403407 headers = self ._headers ,
404408 timeout = self ._timeout ,
405409 ) as events :
410+ if events .response .is_error :
411+ events .response .read ()
412+ raise Exception (events .response .text )
413+
406414 async for sse in events .aiter_sse ():
407415 output = _parse_sse (sse )
408416 if isinstance (output , ProgressMessage ):
You can’t perform that action at this time.
0 commit comments