Skip to content

Commit 28dce44

Browse files
feat(api): api update
1 parent 98127b2 commit 28dce44

11 files changed

Lines changed: 221 additions & 14 deletions

‎.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/supermemory-new-22efc23f9b6792eb4ce96106f7c227a36c008feca20df430490c7b6cb145a703.yml
3-
openapi_spec_hash: f66075689686f6f24a7cb4e47dcffebd
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc/supermemory-new-5ad0e09495301abdcb7a5a63738ce5841248518504e122003219230ef35ed439.yml
3+
openapi_spec_hash: 6462e423d826118caba0292cd5956178
44
config_hash: cde97ef3188581c5f4924c633ec33ddb

‎src/supermemory/types/connection_create_response.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
class ConnectionCreateResponse(BaseModel):
1313
id: str
1414

15-
auth_link: str = FieldInfo(alias="authLink")
15+
auth_link: Optional[str] = FieldInfo(alias="authLink", default=None)
1616

17-
expires_in: str = FieldInfo(alias="expiresIn")
17+
expires_in: Optional[str] = FieldInfo(alias="expiresIn", default=None)
1818

1919
redirects_to: Optional[str] = FieldInfo(alias="redirectsTo", default=None)
Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3+
from typing import List
4+
from typing_extensions import TypeAlias
5+
36
from .._models import BaseModel
47

5-
__all__ = ["ConnectionDeleteByIDResponse"]
8+
__all__ = ["ConnectionDeleteByIDResponse", "ConnectionDeleteByIDResponseItem"]
69

710

8-
class ConnectionDeleteByIDResponse(BaseModel):
11+
class ConnectionDeleteByIDResponseItem(BaseModel):
912
id: str
1013

1114
provider: str
15+
16+
17+
ConnectionDeleteByIDResponse: TypeAlias = List[ConnectionDeleteByIDResponseItem]
Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3+
from typing import List
4+
from typing_extensions import TypeAlias
5+
36
from .._models import BaseModel
47

5-
__all__ = ["ConnectionDeleteByProviderResponse"]
8+
__all__ = ["ConnectionDeleteByProviderResponse", "ConnectionDeleteByProviderResponseItem"]
69

710

8-
class ConnectionDeleteByProviderResponse(BaseModel):
11+
class ConnectionDeleteByProviderResponseItem(BaseModel):
912
id: str
1013

1114
provider: str
15+
16+
17+
ConnectionDeleteByProviderResponse: TypeAlias = List[ConnectionDeleteByProviderResponseItem]

‎src/supermemory/types/connection_list_documents_response.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212

1313
class ConnectionListDocumentsResponseItem(BaseModel):
14-
id: str
14+
id: Optional[str] = None
1515

1616
created_at: str = FieldInfo(alias="createdAt")
1717

‎src/supermemory/types/document_batch_add_response.py‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ class Result(BaseModel):
2020
error: Optional[str] = None
2121
"""Error message when status is 'error'"""
2222

23+
url: Optional[str] = None
24+
"""URL of the failed item, when it had one.
25+
26+
Only present on failed items, where it may be the only way to tell which input
27+
the error belongs to (the id falls back to 'unknown' when the input had neither
28+
an id nor a customId).
29+
"""
30+
2331

2432
class DocumentBatchAddResponse(BaseModel):
2533
failed: float

‎src/supermemory/types/document_list_processing_response.py‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ class Document(BaseModel):
1414
id: str
1515
"""Unique identifier of the document."""
1616

17+
connection_id: Optional[str] = FieldInfo(alias="connectionId", default=None)
18+
"""Optional ID of connection the document was created from.
19+
20+
This is useful for identifying the source of the document.
21+
"""
22+
1723
created_at: str = FieldInfo(alias="createdAt")
1824
"""Creation timestamp"""
1925

@@ -36,6 +42,9 @@ class Document(BaseModel):
3642
status: Literal["unknown", "queued", "extracting", "chunking", "embedding", "indexing", "done", "failed"]
3743
"""Status of the document"""
3844

45+
summary: Optional[str] = None
46+
"""Summary of the document content"""
47+
3948
title: Optional[str] = None
4049
"""Title of the document"""
4150

‎src/supermemory/types/profile_response.py‎

Lines changed: 162 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,24 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
from typing import Dict, List, Optional
4+
from typing_extensions import Literal
45

56
from pydantic import Field as FieldInfo
67

78
from .._models import BaseModel
89

9-
__all__ = ["ProfileResponse", "Profile", "SearchResults"]
10+
__all__ = [
11+
"ProfileResponse",
12+
"Profile",
13+
"SearchResults",
14+
"SearchResultsResult",
15+
"SearchResultsResultChunk",
16+
"SearchResultsResultContext",
17+
"SearchResultsResultContextChild",
18+
"SearchResultsResultContextParent",
19+
"SearchResultsResultContextRelated",
20+
"SearchResultsResultDocument",
21+
]
1022

1123

1224
class Profile(BaseModel):
@@ -20,10 +32,158 @@ class Profile(BaseModel):
2032
"""Static profile information that remains relevant long-term"""
2133

2234

35+
class SearchResultsResultChunk(BaseModel):
36+
content: str
37+
"""Content of the chunk"""
38+
39+
document_id: str = FieldInfo(alias="documentId")
40+
"""ID of the document this chunk belongs to"""
41+
42+
position: float
43+
"""Position of chunk in the document (0-indexed)"""
44+
45+
46+
class SearchResultsResultContextChild(BaseModel):
47+
memory: str
48+
"""The contextual memory content"""
49+
50+
relation: Literal["updates", "extends", "derives"]
51+
"""Relation type between this memory and its parent/child"""
52+
53+
updated_at: str = FieldInfo(alias="updatedAt")
54+
"""Contextual memory last update date"""
55+
56+
metadata: Optional[Dict[str, object]] = None
57+
"""Contextual memory metadata"""
58+
59+
version: Optional[float] = None
60+
"""
61+
Relative version distance from the primary memory (+1 for direct child, +2 for
62+
grand-child, etc.)
63+
"""
64+
65+
66+
class SearchResultsResultContextParent(BaseModel):
67+
memory: str
68+
"""The contextual memory content"""
69+
70+
relation: Literal["updates", "extends", "derives"]
71+
"""Relation type between this memory and its parent/child"""
72+
73+
updated_at: str = FieldInfo(alias="updatedAt")
74+
"""Contextual memory last update date"""
75+
76+
metadata: Optional[Dict[str, object]] = None
77+
"""Contextual memory metadata"""
78+
79+
version: Optional[float] = None
80+
"""
81+
Relative version distance from the primary memory (-1 for direct parent, -2 for
82+
grand-parent, etc.)
83+
"""
84+
85+
86+
class SearchResultsResultContextRelated(BaseModel):
87+
memory: str
88+
"""The related memory content"""
89+
90+
relation: Literal["extends", "derives"]
91+
"""Relation type"""
92+
93+
updated_at: str = FieldInfo(alias="updatedAt")
94+
"""Related memory last update date"""
95+
96+
metadata: Optional[Dict[str, object]] = None
97+
"""Related memory metadata"""
98+
99+
100+
class SearchResultsResultContext(BaseModel):
101+
"""
102+
Object containing version history (parents/children via updates) and related memories (extends/derives)
103+
"""
104+
105+
children: Optional[List[SearchResultsResultContextChild]] = None
106+
107+
parents: Optional[List[SearchResultsResultContextParent]] = None
108+
109+
related: Optional[List[SearchResultsResultContextRelated]] = None
110+
111+
112+
class SearchResultsResultDocument(BaseModel):
113+
id: str
114+
"""Document ID"""
115+
116+
created_at: str = FieldInfo(alias="createdAt")
117+
"""Document creation date"""
118+
119+
updated_at: str = FieldInfo(alias="updatedAt")
120+
"""Document last update date"""
121+
122+
metadata: Optional[Dict[str, object]] = None
123+
"""Document metadata (only included when documents=true)"""
124+
125+
summary: Optional[str] = None
126+
"""Document summary (only included when summaries=true)"""
127+
128+
title: Optional[str] = None
129+
"""Document title (only included when documents=true)"""
130+
131+
type: Optional[str] = None
132+
"""Document type (only included when documents=true)"""
133+
134+
135+
class SearchResultsResult(BaseModel):
136+
id: str
137+
"""Memory entry ID or chunk ID"""
138+
139+
metadata: Optional[Dict[str, object]] = None
140+
"""Memory metadata"""
141+
142+
similarity: float
143+
"""Similarity score between the query and memory entry"""
144+
145+
updated_at: str = FieldInfo(alias="updatedAt")
146+
"""Memory last update date"""
147+
148+
chunk: Optional[str] = None
149+
"""The chunk content (only present for chunk results from hybrid search)"""
150+
151+
chunks: Optional[List[SearchResultsResultChunk]] = None
152+
"""Relevant chunks from associated documents (only included when chunks=true)"""
153+
154+
context: Optional[SearchResultsResultContext] = None
155+
"""
156+
Object containing version history (parents/children via updates) and related
157+
memories (extends/derives)
158+
"""
159+
160+
documents: Optional[List[SearchResultsResultDocument]] = None
161+
"""Associated documents for this memory entry"""
162+
163+
filepath: Optional[str] = None
164+
"""Filepath of the source document this memory or chunk came from"""
165+
166+
is_aggregated: Optional[bool] = FieldInfo(alias="isAggregated", default=None)
167+
"""Indicates if this memory was created by aggregating multiple source memories"""
168+
169+
memory: Optional[str] = None
170+
"""The memory content (only present for memory results)"""
171+
172+
root_memory_id: Optional[str] = FieldInfo(alias="rootMemoryId", default=None)
173+
"""ID of the root (first version) memory entry this one descends from.
174+
175+
Null for memories that have never been superseded. Only present on memory
176+
results, not on standalone chunk results.
177+
"""
178+
179+
version: Optional[float] = None
180+
"""Version number of this memory entry"""
181+
182+
23183
class SearchResults(BaseModel):
24184
"""Search results if a search query was provided"""
25185

26-
results: List[object]
186+
results: List[SearchResultsResult]
27187
"""Search results for the provided query"""
28188

29189
timing: float

‎src/supermemory/types/search_documents_response.py‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ class ResultChunk(BaseModel):
1818
is_relevant: bool = FieldInfo(alias="isRelevant")
1919
"""Whether this chunk is relevant to the query"""
2020

21+
position: float
22+
"""Position of this chunk within the source document (0-indexed).
23+
24+
Use it to order chunks and to locate surrounding context chunks
25+
(isRelevant=false) relative to the matching ones.
26+
"""
27+
2128
score: float
2229
"""Similarity score for this chunk"""
2330

‎src/supermemory/types/search_execute_response.py‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ class ResultChunk(BaseModel):
1818
is_relevant: bool = FieldInfo(alias="isRelevant")
1919
"""Whether this chunk is relevant to the query"""
2020

21+
position: float
22+
"""Position of this chunk within the source document (0-indexed).
23+
24+
Use it to order chunks and to locate surrounding context chunks
25+
(isRelevant=false) relative to the matching ones.
26+
"""
27+
2128
score: float
2229
"""Similarity score for this chunk"""
2330

0 commit comments

Comments
 (0)