usecortex-ai 0.3.6__py3-none-any.whl → 0.4.0__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 (106) hide show
  1. usecortex_ai/__init__.py +80 -70
  2. usecortex_ai/client.py +25 -23
  3. usecortex_ai/dashboard/client.py +448 -0
  4. usecortex_ai/{user_memory → dashboard}/raw_client.py +371 -530
  5. usecortex_ai/embeddings/client.py +229 -102
  6. usecortex_ai/embeddings/raw_client.py +323 -211
  7. usecortex_ai/errors/__init__.py +2 -0
  8. usecortex_ai/errors/bad_request_error.py +1 -2
  9. usecortex_ai/errors/forbidden_error.py +1 -2
  10. usecortex_ai/errors/internal_server_error.py +1 -2
  11. usecortex_ai/errors/not_found_error.py +1 -2
  12. usecortex_ai/errors/service_unavailable_error.py +1 -2
  13. usecortex_ai/errors/too_many_requests_error.py +11 -0
  14. usecortex_ai/errors/unauthorized_error.py +1 -2
  15. usecortex_ai/fetch/client.py +350 -29
  16. usecortex_ai/fetch/raw_client.py +919 -65
  17. usecortex_ai/raw_client.py +8 -2
  18. usecortex_ai/search/client.py +293 -257
  19. usecortex_ai/search/raw_client.py +445 -346
  20. usecortex_ai/search/types/alpha.py +1 -1
  21. usecortex_ai/sources/client.py +29 -216
  22. usecortex_ai/sources/raw_client.py +51 -589
  23. usecortex_ai/tenant/client.py +155 -118
  24. usecortex_ai/tenant/raw_client.py +227 -350
  25. usecortex_ai/types/__init__.py +74 -66
  26. usecortex_ai/types/add_memory_response.py +39 -0
  27. usecortex_ai/types/{relations.py → api_key_info.py} +25 -5
  28. usecortex_ai/types/app_sources_upload_data.py +15 -6
  29. usecortex_ai/types/{file_upload_result.py → collection_stats.py} +5 -5
  30. usecortex_ai/types/custom_property_definition.py +75 -0
  31. usecortex_ai/types/dashboard_apis_response.py +33 -0
  32. usecortex_ai/types/dashboard_sources_response.py +33 -0
  33. usecortex_ai/types/dashboard_tenants_response.py +33 -0
  34. usecortex_ai/types/{list_sources_response.py → delete_result.py} +10 -7
  35. usecortex_ai/types/delete_user_memory_response.py +1 -1
  36. usecortex_ai/types/entity.py +4 -4
  37. usecortex_ai/types/fetch_mode.py +5 -0
  38. usecortex_ai/types/graph_context.py +26 -0
  39. usecortex_ai/types/{delete_sources.py → infra.py} +4 -3
  40. usecortex_ai/types/{fetch_content_data.py → insert_result.py} +12 -8
  41. usecortex_ai/types/memory_item.py +82 -0
  42. usecortex_ai/types/memory_result_item.py +47 -0
  43. usecortex_ai/types/milvus_data_type.py +21 -0
  44. usecortex_ai/types/path_triplet.py +3 -18
  45. usecortex_ai/types/processing_status.py +3 -2
  46. usecortex_ai/types/processing_status_indexing_status.py +7 -0
  47. usecortex_ai/types/qn_a_search_response.py +49 -0
  48. usecortex_ai/types/{retrieve_response.py → raw_embedding_document.py} +11 -8
  49. usecortex_ai/types/raw_embedding_search_result.py +47 -0
  50. usecortex_ai/types/{user_memory.py → raw_embedding_vector.py} +6 -6
  51. usecortex_ai/types/relation_evidence.py +24 -5
  52. usecortex_ai/types/retrieval_result.py +26 -0
  53. usecortex_ai/types/scored_path_response.py +5 -19
  54. usecortex_ai/types/search_mode.py +5 -0
  55. usecortex_ai/types/{batch_upload_data.py → source_delete_response.py} +8 -8
  56. usecortex_ai/types/{list_user_memories_response.py → source_delete_result_item.py} +11 -7
  57. usecortex_ai/types/source_fetch_response.py +70 -0
  58. usecortex_ai/types/{graph_relations_response.py → source_graph_relations_response.py} +3 -3
  59. usecortex_ai/types/{single_upload_data.py → source_list_response.py} +7 -10
  60. usecortex_ai/types/source_model.py +11 -1
  61. usecortex_ai/types/source_status.py +5 -0
  62. usecortex_ai/types/source_upload_response.py +35 -0
  63. usecortex_ai/types/source_upload_result_item.py +38 -0
  64. usecortex_ai/types/supported_llm_providers.py +5 -0
  65. usecortex_ai/types/{embeddings_create_collection_data.py → tenant_create_response.py} +9 -7
  66. usecortex_ai/types/{webpage_scrape_request.py → tenant_info.py} +10 -5
  67. usecortex_ai/types/{scored_triplet_response.py → tenant_metadata_schema_info.py} +8 -15
  68. usecortex_ai/types/{tenant_create_data.py → tenant_stats_response.py} +9 -8
  69. usecortex_ai/types/{triple_with_evidence.py → triplet_with_evidence.py} +5 -1
  70. usecortex_ai/types/user_assistant_pair.py +4 -0
  71. usecortex_ai/types/{search_chunk.py → vector_store_chunk.py} +3 -14
  72. usecortex_ai/upload/__init__.py +3 -0
  73. usecortex_ai/upload/client.py +233 -1937
  74. usecortex_ai/upload/raw_client.py +364 -4401
  75. usecortex_ai/upload/types/__init__.py +7 -0
  76. usecortex_ai/upload/types/body_upload_app_ingestion_upload_app_post_app_sources.py +7 -0
  77. {usecortex_ai-0.3.6.dist-info → usecortex_ai-0.4.0.dist-info}/METADATA +2 -2
  78. usecortex_ai-0.4.0.dist-info/RECORD +113 -0
  79. {usecortex_ai-0.3.6.dist-info → usecortex_ai-0.4.0.dist-info}/WHEEL +1 -1
  80. usecortex_ai/document/client.py +0 -139
  81. usecortex_ai/document/raw_client.py +0 -312
  82. usecortex_ai/types/add_user_memory_response.py +0 -41
  83. usecortex_ai/types/body_scrape_webpage_upload_scrape_webpage_post.py +0 -17
  84. usecortex_ai/types/body_update_scrape_job_upload_update_webpage_patch.py +0 -17
  85. usecortex_ai/types/chunk_graph_relations_response.py +0 -33
  86. usecortex_ai/types/delete_memory_request.py +0 -32
  87. usecortex_ai/types/delete_sub_tenant_data.py +0 -42
  88. usecortex_ai/types/embeddings_delete_data.py +0 -37
  89. usecortex_ai/types/embeddings_get_data.py +0 -37
  90. usecortex_ai/types/embeddings_search_data.py +0 -37
  91. usecortex_ai/types/extended_context.py +0 -17
  92. usecortex_ai/types/markdown_upload_request.py +0 -41
  93. usecortex_ai/types/related_chunk.py +0 -22
  94. usecortex_ai/types/retrieve_user_memory_response.py +0 -38
  95. usecortex_ai/types/source.py +0 -52
  96. usecortex_ai/types/sub_tenant_ids_data.py +0 -47
  97. usecortex_ai/types/tenant_stats.py +0 -42
  98. usecortex_ai/user/__init__.py +0 -4
  99. usecortex_ai/user/client.py +0 -145
  100. usecortex_ai/user/raw_client.py +0 -316
  101. usecortex_ai/user_memory/__init__.py +0 -4
  102. usecortex_ai/user_memory/client.py +0 -515
  103. usecortex_ai-0.3.6.dist-info/RECORD +0 -112
  104. /usecortex_ai/{document → dashboard}/__init__.py +0 -0
  105. {usecortex_ai-0.3.6.dist-info → usecortex_ai-0.4.0.dist-info}/licenses/LICENSE +0 -0
  106. {usecortex_ai-0.3.6.dist-info → usecortex_ai-0.4.0.dist-info}/top_level.txt +0 -0
@@ -8,7 +8,6 @@ from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
8
8
  from ..core.http_response import AsyncHttpResponse, HttpResponse
9
9
  from ..core.pydantic_utilities import parse_obj_as
10
10
  from ..core.request_options import RequestOptions
11
- from ..core.serialization import convert_and_respect_annotation_metadata
12
11
  from ..errors.bad_request_error import BadRequestError
13
12
  from ..errors.forbidden_error import ForbiddenError
14
13
  from ..errors.internal_server_error import InternalServerError
@@ -16,68 +15,45 @@ from ..errors.not_found_error import NotFoundError
16
15
  from ..errors.service_unavailable_error import ServiceUnavailableError
17
16
  from ..errors.unauthorized_error import UnauthorizedError
18
17
  from ..errors.unprocessable_entity_error import UnprocessableEntityError
19
- from ..types.actual_error_response import ActualErrorResponse
20
- from ..types.add_user_memory_response import AddUserMemoryResponse
21
- from ..types.delete_user_memory_response import DeleteUserMemoryResponse
22
- from ..types.list_user_memories_response import ListUserMemoriesResponse
23
- from ..types.retrieve_user_memory_response import RetrieveUserMemoryResponse
24
- from ..types.user_assistant_pair import UserAssistantPair
18
+ from ..types.dashboard_apis_response import DashboardApisResponse
19
+ from ..types.dashboard_sources_response import DashboardSourcesResponse
20
+ from ..types.dashboard_tenants_response import DashboardTenantsResponse
25
21
 
26
- # this is used as the default value for optional parameters
27
- OMIT = typing.cast(typing.Any, ...)
28
22
 
29
-
30
- class RawUserMemoryClient:
23
+ class RawDashboardClient:
31
24
  def __init__(self, *, client_wrapper: SyncClientWrapper):
32
25
  self._client_wrapper = client_wrapper
33
26
 
34
- def list_user_memories(
35
- self,
36
- *,
37
- tenant_id: str,
38
- sub_tenant_id: typing.Optional[str] = None,
39
- request_options: typing.Optional[RequestOptions] = None,
40
- ) -> HttpResponse[ListUserMemoriesResponse]:
27
+ def list_apis(
28
+ self, *, request_options: typing.Optional[RequestOptions] = None
29
+ ) -> HttpResponse[DashboardApisResponse]:
41
30
  """
42
- Retrieve all stored user memories for your tenant.
43
-
44
- This endpoint returns a comprehensive list of all user memories that have been stored,
45
- whether they were added manually or generated through AI. User memories help personalize
46
- your experience by storing context, preferences, and important information.
31
+ List all API keys for dashboard view.
47
32
 
48
- You can optionally specify a sub-tenant to filter memories within that specific scope.
33
+ Uses Firebase authentication to identify the user and returns API keys
34
+ associated with that user.
49
35
 
50
36
  Parameters
51
37
  ----------
52
- tenant_id : str
53
- Unique identifier for the tenant/organization
54
-
55
- sub_tenant_id : typing.Optional[str]
56
- Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
57
-
58
38
  request_options : typing.Optional[RequestOptions]
59
39
  Request-specific configuration.
60
40
 
61
41
  Returns
62
42
  -------
63
- HttpResponse[ListUserMemoriesResponse]
43
+ HttpResponse[DashboardApisResponse]
64
44
  Successful Response
65
45
  """
66
46
  _response = self._client_wrapper.httpx_client.request(
67
- "user_memory/list_user_memories",
47
+ "dashboard/resources/list/api_keys",
68
48
  method="GET",
69
- params={
70
- "tenant_id": tenant_id,
71
- "sub_tenant_id": sub_tenant_id,
72
- },
73
49
  request_options=request_options,
74
50
  )
75
51
  try:
76
52
  if 200 <= _response.status_code < 300:
77
53
  _data = typing.cast(
78
- ListUserMemoriesResponse,
54
+ DashboardApisResponse,
79
55
  parse_obj_as(
80
- type_=ListUserMemoriesResponse, # type: ignore
56
+ type_=DashboardApisResponse, # type: ignore
81
57
  object_=_response.json(),
82
58
  ),
83
59
  )
@@ -86,9 +62,9 @@ class RawUserMemoryClient:
86
62
  raise BadRequestError(
87
63
  headers=dict(_response.headers),
88
64
  body=typing.cast(
89
- ActualErrorResponse,
65
+ typing.Optional[typing.Any],
90
66
  parse_obj_as(
91
- type_=ActualErrorResponse, # type: ignore
67
+ type_=typing.Optional[typing.Any], # type: ignore
92
68
  object_=_response.json(),
93
69
  ),
94
70
  ),
@@ -97,9 +73,9 @@ class RawUserMemoryClient:
97
73
  raise UnauthorizedError(
98
74
  headers=dict(_response.headers),
99
75
  body=typing.cast(
100
- ActualErrorResponse,
76
+ typing.Optional[typing.Any],
101
77
  parse_obj_as(
102
- type_=ActualErrorResponse, # type: ignore
78
+ type_=typing.Optional[typing.Any], # type: ignore
103
79
  object_=_response.json(),
104
80
  ),
105
81
  ),
@@ -108,9 +84,9 @@ class RawUserMemoryClient:
108
84
  raise ForbiddenError(
109
85
  headers=dict(_response.headers),
110
86
  body=typing.cast(
111
- ActualErrorResponse,
87
+ typing.Optional[typing.Any],
112
88
  parse_obj_as(
113
- type_=ActualErrorResponse, # type: ignore
89
+ type_=typing.Optional[typing.Any], # type: ignore
114
90
  object_=_response.json(),
115
91
  ),
116
92
  ),
@@ -119,9 +95,9 @@ class RawUserMemoryClient:
119
95
  raise NotFoundError(
120
96
  headers=dict(_response.headers),
121
97
  body=typing.cast(
122
- ActualErrorResponse,
98
+ typing.Optional[typing.Any],
123
99
  parse_obj_as(
124
- type_=ActualErrorResponse, # type: ignore
100
+ type_=typing.Optional[typing.Any], # type: ignore
125
101
  object_=_response.json(),
126
102
  ),
127
103
  ),
@@ -141,9 +117,9 @@ class RawUserMemoryClient:
141
117
  raise InternalServerError(
142
118
  headers=dict(_response.headers),
143
119
  body=typing.cast(
144
- ActualErrorResponse,
120
+ typing.Optional[typing.Any],
145
121
  parse_obj_as(
146
- type_=ActualErrorResponse, # type: ignore
122
+ type_=typing.Optional[typing.Any], # type: ignore
147
123
  object_=_response.json(),
148
124
  ),
149
125
  ),
@@ -152,9 +128,9 @@ class RawUserMemoryClient:
152
128
  raise ServiceUnavailableError(
153
129
  headers=dict(_response.headers),
154
130
  body=typing.cast(
155
- ActualErrorResponse,
131
+ typing.Optional[typing.Any],
156
132
  parse_obj_as(
157
- type_=ActualErrorResponse, # type: ignore
133
+ type_=typing.Optional[typing.Any], # type: ignore
158
134
  object_=_response.json(),
159
135
  ),
160
136
  ),
@@ -164,48 +140,35 @@ class RawUserMemoryClient:
164
140
  raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
165
141
  raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
166
142
 
167
- def delete_user_memory(
168
- self,
169
- *,
170
- tenant_id: str,
171
- memory_id: str,
172
- sub_tenant_id: typing.Optional[str] = None,
173
- request_options: typing.Optional[RequestOptions] = None,
174
- ) -> HttpResponse[DeleteUserMemoryResponse]:
143
+ def list_sources(
144
+ self, *, tenant_id: str, sub_tenant_id: str, request_options: typing.Optional[RequestOptions] = None
145
+ ) -> HttpResponse[DashboardSourcesResponse]:
175
146
  """
176
- Permanently remove a specific user memory from storage.
177
-
178
- This endpoint allows you to delete a user memory by its unique identifier.
179
- Once deleted, the memory cannot be recovered, so use this operation carefully.
147
+ List all sources for a tenant/sub-tenant combination.
180
148
 
181
- The memory will be removed from your tenant's storage and will no longer
182
- appear in search results or memory listings.
149
+ Uses the same logic as the existing get_sources function.
183
150
 
184
151
  Parameters
185
152
  ----------
186
153
  tenant_id : str
187
- Unique identifier for the tenant/organization
154
+ Tenant ID
188
155
 
189
- memory_id : str
190
- Unique identifier of the memory to delete
191
-
192
- sub_tenant_id : typing.Optional[str]
193
- Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
156
+ sub_tenant_id : str
157
+ Sub-tenant ID
194
158
 
195
159
  request_options : typing.Optional[RequestOptions]
196
160
  Request-specific configuration.
197
161
 
198
162
  Returns
199
163
  -------
200
- HttpResponse[DeleteUserMemoryResponse]
164
+ HttpResponse[DashboardSourcesResponse]
201
165
  Successful Response
202
166
  """
203
167
  _response = self._client_wrapper.httpx_client.request(
204
- "user_memory/delete_user_memory",
205
- method="DELETE",
168
+ "dashboard/sources",
169
+ method="GET",
206
170
  params={
207
171
  "tenant_id": tenant_id,
208
- "memory_id": memory_id,
209
172
  "sub_tenant_id": sub_tenant_id,
210
173
  },
211
174
  request_options=request_options,
@@ -213,9 +176,9 @@ class RawUserMemoryClient:
213
176
  try:
214
177
  if 200 <= _response.status_code < 300:
215
178
  _data = typing.cast(
216
- DeleteUserMemoryResponse,
179
+ DashboardSourcesResponse,
217
180
  parse_obj_as(
218
- type_=DeleteUserMemoryResponse, # type: ignore
181
+ type_=DashboardSourcesResponse, # type: ignore
219
182
  object_=_response.json(),
220
183
  ),
221
184
  )
@@ -224,9 +187,9 @@ class RawUserMemoryClient:
224
187
  raise BadRequestError(
225
188
  headers=dict(_response.headers),
226
189
  body=typing.cast(
227
- ActualErrorResponse,
190
+ typing.Optional[typing.Any],
228
191
  parse_obj_as(
229
- type_=ActualErrorResponse, # type: ignore
192
+ type_=typing.Optional[typing.Any], # type: ignore
230
193
  object_=_response.json(),
231
194
  ),
232
195
  ),
@@ -235,9 +198,9 @@ class RawUserMemoryClient:
235
198
  raise UnauthorizedError(
236
199
  headers=dict(_response.headers),
237
200
  body=typing.cast(
238
- ActualErrorResponse,
201
+ typing.Optional[typing.Any],
239
202
  parse_obj_as(
240
- type_=ActualErrorResponse, # type: ignore
203
+ type_=typing.Optional[typing.Any], # type: ignore
241
204
  object_=_response.json(),
242
205
  ),
243
206
  ),
@@ -246,9 +209,9 @@ class RawUserMemoryClient:
246
209
  raise ForbiddenError(
247
210
  headers=dict(_response.headers),
248
211
  body=typing.cast(
249
- ActualErrorResponse,
212
+ typing.Optional[typing.Any],
250
213
  parse_obj_as(
251
- type_=ActualErrorResponse, # type: ignore
214
+ type_=typing.Optional[typing.Any], # type: ignore
252
215
  object_=_response.json(),
253
216
  ),
254
217
  ),
@@ -257,9 +220,9 @@ class RawUserMemoryClient:
257
220
  raise NotFoundError(
258
221
  headers=dict(_response.headers),
259
222
  body=typing.cast(
260
- ActualErrorResponse,
223
+ typing.Optional[typing.Any],
261
224
  parse_obj_as(
262
- type_=ActualErrorResponse, # type: ignore
225
+ type_=typing.Optional[typing.Any], # type: ignore
263
226
  object_=_response.json(),
264
227
  ),
265
228
  ),
@@ -279,9 +242,9 @@ class RawUserMemoryClient:
279
242
  raise InternalServerError(
280
243
  headers=dict(_response.headers),
281
244
  body=typing.cast(
282
- ActualErrorResponse,
245
+ typing.Optional[typing.Any],
283
246
  parse_obj_as(
284
- type_=ActualErrorResponse, # type: ignore
247
+ type_=typing.Optional[typing.Any], # type: ignore
285
248
  object_=_response.json(),
286
249
  ),
287
250
  ),
@@ -290,9 +253,9 @@ class RawUserMemoryClient:
290
253
  raise ServiceUnavailableError(
291
254
  headers=dict(_response.headers),
292
255
  body=typing.cast(
293
- ActualErrorResponse,
256
+ typing.Optional[typing.Any],
294
257
  parse_obj_as(
295
- type_=ActualErrorResponse, # type: ignore
258
+ type_=typing.Optional[typing.Any], # type: ignore
296
259
  object_=_response.json(),
297
260
  ),
298
261
  ),
@@ -302,75 +265,36 @@ class RawUserMemoryClient:
302
265
  raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
303
266
  raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
304
267
 
305
- def retrieve_user_memory(
306
- self,
307
- *,
308
- tenant_id: str,
309
- query: str,
310
- sub_tenant_id: typing.Optional[str] = None,
311
- max_count: typing.Optional[int] = None,
312
- user_name: typing.Optional[str] = OMIT,
313
- request_options: typing.Optional[RequestOptions] = None,
314
- ) -> HttpResponse[RetrieveUserMemoryResponse]:
268
+ def list_tenants(
269
+ self, *, request_options: typing.Optional[RequestOptions] = None
270
+ ) -> HttpResponse[DashboardTenantsResponse]:
315
271
  """
316
- Find relevant user memories using semantic search and knowledge graph.
317
-
318
- This endpoint performs parallel searches:
319
- 1. Semantic search in Weaviate across all stored user memories
320
- 2. Entity-based search in the knowledge graph for memory entities
272
+ List all tenants for dashboard view.
321
273
 
322
- Results from both sources are combined and ranked by relevance to provide
323
- comprehensive memory retrieval.
274
+ Uses Firebase authentication to identify the user and returns tenant
275
+ mappings associated with that user's organization.
324
276
 
325
277
  Parameters
326
278
  ----------
327
- tenant_id : str
328
- Unique identifier for the tenant/organization
329
-
330
- query : str
331
- Search query to find relevant user memories
332
-
333
- sub_tenant_id : typing.Optional[str]
334
- Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
335
-
336
- max_count : typing.Optional[int]
337
- Maximum number of memories to return (default: 5)
338
-
339
- user_name : typing.Optional[str]
340
- User's name to enhance personalisation
341
-
342
279
  request_options : typing.Optional[RequestOptions]
343
280
  Request-specific configuration.
344
281
 
345
282
  Returns
346
283
  -------
347
- HttpResponse[RetrieveUserMemoryResponse]
284
+ HttpResponse[DashboardTenantsResponse]
348
285
  Successful Response
349
286
  """
350
287
  _response = self._client_wrapper.httpx_client.request(
351
- "user_memory/retrieve_user_memory",
352
- method="POST",
353
- params={
354
- "tenant_id": tenant_id,
355
- "sub_tenant_id": sub_tenant_id,
356
- "max_count": max_count,
357
- },
358
- json={
359
- "query": query,
360
- "user_name": user_name,
361
- },
362
- headers={
363
- "content-type": "application/json",
364
- },
288
+ "dashboard/resources/list/tenant_ids",
289
+ method="GET",
365
290
  request_options=request_options,
366
- omit=OMIT,
367
291
  )
368
292
  try:
369
293
  if 200 <= _response.status_code < 300:
370
294
  _data = typing.cast(
371
- RetrieveUserMemoryResponse,
295
+ DashboardTenantsResponse,
372
296
  parse_obj_as(
373
- type_=RetrieveUserMemoryResponse, # type: ignore
297
+ type_=DashboardTenantsResponse, # type: ignore
374
298
  object_=_response.json(),
375
299
  ),
376
300
  )
@@ -379,9 +303,9 @@ class RawUserMemoryClient:
379
303
  raise BadRequestError(
380
304
  headers=dict(_response.headers),
381
305
  body=typing.cast(
382
- ActualErrorResponse,
306
+ typing.Optional[typing.Any],
383
307
  parse_obj_as(
384
- type_=ActualErrorResponse, # type: ignore
308
+ type_=typing.Optional[typing.Any], # type: ignore
385
309
  object_=_response.json(),
386
310
  ),
387
311
  ),
@@ -390,9 +314,9 @@ class RawUserMemoryClient:
390
314
  raise UnauthorizedError(
391
315
  headers=dict(_response.headers),
392
316
  body=typing.cast(
393
- ActualErrorResponse,
317
+ typing.Optional[typing.Any],
394
318
  parse_obj_as(
395
- type_=ActualErrorResponse, # type: ignore
319
+ type_=typing.Optional[typing.Any], # type: ignore
396
320
  object_=_response.json(),
397
321
  ),
398
322
  ),
@@ -401,9 +325,9 @@ class RawUserMemoryClient:
401
325
  raise ForbiddenError(
402
326
  headers=dict(_response.headers),
403
327
  body=typing.cast(
404
- ActualErrorResponse,
328
+ typing.Optional[typing.Any],
405
329
  parse_obj_as(
406
- type_=ActualErrorResponse, # type: ignore
330
+ type_=typing.Optional[typing.Any], # type: ignore
407
331
  object_=_response.json(),
408
332
  ),
409
333
  ),
@@ -412,9 +336,9 @@ class RawUserMemoryClient:
412
336
  raise NotFoundError(
413
337
  headers=dict(_response.headers),
414
338
  body=typing.cast(
415
- ActualErrorResponse,
339
+ typing.Optional[typing.Any],
416
340
  parse_obj_as(
417
- type_=ActualErrorResponse, # type: ignore
341
+ type_=typing.Optional[typing.Any], # type: ignore
418
342
  object_=_response.json(),
419
343
  ),
420
344
  ),
@@ -434,9 +358,9 @@ class RawUserMemoryClient:
434
358
  raise InternalServerError(
435
359
  headers=dict(_response.headers),
436
360
  body=typing.cast(
437
- ActualErrorResponse,
361
+ typing.Optional[typing.Any],
438
362
  parse_obj_as(
439
- type_=ActualErrorResponse, # type: ignore
363
+ type_=typing.Optional[typing.Any], # type: ignore
440
364
  object_=_response.json(),
441
365
  ),
442
366
  ),
@@ -445,9 +369,9 @@ class RawUserMemoryClient:
445
369
  raise ServiceUnavailableError(
446
370
  headers=dict(_response.headers),
447
371
  body=typing.cast(
448
- ActualErrorResponse,
372
+ typing.Optional[typing.Any],
449
373
  parse_obj_as(
450
- type_=ActualErrorResponse, # type: ignore
374
+ type_=typing.Optional[typing.Any], # type: ignore
451
375
  object_=_response.json(),
452
376
  ),
453
377
  ),
@@ -457,135 +381,114 @@ class RawUserMemoryClient:
457
381
  raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
458
382
  raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
459
383
 
460
- def add_user_memory(
461
- self,
462
- *,
463
- tenant_id: str,
464
- sub_tenant_id: typing.Optional[str] = None,
465
- raw_text: typing.Optional[str] = OMIT,
466
- user_assistant_pairs: typing.Optional[typing.Sequence[UserAssistantPair]] = OMIT,
467
- expiry_time: typing.Optional[int] = OMIT,
468
- infer: typing.Optional[bool] = OMIT,
469
- custom_instructions: typing.Optional[str] = OMIT,
470
- request_options: typing.Optional[RequestOptions] = None,
471
- ) -> HttpResponse[AddUserMemoryResponse]:
384
+ def is_organization_admin(
385
+ self, *, request_options: typing.Optional[RequestOptions] = None
386
+ ) -> HttpResponse[typing.Optional[typing.Any]]:
472
387
  """
473
- Store new user memories for future reference.
474
-
475
- This endpoint allows you to add memories in two formats:
476
- 1. Raw text string - A single text-based memory
477
- 2. User/Assistant pairs array - Conversation pairs that will be chunked as a single memory
478
-
479
- The stored memories will be chunked, indexed in both Weaviate and the knowledge graph,
480
- and made available for semantic search and graph-based retrieval.
481
-
482
388
  Parameters
483
389
  ----------
484
- tenant_id : str
485
- Unique identifier for the tenant/organization
486
-
487
- sub_tenant_id : typing.Optional[str]
488
- Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
489
-
490
- raw_text : typing.Optional[str]
491
- Single raw text memory to store. If both raw_text and user_assistant_pairs are provided, raw_text will be used.
390
+ request_options : typing.Optional[RequestOptions]
391
+ Request-specific configuration.
492
392
 
493
- user_assistant_pairs : typing.Optional[typing.Sequence[UserAssistantPair]]
494
- Array of user/assistant conversation pairs to store as a single memory
393
+ Returns
394
+ -------
395
+ HttpResponse[typing.Optional[typing.Any]]
396
+ Successful Response
397
+ """
398
+ _response = self._client_wrapper.httpx_client.request(
399
+ "dashboard/user/is_user_admin",
400
+ method="GET",
401
+ request_options=request_options,
402
+ )
403
+ try:
404
+ if _response is None or not _response.text.strip():
405
+ return HttpResponse(response=_response, data=None)
406
+ if 200 <= _response.status_code < 300:
407
+ _data = typing.cast(
408
+ typing.Optional[typing.Any],
409
+ parse_obj_as(
410
+ type_=typing.Optional[typing.Any], # type: ignore
411
+ object_=_response.json(),
412
+ ),
413
+ )
414
+ return HttpResponse(response=_response, data=_data)
415
+ _response_json = _response.json()
416
+ except JSONDecodeError:
417
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
418
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
495
419
 
496
- expiry_time : typing.Optional[int]
497
- Expiry time in seconds for the memory (optional)
420
+ def user_details_ep(
421
+ self, *, request_options: typing.Optional[RequestOptions] = None
422
+ ) -> HttpResponse[typing.Optional[typing.Any]]:
423
+ """
424
+ Parameters
425
+ ----------
426
+ request_options : typing.Optional[RequestOptions]
427
+ Request-specific configuration.
498
428
 
499
- infer : typing.Optional[bool]
500
- If true, process and compress chunks into inferred representations before indexing (default: False)
429
+ Returns
430
+ -------
431
+ HttpResponse[typing.Optional[typing.Any]]
432
+ Successful Response
433
+ """
434
+ _response = self._client_wrapper.httpx_client.request(
435
+ "dashboard/user/user_details",
436
+ method="GET",
437
+ request_options=request_options,
438
+ )
439
+ try:
440
+ if _response is None or not _response.text.strip():
441
+ return HttpResponse(response=_response, data=None)
442
+ if 200 <= _response.status_code < 300:
443
+ _data = typing.cast(
444
+ typing.Optional[typing.Any],
445
+ parse_obj_as(
446
+ type_=typing.Optional[typing.Any], # type: ignore
447
+ object_=_response.json(),
448
+ ),
449
+ )
450
+ return HttpResponse(response=_response, data=_data)
451
+ _response_json = _response.json()
452
+ except JSONDecodeError:
453
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
454
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
501
455
 
502
- custom_instructions : typing.Optional[str]
503
- Custom instructions to guide cortex
456
+ def create_user(
457
+ self, *, full_name: str, request_options: typing.Optional[RequestOptions] = None
458
+ ) -> HttpResponse[typing.Optional[typing.Any]]:
459
+ """
460
+ Parameters
461
+ ----------
462
+ full_name : str
504
463
 
505
464
  request_options : typing.Optional[RequestOptions]
506
465
  Request-specific configuration.
507
466
 
508
467
  Returns
509
468
  -------
510
- HttpResponse[AddUserMemoryResponse]
469
+ HttpResponse[typing.Optional[typing.Any]]
511
470
  Successful Response
512
471
  """
513
472
  _response = self._client_wrapper.httpx_client.request(
514
- "user_memory/add_user_memory",
473
+ "dashboard/user/create_user",
515
474
  method="POST",
516
475
  params={
517
- "tenant_id": tenant_id,
518
- "sub_tenant_id": sub_tenant_id,
519
- },
520
- json={
521
- "raw_text": raw_text,
522
- "user_assistant_pairs": convert_and_respect_annotation_metadata(
523
- object_=user_assistant_pairs, annotation=typing.Sequence[UserAssistantPair], direction="write"
524
- ),
525
- "expiry_time": expiry_time,
526
- "infer": infer,
527
- "custom_instructions": custom_instructions,
528
- },
529
- headers={
530
- "content-type": "application/json",
476
+ "full_name": full_name,
531
477
  },
532
478
  request_options=request_options,
533
- omit=OMIT,
534
479
  )
535
480
  try:
481
+ if _response is None or not _response.text.strip():
482
+ return HttpResponse(response=_response, data=None)
536
483
  if 200 <= _response.status_code < 300:
537
484
  _data = typing.cast(
538
- AddUserMemoryResponse,
485
+ typing.Optional[typing.Any],
539
486
  parse_obj_as(
540
- type_=AddUserMemoryResponse, # type: ignore
487
+ type_=typing.Optional[typing.Any], # type: ignore
541
488
  object_=_response.json(),
542
489
  ),
543
490
  )
544
491
  return HttpResponse(response=_response, data=_data)
545
- if _response.status_code == 400:
546
- raise BadRequestError(
547
- headers=dict(_response.headers),
548
- body=typing.cast(
549
- ActualErrorResponse,
550
- parse_obj_as(
551
- type_=ActualErrorResponse, # type: ignore
552
- object_=_response.json(),
553
- ),
554
- ),
555
- )
556
- if _response.status_code == 401:
557
- raise UnauthorizedError(
558
- headers=dict(_response.headers),
559
- body=typing.cast(
560
- ActualErrorResponse,
561
- parse_obj_as(
562
- type_=ActualErrorResponse, # type: ignore
563
- object_=_response.json(),
564
- ),
565
- ),
566
- )
567
- if _response.status_code == 403:
568
- raise ForbiddenError(
569
- headers=dict(_response.headers),
570
- body=typing.cast(
571
- ActualErrorResponse,
572
- parse_obj_as(
573
- type_=ActualErrorResponse, # type: ignore
574
- object_=_response.json(),
575
- ),
576
- ),
577
- )
578
- if _response.status_code == 404:
579
- raise NotFoundError(
580
- headers=dict(_response.headers),
581
- body=typing.cast(
582
- ActualErrorResponse,
583
- parse_obj_as(
584
- type_=ActualErrorResponse, # type: ignore
585
- object_=_response.json(),
586
- ),
587
- ),
588
- )
589
492
  if _response.status_code == 422:
590
493
  raise UnprocessableEntityError(
591
494
  headers=dict(_response.headers),
@@ -597,85 +500,82 @@ class RawUserMemoryClient:
597
500
  ),
598
501
  ),
599
502
  )
600
- if _response.status_code == 500:
601
- raise InternalServerError(
602
- headers=dict(_response.headers),
603
- body=typing.cast(
604
- ActualErrorResponse,
605
- parse_obj_as(
606
- type_=ActualErrorResponse, # type: ignore
607
- object_=_response.json(),
608
- ),
609
- ),
610
- )
611
- if _response.status_code == 503:
612
- raise ServiceUnavailableError(
613
- headers=dict(_response.headers),
614
- body=typing.cast(
615
- ActualErrorResponse,
616
- parse_obj_as(
617
- type_=ActualErrorResponse, # type: ignore
618
- object_=_response.json(),
619
- ),
503
+ _response_json = _response.json()
504
+ except JSONDecodeError:
505
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
506
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
507
+
508
+ def check_user_exists(
509
+ self, *, request_options: typing.Optional[RequestOptions] = None
510
+ ) -> HttpResponse[typing.Optional[typing.Any]]:
511
+ """
512
+ Parameters
513
+ ----------
514
+ request_options : typing.Optional[RequestOptions]
515
+ Request-specific configuration.
516
+
517
+ Returns
518
+ -------
519
+ HttpResponse[typing.Optional[typing.Any]]
520
+ Successful Response
521
+ """
522
+ _response = self._client_wrapper.httpx_client.request(
523
+ "dashboard/user/check_user_exists",
524
+ method="GET",
525
+ request_options=request_options,
526
+ )
527
+ try:
528
+ if _response is None or not _response.text.strip():
529
+ return HttpResponse(response=_response, data=None)
530
+ if 200 <= _response.status_code < 300:
531
+ _data = typing.cast(
532
+ typing.Optional[typing.Any],
533
+ parse_obj_as(
534
+ type_=typing.Optional[typing.Any], # type: ignore
535
+ object_=_response.json(),
620
536
  ),
621
537
  )
538
+ return HttpResponse(response=_response, data=_data)
622
539
  _response_json = _response.json()
623
540
  except JSONDecodeError:
624
541
  raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
625
542
  raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
626
543
 
627
544
 
628
- class AsyncRawUserMemoryClient:
545
+ class AsyncRawDashboardClient:
629
546
  def __init__(self, *, client_wrapper: AsyncClientWrapper):
630
547
  self._client_wrapper = client_wrapper
631
548
 
632
- async def list_user_memories(
633
- self,
634
- *,
635
- tenant_id: str,
636
- sub_tenant_id: typing.Optional[str] = None,
637
- request_options: typing.Optional[RequestOptions] = None,
638
- ) -> AsyncHttpResponse[ListUserMemoriesResponse]:
549
+ async def list_apis(
550
+ self, *, request_options: typing.Optional[RequestOptions] = None
551
+ ) -> AsyncHttpResponse[DashboardApisResponse]:
639
552
  """
640
- Retrieve all stored user memories for your tenant.
553
+ List all API keys for dashboard view.
641
554
 
642
- This endpoint returns a comprehensive list of all user memories that have been stored,
643
- whether they were added manually or generated through AI. User memories help personalize
644
- your experience by storing context, preferences, and important information.
645
-
646
- You can optionally specify a sub-tenant to filter memories within that specific scope.
555
+ Uses Firebase authentication to identify the user and returns API keys
556
+ associated with that user.
647
557
 
648
558
  Parameters
649
559
  ----------
650
- tenant_id : str
651
- Unique identifier for the tenant/organization
652
-
653
- sub_tenant_id : typing.Optional[str]
654
- Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
655
-
656
560
  request_options : typing.Optional[RequestOptions]
657
561
  Request-specific configuration.
658
562
 
659
563
  Returns
660
564
  -------
661
- AsyncHttpResponse[ListUserMemoriesResponse]
565
+ AsyncHttpResponse[DashboardApisResponse]
662
566
  Successful Response
663
567
  """
664
568
  _response = await self._client_wrapper.httpx_client.request(
665
- "user_memory/list_user_memories",
569
+ "dashboard/resources/list/api_keys",
666
570
  method="GET",
667
- params={
668
- "tenant_id": tenant_id,
669
- "sub_tenant_id": sub_tenant_id,
670
- },
671
571
  request_options=request_options,
672
572
  )
673
573
  try:
674
574
  if 200 <= _response.status_code < 300:
675
575
  _data = typing.cast(
676
- ListUserMemoriesResponse,
576
+ DashboardApisResponse,
677
577
  parse_obj_as(
678
- type_=ListUserMemoriesResponse, # type: ignore
578
+ type_=DashboardApisResponse, # type: ignore
679
579
  object_=_response.json(),
680
580
  ),
681
581
  )
@@ -684,9 +584,9 @@ class AsyncRawUserMemoryClient:
684
584
  raise BadRequestError(
685
585
  headers=dict(_response.headers),
686
586
  body=typing.cast(
687
- ActualErrorResponse,
587
+ typing.Optional[typing.Any],
688
588
  parse_obj_as(
689
- type_=ActualErrorResponse, # type: ignore
589
+ type_=typing.Optional[typing.Any], # type: ignore
690
590
  object_=_response.json(),
691
591
  ),
692
592
  ),
@@ -695,9 +595,9 @@ class AsyncRawUserMemoryClient:
695
595
  raise UnauthorizedError(
696
596
  headers=dict(_response.headers),
697
597
  body=typing.cast(
698
- ActualErrorResponse,
598
+ typing.Optional[typing.Any],
699
599
  parse_obj_as(
700
- type_=ActualErrorResponse, # type: ignore
600
+ type_=typing.Optional[typing.Any], # type: ignore
701
601
  object_=_response.json(),
702
602
  ),
703
603
  ),
@@ -706,9 +606,9 @@ class AsyncRawUserMemoryClient:
706
606
  raise ForbiddenError(
707
607
  headers=dict(_response.headers),
708
608
  body=typing.cast(
709
- ActualErrorResponse,
609
+ typing.Optional[typing.Any],
710
610
  parse_obj_as(
711
- type_=ActualErrorResponse, # type: ignore
611
+ type_=typing.Optional[typing.Any], # type: ignore
712
612
  object_=_response.json(),
713
613
  ),
714
614
  ),
@@ -717,9 +617,9 @@ class AsyncRawUserMemoryClient:
717
617
  raise NotFoundError(
718
618
  headers=dict(_response.headers),
719
619
  body=typing.cast(
720
- ActualErrorResponse,
620
+ typing.Optional[typing.Any],
721
621
  parse_obj_as(
722
- type_=ActualErrorResponse, # type: ignore
622
+ type_=typing.Optional[typing.Any], # type: ignore
723
623
  object_=_response.json(),
724
624
  ),
725
625
  ),
@@ -739,9 +639,9 @@ class AsyncRawUserMemoryClient:
739
639
  raise InternalServerError(
740
640
  headers=dict(_response.headers),
741
641
  body=typing.cast(
742
- ActualErrorResponse,
642
+ typing.Optional[typing.Any],
743
643
  parse_obj_as(
744
- type_=ActualErrorResponse, # type: ignore
644
+ type_=typing.Optional[typing.Any], # type: ignore
745
645
  object_=_response.json(),
746
646
  ),
747
647
  ),
@@ -750,9 +650,9 @@ class AsyncRawUserMemoryClient:
750
650
  raise ServiceUnavailableError(
751
651
  headers=dict(_response.headers),
752
652
  body=typing.cast(
753
- ActualErrorResponse,
653
+ typing.Optional[typing.Any],
754
654
  parse_obj_as(
755
- type_=ActualErrorResponse, # type: ignore
655
+ type_=typing.Optional[typing.Any], # type: ignore
756
656
  object_=_response.json(),
757
657
  ),
758
658
  ),
@@ -762,48 +662,35 @@ class AsyncRawUserMemoryClient:
762
662
  raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
763
663
  raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
764
664
 
765
- async def delete_user_memory(
766
- self,
767
- *,
768
- tenant_id: str,
769
- memory_id: str,
770
- sub_tenant_id: typing.Optional[str] = None,
771
- request_options: typing.Optional[RequestOptions] = None,
772
- ) -> AsyncHttpResponse[DeleteUserMemoryResponse]:
665
+ async def list_sources(
666
+ self, *, tenant_id: str, sub_tenant_id: str, request_options: typing.Optional[RequestOptions] = None
667
+ ) -> AsyncHttpResponse[DashboardSourcesResponse]:
773
668
  """
774
- Permanently remove a specific user memory from storage.
775
-
776
- This endpoint allows you to delete a user memory by its unique identifier.
777
- Once deleted, the memory cannot be recovered, so use this operation carefully.
669
+ List all sources for a tenant/sub-tenant combination.
778
670
 
779
- The memory will be removed from your tenant's storage and will no longer
780
- appear in search results or memory listings.
671
+ Uses the same logic as the existing get_sources function.
781
672
 
782
673
  Parameters
783
674
  ----------
784
675
  tenant_id : str
785
- Unique identifier for the tenant/organization
786
-
787
- memory_id : str
788
- Unique identifier of the memory to delete
676
+ Tenant ID
789
677
 
790
- sub_tenant_id : typing.Optional[str]
791
- Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
678
+ sub_tenant_id : str
679
+ Sub-tenant ID
792
680
 
793
681
  request_options : typing.Optional[RequestOptions]
794
682
  Request-specific configuration.
795
683
 
796
684
  Returns
797
685
  -------
798
- AsyncHttpResponse[DeleteUserMemoryResponse]
686
+ AsyncHttpResponse[DashboardSourcesResponse]
799
687
  Successful Response
800
688
  """
801
689
  _response = await self._client_wrapper.httpx_client.request(
802
- "user_memory/delete_user_memory",
803
- method="DELETE",
690
+ "dashboard/sources",
691
+ method="GET",
804
692
  params={
805
693
  "tenant_id": tenant_id,
806
- "memory_id": memory_id,
807
694
  "sub_tenant_id": sub_tenant_id,
808
695
  },
809
696
  request_options=request_options,
@@ -811,9 +698,9 @@ class AsyncRawUserMemoryClient:
811
698
  try:
812
699
  if 200 <= _response.status_code < 300:
813
700
  _data = typing.cast(
814
- DeleteUserMemoryResponse,
701
+ DashboardSourcesResponse,
815
702
  parse_obj_as(
816
- type_=DeleteUserMemoryResponse, # type: ignore
703
+ type_=DashboardSourcesResponse, # type: ignore
817
704
  object_=_response.json(),
818
705
  ),
819
706
  )
@@ -822,9 +709,9 @@ class AsyncRawUserMemoryClient:
822
709
  raise BadRequestError(
823
710
  headers=dict(_response.headers),
824
711
  body=typing.cast(
825
- ActualErrorResponse,
712
+ typing.Optional[typing.Any],
826
713
  parse_obj_as(
827
- type_=ActualErrorResponse, # type: ignore
714
+ type_=typing.Optional[typing.Any], # type: ignore
828
715
  object_=_response.json(),
829
716
  ),
830
717
  ),
@@ -833,9 +720,9 @@ class AsyncRawUserMemoryClient:
833
720
  raise UnauthorizedError(
834
721
  headers=dict(_response.headers),
835
722
  body=typing.cast(
836
- ActualErrorResponse,
723
+ typing.Optional[typing.Any],
837
724
  parse_obj_as(
838
- type_=ActualErrorResponse, # type: ignore
725
+ type_=typing.Optional[typing.Any], # type: ignore
839
726
  object_=_response.json(),
840
727
  ),
841
728
  ),
@@ -844,9 +731,9 @@ class AsyncRawUserMemoryClient:
844
731
  raise ForbiddenError(
845
732
  headers=dict(_response.headers),
846
733
  body=typing.cast(
847
- ActualErrorResponse,
734
+ typing.Optional[typing.Any],
848
735
  parse_obj_as(
849
- type_=ActualErrorResponse, # type: ignore
736
+ type_=typing.Optional[typing.Any], # type: ignore
850
737
  object_=_response.json(),
851
738
  ),
852
739
  ),
@@ -855,9 +742,9 @@ class AsyncRawUserMemoryClient:
855
742
  raise NotFoundError(
856
743
  headers=dict(_response.headers),
857
744
  body=typing.cast(
858
- ActualErrorResponse,
745
+ typing.Optional[typing.Any],
859
746
  parse_obj_as(
860
- type_=ActualErrorResponse, # type: ignore
747
+ type_=typing.Optional[typing.Any], # type: ignore
861
748
  object_=_response.json(),
862
749
  ),
863
750
  ),
@@ -877,9 +764,9 @@ class AsyncRawUserMemoryClient:
877
764
  raise InternalServerError(
878
765
  headers=dict(_response.headers),
879
766
  body=typing.cast(
880
- ActualErrorResponse,
767
+ typing.Optional[typing.Any],
881
768
  parse_obj_as(
882
- type_=ActualErrorResponse, # type: ignore
769
+ type_=typing.Optional[typing.Any], # type: ignore
883
770
  object_=_response.json(),
884
771
  ),
885
772
  ),
@@ -888,9 +775,9 @@ class AsyncRawUserMemoryClient:
888
775
  raise ServiceUnavailableError(
889
776
  headers=dict(_response.headers),
890
777
  body=typing.cast(
891
- ActualErrorResponse,
778
+ typing.Optional[typing.Any],
892
779
  parse_obj_as(
893
- type_=ActualErrorResponse, # type: ignore
780
+ type_=typing.Optional[typing.Any], # type: ignore
894
781
  object_=_response.json(),
895
782
  ),
896
783
  ),
@@ -900,75 +787,36 @@ class AsyncRawUserMemoryClient:
900
787
  raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
901
788
  raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
902
789
 
903
- async def retrieve_user_memory(
904
- self,
905
- *,
906
- tenant_id: str,
907
- query: str,
908
- sub_tenant_id: typing.Optional[str] = None,
909
- max_count: typing.Optional[int] = None,
910
- user_name: typing.Optional[str] = OMIT,
911
- request_options: typing.Optional[RequestOptions] = None,
912
- ) -> AsyncHttpResponse[RetrieveUserMemoryResponse]:
790
+ async def list_tenants(
791
+ self, *, request_options: typing.Optional[RequestOptions] = None
792
+ ) -> AsyncHttpResponse[DashboardTenantsResponse]:
913
793
  """
914
- Find relevant user memories using semantic search and knowledge graph.
794
+ List all tenants for dashboard view.
915
795
 
916
- This endpoint performs parallel searches:
917
- 1. Semantic search in Weaviate across all stored user memories
918
- 2. Entity-based search in the knowledge graph for memory entities
919
-
920
- Results from both sources are combined and ranked by relevance to provide
921
- comprehensive memory retrieval.
796
+ Uses Firebase authentication to identify the user and returns tenant
797
+ mappings associated with that user's organization.
922
798
 
923
799
  Parameters
924
800
  ----------
925
- tenant_id : str
926
- Unique identifier for the tenant/organization
927
-
928
- query : str
929
- Search query to find relevant user memories
930
-
931
- sub_tenant_id : typing.Optional[str]
932
- Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
933
-
934
- max_count : typing.Optional[int]
935
- Maximum number of memories to return (default: 5)
936
-
937
- user_name : typing.Optional[str]
938
- User's name to enhance personalisation
939
-
940
801
  request_options : typing.Optional[RequestOptions]
941
802
  Request-specific configuration.
942
803
 
943
804
  Returns
944
805
  -------
945
- AsyncHttpResponse[RetrieveUserMemoryResponse]
806
+ AsyncHttpResponse[DashboardTenantsResponse]
946
807
  Successful Response
947
808
  """
948
809
  _response = await self._client_wrapper.httpx_client.request(
949
- "user_memory/retrieve_user_memory",
950
- method="POST",
951
- params={
952
- "tenant_id": tenant_id,
953
- "sub_tenant_id": sub_tenant_id,
954
- "max_count": max_count,
955
- },
956
- json={
957
- "query": query,
958
- "user_name": user_name,
959
- },
960
- headers={
961
- "content-type": "application/json",
962
- },
810
+ "dashboard/resources/list/tenant_ids",
811
+ method="GET",
963
812
  request_options=request_options,
964
- omit=OMIT,
965
813
  )
966
814
  try:
967
815
  if 200 <= _response.status_code < 300:
968
816
  _data = typing.cast(
969
- RetrieveUserMemoryResponse,
817
+ DashboardTenantsResponse,
970
818
  parse_obj_as(
971
- type_=RetrieveUserMemoryResponse, # type: ignore
819
+ type_=DashboardTenantsResponse, # type: ignore
972
820
  object_=_response.json(),
973
821
  ),
974
822
  )
@@ -977,9 +825,9 @@ class AsyncRawUserMemoryClient:
977
825
  raise BadRequestError(
978
826
  headers=dict(_response.headers),
979
827
  body=typing.cast(
980
- ActualErrorResponse,
828
+ typing.Optional[typing.Any],
981
829
  parse_obj_as(
982
- type_=ActualErrorResponse, # type: ignore
830
+ type_=typing.Optional[typing.Any], # type: ignore
983
831
  object_=_response.json(),
984
832
  ),
985
833
  ),
@@ -988,9 +836,9 @@ class AsyncRawUserMemoryClient:
988
836
  raise UnauthorizedError(
989
837
  headers=dict(_response.headers),
990
838
  body=typing.cast(
991
- ActualErrorResponse,
839
+ typing.Optional[typing.Any],
992
840
  parse_obj_as(
993
- type_=ActualErrorResponse, # type: ignore
841
+ type_=typing.Optional[typing.Any], # type: ignore
994
842
  object_=_response.json(),
995
843
  ),
996
844
  ),
@@ -999,9 +847,9 @@ class AsyncRawUserMemoryClient:
999
847
  raise ForbiddenError(
1000
848
  headers=dict(_response.headers),
1001
849
  body=typing.cast(
1002
- ActualErrorResponse,
850
+ typing.Optional[typing.Any],
1003
851
  parse_obj_as(
1004
- type_=ActualErrorResponse, # type: ignore
852
+ type_=typing.Optional[typing.Any], # type: ignore
1005
853
  object_=_response.json(),
1006
854
  ),
1007
855
  ),
@@ -1010,9 +858,9 @@ class AsyncRawUserMemoryClient:
1010
858
  raise NotFoundError(
1011
859
  headers=dict(_response.headers),
1012
860
  body=typing.cast(
1013
- ActualErrorResponse,
861
+ typing.Optional[typing.Any],
1014
862
  parse_obj_as(
1015
- type_=ActualErrorResponse, # type: ignore
863
+ type_=typing.Optional[typing.Any], # type: ignore
1016
864
  object_=_response.json(),
1017
865
  ),
1018
866
  ),
@@ -1032,9 +880,9 @@ class AsyncRawUserMemoryClient:
1032
880
  raise InternalServerError(
1033
881
  headers=dict(_response.headers),
1034
882
  body=typing.cast(
1035
- ActualErrorResponse,
883
+ typing.Optional[typing.Any],
1036
884
  parse_obj_as(
1037
- type_=ActualErrorResponse, # type: ignore
885
+ type_=typing.Optional[typing.Any], # type: ignore
1038
886
  object_=_response.json(),
1039
887
  ),
1040
888
  ),
@@ -1043,9 +891,9 @@ class AsyncRawUserMemoryClient:
1043
891
  raise ServiceUnavailableError(
1044
892
  headers=dict(_response.headers),
1045
893
  body=typing.cast(
1046
- ActualErrorResponse,
894
+ typing.Optional[typing.Any],
1047
895
  parse_obj_as(
1048
- type_=ActualErrorResponse, # type: ignore
896
+ type_=typing.Optional[typing.Any], # type: ignore
1049
897
  object_=_response.json(),
1050
898
  ),
1051
899
  ),
@@ -1055,135 +903,114 @@ class AsyncRawUserMemoryClient:
1055
903
  raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1056
904
  raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1057
905
 
1058
- async def add_user_memory(
1059
- self,
1060
- *,
1061
- tenant_id: str,
1062
- sub_tenant_id: typing.Optional[str] = None,
1063
- raw_text: typing.Optional[str] = OMIT,
1064
- user_assistant_pairs: typing.Optional[typing.Sequence[UserAssistantPair]] = OMIT,
1065
- expiry_time: typing.Optional[int] = OMIT,
1066
- infer: typing.Optional[bool] = OMIT,
1067
- custom_instructions: typing.Optional[str] = OMIT,
1068
- request_options: typing.Optional[RequestOptions] = None,
1069
- ) -> AsyncHttpResponse[AddUserMemoryResponse]:
906
+ async def is_organization_admin(
907
+ self, *, request_options: typing.Optional[RequestOptions] = None
908
+ ) -> AsyncHttpResponse[typing.Optional[typing.Any]]:
1070
909
  """
1071
- Store new user memories for future reference.
1072
-
1073
- This endpoint allows you to add memories in two formats:
1074
- 1. Raw text string - A single text-based memory
1075
- 2. User/Assistant pairs array - Conversation pairs that will be chunked as a single memory
1076
-
1077
- The stored memories will be chunked, indexed in both Weaviate and the knowledge graph,
1078
- and made available for semantic search and graph-based retrieval.
1079
-
1080
910
  Parameters
1081
911
  ----------
1082
- tenant_id : str
1083
- Unique identifier for the tenant/organization
1084
-
1085
- sub_tenant_id : typing.Optional[str]
1086
- Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
1087
-
1088
- raw_text : typing.Optional[str]
1089
- Single raw text memory to store. If both raw_text and user_assistant_pairs are provided, raw_text will be used.
912
+ request_options : typing.Optional[RequestOptions]
913
+ Request-specific configuration.
1090
914
 
1091
- user_assistant_pairs : typing.Optional[typing.Sequence[UserAssistantPair]]
1092
- Array of user/assistant conversation pairs to store as a single memory
915
+ Returns
916
+ -------
917
+ AsyncHttpResponse[typing.Optional[typing.Any]]
918
+ Successful Response
919
+ """
920
+ _response = await self._client_wrapper.httpx_client.request(
921
+ "dashboard/user/is_user_admin",
922
+ method="GET",
923
+ request_options=request_options,
924
+ )
925
+ try:
926
+ if _response is None or not _response.text.strip():
927
+ return AsyncHttpResponse(response=_response, data=None)
928
+ if 200 <= _response.status_code < 300:
929
+ _data = typing.cast(
930
+ typing.Optional[typing.Any],
931
+ parse_obj_as(
932
+ type_=typing.Optional[typing.Any], # type: ignore
933
+ object_=_response.json(),
934
+ ),
935
+ )
936
+ return AsyncHttpResponse(response=_response, data=_data)
937
+ _response_json = _response.json()
938
+ except JSONDecodeError:
939
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
940
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1093
941
 
1094
- expiry_time : typing.Optional[int]
1095
- Expiry time in seconds for the memory (optional)
942
+ async def user_details_ep(
943
+ self, *, request_options: typing.Optional[RequestOptions] = None
944
+ ) -> AsyncHttpResponse[typing.Optional[typing.Any]]:
945
+ """
946
+ Parameters
947
+ ----------
948
+ request_options : typing.Optional[RequestOptions]
949
+ Request-specific configuration.
1096
950
 
1097
- infer : typing.Optional[bool]
1098
- If true, process and compress chunks into inferred representations before indexing (default: False)
951
+ Returns
952
+ -------
953
+ AsyncHttpResponse[typing.Optional[typing.Any]]
954
+ Successful Response
955
+ """
956
+ _response = await self._client_wrapper.httpx_client.request(
957
+ "dashboard/user/user_details",
958
+ method="GET",
959
+ request_options=request_options,
960
+ )
961
+ try:
962
+ if _response is None or not _response.text.strip():
963
+ return AsyncHttpResponse(response=_response, data=None)
964
+ if 200 <= _response.status_code < 300:
965
+ _data = typing.cast(
966
+ typing.Optional[typing.Any],
967
+ parse_obj_as(
968
+ type_=typing.Optional[typing.Any], # type: ignore
969
+ object_=_response.json(),
970
+ ),
971
+ )
972
+ return AsyncHttpResponse(response=_response, data=_data)
973
+ _response_json = _response.json()
974
+ except JSONDecodeError:
975
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
976
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1099
977
 
1100
- custom_instructions : typing.Optional[str]
1101
- Custom instructions to guide cortex
978
+ async def create_user(
979
+ self, *, full_name: str, request_options: typing.Optional[RequestOptions] = None
980
+ ) -> AsyncHttpResponse[typing.Optional[typing.Any]]:
981
+ """
982
+ Parameters
983
+ ----------
984
+ full_name : str
1102
985
 
1103
986
  request_options : typing.Optional[RequestOptions]
1104
987
  Request-specific configuration.
1105
988
 
1106
989
  Returns
1107
990
  -------
1108
- AsyncHttpResponse[AddUserMemoryResponse]
991
+ AsyncHttpResponse[typing.Optional[typing.Any]]
1109
992
  Successful Response
1110
993
  """
1111
994
  _response = await self._client_wrapper.httpx_client.request(
1112
- "user_memory/add_user_memory",
995
+ "dashboard/user/create_user",
1113
996
  method="POST",
1114
997
  params={
1115
- "tenant_id": tenant_id,
1116
- "sub_tenant_id": sub_tenant_id,
1117
- },
1118
- json={
1119
- "raw_text": raw_text,
1120
- "user_assistant_pairs": convert_and_respect_annotation_metadata(
1121
- object_=user_assistant_pairs, annotation=typing.Sequence[UserAssistantPair], direction="write"
1122
- ),
1123
- "expiry_time": expiry_time,
1124
- "infer": infer,
1125
- "custom_instructions": custom_instructions,
1126
- },
1127
- headers={
1128
- "content-type": "application/json",
998
+ "full_name": full_name,
1129
999
  },
1130
1000
  request_options=request_options,
1131
- omit=OMIT,
1132
1001
  )
1133
1002
  try:
1003
+ if _response is None or not _response.text.strip():
1004
+ return AsyncHttpResponse(response=_response, data=None)
1134
1005
  if 200 <= _response.status_code < 300:
1135
1006
  _data = typing.cast(
1136
- AddUserMemoryResponse,
1007
+ typing.Optional[typing.Any],
1137
1008
  parse_obj_as(
1138
- type_=AddUserMemoryResponse, # type: ignore
1009
+ type_=typing.Optional[typing.Any], # type: ignore
1139
1010
  object_=_response.json(),
1140
1011
  ),
1141
1012
  )
1142
1013
  return AsyncHttpResponse(response=_response, data=_data)
1143
- if _response.status_code == 400:
1144
- raise BadRequestError(
1145
- headers=dict(_response.headers),
1146
- body=typing.cast(
1147
- ActualErrorResponse,
1148
- parse_obj_as(
1149
- type_=ActualErrorResponse, # type: ignore
1150
- object_=_response.json(),
1151
- ),
1152
- ),
1153
- )
1154
- if _response.status_code == 401:
1155
- raise UnauthorizedError(
1156
- headers=dict(_response.headers),
1157
- body=typing.cast(
1158
- ActualErrorResponse,
1159
- parse_obj_as(
1160
- type_=ActualErrorResponse, # type: ignore
1161
- object_=_response.json(),
1162
- ),
1163
- ),
1164
- )
1165
- if _response.status_code == 403:
1166
- raise ForbiddenError(
1167
- headers=dict(_response.headers),
1168
- body=typing.cast(
1169
- ActualErrorResponse,
1170
- parse_obj_as(
1171
- type_=ActualErrorResponse, # type: ignore
1172
- object_=_response.json(),
1173
- ),
1174
- ),
1175
- )
1176
- if _response.status_code == 404:
1177
- raise NotFoundError(
1178
- headers=dict(_response.headers),
1179
- body=typing.cast(
1180
- ActualErrorResponse,
1181
- parse_obj_as(
1182
- type_=ActualErrorResponse, # type: ignore
1183
- object_=_response.json(),
1184
- ),
1185
- ),
1186
- )
1187
1014
  if _response.status_code == 422:
1188
1015
  raise UnprocessableEntityError(
1189
1016
  headers=dict(_response.headers),
@@ -1195,28 +1022,42 @@ class AsyncRawUserMemoryClient:
1195
1022
  ),
1196
1023
  ),
1197
1024
  )
1198
- if _response.status_code == 500:
1199
- raise InternalServerError(
1200
- headers=dict(_response.headers),
1201
- body=typing.cast(
1202
- ActualErrorResponse,
1203
- parse_obj_as(
1204
- type_=ActualErrorResponse, # type: ignore
1205
- object_=_response.json(),
1206
- ),
1207
- ),
1208
- )
1209
- if _response.status_code == 503:
1210
- raise ServiceUnavailableError(
1211
- headers=dict(_response.headers),
1212
- body=typing.cast(
1213
- ActualErrorResponse,
1214
- parse_obj_as(
1215
- type_=ActualErrorResponse, # type: ignore
1216
- object_=_response.json(),
1217
- ),
1025
+ _response_json = _response.json()
1026
+ except JSONDecodeError:
1027
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1028
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1029
+
1030
+ async def check_user_exists(
1031
+ self, *, request_options: typing.Optional[RequestOptions] = None
1032
+ ) -> AsyncHttpResponse[typing.Optional[typing.Any]]:
1033
+ """
1034
+ Parameters
1035
+ ----------
1036
+ request_options : typing.Optional[RequestOptions]
1037
+ Request-specific configuration.
1038
+
1039
+ Returns
1040
+ -------
1041
+ AsyncHttpResponse[typing.Optional[typing.Any]]
1042
+ Successful Response
1043
+ """
1044
+ _response = await self._client_wrapper.httpx_client.request(
1045
+ "dashboard/user/check_user_exists",
1046
+ method="GET",
1047
+ request_options=request_options,
1048
+ )
1049
+ try:
1050
+ if _response is None or not _response.text.strip():
1051
+ return AsyncHttpResponse(response=_response, data=None)
1052
+ if 200 <= _response.status_code < 300:
1053
+ _data = typing.cast(
1054
+ typing.Optional[typing.Any],
1055
+ parse_obj_as(
1056
+ type_=typing.Optional[typing.Any], # type: ignore
1057
+ object_=_response.json(),
1218
1058
  ),
1219
1059
  )
1060
+ return AsyncHttpResponse(response=_response, data=_data)
1220
1061
  _response_json = _response.json()
1221
1062
  except JSONDecodeError:
1222
1063
  raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)