Skip to content

Commit 196fc39

Browse files
author
Andrei Bratu
committed
Merge branch 'master' into flow-complete-dx
1 parent 23d51c0 commit 196fc39

File tree

9 files changed

+1885
-1743
lines changed

9 files changed

+1885
-1743
lines changed

poetry.lock

Lines changed: 284 additions & 201 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "humanloop"
33

44
[tool.poetry]
55
name = "humanloop"
6-
version = "0.8.39"
6+
version = "0.8.40b5"
77
description = ""
88
readme = "README.md"
99
authors = []

reference.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,6 @@ Controls how the model uses tools. The following options are supported:
178178
The Prompt configuration to use. Two formats are supported:
179179
- An object representing the details of the Prompt configuration
180180
- A string representing the raw contents of a .prompt file
181-
182181
A new Prompt version will be created if the provided details do not match any existing version.
183182

184183
</dd>
@@ -709,7 +708,6 @@ Controls how the model uses tools. The following options are supported:
709708
The Prompt configuration to use. Two formats are supported:
710709
- An object representing the details of the Prompt configuration
711710
- A string representing the raw contents of a .prompt file
712-
713711
A new Prompt version will be created if the provided details do not match any existing version.
714712

715713
</dd>
@@ -974,7 +972,6 @@ Controls how the model uses tools. The following options are supported:
974972
The Prompt configuration to use. Two formats are supported:
975973
- An object representing the details of the Prompt configuration
976974
- A string representing the raw contents of a .prompt file
977-
978975
A new Prompt version will be created if the provided details do not match any existing version.
979976

980977
</dd>
@@ -8383,7 +8380,6 @@ Controls how the model uses tools. The following options are supported:
83838380
The Agent configuration to use. Two formats are supported:
83848381
- An object representing the details of the Agent configuration
83858382
- A string representing the raw contents of a .agent file
8386-
83878383
A new Agent version will be created if the provided details do not match any existing version.
83888384

83898385
</dd>
@@ -8791,7 +8787,6 @@ Controls how the model uses tools. The following options are supported:
87918787
The Agent configuration to use. Two formats are supported:
87928788
- An object representing the details of the Agent configuration
87938789
- A string representing the raw contents of a .agent file
8794-
87958790
A new Agent version will be created if the provided details do not match any existing version.
87968791

87978792
</dd>
@@ -9042,7 +9037,6 @@ Controls how the model uses tools. The following options are supported:
90429037
The Agent configuration to use. Two formats are supported:
90439038
- An object representing the details of the Agent configuration
90449039
- A string representing the raw contents of a .agent file
9045-
90469040
A new Agent version will be created if the provided details do not match any existing version.
90479041

90489042
</dd>

src/humanloop/agents/client.py

Lines changed: 411 additions & 397 deletions
Large diffs are not rendered by default.

src/humanloop/agents/raw_client.py

Lines changed: 369 additions & 355 deletions
Large diffs are not rendered by default.

src/humanloop/core/client_wrapper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ def __init__(self, *, api_key: str, base_url: str, timeout: typing.Optional[floa
1414

1515
def get_headers(self) -> typing.Dict[str, str]:
1616
headers: typing.Dict[str, str] = {
17-
"User-Agent": "humanloop/0.8.39",
17+
"User-Agent": "humanloop/0.8.40b5",
1818
"X-Fern-Language": "Python",
1919
"X-Fern-SDK-Name": "humanloop",
20-
"X-Fern-SDK-Version": "0.8.39",
20+
"X-Fern-SDK-Version": "0.8.40b5",
2121
}
2222
headers["X-API-KEY"] = self.api_key
2323
return headers

src/humanloop/overload.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,17 @@ def _overload_call(self: T, file_syncer: Optional[FileSyncer], use_local_files:
238238
raise HumanloopRuntimeError from e
239239

240240

241+
ClientTemplateType = TypeVar(
242+
"ClientTemplateType",
243+
bound=Union[
244+
FlowsClient,
245+
PromptsClient,
246+
AgentsClient,
247+
ToolsClient,
248+
],
249+
)
250+
251+
241252
def overload_client(
242253
client: T,
243254
file_syncer: Optional[FileSyncer] = None,
@@ -253,23 +264,21 @@ def overload_client(
253264
def log_wrapper(self: T, **kwargs) -> LogResponseType:
254265
return _overload_log(self, file_syncer, use_local_files, **kwargs)
255266

256-
# Replace the log method with type ignore
257-
client.log = types.MethodType(log_wrapper, client) # type: ignore
267+
client.log = types.MethodType(log_wrapper, client)
258268

259269
# Overload call method for Prompt and Agent clients
260270
if _get_file_type_from_client(client) in FileSyncer.SERIALIZABLE_FILE_TYPES:
261271
if file_syncer is None and use_local_files:
262272
logger.error("file_syncer is None but client has call method and use_local_files=%s", use_local_files)
263273
raise HumanloopRuntimeError("file_syncer is required for clients that support call operations")
264274
if hasattr(client, "call") and not hasattr(client, "_call"):
265-
# Store original method with type ignore
266-
client._call = client.call # type: ignore
275+
client._call = client.call
267276

268277
# Create a closure to capture file_syncer and use_local_files
269278
def call_wrapper(self: T, **kwargs) -> CallResponseType:
270279
return _overload_call(self, file_syncer, use_local_files, **kwargs)
271280

272281
# Replace the call method with type ignore
273-
client.call = types.MethodType(call_wrapper, client) # type: ignore
282+
client.call = types.MethodType(call_wrapper, client)
274283

275284
return client

0 commit comments

Comments
 (0)