supermemory 0.1.0a1__py3-none-any.whl → 3.0.0a1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. supermemory/__init__.py +5 -0
  2. supermemory/_client.py +29 -29
  3. supermemory/_files.py +1 -1
  4. supermemory/_utils/_proxy.py +4 -1
  5. supermemory/_utils/_resources_proxy.py +24 -0
  6. supermemory/_version.py +1 -1
  7. supermemory/resources/__init__.py +33 -33
  8. supermemory/resources/{connection.py → connections.py} +154 -61
  9. supermemory/resources/{memory.py → memories.py} +264 -88
  10. supermemory/resources/search.py +92 -50
  11. supermemory/resources/settings.py +58 -11
  12. supermemory/types/__init__.py +10 -2
  13. supermemory/types/connection_create_params.py +5 -2
  14. supermemory/types/connection_create_response.py +7 -1
  15. supermemory/types/connection_get_response.py +21 -0
  16. supermemory/types/connection_list_params.py +13 -0
  17. supermemory/types/connection_list_response.py +25 -0
  18. supermemory/types/memory_add_params.py +18 -0
  19. supermemory/types/{memory_create_response.py → memory_add_response.py} +2 -2
  20. supermemory/types/memory_get_response.py +3 -19
  21. supermemory/types/memory_list_response.py +48 -12
  22. supermemory/types/memory_update_params.py +18 -0
  23. supermemory/types/memory_update_response.py +11 -0
  24. supermemory/types/memory_upload_file_params.py +13 -0
  25. supermemory/types/memory_upload_file_response.py +11 -0
  26. supermemory/types/search_execute_params.py +36 -6
  27. supermemory/types/setting_get_response.py +11 -0
  28. supermemory/types/setting_update_params.py +4 -12
  29. supermemory/types/setting_update_response.py +3 -11
  30. {supermemory-0.1.0a1.dist-info → supermemory-3.0.0a1.dist-info}/METADATA +24 -7
  31. supermemory-3.0.0a1.dist-info/RECORD +56 -0
  32. supermemory/types/memory_create_params.py +0 -23
  33. supermemory-0.1.0a1.dist-info/RECORD +0 -47
  34. {supermemory-0.1.0a1.dist-info → supermemory-3.0.0a1.dist-info}/WHEEL +0 -0
  35. {supermemory-0.1.0a1.dist-info → supermemory-3.0.0a1.dist-info}/licenses/LICENSE +0 -0
@@ -56,6 +56,8 @@ class SearchResource(SyncAPIResource):
56
56
  include_summary: bool | NotGiven = NOT_GIVEN,
57
57
  limit: int | NotGiven = NOT_GIVEN,
58
58
  only_matching_chunks: bool | NotGiven = NOT_GIVEN,
59
+ rerank: bool | NotGiven = NOT_GIVEN,
60
+ rewrite_query: bool | NotGiven = NOT_GIVEN,
59
61
  user_id: str | NotGiven = NOT_GIVEN,
60
62
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
61
63
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -65,29 +67,43 @@ class SearchResource(SyncAPIResource):
65
67
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
66
68
  ) -> SearchExecuteResponse:
67
69
  """
68
- Search through documents with metadata filtering
70
+ Search memories with filtering
69
71
 
70
72
  Args:
71
73
  q: Search query string
72
74
 
73
75
  categories_filter: Optional category filters
74
76
 
75
- chunk_threshold: Maximum number of chunks to return
77
+ chunk_threshold: Threshold / sensitivity for chunk selection. 0 is least sensitive (returns most
78
+ chunks, more results), 1 is most sensitive (returns lesser chunks, accurate
79
+ results)
76
80
 
77
- doc_id: Optional document ID to search within
81
+ doc_id: Optional document ID to search within. You can use this to find chunks in a very
82
+ large document.
78
83
 
79
- document_threshold: Maximum number of documents to return
84
+ document_threshold: Threshold / sensitivity for document selection. 0 is least sensitive (returns
85
+ most documents, more results), 1 is most sensitive (returns lesser documents,
86
+ accurate results)
80
87
 
81
88
  filters: Optional filters to apply to the search
82
89
 
83
90
  include_summary: If true, include document summary in the response. This is helpful if you want a
84
- chatbot to know the context of the document.
91
+ chatbot to know the full context of the document.
85
92
 
86
93
  limit: Maximum number of results to return
87
94
 
88
- only_matching_chunks: If true, only return matching chunks without context
95
+ only_matching_chunks: If true, only return matching chunks without context. Normally, we send the
96
+ previous and next chunk to provide more context for LLMs. If you only want the
97
+ matching chunk, set this to true.
89
98
 
90
- user_id: End user ID this search is associated with
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
+
102
+ rewrite_query: If true, rewrites the query to make it easier to find documents. This increases
103
+ the latency by about 400ms
104
+
105
+ user_id: End user ID this search is associated with. NOTE: This also acts as a filter for
106
+ the search.
91
107
 
92
108
  extra_headers: Send extra headers
93
109
 
@@ -97,25 +113,30 @@ class SearchResource(SyncAPIResource):
97
113
 
98
114
  timeout: Override the client-level default timeout for this request, in seconds
99
115
  """
100
- return self._post(
101
- "/search",
102
- body=maybe_transform(
103
- {
104
- "q": q,
105
- "categories_filter": categories_filter,
106
- "chunk_threshold": chunk_threshold,
107
- "doc_id": doc_id,
108
- "document_threshold": document_threshold,
109
- "filters": filters,
110
- "include_summary": include_summary,
111
- "limit": limit,
112
- "only_matching_chunks": only_matching_chunks,
113
- "user_id": user_id,
114
- },
115
- search_execute_params.SearchExecuteParams,
116
- ),
116
+ return self._get(
117
+ "/v3/search",
117
118
  options=make_request_options(
118
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
119
+ extra_headers=extra_headers,
120
+ extra_query=extra_query,
121
+ extra_body=extra_body,
122
+ timeout=timeout,
123
+ query=maybe_transform(
124
+ {
125
+ "q": q,
126
+ "categories_filter": categories_filter,
127
+ "chunk_threshold": chunk_threshold,
128
+ "doc_id": doc_id,
129
+ "document_threshold": document_threshold,
130
+ "filters": filters,
131
+ "include_summary": include_summary,
132
+ "limit": limit,
133
+ "only_matching_chunks": only_matching_chunks,
134
+ "rerank": rerank,
135
+ "rewrite_query": rewrite_query,
136
+ "user_id": user_id,
137
+ },
138
+ search_execute_params.SearchExecuteParams,
139
+ ),
119
140
  ),
120
141
  cast_to=SearchExecuteResponse,
121
142
  )
@@ -153,6 +174,8 @@ class AsyncSearchResource(AsyncAPIResource):
153
174
  include_summary: bool | NotGiven = NOT_GIVEN,
154
175
  limit: int | NotGiven = NOT_GIVEN,
155
176
  only_matching_chunks: bool | NotGiven = NOT_GIVEN,
177
+ rerank: bool | NotGiven = NOT_GIVEN,
178
+ rewrite_query: bool | NotGiven = NOT_GIVEN,
156
179
  user_id: str | NotGiven = NOT_GIVEN,
157
180
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
158
181
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -162,29 +185,43 @@ class AsyncSearchResource(AsyncAPIResource):
162
185
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
163
186
  ) -> SearchExecuteResponse:
164
187
  """
165
- Search through documents with metadata filtering
188
+ Search memories with filtering
166
189
 
167
190
  Args:
168
191
  q: Search query string
169
192
 
170
193
  categories_filter: Optional category filters
171
194
 
172
- chunk_threshold: Maximum number of chunks to return
195
+ chunk_threshold: Threshold / sensitivity for chunk selection. 0 is least sensitive (returns most
196
+ chunks, more results), 1 is most sensitive (returns lesser chunks, accurate
197
+ results)
173
198
 
174
- doc_id: Optional document ID to search within
199
+ doc_id: Optional document ID to search within. You can use this to find chunks in a very
200
+ large document.
175
201
 
176
- document_threshold: Maximum number of documents to return
202
+ document_threshold: Threshold / sensitivity for document selection. 0 is least sensitive (returns
203
+ most documents, more results), 1 is most sensitive (returns lesser documents,
204
+ accurate results)
177
205
 
178
206
  filters: Optional filters to apply to the search
179
207
 
180
208
  include_summary: If true, include document summary in the response. This is helpful if you want a
181
- chatbot to know the context of the document.
209
+ chatbot to know the full context of the document.
182
210
 
183
211
  limit: Maximum number of results to return
184
212
 
185
- only_matching_chunks: If true, only return matching chunks without context
213
+ only_matching_chunks: If true, only return matching chunks without context. Normally, we send the
214
+ previous and next chunk to provide more context for LLMs. If you only want the
215
+ matching chunk, set this to true.
186
216
 
187
- user_id: End user ID this search is associated with
217
+ rerank: If true, rerank the results based on the query. This is helpful if you want to
218
+ ensure the most relevant results are returned.
219
+
220
+ rewrite_query: If true, rewrites the query to make it easier to find documents. This increases
221
+ the latency by about 400ms
222
+
223
+ user_id: End user ID this search is associated with. NOTE: This also acts as a filter for
224
+ the search.
188
225
 
189
226
  extra_headers: Send extra headers
190
227
 
@@ -194,25 +231,30 @@ class AsyncSearchResource(AsyncAPIResource):
194
231
 
195
232
  timeout: Override the client-level default timeout for this request, in seconds
196
233
  """
197
- return await self._post(
198
- "/search",
199
- body=await async_maybe_transform(
200
- {
201
- "q": q,
202
- "categories_filter": categories_filter,
203
- "chunk_threshold": chunk_threshold,
204
- "doc_id": doc_id,
205
- "document_threshold": document_threshold,
206
- "filters": filters,
207
- "include_summary": include_summary,
208
- "limit": limit,
209
- "only_matching_chunks": only_matching_chunks,
210
- "user_id": user_id,
211
- },
212
- search_execute_params.SearchExecuteParams,
213
- ),
234
+ return await self._get(
235
+ "/v3/search",
214
236
  options=make_request_options(
215
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
237
+ extra_headers=extra_headers,
238
+ extra_query=extra_query,
239
+ extra_body=extra_body,
240
+ timeout=timeout,
241
+ query=await async_maybe_transform(
242
+ {
243
+ "q": q,
244
+ "categories_filter": categories_filter,
245
+ "chunk_threshold": chunk_threshold,
246
+ "doc_id": doc_id,
247
+ "document_threshold": document_threshold,
248
+ "filters": filters,
249
+ "include_summary": include_summary,
250
+ "limit": limit,
251
+ "only_matching_chunks": only_matching_chunks,
252
+ "rerank": rerank,
253
+ "rewrite_query": rewrite_query,
254
+ "user_id": user_id,
255
+ },
256
+ search_execute_params.SearchExecuteParams,
257
+ ),
216
258
  ),
217
259
  cast_to=SearchExecuteResponse,
218
260
  )
@@ -2,7 +2,7 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import List, Iterable
5
+ from typing import Dict, List
6
6
 
7
7
  import httpx
8
8
 
@@ -18,6 +18,7 @@ from .._response import (
18
18
  async_to_streamed_response_wrapper,
19
19
  )
20
20
  from .._base_client import make_request_options
21
+ from ..types.setting_get_response import SettingGetResponse
21
22
  from ..types.setting_update_response import SettingUpdateResponse
22
23
 
23
24
  __all__ = ["SettingsResource", "AsyncSettingsResource"]
@@ -46,10 +47,9 @@ class SettingsResource(SyncAPIResource):
46
47
  def update(
47
48
  self,
48
49
  *,
49
- categories: List[str] | NotGiven = NOT_GIVEN,
50
50
  exclude_items: List[str] | NotGiven = NOT_GIVEN,
51
51
  filter_prompt: str | NotGiven = NOT_GIVEN,
52
- filter_tags: Iterable[setting_update_params.FilterTag] | NotGiven = NOT_GIVEN,
52
+ filter_tags: Dict[str, List[str]] | NotGiven = NOT_GIVEN,
53
53
  include_items: List[str] | NotGiven = NOT_GIVEN,
54
54
  should_llm_filter: bool | NotGiven = NOT_GIVEN,
55
55
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -71,11 +71,10 @@ class SettingsResource(SyncAPIResource):
71
71
 
72
72
  timeout: Override the client-level default timeout for this request, in seconds
73
73
  """
74
- return self._put(
75
- "/settings",
74
+ return self._patch(
75
+ "/v3/settings",
76
76
  body=maybe_transform(
77
77
  {
78
- "categories": categories,
79
78
  "exclude_items": exclude_items,
80
79
  "filter_prompt": filter_prompt,
81
80
  "filter_tags": filter_tags,
@@ -90,6 +89,25 @@ class SettingsResource(SyncAPIResource):
90
89
  cast_to=SettingUpdateResponse,
91
90
  )
92
91
 
92
+ def get(
93
+ self,
94
+ *,
95
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
96
+ # The extra values given here take precedence over values defined on the client or passed to this method.
97
+ extra_headers: Headers | None = None,
98
+ extra_query: Query | None = None,
99
+ extra_body: Body | None = None,
100
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
101
+ ) -> SettingGetResponse:
102
+ """Get settings for an organization"""
103
+ return self._get(
104
+ "/v3/settings",
105
+ options=make_request_options(
106
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
107
+ ),
108
+ cast_to=SettingGetResponse,
109
+ )
110
+
93
111
 
94
112
  class AsyncSettingsResource(AsyncAPIResource):
95
113
  @cached_property
@@ -114,10 +132,9 @@ class AsyncSettingsResource(AsyncAPIResource):
114
132
  async def update(
115
133
  self,
116
134
  *,
117
- categories: List[str] | NotGiven = NOT_GIVEN,
118
135
  exclude_items: List[str] | NotGiven = NOT_GIVEN,
119
136
  filter_prompt: str | NotGiven = NOT_GIVEN,
120
- filter_tags: Iterable[setting_update_params.FilterTag] | NotGiven = NOT_GIVEN,
137
+ filter_tags: Dict[str, List[str]] | NotGiven = NOT_GIVEN,
121
138
  include_items: List[str] | NotGiven = NOT_GIVEN,
122
139
  should_llm_filter: bool | NotGiven = NOT_GIVEN,
123
140
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -139,11 +156,10 @@ class AsyncSettingsResource(AsyncAPIResource):
139
156
 
140
157
  timeout: Override the client-level default timeout for this request, in seconds
141
158
  """
142
- return await self._put(
143
- "/settings",
159
+ return await self._patch(
160
+ "/v3/settings",
144
161
  body=await async_maybe_transform(
145
162
  {
146
- "categories": categories,
147
163
  "exclude_items": exclude_items,
148
164
  "filter_prompt": filter_prompt,
149
165
  "filter_tags": filter_tags,
@@ -158,6 +174,25 @@ class AsyncSettingsResource(AsyncAPIResource):
158
174
  cast_to=SettingUpdateResponse,
159
175
  )
160
176
 
177
+ async def get(
178
+ self,
179
+ *,
180
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
181
+ # The extra values given here take precedence over values defined on the client or passed to this method.
182
+ extra_headers: Headers | None = None,
183
+ extra_query: Query | None = None,
184
+ extra_body: Body | None = None,
185
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
186
+ ) -> SettingGetResponse:
187
+ """Get settings for an organization"""
188
+ return await self._get(
189
+ "/v3/settings",
190
+ options=make_request_options(
191
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
192
+ ),
193
+ cast_to=SettingGetResponse,
194
+ )
195
+
161
196
 
162
197
  class SettingsResourceWithRawResponse:
163
198
  def __init__(self, settings: SettingsResource) -> None:
@@ -166,6 +201,9 @@ class SettingsResourceWithRawResponse:
166
201
  self.update = to_raw_response_wrapper(
167
202
  settings.update,
168
203
  )
204
+ self.get = to_raw_response_wrapper(
205
+ settings.get,
206
+ )
169
207
 
170
208
 
171
209
  class AsyncSettingsResourceWithRawResponse:
@@ -175,6 +213,9 @@ class AsyncSettingsResourceWithRawResponse:
175
213
  self.update = async_to_raw_response_wrapper(
176
214
  settings.update,
177
215
  )
216
+ self.get = async_to_raw_response_wrapper(
217
+ settings.get,
218
+ )
178
219
 
179
220
 
180
221
  class SettingsResourceWithStreamingResponse:
@@ -184,6 +225,9 @@ class SettingsResourceWithStreamingResponse:
184
225
  self.update = to_streamed_response_wrapper(
185
226
  settings.update,
186
227
  )
228
+ self.get = to_streamed_response_wrapper(
229
+ settings.get,
230
+ )
187
231
 
188
232
 
189
233
  class AsyncSettingsResourceWithStreamingResponse:
@@ -193,3 +237,6 @@ class AsyncSettingsResourceWithStreamingResponse:
193
237
  self.update = async_to_streamed_response_wrapper(
194
238
  settings.update,
195
239
  )
240
+ self.get = async_to_streamed_response_wrapper(
241
+ settings.get,
242
+ )
@@ -2,15 +2,23 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
+ from .memory_add_params import MemoryAddParams as MemoryAddParams
5
6
  from .memory_list_params import MemoryListParams as MemoryListParams
7
+ from .memory_add_response import MemoryAddResponse as MemoryAddResponse
6
8
  from .memory_get_response import MemoryGetResponse as MemoryGetResponse
7
- from .memory_create_params import MemoryCreateParams as MemoryCreateParams
8
9
  from .memory_list_response import MemoryListResponse as MemoryListResponse
10
+ from .memory_update_params import MemoryUpdateParams as MemoryUpdateParams
11
+ from .setting_get_response import SettingGetResponse as SettingGetResponse
9
12
  from .search_execute_params import SearchExecuteParams as SearchExecuteParams
10
13
  from .setting_update_params import SettingUpdateParams as SettingUpdateParams
11
- from .memory_create_response import MemoryCreateResponse as MemoryCreateResponse
14
+ from .connection_list_params import ConnectionListParams as ConnectionListParams
12
15
  from .memory_delete_response import MemoryDeleteResponse as MemoryDeleteResponse
16
+ from .memory_update_response import MemoryUpdateResponse as MemoryUpdateResponse
17
+ from .connection_get_response import ConnectionGetResponse as ConnectionGetResponse
13
18
  from .search_execute_response import SearchExecuteResponse as SearchExecuteResponse
14
19
  from .setting_update_response import SettingUpdateResponse as SettingUpdateResponse
15
20
  from .connection_create_params import ConnectionCreateParams as ConnectionCreateParams
21
+ from .connection_list_response import ConnectionListResponse as ConnectionListResponse
22
+ from .memory_upload_file_params import MemoryUploadFileParams as MemoryUploadFileParams
16
23
  from .connection_create_response import ConnectionCreateResponse as ConnectionCreateResponse
24
+ from .memory_upload_file_response import MemoryUploadFileResponse as MemoryUploadFileResponse
@@ -2,7 +2,8 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing_extensions import Required, Annotated, TypedDict
5
+ from typing import Dict, Union, Optional
6
+ from typing_extensions import Annotated, TypedDict
6
7
 
7
8
  from .._utils import PropertyInfo
8
9
 
@@ -10,6 +11,8 @@ __all__ = ["ConnectionCreateParams"]
10
11
 
11
12
 
12
13
  class ConnectionCreateParams(TypedDict, total=False):
13
- id: Required[str]
14
+ end_user_id: Annotated[str, PropertyInfo(alias="endUserId")]
14
15
 
15
16
  redirect_url: Annotated[str, PropertyInfo(alias="redirectUrl")]
17
+
18
+ metadata: Optional[Dict[str, Union[str, float, bool]]]
@@ -1,5 +1,7 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
+ from typing import Optional
4
+
3
5
  from pydantic import Field as FieldInfo
4
6
 
5
7
  from .._models import BaseModel
@@ -8,6 +10,10 @@ __all__ = ["ConnectionCreateResponse"]
8
10
 
9
11
 
10
12
  class ConnectionCreateResponse(BaseModel):
13
+ id: str
14
+
15
+ auth_link: str = FieldInfo(alias="authLink")
16
+
11
17
  expires_in: str = FieldInfo(alias="expiresIn")
12
18
 
13
- magic_link: str = FieldInfo(alias="magicLink")
19
+ redirects_to: Optional[str] = FieldInfo(alias="redirectsTo", default=None)
@@ -0,0 +1,21 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import Dict, Optional
4
+
5
+ from pydantic import Field as FieldInfo
6
+
7
+ from .._models import BaseModel
8
+
9
+ __all__ = ["ConnectionGetResponse"]
10
+
11
+
12
+ class ConnectionGetResponse(BaseModel):
13
+ id: str
14
+
15
+ created_at: float = FieldInfo(alias="createdAt")
16
+
17
+ provider: str
18
+
19
+ expires_at: Optional[float] = FieldInfo(alias="expiresAt", default=None)
20
+
21
+ metadata: Optional[Dict[str, object]] = None
@@ -0,0 +1,13 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing_extensions import Annotated, TypedDict
6
+
7
+ from .._utils import PropertyInfo
8
+
9
+ __all__ = ["ConnectionListParams"]
10
+
11
+
12
+ class ConnectionListParams(TypedDict, total=False):
13
+ end_user_id: Annotated[str, PropertyInfo(alias="endUserId")]
@@ -0,0 +1,25 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import Dict, List, Optional
4
+ from typing_extensions import TypeAlias
5
+
6
+ from pydantic import Field as FieldInfo
7
+
8
+ from .._models import BaseModel
9
+
10
+ __all__ = ["ConnectionListResponse", "ConnectionListResponseItem"]
11
+
12
+
13
+ class ConnectionListResponseItem(BaseModel):
14
+ id: str
15
+
16
+ created_at: float = FieldInfo(alias="createdAt")
17
+
18
+ provider: str
19
+
20
+ expires_at: Optional[float] = FieldInfo(alias="expiresAt", default=None)
21
+
22
+ metadata: Optional[Dict[str, object]] = None
23
+
24
+
25
+ ConnectionListResponse: TypeAlias = List[ConnectionListResponseItem]
@@ -0,0 +1,18 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Dict, List, Union
6
+ from typing_extensions import Required, Annotated, TypedDict
7
+
8
+ from .._utils import PropertyInfo
9
+
10
+ __all__ = ["MemoryAddParams"]
11
+
12
+
13
+ class MemoryAddParams(TypedDict, total=False):
14
+ content: Required[str]
15
+
16
+ container_tags: Annotated[List[str], PropertyInfo(alias="containerTags")]
17
+
18
+ metadata: Dict[str, Union[str, float, bool]]
@@ -2,10 +2,10 @@
2
2
 
3
3
  from .._models import BaseModel
4
4
 
5
- __all__ = ["MemoryCreateResponse"]
5
+ __all__ = ["MemoryAddResponse"]
6
6
 
7
7
 
8
- class MemoryCreateResponse(BaseModel):
8
+ class MemoryAddResponse(BaseModel):
9
9
  id: str
10
10
 
11
11
  status: str
@@ -1,27 +1,11 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- from typing import Dict, Optional
4
-
5
- from pydantic import Field as FieldInfo
6
-
7
3
  from .._models import BaseModel
8
4
 
9
- __all__ = ["MemoryGetResponse", "Doc"]
10
-
11
-
12
- class Doc(BaseModel):
13
- created_at: str = FieldInfo(alias="createdAt")
14
-
15
- updated_at: str = FieldInfo(alias="updatedAt")
16
-
17
- metadata: Optional[Dict[str, object]] = None
18
-
19
- summary: Optional[str] = None
20
-
21
- title: Optional[str] = None
5
+ __all__ = ["MemoryGetResponse"]
22
6
 
23
7
 
24
8
  class MemoryGetResponse(BaseModel):
25
- doc: Doc
9
+ id: str
26
10
 
27
- status: Optional[str] = None
11
+ status: str
@@ -1,6 +1,6 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- from typing import Dict, List, Optional
3
+ from typing import Dict, List, Union, Optional
4
4
  from datetime import datetime
5
5
  from typing_extensions import Literal
6
6
 
@@ -13,33 +13,69 @@ __all__ = ["MemoryListResponse", "Memory", "Pagination"]
13
13
 
14
14
  class Memory(BaseModel):
15
15
  id: str
16
- """Unique identifier of the memory"""
16
+ """Unique identifier of the memory."""
17
+
18
+ content: Optional[str] = None
19
+ """The content to extract and process into a memory.
20
+
21
+ This can be a URL to a website, a PDF, an image, or a video.
22
+
23
+ Plaintext: Any plaintext format
24
+
25
+ URL: A URL to a website, PDF, image, or video
26
+
27
+ We automatically detect the content type from the url's response format.
28
+ """
17
29
 
18
30
  created_at: datetime = FieldInfo(alias="createdAt")
19
31
  """Creation timestamp"""
20
32
 
21
- metadata: Dict[str, object]
22
- """Custom metadata associated with the memory"""
33
+ custom_id: Optional[str] = FieldInfo(alias="customId", default=None)
34
+ """Optional custom ID of the memory.
35
+
36
+ This could be an ID from your database that will uniquely identify this memory.
37
+ """
38
+
39
+ metadata: Union[str, float, bool, Dict[str, object], List[object], None] = None
40
+ """Optional metadata for the memory.
23
41
 
24
- status: Optional[Literal["queued", "extracting", "chunking", "embedding", "indexing", "done", "failed"]] = None
25
- """Processing status of the memory"""
42
+ This is used to store additional information about the memory. You can use this
43
+ to store any additional information you need about the memory. Metadata can be
44
+ filtered through. Keys must be strings and are case sensitive. Values can be
45
+ strings, numbers, or booleans. You cannot nest objects.
46
+ """
47
+
48
+ og_image: Optional[str] = FieldInfo(alias="ogImage", default=None)
49
+
50
+ source: Optional[str] = None
51
+
52
+ status: Literal["unknown", "queued", "extracting", "chunking", "embedding", "indexing", "done", "failed"]
53
+ """Status of the memory"""
26
54
 
27
55
  summary: Optional[str] = None
28
56
  """Summary of the memory content"""
29
57
 
30
- title: str
58
+ title: Optional[str] = None
31
59
  """Title of the memory"""
32
60
 
61
+ type: Literal["text", "pdf", "tweet", "google_doc", "image", "video", "notion_doc", "webpage"]
62
+ """Type of the memory"""
63
+
33
64
  updated_at: datetime = FieldInfo(alias="updatedAt")
34
65
  """Last update timestamp"""
35
66
 
36
67
  url: Optional[str] = None
37
- """Source URL of the memory"""
68
+ """URL of the memory"""
69
+
70
+ container_tags: Optional[List[str]] = FieldInfo(alias="containerTags", default=None)
71
+ """Optional tags this memory should be containerized by.
72
+
73
+ This can be an ID for your user, a project ID, or any other identifier you wish
74
+ to use to group memories.
75
+ """
38
76
 
39
- workflow_status: Optional[Literal["PENDING", "IN_PROGRESS", "COMPLETED", "FAILED"]] = FieldInfo(
40
- alias="workflowStatus", default=None
41
- )
42
- """Current workflow status"""
77
+ raw: None = None
78
+ """Raw content of the memory"""
43
79
 
44
80
 
45
81
  class Pagination(BaseModel):
@@ -0,0 +1,18 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Dict, List, Union
6
+ from typing_extensions import Required, Annotated, TypedDict
7
+
8
+ from .._utils import PropertyInfo
9
+
10
+ __all__ = ["MemoryUpdateParams"]
11
+
12
+
13
+ class MemoryUpdateParams(TypedDict, total=False):
14
+ content: Required[str]
15
+
16
+ container_tags: Annotated[List[str], PropertyInfo(alias="containerTags")]
17
+
18
+ metadata: Dict[str, Union[str, float, bool]]