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 .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "3.0.0-alpha.21"
".": "3.0.0-alpha.22"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 16
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-1a2a84a9cc99c25a9d726bc9300a72871f9469e3ceacebd5e71fd37e87891318.yml
openapi_spec_hash: e71e86a645bc47a86664080c8697b8db
config_hash: b560219f71fa815fec30fe25ca5a71f5
config_hash: be10c837d5319a33f30809a3ec223caf
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 3.0.0-alpha.22 (2025-07-03)

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

### Features

* **api:** manual updates ([2a863a1](https://github.com/supermemoryai/python-sdk/commit/2a863a166b5c39208ef910d84530a27898ed0c71))

## 3.0.0-alpha.21 (2025-07-03)

Full Changelog: [v3.0.0-alpha.20...v3.0.0-alpha.21](https://github.com/supermemoryai/python-sdk/compare/v3.0.0-alpha.20...v3.0.0-alpha.21)
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ $ pip install -r requirements-dev.lock

Most of the SDK is generated code. Modifications to code will be persisted between generations, but may
result in merge conflicts between manual patches and changes from the generator. The generator will never
modify the contents of the `src/supermemory_new/lib/` and `examples/` directories.
modify the contents of the `src/supermemory/lib/` and `examples/` directories.

## Adding and running examples

Expand Down
42 changes: 21 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ The full API of this library can be found in [api.md](api.md).

```python
import os
from supermemory_new import Supermemory
from supermemory import Supermemory

client = Supermemory(
api_key=os.environ.get("SUPERMEMORY_API_KEY"), # This is the default and can be omitted
Expand All @@ -49,7 +49,7 @@ Simply import `AsyncSupermemory` instead of `Supermemory` and use `await` with e
```python
import os
import asyncio
from supermemory_new import AsyncSupermemory
from supermemory import AsyncSupermemory

client = AsyncSupermemory(
api_key=os.environ.get("SUPERMEMORY_API_KEY"), # This is the default and can be omitted
Expand Down Expand Up @@ -84,8 +84,8 @@ Then you can enable it by instantiating the client with `http_client=DefaultAioH
```python
import os
import asyncio
from supermemory_new import DefaultAioHttpClient
from supermemory_new import AsyncSupermemory
from supermemory import DefaultAioHttpClient
from supermemory import AsyncSupermemory


async def main() -> None:
Expand Down Expand Up @@ -113,29 +113,29 @@ Typed requests and responses provide autocomplete and documentation within your

## Handling errors

When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `supermemory_new.APIConnectionError` is raised.
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.

When the API returns a non-success status code (that is, 4xx or 5xx
response), a subclass of `supermemory_new.APIStatusError` is raised, containing `status_code` and `response` properties.
response), a subclass of `supermemory.APIStatusError` is raised, containing `status_code` and `response` properties.

All errors inherit from `supermemory_new.APIError`.
All errors inherit from `supermemory.APIError`.

```python
import supermemory_new
from supermemory_new import Supermemory
import supermemory
from supermemory import Supermemory

client = Supermemory()

try:
client.memories.add(
content="This is a detailed article about machine learning concepts...",
)
except supermemory_new.APIConnectionError as e:
except supermemory.APIConnectionError as e:
print("The server could not be reached")
print(e.__cause__) # an underlying Exception, likely raised within httpx.
except supermemory_new.RateLimitError as e:
except supermemory.RateLimitError as e:
print("A 429 status code was received; we should back off a bit.")
except supermemory_new.APIStatusError as e:
except supermemory.APIStatusError as e:
print("Another non-200-range status code was received")
print(e.status_code)
print(e.response)
Expand Down Expand Up @@ -163,7 +163,7 @@ Connection errors (for example, due to a network connectivity problem), 408 Requ
You can use the `max_retries` option to configure or disable retry settings:

```python
from supermemory_new import Supermemory
from supermemory import Supermemory

# Configure the default for all requests:
client = Supermemory(
Expand All @@ -183,7 +183,7 @@ By default requests time out after 1 minute. You can configure this with a `time
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object:

```python
from supermemory_new import Supermemory
from supermemory import Supermemory

# Configure the default for all requests:
client = Supermemory(
Expand Down Expand Up @@ -237,7 +237,7 @@ if response.my_field is None:
The "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,

```py
from supermemory_new import Supermemory
from supermemory import Supermemory

client = Supermemory()
response = client.memories.with_raw_response.add(
Expand All @@ -249,9 +249,9 @@ memory = response.parse() # get the object that `memories.add()` would have ret
print(memory.id)
```

These methods return an [`APIResponse`](https://github.com/supermemoryai/python-sdk/tree/main/src/supermemory_new/_response.py) object.
These methods return an [`APIResponse`](https://github.com/supermemoryai/python-sdk/tree/main/src/supermemory/_response.py) object.

The async client returns an [`AsyncAPIResponse`](https://github.com/supermemoryai/python-sdk/tree/main/src/supermemory_new/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.
The async client returns an [`AsyncAPIResponse`](https://github.com/supermemoryai/python-sdk/tree/main/src/supermemory/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.

#### `.with_streaming_response`

Expand Down Expand Up @@ -315,7 +315,7 @@ You can directly override the [httpx client](https://www.python-httpx.org/api/#c

```python
import httpx
from supermemory_new import Supermemory, DefaultHttpxClient
from supermemory import Supermemory, DefaultHttpxClient

client = Supermemory(
# Or use the `SUPERMEMORY_BASE_URL` env var
Expand All @@ -338,7 +338,7 @@ client.with_options(http_client=DefaultHttpxClient(...))
By default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.

```py
from supermemory_new import Supermemory
from supermemory import Supermemory

with Supermemory() as client:
# make requests here
Expand Down Expand Up @@ -366,8 +366,8 @@ If you've upgraded to the latest version but aren't seeing any new features you
You can determine the version that is being used at runtime with:

```py
import supermemory_new
print(supermemory_new.__version__)
import supermemory
print(supermemory.__version__)
```

## Requirements
Expand Down
40 changes: 20 additions & 20 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Types:

```python
from supermemory_new.types import (
from supermemory.types import (
MemoryUpdateResponse,
MemoryListResponse,
MemoryAddResponse,
Expand All @@ -13,43 +13,43 @@ from supermemory_new.types import (

Methods:

- <code title="patch /v3/memories/{id}">client.memories.<a href="./src/supermemory_new/resources/memories.py">update</a>(id, \*\*<a href="src/supermemory_new/types/memory_update_params.py">params</a>) -> <a href="./src/supermemory_new/types/memory_update_response.py">MemoryUpdateResponse</a></code>
- <code title="post /v3/memories/list">client.memories.<a href="./src/supermemory_new/resources/memories.py">list</a>(\*\*<a href="src/supermemory_new/types/memory_list_params.py">params</a>) -> <a href="./src/supermemory_new/types/memory_list_response.py">MemoryListResponse</a></code>
- <code title="delete /v3/memories/{id}">client.memories.<a href="./src/supermemory_new/resources/memories.py">delete</a>(id) -> None</code>
- <code title="post /v3/memories">client.memories.<a href="./src/supermemory_new/resources/memories.py">add</a>(\*\*<a href="src/supermemory_new/types/memory_add_params.py">params</a>) -> <a href="./src/supermemory_new/types/memory_add_response.py">MemoryAddResponse</a></code>
- <code title="get /v3/memories/{id}">client.memories.<a href="./src/supermemory_new/resources/memories.py">get</a>(id) -> <a href="./src/supermemory_new/types/memory_get_response.py">MemoryGetResponse</a></code>
- <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>
- <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>
- <code title="delete /v3/memories/{id}">client.memories.<a href="./src/supermemory/resources/memories.py">delete</a>(id) -> None</code>
- <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>
- <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>

# Search

Types:

```python
from supermemory_new.types import SearchExecuteResponse
from supermemory.types import SearchExecuteResponse
```

Methods:

- <code title="post /v3/search">client.search.<a href="./src/supermemory_new/resources/search.py">execute</a>(\*\*<a href="src/supermemory_new/types/search_execute_params.py">params</a>) -> <a href="./src/supermemory_new/types/search_execute_response.py">SearchExecuteResponse</a></code>
- <code title="post /v3/search">client.search.<a href="./src/supermemory/resources/search.py">execute</a>(\*\*<a href="src/supermemory/types/search_execute_params.py">params</a>) -> <a href="./src/supermemory/types/search_execute_response.py">SearchExecuteResponse</a></code>

# Settings

Types:

```python
from supermemory_new.types import SettingUpdateResponse, SettingGetResponse
from supermemory.types import SettingUpdateResponse, SettingGetResponse
```

Methods:

- <code title="patch /v3/settings">client.settings.<a href="./src/supermemory_new/resources/settings.py">update</a>(\*\*<a href="src/supermemory_new/types/setting_update_params.py">params</a>) -> <a href="./src/supermemory_new/types/setting_update_response.py">SettingUpdateResponse</a></code>
- <code title="get /v3/settings">client.settings.<a href="./src/supermemory_new/resources/settings.py">get</a>() -> <a href="./src/supermemory_new/types/setting_get_response.py">SettingGetResponse</a></code>
- <code title="patch /v3/settings">client.settings.<a href="./src/supermemory/resources/settings.py">update</a>(\*\*<a href="src/supermemory/types/setting_update_params.py">params</a>) -> <a href="./src/supermemory/types/setting_update_response.py">SettingUpdateResponse</a></code>
- <code title="get /v3/settings">client.settings.<a href="./src/supermemory/resources/settings.py">get</a>() -> <a href="./src/supermemory/types/setting_get_response.py">SettingGetResponse</a></code>

# Connections

Types:

```python
from supermemory_new.types import (
from supermemory.types import (
ConnectionCreateResponse,
ConnectionListResponse,
ConnectionDeleteByIDResponse,
Expand All @@ -62,11 +62,11 @@ from supermemory_new.types import (

Methods:

- <code title="post /v3/connections/{provider}">client.connections.<a href="./src/supermemory_new/resources/connections.py">create</a>(provider, \*\*<a href="src/supermemory_new/types/connection_create_params.py">params</a>) -> <a href="./src/supermemory_new/types/connection_create_response.py">ConnectionCreateResponse</a></code>
- <code title="post /v3/connections/list">client.connections.<a href="./src/supermemory_new/resources/connections.py">list</a>(\*\*<a href="src/supermemory_new/types/connection_list_params.py">params</a>) -> <a href="./src/supermemory_new/types/connection_list_response.py">ConnectionListResponse</a></code>
- <code title="delete /v3/connections/{connectionId}">client.connections.<a href="./src/supermemory_new/resources/connections.py">delete_by_id</a>(connection_id) -> <a href="./src/supermemory_new/types/connection_delete_by_id_response.py">ConnectionDeleteByIDResponse</a></code>
- <code title="delete /v3/connections/{provider}">client.connections.<a href="./src/supermemory_new/resources/connections.py">delete_by_provider</a>(provider, \*\*<a href="src/supermemory_new/types/connection_delete_by_provider_params.py">params</a>) -> <a href="./src/supermemory_new/types/connection_delete_by_provider_response.py">ConnectionDeleteByProviderResponse</a></code>
- <code title="get /v3/connections/{connectionId}">client.connections.<a href="./src/supermemory_new/resources/connections.py">get_by_id</a>(connection_id) -> <a href="./src/supermemory_new/types/connection_get_by_id_response.py">ConnectionGetByIDResponse</a></code>
- <code title="post /v3/connections/{provider}/connection">client.connections.<a href="./src/supermemory_new/resources/connections.py">get_by_tags</a>(provider, \*\*<a href="src/supermemory_new/types/connection_get_by_tags_params.py">params</a>) -> <a href="./src/supermemory_new/types/connection_get_by_tags_response.py">ConnectionGetByTagsResponse</a></code>
- <code title="post /v3/connections/{provider}/import">client.connections.<a href="./src/supermemory_new/resources/connections.py">import\_</a>(provider, \*\*<a href="src/supermemory_new/types/connection_import_params.py">params</a>) -> None</code>
- <code title="post /v3/connections/{provider}/documents">client.connections.<a href="./src/supermemory_new/resources/connections.py">list_documents</a>(provider, \*\*<a href="src/supermemory_new/types/connection_list_documents_params.py">params</a>) -> <a href="./src/supermemory_new/types/connection_list_documents_response.py">ConnectionListDocumentsResponse</a></code>
- <code title="post /v3/connections/{provider}">client.connections.<a href="./src/supermemory/resources/connections.py">create</a>(provider, \*\*<a href="src/supermemory/types/connection_create_params.py">params</a>) -> <a href="./src/supermemory/types/connection_create_response.py">ConnectionCreateResponse</a></code>
- <code title="post /v3/connections/list">client.connections.<a href="./src/supermemory/resources/connections.py">list</a>(\*\*<a href="src/supermemory/types/connection_list_params.py">params</a>) -> <a href="./src/supermemory/types/connection_list_response.py">ConnectionListResponse</a></code>
- <code title="delete /v3/connections/{connectionId}">client.connections.<a href="./src/supermemory/resources/connections.py">delete_by_id</a>(connection_id) -> <a href="./src/supermemory/types/connection_delete_by_id_response.py">ConnectionDeleteByIDResponse</a></code>
- <code title="delete /v3/connections/{provider}">client.connections.<a href="./src/supermemory/resources/connections.py">delete_by_provider</a>(provider, \*\*<a href="src/supermemory/types/connection_delete_by_provider_params.py">params</a>) -> <a href="./src/supermemory/types/connection_delete_by_provider_response.py">ConnectionDeleteByProviderResponse</a></code>
- <code title="get /v3/connections/{connectionId}">client.connections.<a href="./src/supermemory/resources/connections.py">get_by_id</a>(connection_id) -> <a href="./src/supermemory/types/connection_get_by_id_response.py">ConnectionGetByIDResponse</a></code>
- <code title="post /v3/connections/{provider}/connection">client.connections.<a href="./src/supermemory/resources/connections.py">get_by_tags</a>(provider, \*\*<a href="src/supermemory/types/connection_get_by_tags_params.py">params</a>) -> <a href="./src/supermemory/types/connection_get_by_tags_response.py">ConnectionGetByTagsResponse</a></code>
- <code title="post /v3/connections/{provider}/import">client.connections.<a href="./src/supermemory/resources/connections.py">import\_</a>(provider, \*\*<a href="src/supermemory/types/connection_import_params.py">params</a>) -> None</code>
- <code title="post /v3/connections/{provider}/documents">client.connections.<a href="./src/supermemory/resources/connections.py">list_documents</a>(provider, \*\*<a href="src/supermemory/types/connection_list_documents_params.py">params</a>) -> <a href="./src/supermemory/types/connection_list_documents_response.py">ConnectionListDocumentsResponse</a></code>
2 changes: 1 addition & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ show_error_codes = True
#
# We also exclude our `tests` as mypy doesn't always infer
# types correctly and Pyright will still catch any type errors.
exclude = ^(src/supermemory_new/_files\.py|_dev/.*\.py|tests/.*)$
exclude = ^(src/supermemory/_files\.py|_dev/.*\.py|tests/.*)$

strict_equality = True
implicit_reexport = True
Expand Down
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "supermemory"
version = "3.0.0-alpha.21"
version = "3.0.0-alpha.22"
description = "The official Python library for the supermemory API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down Expand Up @@ -78,14 +78,14 @@ format = { chain = [
"check:ruff" = "ruff check ."
"fix:ruff" = "ruff check --fix ."

"check:importable" = "python -c 'import supermemory_new'"
"check:importable" = "python -c 'import supermemory'"

typecheck = { chain = [
"typecheck:pyright",
"typecheck:mypy"
]}
"typecheck:pyright" = "pyright"
"typecheck:verify-types" = "pyright --verifytypes supermemory_new --ignoreexternal"
"typecheck:verify-types" = "pyright --verifytypes supermemory --ignoreexternal"
"typecheck:mypy" = "mypy ."

[build-system]
Expand All @@ -98,7 +98,7 @@ include = [
]

[tool.hatch.build.targets.wheel]
packages = ["src/supermemory_new"]
packages = ["src/supermemory"]

[tool.hatch.build.targets.sdist]
# Basically everything except hidden files/directories (such as .github, .devcontainers, .python-version, etc)
Expand Down Expand Up @@ -201,7 +201,7 @@ length-sort = true
length-sort-straight = true
combine-as-imports = true
extra-standard-library = ["typing_extensions"]
known-first-party = ["supermemory_new", "tests"]
known-first-party = ["supermemory", "tests"]

[tool.ruff.lint.per-file-ignores]
"bin/**.py" = ["T201", "T203"]
Expand Down
2 changes: 1 addition & 1 deletion release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@
],
"release-type": "python",
"extra-files": [
"src/supermemory_new/_version.py"
"src/supermemory/_version.py"
]
}
2 changes: 1 addition & 1 deletion scripts/lint
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ echo "==> Running lints"
rye run lint

echo "==> Making sure it imports"
rye run python -c 'import supermemory_new'
rye run python -c 'import supermemory'
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@
# Update the __module__ attribute for exported symbols so that
# error messages point to this module instead of the module
# it was originally defined in, e.g.
# supermemory_new._exceptions.NotFoundError -> supermemory_new.NotFoundError
# supermemory._exceptions.NotFoundError -> supermemory.NotFoundError
__locals = locals()
for __name in __all__:
if not __name.startswith("__"):
try:
__locals[__name].__module__ = "supermemory_new"
__locals[__name].__module__ = "supermemory"
except (TypeError, AttributeError):
# Some of our exported symbols are builtins which we can't set attributes for.
pass
Loading