File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 22
33import contextlib
44import datetime as dt
5+ import json
56import typing
67from json .decoder import JSONDecodeError
78
@@ -686,7 +687,13 @@ def _iter():
686687 if _sse .data == None :
687688 return
688689 try :
689- yield _sse .data
690+ yield typing .cast (
691+ PromptCallStreamResponse ,
692+ construct_type (
693+ type_ = PromptCallStreamResponse , # type: ignore
694+ object_ = json .loads (_sse .data ),
695+ ),
696+ )
690697 except Exception :
691698 pass
692699 return
Original file line number Diff line number Diff line change 1- import json
2-
31from humanloop .client import Humanloop
42
53from tests .integration .conftest import TestIdentifiers
@@ -39,7 +37,6 @@ def test_prompts_call_stream(
3937 output = ""
4038 for chunk in response :
4139 assert chunk is not None
42- chunk = json .loads (chunk )
4340 assert chunk .output is not None
4441 assert chunk .id is not None
4542 assert chunk .prompt_id is not None
You can’t perform that action at this time.
0 commit comments