Skip to content

Commit 02e8b00

Browse files
feat(api): api update
1 parent 1788d47 commit 02e8b00

File tree

4 files changed

+4
-134
lines changed

4 files changed

+4
-134
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: 12
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-51f7b8cdabb689a8e8fa328e5c3b82906a2db418d486ef019bd0b2656e3a38aa.yml
3-
openapi_spec_hash: cddc9d0c5e419657929408a3de9228db
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-51498a77be155823007306ade088caca08102547dec1860625b8c111bf5a19b3.yml
3+
openapi_spec_hash: 2a18759ac9605976ae0555be3735d711
44
config_hash: 8477e3ee6fd596ab6ac911d052e4de79

src/supermemory/resources/search.py

Lines changed: 2 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,7 @@ def execute(
4545
self,
4646
*,
4747
q: str,
48-
chunk_threshold: float | NotGiven = NOT_GIVEN,
4948
doc_id: str | NotGiven = NOT_GIVEN,
50-
document_threshold: float | NotGiven = NOT_GIVEN,
51-
include_summary: bool | NotGiven = NOT_GIVEN,
52-
limit: int | NotGiven = NOT_GIVEN,
53-
only_matching_chunks: bool | NotGiven = NOT_GIVEN,
54-
rerank: bool | NotGiven = NOT_GIVEN,
55-
rewrite_query: bool | NotGiven = NOT_GIVEN,
5649
user_id: str | NotGiven = NOT_GIVEN,
5750
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
5851
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -62,37 +55,14 @@ def execute(
6255
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
6356
) -> SearchExecuteResponse:
6457
"""
65-
Search memories with basic filtering (simple query parameters only)
58+
Search memories with basic filtering (Deprecated)
6659
6760
Args:
6861
q: Search query string
6962
70-
chunk_threshold: Threshold / sensitivity for chunk selection. 0 is least sensitive (returns most
71-
chunks, more results), 1 is most sensitive (returns lesser chunks, accurate
72-
results)
73-
7463
doc_id: Optional document ID to search within. You can use this to find chunks in a very
7564
large document.
7665
77-
document_threshold: Threshold / sensitivity for document selection. 0 is least sensitive (returns
78-
most documents, more results), 1 is most sensitive (returns lesser documents,
79-
accurate results)
80-
81-
include_summary: If true, include document summary in the response. This is helpful if you want a
82-
chatbot to know the full context of the document.
83-
84-
limit: Maximum number of results to return
85-
86-
only_matching_chunks: If true, only return matching chunks without context. Normally, we send the
87-
previous and next chunk to provide more context for LLMs. If you only want the
88-
matching chunk, set this to true.
89-
90-
rerank: If true, rerank the results based on the query. This is helpful if you want to
91-
ensure the most relevant results are returned.
92-
93-
rewrite_query: If true, rewrites the query to make it easier to find documents. This increases
94-
the latency by about 400ms
95-
9666
user_id: End user ID this search is associated with. NOTE: This also acts as a filter for
9767
the search.
9868
@@ -114,14 +84,7 @@ def execute(
11484
query=maybe_transform(
11585
{
11686
"q": q,
117-
"chunk_threshold": chunk_threshold,
11887
"doc_id": doc_id,
119-
"document_threshold": document_threshold,
120-
"include_summary": include_summary,
121-
"limit": limit,
122-
"only_matching_chunks": only_matching_chunks,
123-
"rerank": rerank,
124-
"rewrite_query": rewrite_query,
12588
"user_id": user_id,
12689
},
12790
search_execute_params.SearchExecuteParams,
@@ -155,14 +118,7 @@ async def execute(
155118
self,
156119
*,
157120
q: str,
158-
chunk_threshold: float | NotGiven = NOT_GIVEN,
159121
doc_id: str | NotGiven = NOT_GIVEN,
160-
document_threshold: float | NotGiven = NOT_GIVEN,
161-
include_summary: bool | NotGiven = NOT_GIVEN,
162-
limit: int | NotGiven = NOT_GIVEN,
163-
only_matching_chunks: bool | NotGiven = NOT_GIVEN,
164-
rerank: bool | NotGiven = NOT_GIVEN,
165-
rewrite_query: bool | NotGiven = NOT_GIVEN,
166122
user_id: str | NotGiven = NOT_GIVEN,
167123
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
168124
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -172,37 +128,14 @@ async def execute(
172128
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
173129
) -> SearchExecuteResponse:
174130
"""
175-
Search memories with basic filtering (simple query parameters only)
131+
Search memories with basic filtering (Deprecated)
176132
177133
Args:
178134
q: Search query string
179135
180-
chunk_threshold: Threshold / sensitivity for chunk selection. 0 is least sensitive (returns most
181-
chunks, more results), 1 is most sensitive (returns lesser chunks, accurate
182-
results)
183-
184136
doc_id: Optional document ID to search within. You can use this to find chunks in a very
185137
large document.
186138
187-
document_threshold: Threshold / sensitivity for document selection. 0 is least sensitive (returns
188-
most documents, more results), 1 is most sensitive (returns lesser documents,
189-
accurate results)
190-
191-
include_summary: If true, include document summary in the response. This is helpful if you want a
192-
chatbot to know the full context of the document.
193-
194-
limit: Maximum number of results to return
195-
196-
only_matching_chunks: If true, only return matching chunks without context. Normally, we send the
197-
previous and next chunk to provide more context for LLMs. If you only want the
198-
matching chunk, set this to true.
199-
200-
rerank: If true, rerank the results based on the query. This is helpful if you want to
201-
ensure the most relevant results are returned.
202-
203-
rewrite_query: If true, rewrites the query to make it easier to find documents. This increases
204-
the latency by about 400ms
205-
206139
user_id: End user ID this search is associated with. NOTE: This also acts as a filter for
207140
the search.
208141
@@ -224,14 +157,7 @@ async def execute(
224157
query=await async_maybe_transform(
225158
{
226159
"q": q,
227-
"chunk_threshold": chunk_threshold,
228160
"doc_id": doc_id,
229-
"document_threshold": document_threshold,
230-
"include_summary": include_summary,
231-
"limit": limit,
232-
"only_matching_chunks": only_matching_chunks,
233-
"rerank": rerank,
234-
"rewrite_query": rewrite_query,
235161
"user_id": user_id,
236162
},
237163
search_execute_params.SearchExecuteParams,

src/supermemory/types/search_execute_params.py

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -13,54 +13,12 @@ class SearchExecuteParams(TypedDict, total=False):
1313
q: Required[str]
1414
"""Search query string"""
1515

16-
chunk_threshold: Annotated[float, PropertyInfo(alias="chunkThreshold")]
17-
"""Threshold / sensitivity for chunk selection.
18-
19-
0 is least sensitive (returns most chunks, more results), 1 is most sensitive
20-
(returns lesser chunks, accurate results)
21-
"""
22-
2316
doc_id: Annotated[str, PropertyInfo(alias="docId")]
2417
"""Optional document ID to search within.
2518
2619
You can use this to find chunks in a very large document.
2720
"""
2821

29-
document_threshold: Annotated[float, PropertyInfo(alias="documentThreshold")]
30-
"""Threshold / sensitivity for document selection.
31-
32-
0 is least sensitive (returns most documents, more results), 1 is most sensitive
33-
(returns lesser documents, accurate results)
34-
"""
35-
36-
include_summary: Annotated[bool, PropertyInfo(alias="includeSummary")]
37-
"""If true, include document summary in the response.
38-
39-
This is helpful if you want a chatbot to know the full context of the document.
40-
"""
41-
42-
limit: int
43-
"""Maximum number of results to return"""
44-
45-
only_matching_chunks: Annotated[bool, PropertyInfo(alias="onlyMatchingChunks")]
46-
"""If true, only return matching chunks without context.
47-
48-
Normally, we send the previous and next chunk to provide more context for LLMs.
49-
If you only want the matching chunk, set this to true.
50-
"""
51-
52-
rerank: bool
53-
"""If true, rerank the results based on the query.
54-
55-
This is helpful if you want to ensure the most relevant results are returned.
56-
"""
57-
58-
rewrite_query: Annotated[bool, PropertyInfo(alias="rewriteQuery")]
59-
"""If true, rewrites the query to make it easier to find documents.
60-
61-
This increases the latency by about 400ms
62-
"""
63-
6422
user_id: Annotated[str, PropertyInfo(alias="userId")]
6523
"""End user ID this search is associated with.
6624

tests/api_resources/test_search.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,7 @@ def test_method_execute(self, client: Supermemory) -> None:
3030
def test_method_execute_with_all_params(self, client: Supermemory) -> None:
3131
search = client.search.execute(
3232
q="machine learning concepts",
33-
chunk_threshold=0.5,
3433
doc_id="doc_xyz789",
35-
document_threshold=0.5,
36-
include_summary=False,
37-
limit=10,
38-
only_matching_chunks=False,
39-
rerank=False,
40-
rewrite_query=False,
4134
user_id="user_123",
4235
)
4336
assert_matches_type(SearchExecuteResponse, search, path=["response"])
@@ -85,14 +78,7 @@ async def test_method_execute(self, async_client: AsyncSupermemory) -> None:
8578
async def test_method_execute_with_all_params(self, async_client: AsyncSupermemory) -> None:
8679
search = await async_client.search.execute(
8780
q="machine learning concepts",
88-
chunk_threshold=0.5,
8981
doc_id="doc_xyz789",
90-
document_threshold=0.5,
91-
include_summary=False,
92-
limit=10,
93-
only_matching_chunks=False,
94-
rerank=False,
95-
rewrite_query=False,
9682
user_id="user_123",
9783
)
9884
assert_matches_type(SearchExecuteResponse, search, path=["response"])

0 commit comments

Comments
 (0)