Skip to content

Commit 19c5dd3

Browse files
feat(api): api update
1 parent 3031781 commit 19c5dd3

12 files changed

Lines changed: 486 additions & 88 deletions

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 18
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-0dc5f10179855bda1aabcad789449ca1e5b84cb5c619ccdd2227cec5b384af43.yml
3-
openapi_spec_hash: 847c9b8bf6a9a67f2b061243e2024b16
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-6453f22c5b02f00d5656b9fbef9a4c70999ed890c95ddbfd363c7ddba2cef59f.yml
3+
openapi_spec_hash: bb200bfe2a4fa307beaa119b54efeeb2
44
config_hash: 2737bce9823a13e0263c0fa2701821fa

src/supermemory/resources/documents.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def list(
138138
self,
139139
*,
140140
container_tags: SequenceNotStr[str] | Omit = omit,
141-
filters: str | Omit = omit,
141+
filters: document_list_params.Filters | Omit = omit,
142142
include_content: bool | Omit = omit,
143143
limit: Union[str, float] | Omit = omit,
144144
order: Literal["asc", "desc"] | Omit = omit,
@@ -159,7 +159,7 @@ def list(
159159
your user, a project ID, or any other identifier you wish to use to group
160160
documents.
161161
162-
filters: Optional filters to apply to the search
162+
filters: Optional filters to apply to the search. Can be a JSON string or Query object.
163163
164164
include_content: Whether to include the content field in the response. Warning: This can make
165165
responses significantly larger.
@@ -523,7 +523,7 @@ async def list(
523523
self,
524524
*,
525525
container_tags: SequenceNotStr[str] | Omit = omit,
526-
filters: str | Omit = omit,
526+
filters: document_list_params.Filters | Omit = omit,
527527
include_content: bool | Omit = omit,
528528
limit: Union[str, float] | Omit = omit,
529529
order: Literal["asc", "desc"] | Omit = omit,
@@ -544,7 +544,7 @@ async def list(
544544
your user, a project ID, or any other identifier you wish to use to group
545545
documents.
546546
547-
filters: Optional filters to apply to the search
547+
filters: Optional filters to apply to the search. Can be a JSON string or Query object.
548548
549549
include_content: Whether to include the content field in the response. Warning: This can make
550550
responses significantly larger.

src/supermemory/resources/memories.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def list(
138138
self,
139139
*,
140140
container_tags: SequenceNotStr[str] | Omit = omit,
141-
filters: str | Omit = omit,
141+
filters: memory_list_params.Filters | Omit = omit,
142142
include_content: bool | Omit = omit,
143143
limit: Union[str, float] | Omit = omit,
144144
order: Literal["asc", "desc"] | Omit = omit,
@@ -159,7 +159,7 @@ def list(
159159
your user, a project ID, or any other identifier you wish to use to group
160160
documents.
161161
162-
filters: Optional filters to apply to the search
162+
filters: Optional filters to apply to the search. Can be a JSON string or Query object.
163163
164164
include_content: Whether to include the content field in the response. Warning: This can make
165165
responses significantly larger.
@@ -523,7 +523,7 @@ async def list(
523523
self,
524524
*,
525525
container_tags: SequenceNotStr[str] | Omit = omit,
526-
filters: str | Omit = omit,
526+
filters: memory_list_params.Filters | Omit = omit,
527527
include_content: bool | Omit = omit,
528528
limit: Union[str, float] | Omit = omit,
529529
order: Literal["asc", "desc"] | Omit = omit,
@@ -544,7 +544,7 @@ async def list(
544544
your user, a project ID, or any other identifier you wish to use to group
545545
documents.
546546
547-
filters: Optional filters to apply to the search
547+
filters: Optional filters to apply to the search. Can be a JSON string or Query object.
548548
549549
include_content: Whether to include the content field in the response. Warning: This can make
550550
responses significantly larger.

src/supermemory/resources/search.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def documents(
9191
most documents, more results), 1 is most sensitive (returns lesser documents,
9292
accurate results)
9393
94-
filters: Optional filters to apply to the search
94+
filters: Optional filters to apply to the search. Can be a JSON string or Query object.
9595
9696
include_full_docs: If true, include full document in the response. This is helpful if you want a
9797
chatbot to know the full context of the document.
@@ -190,7 +190,7 @@ def execute(
190190
most documents, more results), 1 is most sensitive (returns lesser documents,
191191
accurate results)
192192
193-
filters: Optional filters to apply to the search
193+
filters: Optional filters to apply to the search. Can be a JSON string or Query object.
194194
195195
include_full_docs: If true, include full document in the response. This is helpful if you want a
196196
chatbot to know the full context of the document.
@@ -271,7 +271,7 @@ def memories(
271271
container_tag: Optional tag this search should be containerized by. This can be an ID for your
272272
user, a project ID, or any other identifier you wish to use to filter memories.
273273
274-
filters: Optional filters to apply to the search
274+
filters: Optional filters to apply to the search. Can be a JSON string or Query object.
275275
276276
limit: Maximum number of results to return
277277
@@ -380,7 +380,7 @@ async def documents(
380380
most documents, more results), 1 is most sensitive (returns lesser documents,
381381
accurate results)
382382
383-
filters: Optional filters to apply to the search
383+
filters: Optional filters to apply to the search. Can be a JSON string or Query object.
384384
385385
include_full_docs: If true, include full document in the response. This is helpful if you want a
386386
chatbot to know the full context of the document.
@@ -479,7 +479,7 @@ async def execute(
479479
most documents, more results), 1 is most sensitive (returns lesser documents,
480480
accurate results)
481481
482-
filters: Optional filters to apply to the search
482+
filters: Optional filters to apply to the search. Can be a JSON string or Query object.
483483
484484
include_full_docs: If true, include full document in the response. This is helpful if you want a
485485
chatbot to know the full context of the document.
@@ -560,7 +560,7 @@ async def memories(
560560
container_tag: Optional tag this search should be containerized by. This can be an ID for your
561561
user, a project ID, or any other identifier you wish to use to filter memories.
562562
563-
filters: Optional filters to apply to the search
563+
filters: Optional filters to apply to the search. Can be a JSON string or Query object.
564564
565565
limit: Maximum number of results to return
566566

src/supermemory/types/document_list_params.py

Lines changed: 75 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,26 @@
22

33
from __future__ import annotations
44

5-
from typing import Union
6-
from typing_extensions import Literal, Annotated, TypedDict
5+
from typing import Union, Iterable
6+
from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict
77

88
from .._types import SequenceNotStr
99
from .._utils import PropertyInfo
1010

11-
__all__ = ["DocumentListParams"]
11+
__all__ = [
12+
"DocumentListParams",
13+
"Filters",
14+
"FiltersOr",
15+
"FiltersOrOr",
16+
"FiltersOrOrUnionMember0",
17+
"FiltersOrOrOr",
18+
"FiltersOrOrAnd",
19+
"FiltersAnd",
20+
"FiltersAndAnd",
21+
"FiltersAndAndUnionMember0",
22+
"FiltersAndAndOr",
23+
"FiltersAndAndAnd",
24+
]
1225

1326

1427
class DocumentListParams(TypedDict, total=False):
@@ -19,8 +32,8 @@ class DocumentListParams(TypedDict, total=False):
1932
to use to group documents.
2033
"""
2134

22-
filters: str
23-
"""Optional filters to apply to the search"""
35+
filters: Filters
36+
"""Optional filters to apply to the search. Can be a JSON string or Query object."""
2437

2538
include_content: Annotated[bool, PropertyInfo(alias="includeContent")]
2639
"""Whether to include the content field in the response.
@@ -39,3 +52,60 @@ class DocumentListParams(TypedDict, total=False):
3952

4053
sort: Literal["createdAt", "updatedAt"]
4154
"""Field to sort by"""
55+
56+
57+
class FiltersOrOrUnionMember0(TypedDict, total=False):
58+
key: Required[str]
59+
60+
value: Required[str]
61+
62+
filter_type: Annotated[Literal["metadata", "numeric", "array_contains"], PropertyInfo(alias="filterType")]
63+
64+
negate: Union[bool, Literal["true", "false"]]
65+
66+
numeric_operator: Annotated[Literal[">", "<", ">=", "<=", "="], PropertyInfo(alias="numericOperator")]
67+
68+
69+
class FiltersOrOrOr(TypedDict, total=False):
70+
or_: Required[Annotated[Iterable[object], PropertyInfo(alias="OR")]]
71+
72+
73+
class FiltersOrOrAnd(TypedDict, total=False):
74+
and_: Required[Annotated[Iterable[object], PropertyInfo(alias="AND")]]
75+
76+
77+
FiltersOrOr: TypeAlias = Union[FiltersOrOrUnionMember0, FiltersOrOrOr, FiltersOrOrAnd]
78+
79+
80+
class FiltersOr(TypedDict, total=False):
81+
or_: Required[Annotated[Iterable[FiltersOrOr], PropertyInfo(alias="OR")]]
82+
83+
84+
class FiltersAndAndUnionMember0(TypedDict, total=False):
85+
key: Required[str]
86+
87+
value: Required[str]
88+
89+
filter_type: Annotated[Literal["metadata", "numeric", "array_contains"], PropertyInfo(alias="filterType")]
90+
91+
negate: Union[bool, Literal["true", "false"]]
92+
93+
numeric_operator: Annotated[Literal[">", "<", ">=", "<=", "="], PropertyInfo(alias="numericOperator")]
94+
95+
96+
class FiltersAndAndOr(TypedDict, total=False):
97+
or_: Required[Annotated[Iterable[object], PropertyInfo(alias="OR")]]
98+
99+
100+
class FiltersAndAndAnd(TypedDict, total=False):
101+
and_: Required[Annotated[Iterable[object], PropertyInfo(alias="AND")]]
102+
103+
104+
FiltersAndAnd: TypeAlias = Union[FiltersAndAndUnionMember0, FiltersAndAndOr, FiltersAndAndAnd]
105+
106+
107+
class FiltersAnd(TypedDict, total=False):
108+
and_: Required[Annotated[Iterable[FiltersAndAnd], PropertyInfo(alias="AND")]]
109+
110+
111+
Filters: TypeAlias = Union[FiltersOr, FiltersAnd]

src/supermemory/types/memory_list_params.py

Lines changed: 75 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,26 @@
22

33
from __future__ import annotations
44

5-
from typing import Union
6-
from typing_extensions import Literal, Annotated, TypedDict
5+
from typing import Union, Iterable
6+
from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict
77

88
from .._types import SequenceNotStr
99
from .._utils import PropertyInfo
1010

11-
__all__ = ["MemoryListParams"]
11+
__all__ = [
12+
"MemoryListParams",
13+
"Filters",
14+
"FiltersOr",
15+
"FiltersOrOr",
16+
"FiltersOrOrUnionMember0",
17+
"FiltersOrOrOr",
18+
"FiltersOrOrAnd",
19+
"FiltersAnd",
20+
"FiltersAndAnd",
21+
"FiltersAndAndUnionMember0",
22+
"FiltersAndAndOr",
23+
"FiltersAndAndAnd",
24+
]
1225

1326

1427
class MemoryListParams(TypedDict, total=False):
@@ -19,8 +32,8 @@ class MemoryListParams(TypedDict, total=False):
1932
to use to group documents.
2033
"""
2134

22-
filters: str
23-
"""Optional filters to apply to the search"""
35+
filters: Filters
36+
"""Optional filters to apply to the search. Can be a JSON string or Query object."""
2437

2538
include_content: Annotated[bool, PropertyInfo(alias="includeContent")]
2639
"""Whether to include the content field in the response.
@@ -39,3 +52,60 @@ class MemoryListParams(TypedDict, total=False):
3952

4053
sort: Literal["createdAt", "updatedAt"]
4154
"""Field to sort by"""
55+
56+
57+
class FiltersOrOrUnionMember0(TypedDict, total=False):
58+
key: Required[str]
59+
60+
value: Required[str]
61+
62+
filter_type: Annotated[Literal["metadata", "numeric", "array_contains"], PropertyInfo(alias="filterType")]
63+
64+
negate: Union[bool, Literal["true", "false"]]
65+
66+
numeric_operator: Annotated[Literal[">", "<", ">=", "<=", "="], PropertyInfo(alias="numericOperator")]
67+
68+
69+
class FiltersOrOrOr(TypedDict, total=False):
70+
or_: Required[Annotated[Iterable[object], PropertyInfo(alias="OR")]]
71+
72+
73+
class FiltersOrOrAnd(TypedDict, total=False):
74+
and_: Required[Annotated[Iterable[object], PropertyInfo(alias="AND")]]
75+
76+
77+
FiltersOrOr: TypeAlias = Union[FiltersOrOrUnionMember0, FiltersOrOrOr, FiltersOrOrAnd]
78+
79+
80+
class FiltersOr(TypedDict, total=False):
81+
or_: Required[Annotated[Iterable[FiltersOrOr], PropertyInfo(alias="OR")]]
82+
83+
84+
class FiltersAndAndUnionMember0(TypedDict, total=False):
85+
key: Required[str]
86+
87+
value: Required[str]
88+
89+
filter_type: Annotated[Literal["metadata", "numeric", "array_contains"], PropertyInfo(alias="filterType")]
90+
91+
negate: Union[bool, Literal["true", "false"]]
92+
93+
numeric_operator: Annotated[Literal[">", "<", ">=", "<=", "="], PropertyInfo(alias="numericOperator")]
94+
95+
96+
class FiltersAndAndOr(TypedDict, total=False):
97+
or_: Required[Annotated[Iterable[object], PropertyInfo(alias="OR")]]
98+
99+
100+
class FiltersAndAndAnd(TypedDict, total=False):
101+
and_: Required[Annotated[Iterable[object], PropertyInfo(alias="AND")]]
102+
103+
104+
FiltersAndAnd: TypeAlias = Union[FiltersAndAndUnionMember0, FiltersAndAndOr, FiltersAndAndAnd]
105+
106+
107+
class FiltersAnd(TypedDict, total=False):
108+
and_: Required[Annotated[Iterable[FiltersAndAnd], PropertyInfo(alias="AND")]]
109+
110+
111+
Filters: TypeAlias = Union[FiltersOr, FiltersAnd]

0 commit comments

Comments
 (0)