Skip to content

Commit 844d56e

Browse files
feat(api): api update
1 parent fda6f9f commit 844d56e

File tree

5 files changed

+23
-2
lines changed

5 files changed

+23
-2
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-aebc3d012c87df9d5cb4d651a374fceefb5154e74c70f51d927c76b923267a85.yml
3-
openapi_spec_hash: 98493a823305edac2c711cd052971f3d
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-b581efe40ff877fc21a621d2e1b9419bf8126142f14f818416f69f6ffa376ddb.yml
3+
openapi_spec_hash: 6e730fceb0f977b607e8d08d52f5e252
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+
rewrite_query: bool | NotGiven = NOT_GIVEN,
5960
user_id: str | NotGiven = NOT_GIVEN,
6061
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
6162
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -87,6 +88,9 @@ def execute(
8788
8889
only_matching_chunks: If true, only return matching chunks without context
8990
91+
rewrite_query: If true, rewrites the query to make it easier to find documents. This increases
92+
the latency by about 400ms
93+
9094
user_id: End user ID this search is associated with
9195
9296
extra_headers: Send extra headers
@@ -110,6 +114,7 @@ def execute(
110114
"include_summary": include_summary,
111115
"limit": limit,
112116
"only_matching_chunks": only_matching_chunks,
117+
"rewrite_query": rewrite_query,
113118
"user_id": user_id,
114119
},
115120
search_execute_params.SearchExecuteParams,
@@ -153,6 +158,7 @@ async def execute(
153158
include_summary: bool | NotGiven = NOT_GIVEN,
154159
limit: int | NotGiven = NOT_GIVEN,
155160
only_matching_chunks: bool | NotGiven = NOT_GIVEN,
161+
rewrite_query: bool | NotGiven = NOT_GIVEN,
156162
user_id: str | NotGiven = NOT_GIVEN,
157163
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
158164
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -184,6 +190,9 @@ async def execute(
184190
185191
only_matching_chunks: If true, only return matching chunks without context
186192
193+
rewrite_query: If true, rewrites the query to make it easier to find documents. This increases
194+
the latency by about 400ms
195+
187196
user_id: End user ID this search is associated with
188197
189198
extra_headers: Send extra headers
@@ -207,6 +216,7 @@ async def execute(
207216
"include_summary": include_summary,
208217
"limit": limit,
209218
"only_matching_chunks": only_matching_chunks,
219+
"rewrite_query": rewrite_query,
210220
"user_id": user_id,
211221
},
212222
search_execute_params.SearchExecuteParams,

src/supermemory/types/memory_list_response.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ class Memory(BaseModel):
1515
id: str
1616
"""Unique identifier of the memory"""
1717

18+
content: Optional[str] = None
19+
"""Content of the memory"""
20+
1821
created_at: datetime = FieldInfo(alias="createdAt")
1922
"""Creation timestamp"""
2023

src/supermemory/types/search_execute_params.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ class SearchExecuteParams(TypedDict, total=False):
4343
only_matching_chunks: Annotated[bool, PropertyInfo(alias="onlyMatchingChunks")]
4444
"""If true, only return matching chunks without context"""
4545

46+
rewrite_query: Annotated[bool, PropertyInfo(alias="rewriteQuery")]
47+
"""If true, rewrites the query to make it easier to find documents.
48+
49+
This increases the latency by about 400ms
50+
"""
51+
4652
user_id: Annotated[str, PropertyInfo(alias="userId")]
4753
"""End user ID this search is associated with"""
4854

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+
rewrite_query=False,
5758
user_id="user_123",
5859
)
5960
assert_matches_type(SearchExecuteResponse, search, path=["response"])
@@ -125,6 +126,7 @@ async def test_method_execute_with_all_params(self, async_client: AsyncSupermemo
125126
include_summary=False,
126127
limit=10,
127128
only_matching_chunks=False,
129+
rewrite_query=False,
128130
user_id="user_123",
129131
)
130132
assert_matches_type(SearchExecuteResponse, search, path=["response"])

0 commit comments

Comments
 (0)