Skip to content

Commit 722df63

Browse files
feat(api): api update
1 parent 4052bae commit 722df63

File tree

5 files changed

+24
-3
lines changed

5 files changed

+24
-3
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-783134192ebb9f62b9a25815c143704ccec4466fb4c5ba611d60d854db976970.yml
3-
openapi_spec_hash: 2d0e081f9844f31ae00f95cff68ec29d
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-571ecc4d367c9f140a08728c8e3b5c1cc4f5f8ae698e325c5cbe5181c2c87bb0.yml
3+
openapi_spec_hash: b96a73f50568a58168354cb8690969e9
44
config_hash: eb32087403f958eead829e810f5a71b8

src/supermemory/resources/search.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ def execute(
5656
include_summary: bool | NotGiven = NOT_GIVEN,
5757
limit: int | NotGiven = NOT_GIVEN,
5858
only_matching_chunks: bool | NotGiven = NOT_GIVEN,
59+
rerank: bool | NotGiven = NOT_GIVEN,
5960
rewrite_query: bool | NotGiven = NOT_GIVEN,
6061
user_id: str | NotGiven = NOT_GIVEN,
6162
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -95,6 +96,9 @@ def execute(
9596
previous and next chunk to provide more context for LLMs. If you only want the
9697
matching chunk, set this to true.
9798
99+
rerank: If true, rerank the results based on the query. This is helpful if you want to
100+
ensure the most relevant results are returned.
101+
98102
rewrite_query: If true, rewrites the query to make it easier to find documents. This increases
99103
the latency by about 400ms
100104
@@ -122,6 +126,7 @@ def execute(
122126
"include_summary": include_summary,
123127
"limit": limit,
124128
"only_matching_chunks": only_matching_chunks,
129+
"rerank": rerank,
125130
"rewrite_query": rewrite_query,
126131
"user_id": user_id,
127132
},
@@ -166,6 +171,7 @@ async def execute(
166171
include_summary: bool | NotGiven = NOT_GIVEN,
167172
limit: int | NotGiven = NOT_GIVEN,
168173
only_matching_chunks: bool | NotGiven = NOT_GIVEN,
174+
rerank: bool | NotGiven = NOT_GIVEN,
169175
rewrite_query: bool | NotGiven = NOT_GIVEN,
170176
user_id: str | NotGiven = NOT_GIVEN,
171177
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -205,6 +211,9 @@ async def execute(
205211
previous and next chunk to provide more context for LLMs. If you only want the
206212
matching chunk, set this to true.
207213
214+
rerank: If true, rerank the results based on the query. This is helpful if you want to
215+
ensure the most relevant results are returned.
216+
208217
rewrite_query: If true, rewrites the query to make it easier to find documents. This increases
209218
the latency by about 400ms
210219
@@ -232,6 +241,7 @@ async def execute(
232241
"include_summary": include_summary,
233242
"limit": limit,
234243
"only_matching_chunks": only_matching_chunks,
244+
"rerank": rerank,
235245
"rewrite_query": rewrite_query,
236246
"user_id": user_id,
237247
},

src/supermemory/types/memory_list_response.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@
1313

1414
class Memory(BaseModel):
1515
id: str
16-
"""Unique identifier of the memory"""
16+
"""Unique identifier of the memory.
17+
18+
This is your user's id in your system or database.
19+
"""
1720

1821
content: Optional[str] = None
1922
"""Content of the memory"""

src/supermemory/types/search_execute_params.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ class SearchExecuteParams(TypedDict, total=False):
5858
If you only want the matching chunk, set this to true.
5959
"""
6060

61+
rerank: bool
62+
"""If true, rerank the results based on the query.
63+
64+
This is helpful if you want to ensure the most relevant results are returned.
65+
"""
66+
6167
rewrite_query: Annotated[bool, PropertyInfo(alias="rewriteQuery")]
6268
"""If true, rewrites the query to make it easier to find documents.
6369

tests/api_resources/test_search.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ def test_method_execute_with_all_params(self, client: Supermemory) -> None:
5454
include_summary=False,
5555
limit=10,
5656
only_matching_chunks=False,
57+
rerank=False,
5758
rewrite_query=False,
5859
user_id="user_123",
5960
)
@@ -126,6 +127,7 @@ async def test_method_execute_with_all_params(self, async_client: AsyncSupermemo
126127
include_summary=False,
127128
limit=10,
128129
only_matching_chunks=False,
130+
rerank=False,
129131
rewrite_query=False,
130132
user_id="user_123",
131133
)

0 commit comments

Comments
 (0)