Skip to content

Commit a9c1b33

Browse files
committed
Release 0.8.30
1 parent 7fc9900 commit a9c1b33

78 files changed

Lines changed: 15615 additions & 7143 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

reference.md

Lines changed: 200 additions & 174 deletions
Large diffs are not rendered by default.

src/humanloop/__init__.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
ChatRole,
1111
ChatToolType,
1212
CodeEvaluatorRequest,
13-
CommitRequest,
1413
ConfigToolResponse,
1514
CreateDatapointRequest,
1615
CreateDatapointRequestTargetValue,
@@ -147,6 +146,7 @@
147146
ToolResponse,
148147
UpdateDatesetAction,
149148
UpdateEvaluationStatusRequest,
149+
UpdateVersionRequest,
150150
UserResponse,
151151
Valence,
152152
ValidationError,
@@ -164,6 +164,7 @@
164164
from .errors import UnprocessableEntityError
165165
from . import datasets, directories, evaluations, evaluators, files, flows, logs, prompts, tools
166166
from .client import AsyncHumanloop, Humanloop
167+
from .datasets import ListVersionsDatasetsIdVersionsGetRequestIncludeDatapoints
167168
from .environment import HumanloopEnvironment
168169
from .evaluations import (
169170
AddEvaluatorsRequestEvaluatorsItem,
@@ -205,7 +206,6 @@
205206
ChatMessageContentParams,
206207
ChatMessageParams,
207208
CodeEvaluatorRequestParams,
208-
CommitRequestParams,
209209
CreateDatapointRequestParams,
210210
CreateDatapointRequestTargetValueParams,
211211
CreateEvaluatorLogResponseParams,
@@ -312,6 +312,7 @@
312312
ToolKernelRequestParams,
313313
ToolLogResponseParams,
314314
ToolResponseParams,
315+
UpdateVersionRequestParams,
315316
ValidationErrorLocItemParams,
316317
ValidationErrorParams,
317318
VersionDeploymentResponseFileParams,
@@ -344,8 +345,6 @@
344345
"ChatToolType",
345346
"CodeEvaluatorRequest",
346347
"CodeEvaluatorRequestParams",
347-
"CommitRequest",
348-
"CommitRequestParams",
349348
"ConfigToolResponse",
350349
"CreateDatapointRequest",
351350
"CreateDatapointRequestParams",
@@ -490,6 +489,7 @@
490489
"ListPromptsParams",
491490
"ListTools",
492491
"ListToolsParams",
492+
"ListVersionsDatasetsIdVersionsGetRequestIncludeDatapoints",
493493
"LlmEvaluatorRequest",
494494
"LlmEvaluatorRequestParams",
495495
"LogResponse",
@@ -617,6 +617,8 @@
617617
"UnprocessableEntityError",
618618
"UpdateDatesetAction",
619619
"UpdateEvaluationStatusRequest",
620+
"UpdateVersionRequest",
621+
"UpdateVersionRequestParams",
620622
"UserResponse",
621623
"Valence",
622624
"ValidationError",

src/humanloop/base_client.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ def __init__(
7474
follow_redirects: typing.Optional[bool] = True,
7575
httpx_client: typing.Optional[httpx.Client] = None,
7676
):
77-
_defaulted_timeout = timeout if timeout is not None else 60 if httpx_client is None else None
77+
_defaulted_timeout = (
78+
timeout if timeout is not None else 60 if httpx_client is None else httpx_client.timeout.read
79+
)
7880
if api_key is None:
7981
raise ApiError(
8082
body="The client must be instantiated be either passing in api_key or setting HUMANLOOP_API_KEY"
@@ -147,7 +149,9 @@ def __init__(
147149
follow_redirects: typing.Optional[bool] = True,
148150
httpx_client: typing.Optional[httpx.AsyncClient] = None,
149151
):
150-
_defaulted_timeout = timeout if timeout is not None else 60 if httpx_client is None else None
152+
_defaulted_timeout = (
153+
timeout if timeout is not None else 60 if httpx_client is None else httpx_client.timeout.read
154+
)
151155
if api_key is None:
152156
raise ApiError(
153157
body="The client must be instantiated be either passing in api_key or setting HUMANLOOP_API_KEY"

src/humanloop/core/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from .datetime_utils import serialize_datetime
66
from .file import File, convert_file_dict_to_httpx_tuples, with_content_type
77
from .http_client import AsyncHttpClient, HttpClient
8+
from .http_response import AsyncHttpResponse, HttpResponse
89
from .jsonable_encoder import jsonable_encoder
910
from .pagination import AsyncPager, SyncPager
1011
from .pydantic_utilities import (
@@ -26,11 +27,13 @@
2627
"ApiError",
2728
"AsyncClientWrapper",
2829
"AsyncHttpClient",
30+
"AsyncHttpResponse",
2931
"AsyncPager",
3032
"BaseClientWrapper",
3133
"FieldMetadata",
3234
"File",
3335
"HttpClient",
36+
"HttpResponse",
3437
"IS_PYDANTIC_V2",
3538
"RequestOptions",
3639
"SyncClientWrapper",

src/humanloop/core/client_wrapper.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ 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.30",
1718
"X-Fern-Language": "Python",
1819
"X-Fern-SDK-Name": "humanloop",
1920
"X-Fern-SDK-Version": "0.8.30",

src/humanloop/core/http_client.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import asyncio
44
import email.utils
5-
import json
65
import re
76
import time
87
import typing
@@ -11,7 +10,6 @@
1110
from random import random
1211

1312
import httpx
14-
1513
from .file import File, convert_file_dict_to_httpx_tuples
1614
from .jsonable_encoder import jsonable_encoder
1715
from .query_encoder import encode_query
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# This file was auto-generated by Fern from our API Definition.
2+
3+
from typing import Dict, Generic, TypeVar
4+
5+
import httpx
6+
7+
T = TypeVar("T")
8+
9+
10+
class HttpResponse(Generic[T]):
11+
_response: httpx.Response
12+
_data: T
13+
14+
def __init__(self, response: httpx.Response, data: T):
15+
self._response = response
16+
self._data = data
17+
18+
@property
19+
def headers(self) -> Dict[str, str]:
20+
return dict(self._response.headers)
21+
22+
@property
23+
def data(self) -> T:
24+
return self._data
25+
26+
def close(self) -> None:
27+
self._response.close()
28+
29+
30+
class AsyncHttpResponse(Generic[T]):
31+
_response: httpx.Response
32+
_data: T
33+
34+
def __init__(self, response: httpx.Response, data: T):
35+
self._response = response
36+
self._data = data
37+
38+
@property
39+
def headers(self) -> Dict[str, str]:
40+
return dict(self._response.headers)
41+
42+
@property
43+
def data(self) -> T:
44+
return self._data
45+
46+
async def close(self) -> None:
47+
await self._response.aclose()

src/humanloop/core/jsonable_encoder.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
from typing import Any, Callable, Dict, List, Optional, Set, Union
1818

1919
import pydantic
20-
2120
from .datetime_utils import serialize_datetime
2221
from .pydantic_utilities import (
2322
IS_PYDANTIC_V2,

src/humanloop/core/pagination.py

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

33
import typing
44

5-
from typing_extensions import Self
6-
75
import pydantic
6+
from typing_extensions import Self
87

98
# Generic to represent the underlying type of the results within a page
109
T = typing.TypeVar("T")

src/humanloop/core/pydantic_utilities.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@
55
import typing
66
from collections import defaultdict
77

8-
import typing_extensions
9-
108
import pydantic
11-
9+
import typing_extensions
1210
from .datetime_utils import serialize_datetime
1311
from .serialization import convert_and_respect_annotation_metadata
1412

0 commit comments

Comments
 (0)