Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "humanloop"

[tool.poetry]
name = "humanloop"
version = "0.8.37"
version = "0.8.38"
description = ""
readme = "README.md"
authors = []
Expand Down
33 changes: 29 additions & 4 deletions src/humanloop/agents/raw_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import contextlib
import datetime as dt
import json
import typing
from json.decoder import JSONDecodeError

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/humanloop/core/client_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 15 additions & 2 deletions src/humanloop/prompts/raw_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import contextlib
import datetime as dt
import json
import typing
from json.decoder import JSONDecodeError

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down