supermemory 0.1.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 (47) hide show
  1. supermemory/__init__.py +94 -0
  2. supermemory/_base_client.py +1943 -0
  3. supermemory/_client.py +427 -0
  4. supermemory/_compat.py +219 -0
  5. supermemory/_constants.py +14 -0
  6. supermemory/_exceptions.py +108 -0
  7. supermemory/_files.py +123 -0
  8. supermemory/_models.py +803 -0
  9. supermemory/_qs.py +150 -0
  10. supermemory/_resource.py +43 -0
  11. supermemory/_response.py +832 -0
  12. supermemory/_streaming.py +333 -0
  13. supermemory/_types.py +217 -0
  14. supermemory/_utils/__init__.py +57 -0
  15. supermemory/_utils/_logs.py +25 -0
  16. supermemory/_utils/_proxy.py +62 -0
  17. supermemory/_utils/_reflection.py +42 -0
  18. supermemory/_utils/_streams.py +12 -0
  19. supermemory/_utils/_sync.py +86 -0
  20. supermemory/_utils/_transform.py +447 -0
  21. supermemory/_utils/_typing.py +151 -0
  22. supermemory/_utils/_utils.py +422 -0
  23. supermemory/_version.py +4 -0
  24. supermemory/lib/.keep +4 -0
  25. supermemory/py.typed +0 -0
  26. supermemory/resources/__init__.py +61 -0
  27. supermemory/resources/connection.py +267 -0
  28. supermemory/resources/memory.py +487 -0
  29. supermemory/resources/search.py +254 -0
  30. supermemory/resources/settings.py +195 -0
  31. supermemory/types/__init__.py +16 -0
  32. supermemory/types/connection_create_params.py +15 -0
  33. supermemory/types/connection_create_response.py +13 -0
  34. supermemory/types/memory_create_params.py +23 -0
  35. supermemory/types/memory_create_response.py +11 -0
  36. supermemory/types/memory_delete_response.py +9 -0
  37. supermemory/types/memory_get_response.py +27 -0
  38. supermemory/types/memory_list_params.py +24 -0
  39. supermemory/types/memory_list_response.py +59 -0
  40. supermemory/types/search_execute_params.py +56 -0
  41. supermemory/types/search_execute_response.py +52 -0
  42. supermemory/types/setting_update_params.py +30 -0
  43. supermemory/types/setting_update_response.py +35 -0
  44. supermemory-0.1.0a1.dist-info/METADATA +376 -0
  45. supermemory-0.1.0a1.dist-info/RECORD +47 -0
  46. supermemory-0.1.0a1.dist-info/WHEEL +4 -0
  47. supermemory-0.1.0a1.dist-info/licenses/LICENSE +201 -0
@@ -0,0 +1,254 @@
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 List
6
+ from typing_extensions import Literal
7
+
8
+ import httpx
9
+
10
+ from ..types import search_execute_params
11
+ from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
12
+ from .._utils import maybe_transform, async_maybe_transform
13
+ from .._compat import cached_property
14
+ from .._resource import SyncAPIResource, AsyncAPIResource
15
+ from .._response import (
16
+ to_raw_response_wrapper,
17
+ to_streamed_response_wrapper,
18
+ async_to_raw_response_wrapper,
19
+ async_to_streamed_response_wrapper,
20
+ )
21
+ from .._base_client import make_request_options
22
+ from ..types.search_execute_response import SearchExecuteResponse
23
+
24
+ __all__ = ["SearchResource", "AsyncSearchResource"]
25
+
26
+
27
+ class SearchResource(SyncAPIResource):
28
+ @cached_property
29
+ def with_raw_response(self) -> SearchResourceWithRawResponse:
30
+ """
31
+ This property can be used as a prefix for any HTTP method call to return
32
+ the raw response object instead of the parsed content.
33
+
34
+ For more information, see https://www.github.com/supermemoryai/python-sdk#accessing-raw-response-data-eg-headers
35
+ """
36
+ return SearchResourceWithRawResponse(self)
37
+
38
+ @cached_property
39
+ def with_streaming_response(self) -> SearchResourceWithStreamingResponse:
40
+ """
41
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
42
+
43
+ For more information, see https://www.github.com/supermemoryai/python-sdk#with_streaming_response
44
+ """
45
+ return SearchResourceWithStreamingResponse(self)
46
+
47
+ def execute(
48
+ self,
49
+ *,
50
+ q: str,
51
+ categories_filter: List[Literal["technology", "science", "business", "health"]] | NotGiven = NOT_GIVEN,
52
+ chunk_threshold: float | NotGiven = NOT_GIVEN,
53
+ doc_id: str | NotGiven = NOT_GIVEN,
54
+ document_threshold: float | NotGiven = NOT_GIVEN,
55
+ filters: search_execute_params.Filters | NotGiven = NOT_GIVEN,
56
+ include_summary: bool | NotGiven = NOT_GIVEN,
57
+ limit: int | NotGiven = NOT_GIVEN,
58
+ only_matching_chunks: bool | NotGiven = NOT_GIVEN,
59
+ user_id: str | NotGiven = NOT_GIVEN,
60
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
61
+ # The extra values given here take precedence over values defined on the client or passed to this method.
62
+ extra_headers: Headers | None = None,
63
+ extra_query: Query | None = None,
64
+ extra_body: Body | None = None,
65
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
66
+ ) -> SearchExecuteResponse:
67
+ """
68
+ Search through documents with metadata filtering
69
+
70
+ Args:
71
+ q: Search query string
72
+
73
+ categories_filter: Optional category filters
74
+
75
+ chunk_threshold: Maximum number of chunks to return
76
+
77
+ doc_id: Optional document ID to search within
78
+
79
+ document_threshold: Maximum number of documents to return
80
+
81
+ filters: Optional filters to apply to the search
82
+
83
+ 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.
85
+
86
+ limit: Maximum number of results to return
87
+
88
+ only_matching_chunks: If true, only return matching chunks without context
89
+
90
+ user_id: End user ID this search is associated with
91
+
92
+ extra_headers: Send extra headers
93
+
94
+ extra_query: Add additional query parameters to the request
95
+
96
+ extra_body: Add additional JSON properties to the request
97
+
98
+ timeout: Override the client-level default timeout for this request, in seconds
99
+ """
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
+ ),
117
+ options=make_request_options(
118
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
119
+ ),
120
+ cast_to=SearchExecuteResponse,
121
+ )
122
+
123
+
124
+ class AsyncSearchResource(AsyncAPIResource):
125
+ @cached_property
126
+ def with_raw_response(self) -> AsyncSearchResourceWithRawResponse:
127
+ """
128
+ This property can be used as a prefix for any HTTP method call to return
129
+ the raw response object instead of the parsed content.
130
+
131
+ For more information, see https://www.github.com/supermemoryai/python-sdk#accessing-raw-response-data-eg-headers
132
+ """
133
+ return AsyncSearchResourceWithRawResponse(self)
134
+
135
+ @cached_property
136
+ def with_streaming_response(self) -> AsyncSearchResourceWithStreamingResponse:
137
+ """
138
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
139
+
140
+ For more information, see https://www.github.com/supermemoryai/python-sdk#with_streaming_response
141
+ """
142
+ return AsyncSearchResourceWithStreamingResponse(self)
143
+
144
+ async def execute(
145
+ self,
146
+ *,
147
+ q: str,
148
+ categories_filter: List[Literal["technology", "science", "business", "health"]] | NotGiven = NOT_GIVEN,
149
+ chunk_threshold: float | NotGiven = NOT_GIVEN,
150
+ doc_id: str | NotGiven = NOT_GIVEN,
151
+ document_threshold: float | NotGiven = NOT_GIVEN,
152
+ filters: search_execute_params.Filters | NotGiven = NOT_GIVEN,
153
+ include_summary: bool | NotGiven = NOT_GIVEN,
154
+ limit: int | NotGiven = NOT_GIVEN,
155
+ only_matching_chunks: bool | NotGiven = NOT_GIVEN,
156
+ user_id: str | NotGiven = NOT_GIVEN,
157
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
158
+ # The extra values given here take precedence over values defined on the client or passed to this method.
159
+ extra_headers: Headers | None = None,
160
+ extra_query: Query | None = None,
161
+ extra_body: Body | None = None,
162
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
163
+ ) -> SearchExecuteResponse:
164
+ """
165
+ Search through documents with metadata filtering
166
+
167
+ Args:
168
+ q: Search query string
169
+
170
+ categories_filter: Optional category filters
171
+
172
+ chunk_threshold: Maximum number of chunks to return
173
+
174
+ doc_id: Optional document ID to search within
175
+
176
+ document_threshold: Maximum number of documents to return
177
+
178
+ filters: Optional filters to apply to the search
179
+
180
+ 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.
182
+
183
+ limit: Maximum number of results to return
184
+
185
+ only_matching_chunks: If true, only return matching chunks without context
186
+
187
+ user_id: End user ID this search is associated with
188
+
189
+ extra_headers: Send extra headers
190
+
191
+ extra_query: Add additional query parameters to the request
192
+
193
+ extra_body: Add additional JSON properties to the request
194
+
195
+ timeout: Override the client-level default timeout for this request, in seconds
196
+ """
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
+ ),
214
+ options=make_request_options(
215
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
216
+ ),
217
+ cast_to=SearchExecuteResponse,
218
+ )
219
+
220
+
221
+ class SearchResourceWithRawResponse:
222
+ def __init__(self, search: SearchResource) -> None:
223
+ self._search = search
224
+
225
+ self.execute = to_raw_response_wrapper(
226
+ search.execute,
227
+ )
228
+
229
+
230
+ class AsyncSearchResourceWithRawResponse:
231
+ def __init__(self, search: AsyncSearchResource) -> None:
232
+ self._search = search
233
+
234
+ self.execute = async_to_raw_response_wrapper(
235
+ search.execute,
236
+ )
237
+
238
+
239
+ class SearchResourceWithStreamingResponse:
240
+ def __init__(self, search: SearchResource) -> None:
241
+ self._search = search
242
+
243
+ self.execute = to_streamed_response_wrapper(
244
+ search.execute,
245
+ )
246
+
247
+
248
+ class AsyncSearchResourceWithStreamingResponse:
249
+ def __init__(self, search: AsyncSearchResource) -> None:
250
+ self._search = search
251
+
252
+ self.execute = async_to_streamed_response_wrapper(
253
+ search.execute,
254
+ )
@@ -0,0 +1,195 @@
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 List, Iterable
6
+
7
+ import httpx
8
+
9
+ from ..types import setting_update_params
10
+ from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
11
+ from .._utils import maybe_transform, async_maybe_transform
12
+ from .._compat import cached_property
13
+ from .._resource import SyncAPIResource, AsyncAPIResource
14
+ from .._response import (
15
+ to_raw_response_wrapper,
16
+ to_streamed_response_wrapper,
17
+ async_to_raw_response_wrapper,
18
+ async_to_streamed_response_wrapper,
19
+ )
20
+ from .._base_client import make_request_options
21
+ from ..types.setting_update_response import SettingUpdateResponse
22
+
23
+ __all__ = ["SettingsResource", "AsyncSettingsResource"]
24
+
25
+
26
+ class SettingsResource(SyncAPIResource):
27
+ @cached_property
28
+ def with_raw_response(self) -> SettingsResourceWithRawResponse:
29
+ """
30
+ This property can be used as a prefix for any HTTP method call to return
31
+ the raw response object instead of the parsed content.
32
+
33
+ For more information, see https://www.github.com/supermemoryai/python-sdk#accessing-raw-response-data-eg-headers
34
+ """
35
+ return SettingsResourceWithRawResponse(self)
36
+
37
+ @cached_property
38
+ def with_streaming_response(self) -> SettingsResourceWithStreamingResponse:
39
+ """
40
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
41
+
42
+ For more information, see https://www.github.com/supermemoryai/python-sdk#with_streaming_response
43
+ """
44
+ return SettingsResourceWithStreamingResponse(self)
45
+
46
+ def update(
47
+ self,
48
+ *,
49
+ categories: List[str] | NotGiven = NOT_GIVEN,
50
+ exclude_items: List[str] | NotGiven = NOT_GIVEN,
51
+ filter_prompt: str | NotGiven = NOT_GIVEN,
52
+ filter_tags: Iterable[setting_update_params.FilterTag] | NotGiven = NOT_GIVEN,
53
+ include_items: List[str] | NotGiven = NOT_GIVEN,
54
+ should_llm_filter: bool | NotGiven = NOT_GIVEN,
55
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
56
+ # The extra values given here take precedence over values defined on the client or passed to this method.
57
+ extra_headers: Headers | None = None,
58
+ extra_query: Query | None = None,
59
+ extra_body: Body | None = None,
60
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
61
+ ) -> SettingUpdateResponse:
62
+ """
63
+ Update settings for an organization
64
+
65
+ Args:
66
+ extra_headers: Send extra headers
67
+
68
+ extra_query: Add additional query parameters to the request
69
+
70
+ extra_body: Add additional JSON properties to the request
71
+
72
+ timeout: Override the client-level default timeout for this request, in seconds
73
+ """
74
+ return self._put(
75
+ "/settings",
76
+ body=maybe_transform(
77
+ {
78
+ "categories": categories,
79
+ "exclude_items": exclude_items,
80
+ "filter_prompt": filter_prompt,
81
+ "filter_tags": filter_tags,
82
+ "include_items": include_items,
83
+ "should_llm_filter": should_llm_filter,
84
+ },
85
+ setting_update_params.SettingUpdateParams,
86
+ ),
87
+ options=make_request_options(
88
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
89
+ ),
90
+ cast_to=SettingUpdateResponse,
91
+ )
92
+
93
+
94
+ class AsyncSettingsResource(AsyncAPIResource):
95
+ @cached_property
96
+ def with_raw_response(self) -> AsyncSettingsResourceWithRawResponse:
97
+ """
98
+ This property can be used as a prefix for any HTTP method call to return
99
+ the raw response object instead of the parsed content.
100
+
101
+ For more information, see https://www.github.com/supermemoryai/python-sdk#accessing-raw-response-data-eg-headers
102
+ """
103
+ return AsyncSettingsResourceWithRawResponse(self)
104
+
105
+ @cached_property
106
+ def with_streaming_response(self) -> AsyncSettingsResourceWithStreamingResponse:
107
+ """
108
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
109
+
110
+ For more information, see https://www.github.com/supermemoryai/python-sdk#with_streaming_response
111
+ """
112
+ return AsyncSettingsResourceWithStreamingResponse(self)
113
+
114
+ async def update(
115
+ self,
116
+ *,
117
+ categories: List[str] | NotGiven = NOT_GIVEN,
118
+ exclude_items: List[str] | NotGiven = NOT_GIVEN,
119
+ filter_prompt: str | NotGiven = NOT_GIVEN,
120
+ filter_tags: Iterable[setting_update_params.FilterTag] | NotGiven = NOT_GIVEN,
121
+ include_items: List[str] | NotGiven = NOT_GIVEN,
122
+ should_llm_filter: bool | NotGiven = NOT_GIVEN,
123
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
124
+ # The extra values given here take precedence over values defined on the client or passed to this method.
125
+ extra_headers: Headers | None = None,
126
+ extra_query: Query | None = None,
127
+ extra_body: Body | None = None,
128
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
129
+ ) -> SettingUpdateResponse:
130
+ """
131
+ Update settings for an organization
132
+
133
+ Args:
134
+ extra_headers: Send extra headers
135
+
136
+ extra_query: Add additional query parameters to the request
137
+
138
+ extra_body: Add additional JSON properties to the request
139
+
140
+ timeout: Override the client-level default timeout for this request, in seconds
141
+ """
142
+ return await self._put(
143
+ "/settings",
144
+ body=await async_maybe_transform(
145
+ {
146
+ "categories": categories,
147
+ "exclude_items": exclude_items,
148
+ "filter_prompt": filter_prompt,
149
+ "filter_tags": filter_tags,
150
+ "include_items": include_items,
151
+ "should_llm_filter": should_llm_filter,
152
+ },
153
+ setting_update_params.SettingUpdateParams,
154
+ ),
155
+ options=make_request_options(
156
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
157
+ ),
158
+ cast_to=SettingUpdateResponse,
159
+ )
160
+
161
+
162
+ class SettingsResourceWithRawResponse:
163
+ def __init__(self, settings: SettingsResource) -> None:
164
+ self._settings = settings
165
+
166
+ self.update = to_raw_response_wrapper(
167
+ settings.update,
168
+ )
169
+
170
+
171
+ class AsyncSettingsResourceWithRawResponse:
172
+ def __init__(self, settings: AsyncSettingsResource) -> None:
173
+ self._settings = settings
174
+
175
+ self.update = async_to_raw_response_wrapper(
176
+ settings.update,
177
+ )
178
+
179
+
180
+ class SettingsResourceWithStreamingResponse:
181
+ def __init__(self, settings: SettingsResource) -> None:
182
+ self._settings = settings
183
+
184
+ self.update = to_streamed_response_wrapper(
185
+ settings.update,
186
+ )
187
+
188
+
189
+ class AsyncSettingsResourceWithStreamingResponse:
190
+ def __init__(self, settings: AsyncSettingsResource) -> None:
191
+ self._settings = settings
192
+
193
+ self.update = async_to_streamed_response_wrapper(
194
+ settings.update,
195
+ )
@@ -0,0 +1,16 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from .memory_list_params import MemoryListParams as MemoryListParams
6
+ from .memory_get_response import MemoryGetResponse as MemoryGetResponse
7
+ from .memory_create_params import MemoryCreateParams as MemoryCreateParams
8
+ from .memory_list_response import MemoryListResponse as MemoryListResponse
9
+ from .search_execute_params import SearchExecuteParams as SearchExecuteParams
10
+ from .setting_update_params import SettingUpdateParams as SettingUpdateParams
11
+ from .memory_create_response import MemoryCreateResponse as MemoryCreateResponse
12
+ from .memory_delete_response import MemoryDeleteResponse as MemoryDeleteResponse
13
+ from .search_execute_response import SearchExecuteResponse as SearchExecuteResponse
14
+ from .setting_update_response import SettingUpdateResponse as SettingUpdateResponse
15
+ from .connection_create_params import ConnectionCreateParams as ConnectionCreateParams
16
+ from .connection_create_response import ConnectionCreateResponse as ConnectionCreateResponse
@@ -0,0 +1,15 @@
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 Required, Annotated, TypedDict
6
+
7
+ from .._utils import PropertyInfo
8
+
9
+ __all__ = ["ConnectionCreateParams"]
10
+
11
+
12
+ class ConnectionCreateParams(TypedDict, total=False):
13
+ id: Required[str]
14
+
15
+ redirect_url: Annotated[str, PropertyInfo(alias="redirectUrl")]
@@ -0,0 +1,13 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from pydantic import Field as FieldInfo
4
+
5
+ from .._models import BaseModel
6
+
7
+ __all__ = ["ConnectionCreateResponse"]
8
+
9
+
10
+ class ConnectionCreateResponse(BaseModel):
11
+ expires_in: str = FieldInfo(alias="expiresIn")
12
+
13
+ magic_link: str = FieldInfo(alias="magicLink")
@@ -0,0 +1,23 @@
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, Union
6
+ from typing_extensions import Required, Annotated, TypedDict
7
+
8
+ from .._utils import PropertyInfo
9
+
10
+ __all__ = ["MemoryCreateParams"]
11
+
12
+
13
+ class MemoryCreateParams(TypedDict, total=False):
14
+ content: Required[str]
15
+ """Content of the memory"""
16
+
17
+ id: str
18
+
19
+ metadata: Dict[str, Union[str, float, bool]]
20
+ """Optional metadata for the memory"""
21
+
22
+ user_id: Annotated[str, PropertyInfo(alias="userId")]
23
+ """Optional end user ID this memory belongs to"""
@@ -0,0 +1,11 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from .._models import BaseModel
4
+
5
+ __all__ = ["MemoryCreateResponse"]
6
+
7
+
8
+ class MemoryCreateResponse(BaseModel):
9
+ id: str
10
+
11
+ status: str
@@ -0,0 +1,9 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from .._models import BaseModel
4
+
5
+ __all__ = ["MemoryDeleteResponse"]
6
+
7
+
8
+ class MemoryDeleteResponse(BaseModel):
9
+ success: bool
@@ -0,0 +1,27 @@
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__ = ["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
22
+
23
+
24
+ class MemoryGetResponse(BaseModel):
25
+ doc: Doc
26
+
27
+ status: Optional[str] = None
@@ -0,0 +1,24 @@
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 Literal, TypedDict
6
+
7
+ __all__ = ["MemoryListParams"]
8
+
9
+
10
+ class MemoryListParams(TypedDict, total=False):
11
+ filters: str
12
+ """Optional filters to apply to the search"""
13
+
14
+ limit: str
15
+ """Number of items per page"""
16
+
17
+ order: Literal["asc", "desc"]
18
+ """Sort order"""
19
+
20
+ page: str
21
+ """Page number to fetch"""
22
+
23
+ sort: Literal["createdAt", "updatedAt"]
24
+ """Field to sort by"""
@@ -0,0 +1,59 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import Dict, List, Optional
4
+ from datetime import datetime
5
+ from typing_extensions import Literal
6
+
7
+ from pydantic import Field as FieldInfo
8
+
9
+ from .._models import BaseModel
10
+
11
+ __all__ = ["MemoryListResponse", "Memory", "Pagination"]
12
+
13
+
14
+ class Memory(BaseModel):
15
+ id: str
16
+ """Unique identifier of the memory"""
17
+
18
+ created_at: datetime = FieldInfo(alias="createdAt")
19
+ """Creation timestamp"""
20
+
21
+ metadata: Dict[str, object]
22
+ """Custom metadata associated with the memory"""
23
+
24
+ status: Optional[Literal["queued", "extracting", "chunking", "embedding", "indexing", "done", "failed"]] = None
25
+ """Processing status of the memory"""
26
+
27
+ summary: Optional[str] = None
28
+ """Summary of the memory content"""
29
+
30
+ title: str
31
+ """Title of the memory"""
32
+
33
+ updated_at: datetime = FieldInfo(alias="updatedAt")
34
+ """Last update timestamp"""
35
+
36
+ url: Optional[str] = None
37
+ """Source URL of the memory"""
38
+
39
+ workflow_status: Optional[Literal["PENDING", "IN_PROGRESS", "COMPLETED", "FAILED"]] = FieldInfo(
40
+ alias="workflowStatus", default=None
41
+ )
42
+ """Current workflow status"""
43
+
44
+
45
+ class Pagination(BaseModel):
46
+ current_page: float = FieldInfo(alias="currentPage")
47
+
48
+ limit: float
49
+
50
+ total_items: float = FieldInfo(alias="totalItems")
51
+
52
+ total_pages: float = FieldInfo(alias="totalPages")
53
+
54
+
55
+ class MemoryListResponse(BaseModel):
56
+ memories: List[Memory]
57
+
58
+ pagination: Pagination
59
+ """Pagination metadata"""