Skip to content

Commit 4e6c8e6

Browse files
feat(api): api update
1 parent 4033279 commit 4e6c8e6

File tree

5 files changed

+60
-169
lines changed

5 files changed

+60
-169
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: 18
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-b3dad40bf7690f4d2179099085eb863299ba5a48f3616ea8275611780b1662a8.yml
3-
openapi_spec_hash: 3971074431cc6ff589ab4ddfbf998df9
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-e61d7828c965d3ed4a4e638705dd71a5572291216a4dd3a9d4f52cbde04d47e7.yml
3+
openapi_spec_hash: 2623fa1606f109694056e589c06eeeb5
44
config_hash: a478b24249ee4f53abfb5787ca4daf8b

src/supermemory/resources/search.py

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22

33
from __future__ import annotations
44

5-
from typing import List
6-
from typing_extensions import Literal
7-
85
import httpx
96

107
from ..types import search_execute_params, search_memories_params, search_documents_params
@@ -50,7 +47,7 @@ def documents(
5047
self,
5148
*,
5249
q: str,
53-
categories_filter: List[Literal["technology", "science", "business", "health"]] | Omit = omit,
50+
categories_filter: SequenceNotStr[str] | Omit = omit,
5451
chunk_threshold: float | Omit = omit,
5552
container_tags: SequenceNotStr[str] | Omit = omit,
5653
doc_id: str | Omit = omit,
@@ -75,7 +72,7 @@ def documents(
7572
Args:
7673
q: Search query string
7774
78-
categories_filter: Optional category filters
75+
categories_filter: DEPRECATED: Optional category filters
7976
8077
chunk_threshold: Threshold / sensitivity for chunk selection. 0 is least sensitive (returns most
8178
chunks, more results), 1 is most sensitive (returns lesser chunks, accurate
@@ -87,9 +84,8 @@ def documents(
8784
doc_id: Optional document ID to search within. You can use this to find chunks in a very
8885
large document.
8986
90-
document_threshold: Threshold / sensitivity for document selection. 0 is least sensitive (returns
91-
most documents, more results), 1 is most sensitive (returns lesser documents,
92-
accurate results)
87+
document_threshold: DEPRECATED: This field is no longer used in v3 search. The search now uses
88+
chunkThreshold only. This parameter will be ignored.
9389
9490
filters: Optional filters to apply to the search. Can be a JSON string or Query object.
9591
@@ -149,7 +145,7 @@ def execute(
149145
self,
150146
*,
151147
q: str,
152-
categories_filter: List[Literal["technology", "science", "business", "health"]] | Omit = omit,
148+
categories_filter: SequenceNotStr[str] | Omit = omit,
153149
chunk_threshold: float | Omit = omit,
154150
container_tags: SequenceNotStr[str] | Omit = omit,
155151
doc_id: str | Omit = omit,
@@ -174,7 +170,7 @@ def execute(
174170
Args:
175171
q: Search query string
176172
177-
categories_filter: Optional category filters
173+
categories_filter: DEPRECATED: Optional category filters
178174
179175
chunk_threshold: Threshold / sensitivity for chunk selection. 0 is least sensitive (returns most
180176
chunks, more results), 1 is most sensitive (returns lesser chunks, accurate
@@ -186,9 +182,8 @@ def execute(
186182
doc_id: Optional document ID to search within. You can use this to find chunks in a very
187183
large document.
188184
189-
document_threshold: Threshold / sensitivity for document selection. 0 is least sensitive (returns
190-
most documents, more results), 1 is most sensitive (returns lesser documents,
191-
accurate results)
185+
document_threshold: DEPRECATED: This field is no longer used in v3 search. The search now uses
186+
chunkThreshold only. This parameter will be ignored.
192187
193188
filters: Optional filters to apply to the search. Can be a JSON string or Query object.
194189
@@ -339,7 +334,7 @@ async def documents(
339334
self,
340335
*,
341336
q: str,
342-
categories_filter: List[Literal["technology", "science", "business", "health"]] | Omit = omit,
337+
categories_filter: SequenceNotStr[str] | Omit = omit,
343338
chunk_threshold: float | Omit = omit,
344339
container_tags: SequenceNotStr[str] | Omit = omit,
345340
doc_id: str | Omit = omit,
@@ -364,7 +359,7 @@ async def documents(
364359
Args:
365360
q: Search query string
366361
367-
categories_filter: Optional category filters
362+
categories_filter: DEPRECATED: Optional category filters
368363
369364
chunk_threshold: Threshold / sensitivity for chunk selection. 0 is least sensitive (returns most
370365
chunks, more results), 1 is most sensitive (returns lesser chunks, accurate
@@ -376,9 +371,8 @@ async def documents(
376371
doc_id: Optional document ID to search within. You can use this to find chunks in a very
377372
large document.
378373
379-
document_threshold: Threshold / sensitivity for document selection. 0 is least sensitive (returns
380-
most documents, more results), 1 is most sensitive (returns lesser documents,
381-
accurate results)
374+
document_threshold: DEPRECATED: This field is no longer used in v3 search. The search now uses
375+
chunkThreshold only. This parameter will be ignored.
382376
383377
filters: Optional filters to apply to the search. Can be a JSON string or Query object.
384378
@@ -438,7 +432,7 @@ async def execute(
438432
self,
439433
*,
440434
q: str,
441-
categories_filter: List[Literal["technology", "science", "business", "health"]] | Omit = omit,
435+
categories_filter: SequenceNotStr[str] | Omit = omit,
442436
chunk_threshold: float | Omit = omit,
443437
container_tags: SequenceNotStr[str] | Omit = omit,
444438
doc_id: str | Omit = omit,
@@ -463,7 +457,7 @@ async def execute(
463457
Args:
464458
q: Search query string
465459
466-
categories_filter: Optional category filters
460+
categories_filter: DEPRECATED: Optional category filters
467461
468462
chunk_threshold: Threshold / sensitivity for chunk selection. 0 is least sensitive (returns most
469463
chunks, more results), 1 is most sensitive (returns lesser chunks, accurate
@@ -475,9 +469,8 @@ async def execute(
475469
doc_id: Optional document ID to search within. You can use this to find chunks in a very
476470
large document.
477471
478-
document_threshold: Threshold / sensitivity for document selection. 0 is least sensitive (returns
479-
most documents, more results), 1 is most sensitive (returns lesser documents,
480-
accurate results)
472+
document_threshold: DEPRECATED: This field is no longer used in v3 search. The search now uses
473+
chunkThreshold only. This parameter will be ignored.
481474
482475
filters: Optional filters to apply to the search. Can be a JSON string or Query object.
483476

src/supermemory/types/search_documents_params.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
from __future__ import annotations
44

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

88
from .._types import SequenceNotStr
99
from .._utils import PropertyInfo
@@ -17,10 +17,8 @@ class SearchDocumentsParams(TypedDict, total=False):
1717
q: Required[str]
1818
"""Search query string"""
1919

20-
categories_filter: Annotated[
21-
List[Literal["technology", "science", "business", "health"]], PropertyInfo(alias="categoriesFilter")
22-
]
23-
"""Optional category filters"""
20+
categories_filter: Annotated[SequenceNotStr[str], PropertyInfo(alias="categoriesFilter")]
21+
"""DEPRECATED: Optional category filters"""
2422

2523
chunk_threshold: Annotated[float, PropertyInfo(alias="chunkThreshold")]
2624
"""Threshold / sensitivity for chunk selection.
@@ -43,10 +41,9 @@ class SearchDocumentsParams(TypedDict, total=False):
4341
"""
4442

4543
document_threshold: Annotated[float, PropertyInfo(alias="documentThreshold")]
46-
"""Threshold / sensitivity for document selection.
44+
"""DEPRECATED: This field is no longer used in v3 search.
4745
48-
0 is least sensitive (returns most documents, more results), 1 is most sensitive
49-
(returns lesser documents, accurate results)
46+
The search now uses chunkThreshold only. This parameter will be ignored.
5047
"""
5148

5249
filters: Filters

src/supermemory/types/search_execute_params.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
from __future__ import annotations
44

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

88
from .._types import SequenceNotStr
99
from .._utils import PropertyInfo
@@ -17,10 +17,8 @@ class SearchExecuteParams(TypedDict, total=False):
1717
q: Required[str]
1818
"""Search query string"""
1919

20-
categories_filter: Annotated[
21-
List[Literal["technology", "science", "business", "health"]], PropertyInfo(alias="categoriesFilter")
22-
]
23-
"""Optional category filters"""
20+
categories_filter: Annotated[SequenceNotStr[str], PropertyInfo(alias="categoriesFilter")]
21+
"""DEPRECATED: Optional category filters"""
2422

2523
chunk_threshold: Annotated[float, PropertyInfo(alias="chunkThreshold")]
2624
"""Threshold / sensitivity for chunk selection.
@@ -43,10 +41,9 @@ class SearchExecuteParams(TypedDict, total=False):
4341
"""
4442

4543
document_threshold: Annotated[float, PropertyInfo(alias="documentThreshold")]
46-
"""Threshold / sensitivity for document selection.
44+
"""DEPRECATED: This field is no longer used in v3 search.
4745
48-
0 is least sensitive (returns most documents, more results), 1 is most sensitive
49-
(returns lesser documents, accurate results)
46+
The search now uses chunkThreshold only. This parameter will be ignored.
5047
"""
5148

5249
filters: Filters

0 commit comments

Comments
 (0)