Skip to content

Commit c683332

Browse files
Revert "Attempt quick fix"
This reverts commit 1d2510e. Should be unnecessary after rebasing on master.
1 parent 8208d45 commit c683332

2 files changed

Lines changed: 4 additions & 8 deletions

File tree

src/humanloop/prompts/raw_client.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import contextlib
44
import datetime as dt
5-
import json
65
import typing
76
from json.decoder import JSONDecodeError
87

@@ -687,13 +686,7 @@ def _iter():
687686
if _sse.data == None:
688687
return
689688
try:
690-
yield typing.cast(
691-
PromptCallStreamResponse,
692-
construct_type(
693-
type_=PromptCallStreamResponse, # type: ignore
694-
object_=json.loads(_sse.data),
695-
),
696-
)
689+
yield _sse.data
697690
except Exception:
698691
pass
699692
return

tests/integration/test_prompts.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import json
2+
13
from humanloop.client import Humanloop
24

35
from tests.integration.conftest import TestIdentifiers
@@ -37,6 +39,7 @@ def test_prompts_call_stream(
3739
output = ""
3840
for chunk in response:
3941
assert chunk is not None
42+
chunk = json.loads(chunk)
4043
assert chunk.output is not None
4144
assert chunk.id is not None
4245
assert chunk.prompt_id is not None

0 commit comments

Comments
 (0)