diff --git a/pyproject.toml b/pyproject.toml index 776176d..d080275 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ name = "humanloop" [tool.poetry] name = "humanloop" -version = "0.8.37" +version = "0.8.38" description = "" readme = "README.md" authors = [] diff --git a/src/humanloop/agents/raw_client.py b/src/humanloop/agents/raw_client.py index 03caae7..e577f8c 100644 --- a/src/humanloop/agents/raw_client.py +++ b/src/humanloop/agents/raw_client.py @@ -2,6 +2,7 @@ import contextlib import datetime as dt +import json import typing from json.decoder import JSONDecodeError @@ -591,7 +592,13 @@ def _iter(): if _sse.data == None: return try: - yield _sse.data + yield typing.cast( + AgentCallStreamResponse, + construct_type( + type_=AgentCallStreamResponse, # type: ignore + object_=json.loads(_sse.data), + ), + ) except Exception: pass return @@ -889,7 +896,13 @@ def _iter(): if _sse.data == None: return try: - yield _sse.data + yield typing.cast( + AgentContinueCallStreamResponse, + construct_type( + type_=AgentContinueCallStreamResponse, # type: ignore + object_=json.loads(_sse.data), + ), + ) except Exception: pass return @@ -2558,7 +2571,13 @@ async def _iter(): if _sse.data == None: return try: - yield _sse.data + yield typing.cast( + AgentCallStreamResponse, + construct_type( + type_=AgentCallStreamResponse, # type: ignore + object_=json.loads(_sse.data), + ), + ) except Exception: pass return @@ -2856,7 +2875,13 @@ async def _iter(): if _sse.data == None: return try: - yield _sse.data + yield typing.cast( + AgentContinueCallStreamResponse, + construct_type( + type_=AgentContinueCallStreamResponse, # type: ignore + object_=json.loads(_sse.data), + ), + ) except Exception: pass return diff --git a/src/humanloop/core/client_wrapper.py b/src/humanloop/core/client_wrapper.py index 36e7630..1180f0a 100644 --- a/src/humanloop/core/client_wrapper.py +++ b/src/humanloop/core/client_wrapper.py @@ -14,10 +14,10 @@ def __init__(self, *, api_key: str, base_url: str, timeout: typing.Optional[floa def get_headers(self) -> typing.Dict[str, str]: headers: typing.Dict[str, str] = { - "User-Agent": "humanloop/0.8.37", + "User-Agent": "humanloop/0.8.38", "X-Fern-Language": "Python", "X-Fern-SDK-Name": "humanloop", - "X-Fern-SDK-Version": "0.8.37", + "X-Fern-SDK-Version": "0.8.38", } headers["X-API-KEY"] = self.api_key return headers diff --git a/src/humanloop/prompts/raw_client.py b/src/humanloop/prompts/raw_client.py index 57ba25a..5d12b08 100644 --- a/src/humanloop/prompts/raw_client.py +++ b/src/humanloop/prompts/raw_client.py @@ -2,6 +2,7 @@ import contextlib import datetime as dt +import json import typing from json.decoder import JSONDecodeError @@ -686,7 +687,13 @@ def _iter(): if _sse.data == None: return try: - yield _sse.data + yield typing.cast( + PromptCallStreamResponse, + construct_type( + type_=PromptCallStreamResponse, # type: ignore + object_=json.loads(_sse.data), + ), + ) except Exception: pass return @@ -2637,7 +2644,13 @@ async def _iter(): if _sse.data == None: return try: - yield _sse.data + yield typing.cast( + PromptCallStreamResponse, + construct_type( + type_=PromptCallStreamResponse, # type: ignore + object_=json.loads(_sse.data), + ), + ) except Exception: pass return