Skip to content

Commit f65b00a

Browse files
authored
Merge pull request #16 from supermemoryai/release-please--branches--main--changes--next
release: 3.0.0-alpha.30
2 parents 6f3e958 + 88ea4dc commit f65b00a

Some content is hidden

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

50 files changed

+672
-2169
lines changed

.release-please-manifest.json

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

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 18
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-de994787885a5ec28fb19f069715a257ea4e4f1bcff2b25c4b33e928779c6454.yml
3-
openapi_spec_hash: 7b831b4614b8d9b8caddcaa096bf3817
1+
configured_endpoints: 12
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-f181eaeb22a42d197dbd9c45fa61bf9a9b78a91d3334fc0f841494dc73d1a203.yml
3+
openapi_spec_hash: bb8262ebcdea53979cf1cafbc2c68dc8
44
config_hash: 9b9291a6c872b063900a46386729ba3c

CHANGELOG.md

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

3+
## 3.0.0-alpha.30 (2025-09-15)
4+
5+
Full Changelog: [v3.0.0-alpha.29...v3.0.0-alpha.30](https://github.com/supermemoryai/python-sdk/compare/v3.0.0-alpha.29...v3.0.0-alpha.30)
6+
7+
### Features
8+
9+
* **api:** api update ([b7df28e](https://github.com/supermemoryai/python-sdk/commit/b7df28ec025c70d7b8e1544aa1ef0262c0be8a03))
10+
* **api:** api update ([54cf9c1](https://github.com/supermemoryai/python-sdk/commit/54cf9c13bf3ff378dd6a19a15c9e343e822ab99a))
11+
* **api:** api update ([4812077](https://github.com/supermemoryai/python-sdk/commit/48120771b2476f2d2863a1614edc222e863ddde4))
12+
* **api:** api update ([a4f4259](https://github.com/supermemoryai/python-sdk/commit/a4f425943298762bdfb7f3b0421f8d56d2e1473c))
13+
* **api:** api update ([8412e4d](https://github.com/supermemoryai/python-sdk/commit/8412e4d06b0225fd3707a55b743c401d87b1c0aa))
14+
* improve future compat with pydantic v3 ([70ea8b7](https://github.com/supermemoryai/python-sdk/commit/70ea8b7206b2e8db3d86f5a1674e7dd2f7a7e67b))
15+
* **types:** replace List[str] with SequenceNotStr in params ([f4bfda3](https://github.com/supermemoryai/python-sdk/commit/f4bfda34d40ca947eae6a32ea323dafeddf51484))
16+
17+
18+
### Chores
19+
20+
* **internal:** add Sequence related utils ([d2b96ed](https://github.com/supermemoryai/python-sdk/commit/d2b96ed43577a3d046ffea7cbc87ba6b877beba7))
21+
* **internal:** move mypy configurations to `pyproject.toml` file ([31832f5](https://github.com/supermemoryai/python-sdk/commit/31832f5046f7b6384c1bb506680319890e3a5194))
22+
* **tests:** simplify `get_platform` test ([30d8e46](https://github.com/supermemoryai/python-sdk/commit/30d8e464a5d8ceb5cec41a6197c291962b78b0b5))
23+
324
## 3.0.0-alpha.29 (2025-08-27)
425

526
Full Changelog: [v3.0.0-alpha.28...v3.0.0-alpha.29](https://github.com/supermemoryai/python-sdk/compare/v3.0.0-alpha.28...v3.0.0-alpha.29)

README.md

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -127,23 +127,6 @@ response = client.search.memories(
127127
print(response.include)
128128
```
129129

130-
## File uploads
131-
132-
Request parameters that correspond to file uploads can be passed as `bytes`, or a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance or a tuple of `(filename, contents, media type)`.
133-
134-
```python
135-
from pathlib import Path
136-
from supermemory import Supermemory
137-
138-
client = Supermemory()
139-
140-
client.memories.upload_file(
141-
file=Path("/path/to/file"),
142-
)
143-
```
144-
145-
The async client uses the exact same interface. If you pass a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance, the file contents will be read asynchronously automatically.
146-
147130
## Handling errors
148131

149132
When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `supermemory.APIConnectionError` is raised.
@@ -160,7 +143,9 @@ from supermemory import Supermemory
160143
client = Supermemory()
161144

162145
try:
163-
client.memories.add()
146+
client.search.documents(
147+
q="machine learning concepts",
148+
)
164149
except supermemory.APIConnectionError as e:
165150
print("The server could not be reached")
166151
print(e.__cause__) # an underlying Exception, likely raised within httpx.
@@ -203,7 +188,9 @@ client = Supermemory(
203188
)
204189

205190
# Or, configure per-request:
206-
client.with_options(max_retries=5).memories.add()
191+
client.with_options(max_retries=5).search.documents(
192+
q="machine learning concepts",
193+
)
207194
```
208195

209196
### Timeouts
@@ -226,7 +213,9 @@ client = Supermemory(
226213
)
227214

228215
# Override per-request:
229-
client.with_options(timeout=5.0).memories.add()
216+
client.with_options(timeout=5.0).search.documents(
217+
q="machine learning concepts",
218+
)
230219
```
231220

232221
On timeout, an `APITimeoutError` is thrown.
@@ -267,11 +256,13 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to
267256
from supermemory import Supermemory
268257

269258
client = Supermemory()
270-
response = client.memories.with_raw_response.add()
259+
response = client.search.with_raw_response.documents(
260+
q="machine learning concepts",
261+
)
271262
print(response.headers.get('X-My-Header'))
272263

273-
memory = response.parse() # get the object that `memories.add()` would have returned
274-
print(memory.id)
264+
search = response.parse() # get the object that `search.documents()` would have returned
265+
print(search.results)
275266
```
276267

277268
These methods return an [`APIResponse`](https://github.com/supermemoryai/python-sdk/tree/main/src/supermemory/_response.py) object.
@@ -285,7 +276,9 @@ The above interface eagerly reads the full response body when you make the reque
285276
To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.
286277

287278
```python
288-
with client.memories.with_streaming_response.add() as response:
279+
with client.search.with_streaming_response.documents(
280+
q="machine learning concepts",
281+
) as response:
289282
print(response.headers.get("X-My-Header"))
290283

291284
for line in response.iter_lines():

api.md

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,3 @@
1-
# Memories
2-
3-
Types:
4-
5-
```python
6-
from supermemory.types import (
7-
MemoryUpdateResponse,
8-
MemoryListResponse,
9-
MemoryAddResponse,
10-
MemoryGetResponse,
11-
MemoryUploadFileResponse,
12-
)
13-
```
14-
15-
Methods:
16-
17-
- <code title="patch /v3/memories/{id}">client.memories.<a href="./src/supermemory/resources/memories.py">update</a>(id, \*\*<a href="src/supermemory/types/memory_update_params.py">params</a>) -> <a href="./src/supermemory/types/memory_update_response.py">MemoryUpdateResponse</a></code>
18-
- <code title="post /v3/memories/list">client.memories.<a href="./src/supermemory/resources/memories.py">list</a>(\*\*<a href="src/supermemory/types/memory_list_params.py">params</a>) -> <a href="./src/supermemory/types/memory_list_response.py">MemoryListResponse</a></code>
19-
- <code title="delete /v3/memories/{id}">client.memories.<a href="./src/supermemory/resources/memories.py">delete</a>(id) -> None</code>
20-
- <code title="post /v3/memories">client.memories.<a href="./src/supermemory/resources/memories.py">add</a>(\*\*<a href="src/supermemory/types/memory_add_params.py">params</a>) -> <a href="./src/supermemory/types/memory_add_response.py">MemoryAddResponse</a></code>
21-
- <code title="get /v3/memories/{id}">client.memories.<a href="./src/supermemory/resources/memories.py">get</a>(id) -> <a href="./src/supermemory/types/memory_get_response.py">MemoryGetResponse</a></code>
22-
- <code title="post /v3/memories/file">client.memories.<a href="./src/supermemory/resources/memories.py">upload_file</a>(\*\*<a href="src/supermemory/types/memory_upload_file_params.py">params</a>) -> <a href="./src/supermemory/types/memory_upload_file_response.py">MemoryUploadFileResponse</a></code>
23-
241
# Search
252

263
Types:

mypy.ini

Lines changed: 0 additions & 50 deletions
This file was deleted.

pyproject.toml

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "supermemory"
3-
version = "3.0.0-alpha.29"
3+
version = "3.0.0-alpha.30"
44
description = "The official Python library for the supermemory API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"
@@ -56,7 +56,6 @@ dev-dependencies = [
5656
"dirty-equals>=0.6.0",
5757
"importlib-metadata>=6.7.0",
5858
"rich>=13.7.1",
59-
"nest_asyncio==1.6.0",
6059
"pytest-xdist>=3.6.1",
6160
]
6261

@@ -157,6 +156,58 @@ reportOverlappingOverload = false
157156
reportImportCycles = false
158157
reportPrivateUsage = false
159158

159+
[tool.mypy]
160+
pretty = true
161+
show_error_codes = true
162+
163+
# Exclude _files.py because mypy isn't smart enough to apply
164+
# the correct type narrowing and as this is an internal module
165+
# it's fine to just use Pyright.
166+
#
167+
# We also exclude our `tests` as mypy doesn't always infer
168+
# types correctly and Pyright will still catch any type errors.
169+
exclude = ['src/supermemory/_files.py', '_dev/.*.py', 'tests/.*']
170+
171+
strict_equality = true
172+
implicit_reexport = true
173+
check_untyped_defs = true
174+
no_implicit_optional = true
175+
176+
warn_return_any = true
177+
warn_unreachable = true
178+
warn_unused_configs = true
179+
180+
# Turn these options off as it could cause conflicts
181+
# with the Pyright options.
182+
warn_unused_ignores = false
183+
warn_redundant_casts = false
184+
185+
disallow_any_generics = true
186+
disallow_untyped_defs = true
187+
disallow_untyped_calls = true
188+
disallow_subclassing_any = true
189+
disallow_incomplete_defs = true
190+
disallow_untyped_decorators = true
191+
cache_fine_grained = true
192+
193+
# By default, mypy reports an error if you assign a value to the result
194+
# of a function call that doesn't return anything. We do this in our test
195+
# cases:
196+
# ```
197+
# result = ...
198+
# assert result is None
199+
# ```
200+
# Changing this codegen to make mypy happy would increase complexity
201+
# and would not be worth it.
202+
disable_error_code = "func-returns-value,overload-cannot-match"
203+
204+
# https://github.com/python/mypy/issues/12162
205+
[[tool.mypy.overrides]]
206+
module = "black.files.*"
207+
ignore_errors = true
208+
ignore_missing_imports = true
209+
210+
160211
[tool.ruff]
161212
line-length = 120
162213
output-format = "grouped"

requirements-dev.lock

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ multidict==6.4.4
7575
mypy==1.14.1
7676
mypy-extensions==1.0.0
7777
# via mypy
78-
nest-asyncio==1.6.0
7978
nodeenv==1.8.0
8079
# via pyright
8180
nox==2023.4.22

src/supermemory/_base_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
ModelBuilderProtocol,
6060
)
6161
from ._utils import is_dict, is_list, asyncify, is_given, lru_cache, is_mapping
62-
from ._compat import PYDANTIC_V2, model_copy, model_dump
62+
from ._compat import PYDANTIC_V1, model_copy, model_dump
6363
from ._models import GenericModel, FinalRequestOptions, validate_type, construct_type
6464
from ._response import (
6565
APIResponse,
@@ -232,7 +232,7 @@ def _set_private_attributes(
232232
model: Type[_T],
233233
options: FinalRequestOptions,
234234
) -> None:
235-
if PYDANTIC_V2 and getattr(self, "__pydantic_private__", None) is None:
235+
if (not PYDANTIC_V1) and getattr(self, "__pydantic_private__", None) is None:
236236
self.__pydantic_private__ = {}
237237

238238
self._model = model
@@ -320,7 +320,7 @@ def _set_private_attributes(
320320
client: AsyncAPIClient,
321321
options: FinalRequestOptions,
322322
) -> None:
323-
if PYDANTIC_V2 and getattr(self, "__pydantic_private__", None) is None:
323+
if (not PYDANTIC_V1) and getattr(self, "__pydantic_private__", None) is None:
324324
self.__pydantic_private__ = {}
325325

326326
self._model = model

src/supermemory/_client.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
)
2222
from ._utils import is_given, get_async_library
2323
from ._version import __version__
24-
from .resources import search, memories, settings, connections
24+
from .resources import search, settings, connections
2525
from ._streaming import Stream as Stream, AsyncStream as AsyncStream
2626
from ._exceptions import APIStatusError, SupermemoryError
2727
from ._base_client import (
@@ -43,7 +43,6 @@
4343

4444

4545
class Supermemory(SyncAPIClient):
46-
memories: memories.MemoriesResource
4746
search: search.SearchResource
4847
settings: settings.SettingsResource
4948
connections: connections.ConnectionsResource
@@ -104,7 +103,6 @@ def __init__(
104103
_strict_response_validation=_strict_response_validation,
105104
)
106105

107-
self.memories = memories.MemoriesResource(self)
108106
self.search = search.SearchResource(self)
109107
self.settings = settings.SettingsResource(self)
110108
self.connections = connections.ConnectionsResource(self)
@@ -217,7 +215,6 @@ def _make_status_error(
217215

218216

219217
class AsyncSupermemory(AsyncAPIClient):
220-
memories: memories.AsyncMemoriesResource
221218
search: search.AsyncSearchResource
222219
settings: settings.AsyncSettingsResource
223220
connections: connections.AsyncConnectionsResource
@@ -278,7 +275,6 @@ def __init__(
278275
_strict_response_validation=_strict_response_validation,
279276
)
280277

281-
self.memories = memories.AsyncMemoriesResource(self)
282278
self.search = search.AsyncSearchResource(self)
283279
self.settings = settings.AsyncSettingsResource(self)
284280
self.connections = connections.AsyncConnectionsResource(self)
@@ -392,31 +388,27 @@ def _make_status_error(
392388

393389
class SupermemoryWithRawResponse:
394390
def __init__(self, client: Supermemory) -> None:
395-
self.memories = memories.MemoriesResourceWithRawResponse(client.memories)
396391
self.search = search.SearchResourceWithRawResponse(client.search)
397392
self.settings = settings.SettingsResourceWithRawResponse(client.settings)
398393
self.connections = connections.ConnectionsResourceWithRawResponse(client.connections)
399394

400395

401396
class AsyncSupermemoryWithRawResponse:
402397
def __init__(self, client: AsyncSupermemory) -> None:
403-
self.memories = memories.AsyncMemoriesResourceWithRawResponse(client.memories)
404398
self.search = search.AsyncSearchResourceWithRawResponse(client.search)
405399
self.settings = settings.AsyncSettingsResourceWithRawResponse(client.settings)
406400
self.connections = connections.AsyncConnectionsResourceWithRawResponse(client.connections)
407401

408402

409403
class SupermemoryWithStreamedResponse:
410404
def __init__(self, client: Supermemory) -> None:
411-
self.memories = memories.MemoriesResourceWithStreamingResponse(client.memories)
412405
self.search = search.SearchResourceWithStreamingResponse(client.search)
413406
self.settings = settings.SettingsResourceWithStreamingResponse(client.settings)
414407
self.connections = connections.ConnectionsResourceWithStreamingResponse(client.connections)
415408

416409

417410
class AsyncSupermemoryWithStreamedResponse:
418411
def __init__(self, client: AsyncSupermemory) -> None:
419-
self.memories = memories.AsyncMemoriesResourceWithStreamingResponse(client.memories)
420412
self.search = search.AsyncSearchResourceWithStreamingResponse(client.search)
421413
self.settings = settings.AsyncSettingsResourceWithStreamingResponse(client.settings)
422414
self.connections = connections.AsyncConnectionsResourceWithStreamingResponse(client.connections)

0 commit comments

Comments
 (0)