Skip to content

Commit 5e2fc3b

Browse files
feat(api): api update
1 parent 6f2429a commit 5e2fc3b

File tree

5 files changed

+26
-2
lines changed

5 files changed

+26
-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: 26
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-e519a815da9102647222f1f73920926f2d8b63d16995d3687213b604963f5ec5.yml
3-
openapi_spec_hash: 4de453d3c2fca716f7f645d4c2c8f921
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-008c99427a2471a387bd071f936b0a1e352b81cea24a7d329719c28c652738df.yml
3+
openapi_spec_hash: b47b3fdce4626adc8193b4c340e340ed
44
config_hash: f3eb5ca71172780678106f6d46f15dda

src/supermemory/resources/search.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ def memories(
245245
self,
246246
*,
247247
q: str,
248+
aggregate: bool | Omit = omit,
248249
container_tag: str | Omit = omit,
249250
filters: search_memories_params.Filters | Omit = omit,
250251
include: search_memories_params.Include | Omit = omit,
@@ -266,6 +267,10 @@ def memories(
266267
Args:
267268
q: Search query string
268269
270+
aggregate: If true, aggregates information from multiple memories to create new synthesized
271+
memories. The result will be a mix of aggregated and non-aggregated memories,
272+
reranked by relevance to the query. Works in conjunction with reranking.
273+
269274
container_tag: Optional tag this search should be containerized by. This can be an ID for your
270275
user, a project ID, or any other identifier you wish to use to filter memories.
271276
@@ -300,6 +305,7 @@ def memories(
300305
body=maybe_transform(
301306
{
302307
"q": q,
308+
"aggregate": aggregate,
303309
"container_tag": container_tag,
304310
"filters": filters,
305311
"include": include,
@@ -538,6 +544,7 @@ async def memories(
538544
self,
539545
*,
540546
q: str,
547+
aggregate: bool | Omit = omit,
541548
container_tag: str | Omit = omit,
542549
filters: search_memories_params.Filters | Omit = omit,
543550
include: search_memories_params.Include | Omit = omit,
@@ -559,6 +566,10 @@ async def memories(
559566
Args:
560567
q: Search query string
561568
569+
aggregate: If true, aggregates information from multiple memories to create new synthesized
570+
memories. The result will be a mix of aggregated and non-aggregated memories,
571+
reranked by relevance to the query. Works in conjunction with reranking.
572+
562573
container_tag: Optional tag this search should be containerized by. This can be an ID for your
563574
user, a project ID, or any other identifier you wish to use to filter memories.
564575
@@ -593,6 +604,7 @@ async def memories(
593604
body=await async_maybe_transform(
594605
{
595606
"q": q,
607+
"aggregate": aggregate,
596608
"container_tag": container_tag,
597609
"filters": filters,
598610
"include": include,

src/supermemory/types/search_memories_params.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,13 @@ class SearchMemoriesParams(TypedDict, total=False):
332332
q: Required[str]
333333
"""Search query string"""
334334

335+
aggregate: bool
336+
"""
337+
If true, aggregates information from multiple memories to create new synthesized
338+
memories. The result will be a mix of aggregated and non-aggregated memories,
339+
reranked by relevance to the query. Works in conjunction with reranking.
340+
"""
341+
335342
container_tag: Annotated[str, PropertyInfo(alias="containerTag")]
336343
"""Optional tag this search should be containerized by.
337344

src/supermemory/types/search_memories_response.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,9 @@ class Result(BaseModel):
128128
documents: Optional[List[ResultDocument]] = None
129129
"""Associated documents for this memory entry"""
130130

131+
is_aggregated: Optional[bool] = FieldInfo(alias="isAggregated", default=None)
132+
"""Indicates if this memory was created by aggregating multiple source memories"""
133+
131134
memory: Optional[str] = None
132135
"""The memory content (only present for memory results)"""
133136

tests/api_resources/test_search.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ def test_method_memories(self, client: Supermemory) -> None:
164164
def test_method_memories_with_all_params(self, client: Supermemory) -> None:
165165
search = client.search.memories(
166166
q="machine learning concepts",
167+
aggregate=False,
167168
container_tag="user_123",
168169
filters={
169170
"or_": [
@@ -367,6 +368,7 @@ async def test_method_memories(self, async_client: AsyncSupermemory) -> None:
367368
async def test_method_memories_with_all_params(self, async_client: AsyncSupermemory) -> None:
368369
search = await async_client.search.memories(
369370
q="machine learning concepts",
371+
aggregate=False,
370372
container_tag="user_123",
371373
filters={
372374
"or_": [

0 commit comments

Comments
 (0)