Skip to content

Commit 6ae04c8

Browse files
authored
Merge pull request letta-ai#88 from letta-ai/release-please--branches--main--changes--next
release: 1.10.3
2 parents 79675f1 + 33e0882 commit 6ae04c8

88 files changed

Lines changed: 832 additions & 527 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.

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "1.10.2"
2+
".": "1.10.3"
33
}

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 126
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/letta-ai%2Fletta-sdk-2fcabe48fcd0f7ea8bb7af9870483b1369331f0fc345e085d607ff3cbd31b44b.yml
3-
openapi_spec_hash: af474c9c636bde8224321911d2272d09
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/letta-ai%2Fletta-sdk-873f657578988b58f8920addcacee62440377571f56a48c44b3505342a4cdc96.yml
3+
openapi_spec_hash: 6c5174fa1eddd3c0b8b072320d1d32b0
44
config_hash: f2ff70633d052a11601ad82a5afcfaec

CHANGELOG.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,35 @@
11
# Changelog
22

3+
## 1.10.3 (2026-04-17)
4+
5+
Full Changelog: [v1.10.2...v1.10.3](https://github.com/letta-ai/letta-python/compare/v1.10.2...v1.10.3)
6+
7+
### Features
8+
9+
* add xhigh opus 4.7 ([13053eb](https://github.com/letta-ai/letta-python/commit/13053ebdf4d9bbba90d03b45bcfc12e9ec93b4bf))
10+
* **api:** api update ([fa185df](https://github.com/letta-ai/letta-python/commit/fa185df57247bcac3842916ddfe165c4ce88a0b4))
11+
* **core:** add is_hidden field to conversations for hidden forks ([5f4a164](https://github.com/letta-ai/letta-python/commit/5f4a1648a5f7544fd11649ee28ea84fd2d03371f))
12+
* **core:** allow creating hidden conversations ([8818aca](https://github.com/letta-ai/letta-python/commit/8818acae5bdb5e8b42ee55851881943f84ef077b))
13+
* Feat/user quota view ([5322813](https://github.com/letta-ai/letta-python/commit/5322813e4ffb74f04cab02f24380c4baebcc113f))
14+
15+
16+
### Bug Fixes
17+
18+
* autogenerated changes ([0fe88a6](https://github.com/letta-ai/letta-python/commit/0fe88a680b70c5df5b1ca1fd03435344955044e9))
19+
* **client:** preserve hardcoded query params when merging with user params ([ff0da42](https://github.com/letta-ai/letta-python/commit/ff0da420446afde94f94beda4c83d968f4bdc711))
20+
* **core:** persist conversation context window overrides ([4e29e5f](https://github.com/letta-ai/letta-python/commit/4e29e5feea5290358ea4f44114d8493c8ca51ba2))
21+
* ensure file data are only sent as 1 parameter ([3df7d83](https://github.com/letta-ai/letta-python/commit/3df7d835b2242a91d7fb1ac02090c6487b9ba1b9))
22+
23+
24+
### Performance Improvements
25+
26+
* **client:** optimize file structure copying in multipart requests ([1e73b56](https://github.com/letta-ai/letta-python/commit/1e73b5635c3a74dab9a04e4d5c76e44e7a90af3b))
27+
28+
29+
### Refactors
30+
31+
* **core:** remove built-in multi-agent tools ([c120257](https://github.com/letta-ai/letta-python/commit/c1202573066daa9c0679c41c4f01b4454a70650e))
32+
333
## 1.10.2 (2026-04-02)
434

535
Full Changelog: [v1.10.1...v1.10.2](https://github.com/letta-ai/letta-python/compare/v1.10.1...v1.10.2)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "letta-client"
3-
version = "1.10.2"
3+
version = "1.10.3"
44
description = "The official Python library for the letta API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"

src/letta_client/_base_client.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,10 @@ def _build_request(
540540
files = cast(HttpxRequestFiles, ForceMultipartDict())
541541

542542
prepared_url = self._prepare_url(options.url)
543+
# preserve hard-coded query params from the url
544+
if params and prepared_url.query:
545+
params = {**dict(prepared_url.params.items()), **params}
546+
prepared_url = prepared_url.copy_with(raw_path=prepared_url.raw_path.split(b"?", 1)[0])
543547
if "_" in prepared_url.host:
544548
# work around https://github.com/encode/httpx/discussions/2880
545549
kwargs["extensions"] = {"sni_hostname": prepared_url.host.replace("_", "-")}

src/letta_client/_files.py

Lines changed: 53 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import io
44
import os
55
import pathlib
6-
from typing import overload
7-
from typing_extensions import TypeGuard
6+
from typing import Sequence, cast, overload
7+
from typing_extensions import TypeVar, TypeGuard
88

99
import anyio
1010

@@ -17,7 +17,9 @@
1717
HttpxFileContent,
1818
HttpxRequestFiles,
1919
)
20-
from ._utils import is_tuple_t, is_mapping_t, is_sequence_t
20+
from ._utils import is_list, is_mapping, is_tuple_t, is_mapping_t, is_sequence_t
21+
22+
_T = TypeVar("_T")
2123

2224

2325
def is_base64_file_input(obj: object) -> TypeGuard[Base64FileInput]:
@@ -121,3 +123,51 @@ async def async_read_file_content(file: FileContent) -> HttpxFileContent:
121123
return await anyio.Path(file).read_bytes()
122124

123125
return file
126+
127+
128+
def deepcopy_with_paths(item: _T, paths: Sequence[Sequence[str]]) -> _T:
129+
"""Copy only the containers along the given paths.
130+
131+
Used to guard against mutation by extract_files without copying the entire structure.
132+
Only dicts and lists that lie on a path are copied; everything else
133+
is returned by reference.
134+
135+
For example, given paths=[["foo", "files", "file"]] and the structure:
136+
{
137+
"foo": {
138+
"bar": {"baz": {}},
139+
"files": {"file": <content>}
140+
}
141+
}
142+
The root dict, "foo", and "files" are copied (they lie on the path).
143+
"bar" and "baz" are returned by reference (off the path).
144+
"""
145+
return _deepcopy_with_paths(item, paths, 0)
146+
147+
148+
def _deepcopy_with_paths(item: _T, paths: Sequence[Sequence[str]], index: int) -> _T:
149+
if not paths:
150+
return item
151+
if is_mapping(item):
152+
key_to_paths: dict[str, list[Sequence[str]]] = {}
153+
for path in paths:
154+
if index < len(path):
155+
key_to_paths.setdefault(path[index], []).append(path)
156+
157+
# if no path continues through this mapping, it won't be mutated and copying it is redundant
158+
if not key_to_paths:
159+
return item
160+
161+
result = dict(item)
162+
for key, subpaths in key_to_paths.items():
163+
if key in result:
164+
result[key] = _deepcopy_with_paths(result[key], subpaths, index + 1)
165+
return cast(_T, result)
166+
if is_list(item):
167+
array_paths = [path for path in paths if index < len(path) and path[index] == "<array>"]
168+
169+
# if no path expects a list here, nothing will be mutated inside it - return by reference
170+
if not array_paths:
171+
return cast(_T, item)
172+
return cast(_T, [_deepcopy_with_paths(entry, array_paths, index + 1) for entry in item])
173+
return item

src/letta_client/_utils/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
coerce_integer as coerce_integer,
2525
file_from_path as file_from_path,
2626
strip_not_given as strip_not_given,
27-
deepcopy_minimal as deepcopy_minimal,
2827
get_async_library as get_async_library,
2928
maybe_coerce_float as maybe_coerce_float,
3029
get_required_header as get_required_header,

src/letta_client/_utils/_utils.py

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,9 @@ def _extract_items(
8686
index += 1
8787
if is_dict(obj):
8888
try:
89-
# We are at the last entry in the path so we must remove the field
90-
if (len(path)) == index:
89+
# Remove the field if there are no more dict keys in the path,
90+
# only "<array>" traversal markers or end.
91+
if all(p == "<array>" for p in path[index:]):
9192
item = obj.pop(key)
9293
else:
9394
item = obj[key]
@@ -176,21 +177,6 @@ def is_iterable(obj: object) -> TypeGuard[Iterable[object]]:
176177
return isinstance(obj, Iterable)
177178

178179

179-
def deepcopy_minimal(item: _T) -> _T:
180-
"""Minimal reimplementation of copy.deepcopy() that will only copy certain object types:
181-
182-
- mappings, e.g. `dict`
183-
- list
184-
185-
This is done for performance reasons.
186-
"""
187-
if is_mapping(item):
188-
return cast(_T, {k: deepcopy_minimal(v) for k, v in item.items()})
189-
if is_list(item):
190-
return cast(_T, [deepcopy_minimal(entry) for entry in item])
191-
return item
192-
193-
194180
# copied from https://github.com/Rapptz/RoboDanny
195181
def human_join(seq: Sequence[str], *, delim: str = ", ", final: str = "or") -> str:
196182
size = len(seq)

src/letta_client/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
__title__ = "letta_client"
4-
__version__ = "1.10.2" # x-release-please-version
4+
__version__ = "1.10.3" # x-release-please-version

0 commit comments

Comments
 (0)