Skip to content

Commit 200e97a

Browse files
feat(api): api update
1 parent 1e9b706 commit 200e97a

19 files changed

+171
-854
lines changed

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 10
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-a3f5eda63cbdc4bfdd49d8df67977c090c9ec56dac7160aa54a229593ef2d33f.yml
3-
openapi_spec_hash: 5abb9b20ab9c8c379956ed52a608467b
1+
configured_endpoints: 8
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-ce8810a8f8d5fa2d49c37e64b5bc3847eb102d7cc9154455ee598be5d118614d.yml
3+
openapi_spec_hash: 36e6e52e5cf59f5df66f96afae0afef7
44
config_hash: 8477e3ee6fd596ab6ac911d052e4de79

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ client = Supermemory(
3131
api_key=os.environ.get("SUPERMEMORY_API_KEY"), # This is the default and can be omitted
3232
)
3333

34-
response = client.search.execute(
35-
q="documents related to python",
34+
response = client.memories.add(
35+
content="This is a detailed article about machine learning concepts...",
3636
)
37-
print(response.results)
37+
print(response.id)
3838
```
3939

4040
While you can provide an `api_key` keyword argument,
@@ -57,10 +57,10 @@ client = AsyncSupermemory(
5757

5858

5959
async def main() -> None:
60-
response = await client.search.execute(
61-
q="documents related to python",
60+
response = await client.memories.add(
61+
content="This is a detailed article about machine learning concepts...",
6262
)
63-
print(response.results)
63+
print(response.id)
6464

6565

6666
asyncio.run(main())

api.md

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,16 @@
33
Types:
44

55
```python
6-
from supermemory.types import (
7-
MemoryUpdateResponse,
8-
MemoryListResponse,
9-
MemoryAddResponse,
10-
MemoryGetResponse,
11-
)
6+
from supermemory.types import MemoryUpdateResponse, MemoryAddResponse, MemoryGetResponse
127
```
138

149
Methods:
1510

1611
- <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>
17-
- <code title="get /v3/memories">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>
1812
- <code title="delete /v3/memories/{id}">client.memories.<a href="./src/supermemory/resources/memories.py">delete</a>(id) -> None</code>
1913
- <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>
2014
- <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>
2115

22-
# Search
23-
24-
Types:
25-
26-
```python
27-
from supermemory.types import SearchExecuteResponse
28-
```
29-
30-
Methods:
31-
32-
- <code title="get /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>
33-
3416
# Settings
3517

3618
Types:

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 memories, settings, connections
2525
from ._streaming import Stream as Stream, AsyncStream as AsyncStream
2626
from ._exceptions import APIStatusError, SupermemoryError
2727
from ._base_client import (
@@ -44,7 +44,6 @@
4444

4545
class Supermemory(SyncAPIClient):
4646
memories: memories.MemoriesResource
47-
search: search.SearchResource
4847
settings: settings.SettingsResource
4948
connections: connections.ConnectionsResource
5049
with_raw_response: SupermemoryWithRawResponse
@@ -105,7 +104,6 @@ def __init__(
105104
)
106105

107106
self.memories = memories.MemoriesResource(self)
108-
self.search = search.SearchResource(self)
109107
self.settings = settings.SettingsResource(self)
110108
self.connections = connections.ConnectionsResource(self)
111109
self.with_raw_response = SupermemoryWithRawResponse(self)
@@ -218,7 +216,6 @@ def _make_status_error(
218216

219217
class AsyncSupermemory(AsyncAPIClient):
220218
memories: memories.AsyncMemoriesResource
221-
search: search.AsyncSearchResource
222219
settings: settings.AsyncSettingsResource
223220
connections: connections.AsyncConnectionsResource
224221
with_raw_response: AsyncSupermemoryWithRawResponse
@@ -279,7 +276,6 @@ def __init__(
279276
)
280277

281278
self.memories = memories.AsyncMemoriesResource(self)
282-
self.search = search.AsyncSearchResource(self)
283279
self.settings = settings.AsyncSettingsResource(self)
284280
self.connections = connections.AsyncConnectionsResource(self)
285281
self.with_raw_response = AsyncSupermemoryWithRawResponse(self)
@@ -393,31 +389,27 @@ def _make_status_error(
393389
class SupermemoryWithRawResponse:
394390
def __init__(self, client: Supermemory) -> None:
395391
self.memories = memories.MemoriesResourceWithRawResponse(client.memories)
396-
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:
403398
self.memories = memories.AsyncMemoriesResourceWithRawResponse(client.memories)
404-
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:
411405
self.memories = memories.MemoriesResourceWithStreamingResponse(client.memories)
412-
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:
419412
self.memories = memories.AsyncMemoriesResourceWithStreamingResponse(client.memories)
420-
self.search = search.AsyncSearchResourceWithStreamingResponse(client.search)
421413
self.settings = settings.AsyncSettingsResourceWithStreamingResponse(client.settings)
422414
self.connections = connections.AsyncConnectionsResourceWithStreamingResponse(client.connections)
423415

src/supermemory/resources/__init__.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from .search import (
4-
SearchResource,
5-
AsyncSearchResource,
6-
SearchResourceWithRawResponse,
7-
AsyncSearchResourceWithRawResponse,
8-
SearchResourceWithStreamingResponse,
9-
AsyncSearchResourceWithStreamingResponse,
10-
)
113
from .memories import (
124
MemoriesResource,
135
AsyncMemoriesResource,
@@ -40,12 +32,6 @@
4032
"AsyncMemoriesResourceWithRawResponse",
4133
"MemoriesResourceWithStreamingResponse",
4234
"AsyncMemoriesResourceWithStreamingResponse",
43-
"SearchResource",
44-
"AsyncSearchResource",
45-
"SearchResourceWithRawResponse",
46-
"AsyncSearchResourceWithRawResponse",
47-
"SearchResourceWithStreamingResponse",
48-
"AsyncSearchResourceWithStreamingResponse",
4935
"SettingsResource",
5036
"AsyncSettingsResource",
5137
"SettingsResourceWithRawResponse",

src/supermemory/resources/memories.py

Lines changed: 1 addition & 152 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@
22

33
from __future__ import annotations
44

5-
import typing_extensions
65
from typing import Dict, List, Union
7-
from typing_extensions import Literal
86

97
import httpx
108

11-
from ..types import memory_add_params, memory_list_params, memory_update_params
9+
from ..types import memory_add_params, memory_update_params
1210
from .._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven
1311
from .._utils import maybe_transform, async_maybe_transform
1412
from .._compat import cached_property
@@ -22,7 +20,6 @@
2220
from .._base_client import make_request_options
2321
from ..types.memory_add_response import MemoryAddResponse
2422
from ..types.memory_get_response import MemoryGetResponse
25-
from ..types.memory_list_response import MemoryListResponse
2623
from ..types.memory_update_response import MemoryUpdateResponse
2724

2825
__all__ = ["MemoriesResource", "AsyncMemoriesResource"]
@@ -115,70 +112,6 @@ def update(
115112
cast_to=MemoryUpdateResponse,
116113
)
117114

118-
@typing_extensions.deprecated("deprecated")
119-
def list(
120-
self,
121-
*,
122-
container_tags: List[str] | NotGiven = NOT_GIVEN,
123-
filters: str | NotGiven = NOT_GIVEN,
124-
limit: Union[str, float] | NotGiven = NOT_GIVEN,
125-
order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
126-
page: Union[str, float] | NotGiven = NOT_GIVEN,
127-
sort: Literal["createdAt", "updatedAt"] | NotGiven = NOT_GIVEN,
128-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
129-
# The extra values given here take precedence over values defined on the client or passed to this method.
130-
extra_headers: Headers | None = None,
131-
extra_query: Query | None = None,
132-
extra_body: Body | None = None,
133-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
134-
) -> MemoryListResponse:
135-
"""
136-
Retrieves a paginated list of memories with their metadata and workflow status
137-
138-
Args:
139-
container_tags: Optional tags this memory should be containerized by. This can be an ID for your
140-
user, a project ID, or any other identifier you wish to use to group memories.
141-
142-
filters: Optional filters to apply to the search
143-
144-
limit: Number of items per page
145-
146-
order: Sort order
147-
148-
page: Page number to fetch
149-
150-
sort: Field to sort by
151-
152-
extra_headers: Send extra headers
153-
154-
extra_query: Add additional query parameters to the request
155-
156-
extra_body: Add additional JSON properties to the request
157-
158-
timeout: Override the client-level default timeout for this request, in seconds
159-
"""
160-
return self._get(
161-
"/v3/memories",
162-
options=make_request_options(
163-
extra_headers=extra_headers,
164-
extra_query=extra_query,
165-
extra_body=extra_body,
166-
timeout=timeout,
167-
query=maybe_transform(
168-
{
169-
"container_tags": container_tags,
170-
"filters": filters,
171-
"limit": limit,
172-
"order": order,
173-
"page": page,
174-
"sort": sort,
175-
},
176-
memory_list_params.MemoryListParams,
177-
),
178-
),
179-
cast_to=MemoryListResponse,
180-
)
181-
182115
def delete(
183116
self,
184117
id: str,
@@ -398,70 +331,6 @@ async def update(
398331
cast_to=MemoryUpdateResponse,
399332
)
400333

401-
@typing_extensions.deprecated("deprecated")
402-
async def list(
403-
self,
404-
*,
405-
container_tags: List[str] | NotGiven = NOT_GIVEN,
406-
filters: str | NotGiven = NOT_GIVEN,
407-
limit: Union[str, float] | NotGiven = NOT_GIVEN,
408-
order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
409-
page: Union[str, float] | NotGiven = NOT_GIVEN,
410-
sort: Literal["createdAt", "updatedAt"] | NotGiven = NOT_GIVEN,
411-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
412-
# The extra values given here take precedence over values defined on the client or passed to this method.
413-
extra_headers: Headers | None = None,
414-
extra_query: Query | None = None,
415-
extra_body: Body | None = None,
416-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
417-
) -> MemoryListResponse:
418-
"""
419-
Retrieves a paginated list of memories with their metadata and workflow status
420-
421-
Args:
422-
container_tags: Optional tags this memory should be containerized by. This can be an ID for your
423-
user, a project ID, or any other identifier you wish to use to group memories.
424-
425-
filters: Optional filters to apply to the search
426-
427-
limit: Number of items per page
428-
429-
order: Sort order
430-
431-
page: Page number to fetch
432-
433-
sort: Field to sort by
434-
435-
extra_headers: Send extra headers
436-
437-
extra_query: Add additional query parameters to the request
438-
439-
extra_body: Add additional JSON properties to the request
440-
441-
timeout: Override the client-level default timeout for this request, in seconds
442-
"""
443-
return await self._get(
444-
"/v3/memories",
445-
options=make_request_options(
446-
extra_headers=extra_headers,
447-
extra_query=extra_query,
448-
extra_body=extra_body,
449-
timeout=timeout,
450-
query=await async_maybe_transform(
451-
{
452-
"container_tags": container_tags,
453-
"filters": filters,
454-
"limit": limit,
455-
"order": order,
456-
"page": page,
457-
"sort": sort,
458-
},
459-
memory_list_params.MemoryListParams,
460-
),
461-
),
462-
cast_to=MemoryListResponse,
463-
)
464-
465334
async def delete(
466335
self,
467336
id: str,
@@ -601,11 +470,6 @@ def __init__(self, memories: MemoriesResource) -> None:
601470
self.update = to_raw_response_wrapper(
602471
memories.update,
603472
)
604-
self.list = ( # pyright: ignore[reportDeprecated]
605-
to_raw_response_wrapper(
606-
memories.list # pyright: ignore[reportDeprecated],
607-
)
608-
)
609473
self.delete = to_raw_response_wrapper(
610474
memories.delete,
611475
)
@@ -624,11 +488,6 @@ def __init__(self, memories: AsyncMemoriesResource) -> None:
624488
self.update = async_to_raw_response_wrapper(
625489
memories.update,
626490
)
627-
self.list = ( # pyright: ignore[reportDeprecated]
628-
async_to_raw_response_wrapper(
629-
memories.list # pyright: ignore[reportDeprecated],
630-
)
631-
)
632491
self.delete = async_to_raw_response_wrapper(
633492
memories.delete,
634493
)
@@ -647,11 +506,6 @@ def __init__(self, memories: MemoriesResource) -> None:
647506
self.update = to_streamed_response_wrapper(
648507
memories.update,
649508
)
650-
self.list = ( # pyright: ignore[reportDeprecated]
651-
to_streamed_response_wrapper(
652-
memories.list # pyright: ignore[reportDeprecated],
653-
)
654-
)
655509
self.delete = to_streamed_response_wrapper(
656510
memories.delete,
657511
)
@@ -670,11 +524,6 @@ def __init__(self, memories: AsyncMemoriesResource) -> None:
670524
self.update = async_to_streamed_response_wrapper(
671525
memories.update,
672526
)
673-
self.list = ( # pyright: ignore[reportDeprecated]
674-
async_to_streamed_response_wrapper(
675-
memories.list # pyright: ignore[reportDeprecated],
676-
)
677-
)
678527
self.delete = async_to_streamed_response_wrapper(
679528
memories.delete,
680529
)

0 commit comments

Comments
 (0)