Skip to content

Commit fc586f7

Browse files
feat(api): api update
1 parent d376719 commit fc586f7

File tree

11 files changed

+12
-162
lines changed

11 files changed

+12
-162
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 8
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-121e18b2f7d9c4c8e3d6264ba5533cf0e10d566487a69cad5729842652ef509c.yml
3-
openapi_spec_hash: 0836cd0867d256250f8a040e4c6f81dc
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-4c45e387cbdc7c80d75cdb8eb924cf92a3a48a0c10060fda917b83a7e454aef5.yml
3+
openapi_spec_hash: c859ac2e3429ad3663337b99c722f317
44
config_hash: 8477e3ee6fd596ab6ac911d052e4de79

README.md

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -68,40 +68,6 @@ asyncio.run(main())
6868

6969
Functionality between the synchronous and asynchronous clients is otherwise identical.
7070

71-
### With aiohttp
72-
73-
By default, the async client uses `httpx` for HTTP requests. However, for improved concurrency performance you may also use `aiohttp` as the HTTP backend.
74-
75-
You can enable this by installing `aiohttp`:
76-
77-
```sh
78-
# install from PyPI
79-
pip install --pre supermemory[aiohttp]
80-
```
81-
82-
Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:
83-
84-
```python
85-
import os
86-
import asyncio
87-
from supermemory import DefaultAioHttpClient
88-
from supermemory import AsyncSupermemory
89-
90-
91-
async def main() -> None:
92-
async with AsyncSupermemory(
93-
api_key=os.environ.get("SUPERMEMORY_API_KEY"), # This is the default and can be omitted
94-
http_client=DefaultAioHttpClient(),
95-
) as client:
96-
response = await client.memories.add(
97-
content="This is a detailed article about machine learning concepts...",
98-
)
99-
print(response.id)
100-
101-
102-
asyncio.run(main())
103-
```
104-
10571
## Using types
10672

10773
Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev) which also provide helper methods for things like:

pyproject.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ classifiers = [
3737
Homepage = "https://github.com/supermemoryai/python-sdk"
3838
Repository = "https://github.com/supermemoryai/python-sdk"
3939

40-
[project.optional-dependencies]
41-
aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.6"]
4240

4341
[tool.rye]
4442
managed = true

requirements-dev.lock

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,13 @@
1010
# universal: false
1111

1212
-e file:.
13-
aiohappyeyeballs==2.6.1
14-
# via aiohttp
15-
aiohttp==3.12.8
16-
# via httpx-aiohttp
17-
# via supermemory
18-
aiosignal==1.3.2
19-
# via aiohttp
2013
annotated-types==0.6.0
2114
# via pydantic
2215
anyio==4.4.0
2316
# via httpx
2417
# via supermemory
2518
argcomplete==3.1.2
2619
# via nox
27-
async-timeout==5.0.1
28-
# via aiohttp
29-
attrs==25.3.0
30-
# via aiohttp
3120
certifi==2023.7.22
3221
# via httpcore
3322
# via httpx
@@ -45,33 +34,23 @@ execnet==2.1.1
4534
# via pytest-xdist
4635
filelock==3.12.4
4736
# via virtualenv
48-
frozenlist==1.6.2
49-
# via aiohttp
50-
# via aiosignal
5137
h11==0.14.0
5238
# via httpcore
5339
httpcore==1.0.2
5440
# via httpx
5541
httpx==0.28.1
56-
# via httpx-aiohttp
5742
# via respx
5843
# via supermemory
59-
httpx-aiohttp==0.1.6
60-
# via supermemory
6144
idna==3.4
6245
# via anyio
6346
# via httpx
64-
# via yarl
6547
importlib-metadata==7.0.0
6648
iniconfig==2.0.0
6749
# via pytest
6850
markdown-it-py==3.0.0
6951
# via rich
7052
mdurl==0.1.2
7153
# via markdown-it-py
72-
multidict==6.4.4
73-
# via aiohttp
74-
# via yarl
7554
mypy==1.14.1
7655
mypy-extensions==1.0.0
7756
# via mypy
@@ -86,9 +65,6 @@ platformdirs==3.11.0
8665
# via virtualenv
8766
pluggy==1.5.0
8867
# via pytest
89-
propcache==0.3.1
90-
# via aiohttp
91-
# via yarl
9268
pydantic==2.10.3
9369
# via supermemory
9470
pydantic-core==2.27.1
@@ -121,15 +97,12 @@ tomli==2.0.2
12197
# via pytest
12298
typing-extensions==4.12.2
12399
# via anyio
124-
# via multidict
125100
# via mypy
126101
# via pydantic
127102
# via pydantic-core
128103
# via pyright
129104
# via supermemory
130105
virtualenv==20.24.5
131106
# via nox
132-
yarl==1.20.0
133-
# via aiohttp
134107
zipp==3.17.0
135108
# via importlib-metadata

requirements.lock

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -10,51 +10,27 @@
1010
# universal: false
1111

1212
-e file:.
13-
aiohappyeyeballs==2.6.1
14-
# via aiohttp
15-
aiohttp==3.12.8
16-
# via httpx-aiohttp
17-
# via supermemory
18-
aiosignal==1.3.2
19-
# via aiohttp
2013
annotated-types==0.6.0
2114
# via pydantic
2215
anyio==4.4.0
2316
# via httpx
2417
# via supermemory
25-
async-timeout==5.0.1
26-
# via aiohttp
27-
attrs==25.3.0
28-
# via aiohttp
2918
certifi==2023.7.22
3019
# via httpcore
3120
# via httpx
3221
distro==1.8.0
3322
# via supermemory
3423
exceptiongroup==1.2.2
3524
# via anyio
36-
frozenlist==1.6.2
37-
# via aiohttp
38-
# via aiosignal
3925
h11==0.14.0
4026
# via httpcore
4127
httpcore==1.0.2
4228
# via httpx
4329
httpx==0.28.1
44-
# via httpx-aiohttp
45-
# via supermemory
46-
httpx-aiohttp==0.1.6
4730
# via supermemory
4831
idna==3.4
4932
# via anyio
5033
# via httpx
51-
# via yarl
52-
multidict==6.4.4
53-
# via aiohttp
54-
# via yarl
55-
propcache==0.3.1
56-
# via aiohttp
57-
# via yarl
5834
pydantic==2.10.3
5935
# via supermemory
6036
pydantic-core==2.27.1
@@ -64,9 +40,6 @@ sniffio==1.3.0
6440
# via supermemory
6541
typing-extensions==4.12.2
6642
# via anyio
67-
# via multidict
6843
# via pydantic
6944
# via pydantic-core
7045
# via supermemory
71-
yarl==1.20.0
72-
# via aiohttp

src/supermemory/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
UnprocessableEntityError,
3737
APIResponseValidationError,
3838
)
39-
from ._base_client import DefaultHttpxClient, DefaultAioHttpClient, DefaultAsyncHttpxClient
39+
from ._base_client import DefaultHttpxClient, DefaultAsyncHttpxClient
4040
from ._utils._logs import setup_logging as _setup_logging
4141

4242
__all__ = [
@@ -78,7 +78,6 @@
7878
"DEFAULT_CONNECTION_LIMITS",
7979
"DefaultHttpxClient",
8080
"DefaultAsyncHttpxClient",
81-
"DefaultAioHttpClient",
8281
]
8382

8483
if not _t.TYPE_CHECKING:

src/supermemory/_base_client.py

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1289,24 +1289,6 @@ def __init__(self, **kwargs: Any) -> None:
12891289
super().__init__(**kwargs)
12901290

12911291

1292-
try:
1293-
import httpx_aiohttp
1294-
except ImportError:
1295-
1296-
class _DefaultAioHttpClient(httpx.AsyncClient):
1297-
def __init__(self, **_kwargs: Any) -> None:
1298-
raise RuntimeError("To use the aiohttp client you must have installed the package with the `aiohttp` extra")
1299-
else:
1300-
1301-
class _DefaultAioHttpClient(httpx_aiohttp.HttpxAiohttpClient): # type: ignore
1302-
def __init__(self, **kwargs: Any) -> None:
1303-
kwargs.setdefault("timeout", DEFAULT_TIMEOUT)
1304-
kwargs.setdefault("limits", DEFAULT_CONNECTION_LIMITS)
1305-
kwargs.setdefault("follow_redirects", True)
1306-
1307-
super().__init__(**kwargs)
1308-
1309-
13101292
if TYPE_CHECKING:
13111293
DefaultAsyncHttpxClient = httpx.AsyncClient
13121294
"""An alias to `httpx.AsyncClient` that provides the same defaults that this SDK
@@ -1315,12 +1297,8 @@ def __init__(self, **kwargs: Any) -> None:
13151297
This is useful because overriding the `http_client` with your own instance of
13161298
`httpx.AsyncClient` will result in httpx's defaults being used, not ours.
13171299
"""
1318-
1319-
DefaultAioHttpClient = httpx.AsyncClient
1320-
"""An alias to `httpx.AsyncClient` that changes the default HTTP transport to `aiohttp`."""
13211300
else:
13221301
DefaultAsyncHttpxClient = _DefaultAsyncHttpxClient
1323-
DefaultAioHttpClient = _DefaultAioHttpClient
13241302

13251303

13261304
class AsyncHttpxClientWrapper(DefaultAsyncHttpxClient):

tests/api_resources/test_connections.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,7 @@ def test_path_params_get(self, client: Supermemory) -> None:
107107

108108

109109
class TestAsyncConnections:
110-
parametrize = pytest.mark.parametrize(
111-
"async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"]
112-
)
110+
parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
113111

114112
@pytest.mark.skip()
115113
@parametrize

tests/api_resources/test_memories.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,7 @@ def test_path_params_get(self, client: Supermemory) -> None:
224224

225225

226226
class TestAsyncMemories:
227-
parametrize = pytest.mark.parametrize(
228-
"async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"]
229-
)
227+
parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
230228

231229
@pytest.mark.skip()
232230
@parametrize

tests/api_resources/test_settings.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,7 @@ def test_streaming_response_get(self, client: Supermemory) -> None:
9696

9797

9898
class TestAsyncSettings:
99-
parametrize = pytest.mark.parametrize(
100-
"async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"]
101-
)
99+
parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
102100

103101
@pytest.mark.skip()
104102
@parametrize

0 commit comments

Comments
 (0)