usecortex-ai 0.3.6__py3-none-any.whl → 0.5.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 (107) hide show
  1. usecortex_ai/__init__.py +82 -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 +313 -257
  19. usecortex_ai/search/raw_client.py +463 -344
  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 +76 -66
  26. usecortex_ai/types/add_memory_response.py +39 -0
  27. usecortex_ai/types/{scored_triplet_response.py → api_key_info.py} +16 -12
  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/{relations.py → forceful_relations_payload.py} +4 -4
  39. usecortex_ai/types/graph_context.py +26 -0
  40. usecortex_ai/types/{delete_sources.py → infra.py} +4 -3
  41. usecortex_ai/types/{fetch_content_data.py → insert_result.py} +12 -8
  42. usecortex_ai/types/memory_item.py +88 -0
  43. usecortex_ai/types/memory_result_item.py +47 -0
  44. usecortex_ai/types/milvus_data_type.py +21 -0
  45. usecortex_ai/types/path_triplet.py +3 -18
  46. usecortex_ai/types/processing_status.py +3 -2
  47. usecortex_ai/types/processing_status_indexing_status.py +7 -0
  48. usecortex_ai/types/qn_a_search_response.py +49 -0
  49. usecortex_ai/types/{retrieve_response.py → raw_embedding_document.py} +11 -8
  50. usecortex_ai/types/raw_embedding_search_result.py +47 -0
  51. usecortex_ai/types/{user_memory.py → raw_embedding_vector.py} +6 -6
  52. usecortex_ai/types/relation_evidence.py +24 -5
  53. usecortex_ai/types/retrieval_result.py +30 -0
  54. usecortex_ai/types/scored_path_response.py +5 -19
  55. usecortex_ai/types/search_mode.py +5 -0
  56. usecortex_ai/types/{batch_upload_data.py → source_delete_response.py} +8 -8
  57. usecortex_ai/types/{list_user_memories_response.py → source_delete_result_item.py} +11 -7
  58. usecortex_ai/types/source_fetch_response.py +70 -0
  59. usecortex_ai/types/{graph_relations_response.py → source_graph_relations_response.py} +3 -3
  60. usecortex_ai/types/{single_upload_data.py → source_list_response.py} +7 -10
  61. usecortex_ai/types/source_model.py +11 -1
  62. usecortex_ai/types/source_status.py +5 -0
  63. usecortex_ai/types/source_upload_response.py +35 -0
  64. usecortex_ai/types/source_upload_result_item.py +38 -0
  65. usecortex_ai/types/supported_llm_providers.py +5 -0
  66. usecortex_ai/types/{embeddings_create_collection_data.py → tenant_create_response.py} +9 -7
  67. usecortex_ai/types/{webpage_scrape_request.py → tenant_info.py} +10 -5
  68. usecortex_ai/types/tenant_metadata_schema_info.py +36 -0
  69. usecortex_ai/types/{tenant_create_data.py → tenant_stats_response.py} +9 -8
  70. usecortex_ai/types/{triple_with_evidence.py → triplet_with_evidence.py} +5 -1
  71. usecortex_ai/types/user_assistant_pair.py +4 -0
  72. usecortex_ai/types/{search_chunk.py → vector_store_chunk.py} +5 -11
  73. usecortex_ai/upload/__init__.py +3 -0
  74. usecortex_ai/upload/client.py +233 -1937
  75. usecortex_ai/upload/raw_client.py +364 -4401
  76. usecortex_ai/upload/types/__init__.py +7 -0
  77. usecortex_ai/upload/types/body_upload_app_ingestion_upload_app_post_app_sources.py +7 -0
  78. {usecortex_ai-0.3.6.dist-info → usecortex_ai-0.5.0.dist-info}/METADATA +2 -2
  79. usecortex_ai-0.5.0.dist-info/RECORD +114 -0
  80. {usecortex_ai-0.3.6.dist-info → usecortex_ai-0.5.0.dist-info}/WHEEL +1 -1
  81. {usecortex_ai-0.3.6.dist-info → usecortex_ai-0.5.0.dist-info}/licenses/LICENSE +21 -21
  82. {usecortex_ai-0.3.6.dist-info → usecortex_ai-0.5.0.dist-info}/top_level.txt +0 -0
  83. usecortex_ai/document/client.py +0 -139
  84. usecortex_ai/document/raw_client.py +0 -312
  85. usecortex_ai/types/add_user_memory_response.py +0 -41
  86. usecortex_ai/types/body_scrape_webpage_upload_scrape_webpage_post.py +0 -17
  87. usecortex_ai/types/body_update_scrape_job_upload_update_webpage_patch.py +0 -17
  88. usecortex_ai/types/chunk_graph_relations_response.py +0 -33
  89. usecortex_ai/types/delete_memory_request.py +0 -32
  90. usecortex_ai/types/delete_sub_tenant_data.py +0 -42
  91. usecortex_ai/types/embeddings_delete_data.py +0 -37
  92. usecortex_ai/types/embeddings_get_data.py +0 -37
  93. usecortex_ai/types/embeddings_search_data.py +0 -37
  94. usecortex_ai/types/extended_context.py +0 -17
  95. usecortex_ai/types/markdown_upload_request.py +0 -41
  96. usecortex_ai/types/related_chunk.py +0 -22
  97. usecortex_ai/types/retrieve_user_memory_response.py +0 -38
  98. usecortex_ai/types/source.py +0 -52
  99. usecortex_ai/types/sub_tenant_ids_data.py +0 -47
  100. usecortex_ai/types/tenant_stats.py +0 -42
  101. usecortex_ai/user/__init__.py +0 -4
  102. usecortex_ai/user/client.py +0 -145
  103. usecortex_ai/user/raw_client.py +0 -316
  104. usecortex_ai/user_memory/__init__.py +0 -4
  105. usecortex_ai/user_memory/client.py +0 -515
  106. usecortex_ai-0.3.6.dist-info/RECORD +0 -112
  107. /usecortex_ai/{document → dashboard}/__init__.py +0 -0
@@ -0,0 +1,448 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
6
+ from ..core.request_options import RequestOptions
7
+ from ..types.dashboard_apis_response import DashboardApisResponse
8
+ from ..types.dashboard_sources_response import DashboardSourcesResponse
9
+ from ..types.dashboard_tenants_response import DashboardTenantsResponse
10
+ from .raw_client import AsyncRawDashboardClient, RawDashboardClient
11
+
12
+
13
+ class DashboardClient:
14
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
15
+ self._raw_client = RawDashboardClient(client_wrapper=client_wrapper)
16
+
17
+ @property
18
+ def with_raw_response(self) -> RawDashboardClient:
19
+ """
20
+ Retrieves a raw implementation of this client that returns raw responses.
21
+
22
+ Returns
23
+ -------
24
+ RawDashboardClient
25
+ """
26
+ return self._raw_client
27
+
28
+ def list_apis(self, *, request_options: typing.Optional[RequestOptions] = None) -> DashboardApisResponse:
29
+ """
30
+ List all API keys for dashboard view.
31
+
32
+ Uses Firebase authentication to identify the user and returns API keys
33
+ associated with that user.
34
+
35
+ Parameters
36
+ ----------
37
+ request_options : typing.Optional[RequestOptions]
38
+ Request-specific configuration.
39
+
40
+ Returns
41
+ -------
42
+ DashboardApisResponse
43
+ Successful Response
44
+
45
+ Examples
46
+ --------
47
+ from usecortex-ai import CortexAI
48
+
49
+ client = CortexAI(token="YOUR_TOKEN", )
50
+ client.dashboard.list_apis()
51
+ """
52
+ _response = self._raw_client.list_apis(request_options=request_options)
53
+ return _response.data
54
+
55
+ def list_sources(
56
+ self, *, tenant_id: str, sub_tenant_id: str, request_options: typing.Optional[RequestOptions] = None
57
+ ) -> DashboardSourcesResponse:
58
+ """
59
+ List all sources for a tenant/sub-tenant combination.
60
+
61
+ Uses the same logic as the existing get_sources function.
62
+
63
+ Parameters
64
+ ----------
65
+ tenant_id : str
66
+ Tenant ID
67
+
68
+ sub_tenant_id : str
69
+ Sub-tenant ID
70
+
71
+ request_options : typing.Optional[RequestOptions]
72
+ Request-specific configuration.
73
+
74
+ Returns
75
+ -------
76
+ DashboardSourcesResponse
77
+ Successful Response
78
+
79
+ Examples
80
+ --------
81
+ from usecortex-ai import CortexAI
82
+
83
+ client = CortexAI(token="YOUR_TOKEN", )
84
+ client.dashboard.list_sources(tenant_id='tenant_id', sub_tenant_id='sub_tenant_id', )
85
+ """
86
+ _response = self._raw_client.list_sources(
87
+ tenant_id=tenant_id, sub_tenant_id=sub_tenant_id, request_options=request_options
88
+ )
89
+ return _response.data
90
+
91
+ def list_tenants(self, *, request_options: typing.Optional[RequestOptions] = None) -> DashboardTenantsResponse:
92
+ """
93
+ List all tenants for dashboard view.
94
+
95
+ Uses Firebase authentication to identify the user and returns tenant
96
+ mappings associated with that user's organization.
97
+
98
+ Parameters
99
+ ----------
100
+ request_options : typing.Optional[RequestOptions]
101
+ Request-specific configuration.
102
+
103
+ Returns
104
+ -------
105
+ DashboardTenantsResponse
106
+ Successful Response
107
+
108
+ Examples
109
+ --------
110
+ from usecortex-ai import CortexAI
111
+
112
+ client = CortexAI(token="YOUR_TOKEN", )
113
+ client.dashboard.list_tenants()
114
+ """
115
+ _response = self._raw_client.list_tenants(request_options=request_options)
116
+ return _response.data
117
+
118
+ def is_organization_admin(
119
+ self, *, request_options: typing.Optional[RequestOptions] = None
120
+ ) -> typing.Optional[typing.Any]:
121
+ """
122
+ Parameters
123
+ ----------
124
+ request_options : typing.Optional[RequestOptions]
125
+ Request-specific configuration.
126
+
127
+ Returns
128
+ -------
129
+ typing.Optional[typing.Any]
130
+ Successful Response
131
+
132
+ Examples
133
+ --------
134
+ from usecortex-ai import CortexAI
135
+
136
+ client = CortexAI(token="YOUR_TOKEN", )
137
+ client.dashboard.is_organization_admin()
138
+ """
139
+ _response = self._raw_client.is_organization_admin(request_options=request_options)
140
+ return _response.data
141
+
142
+ def user_details_ep(
143
+ self, *, request_options: typing.Optional[RequestOptions] = None
144
+ ) -> typing.Optional[typing.Any]:
145
+ """
146
+ Parameters
147
+ ----------
148
+ request_options : typing.Optional[RequestOptions]
149
+ Request-specific configuration.
150
+
151
+ Returns
152
+ -------
153
+ typing.Optional[typing.Any]
154
+ Successful Response
155
+
156
+ Examples
157
+ --------
158
+ from usecortex-ai import CortexAI
159
+
160
+ client = CortexAI(token="YOUR_TOKEN", )
161
+ client.dashboard.user_details_ep()
162
+ """
163
+ _response = self._raw_client.user_details_ep(request_options=request_options)
164
+ return _response.data
165
+
166
+ def create_user(
167
+ self, *, full_name: str, request_options: typing.Optional[RequestOptions] = None
168
+ ) -> typing.Optional[typing.Any]:
169
+ """
170
+ Parameters
171
+ ----------
172
+ full_name : str
173
+
174
+ request_options : typing.Optional[RequestOptions]
175
+ Request-specific configuration.
176
+
177
+ Returns
178
+ -------
179
+ typing.Optional[typing.Any]
180
+ Successful Response
181
+
182
+ Examples
183
+ --------
184
+ from usecortex-ai import CortexAI
185
+
186
+ client = CortexAI(token="YOUR_TOKEN", )
187
+ client.dashboard.create_user(full_name='full_name', )
188
+ """
189
+ _response = self._raw_client.create_user(full_name=full_name, request_options=request_options)
190
+ return _response.data
191
+
192
+ def check_user_exists(
193
+ self, *, request_options: typing.Optional[RequestOptions] = None
194
+ ) -> typing.Optional[typing.Any]:
195
+ """
196
+ Parameters
197
+ ----------
198
+ request_options : typing.Optional[RequestOptions]
199
+ Request-specific configuration.
200
+
201
+ Returns
202
+ -------
203
+ typing.Optional[typing.Any]
204
+ Successful Response
205
+
206
+ Examples
207
+ --------
208
+ from usecortex-ai import CortexAI
209
+
210
+ client = CortexAI(token="YOUR_TOKEN", )
211
+ client.dashboard.check_user_exists()
212
+ """
213
+ _response = self._raw_client.check_user_exists(request_options=request_options)
214
+ return _response.data
215
+
216
+
217
+ class AsyncDashboardClient:
218
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
219
+ self._raw_client = AsyncRawDashboardClient(client_wrapper=client_wrapper)
220
+
221
+ @property
222
+ def with_raw_response(self) -> AsyncRawDashboardClient:
223
+ """
224
+ Retrieves a raw implementation of this client that returns raw responses.
225
+
226
+ Returns
227
+ -------
228
+ AsyncRawDashboardClient
229
+ """
230
+ return self._raw_client
231
+
232
+ async def list_apis(self, *, request_options: typing.Optional[RequestOptions] = None) -> DashboardApisResponse:
233
+ """
234
+ List all API keys for dashboard view.
235
+
236
+ Uses Firebase authentication to identify the user and returns API keys
237
+ associated with that user.
238
+
239
+ Parameters
240
+ ----------
241
+ request_options : typing.Optional[RequestOptions]
242
+ Request-specific configuration.
243
+
244
+ Returns
245
+ -------
246
+ DashboardApisResponse
247
+ Successful Response
248
+
249
+ Examples
250
+ --------
251
+ import asyncio
252
+
253
+ from usecortex-ai import AsyncCortexAI
254
+
255
+ client = AsyncCortexAI(token="YOUR_TOKEN", )
256
+ async def main() -> None:
257
+ await client.dashboard.list_apis()
258
+ asyncio.run(main())
259
+ """
260
+ _response = await self._raw_client.list_apis(request_options=request_options)
261
+ return _response.data
262
+
263
+ async def list_sources(
264
+ self, *, tenant_id: str, sub_tenant_id: str, request_options: typing.Optional[RequestOptions] = None
265
+ ) -> DashboardSourcesResponse:
266
+ """
267
+ List all sources for a tenant/sub-tenant combination.
268
+
269
+ Uses the same logic as the existing get_sources function.
270
+
271
+ Parameters
272
+ ----------
273
+ tenant_id : str
274
+ Tenant ID
275
+
276
+ sub_tenant_id : str
277
+ Sub-tenant ID
278
+
279
+ request_options : typing.Optional[RequestOptions]
280
+ Request-specific configuration.
281
+
282
+ Returns
283
+ -------
284
+ DashboardSourcesResponse
285
+ Successful Response
286
+
287
+ Examples
288
+ --------
289
+ import asyncio
290
+
291
+ from usecortex-ai import AsyncCortexAI
292
+
293
+ client = AsyncCortexAI(token="YOUR_TOKEN", )
294
+ async def main() -> None:
295
+ await client.dashboard.list_sources(tenant_id='tenant_id', sub_tenant_id='sub_tenant_id', )
296
+ asyncio.run(main())
297
+ """
298
+ _response = await self._raw_client.list_sources(
299
+ tenant_id=tenant_id, sub_tenant_id=sub_tenant_id, request_options=request_options
300
+ )
301
+ return _response.data
302
+
303
+ async def list_tenants(
304
+ self, *, request_options: typing.Optional[RequestOptions] = None
305
+ ) -> DashboardTenantsResponse:
306
+ """
307
+ List all tenants for dashboard view.
308
+
309
+ Uses Firebase authentication to identify the user and returns tenant
310
+ mappings associated with that user's organization.
311
+
312
+ Parameters
313
+ ----------
314
+ request_options : typing.Optional[RequestOptions]
315
+ Request-specific configuration.
316
+
317
+ Returns
318
+ -------
319
+ DashboardTenantsResponse
320
+ Successful Response
321
+
322
+ Examples
323
+ --------
324
+ import asyncio
325
+
326
+ from usecortex-ai import AsyncCortexAI
327
+
328
+ client = AsyncCortexAI(token="YOUR_TOKEN", )
329
+ async def main() -> None:
330
+ await client.dashboard.list_tenants()
331
+ asyncio.run(main())
332
+ """
333
+ _response = await self._raw_client.list_tenants(request_options=request_options)
334
+ return _response.data
335
+
336
+ async def is_organization_admin(
337
+ self, *, request_options: typing.Optional[RequestOptions] = None
338
+ ) -> typing.Optional[typing.Any]:
339
+ """
340
+ Parameters
341
+ ----------
342
+ request_options : typing.Optional[RequestOptions]
343
+ Request-specific configuration.
344
+
345
+ Returns
346
+ -------
347
+ typing.Optional[typing.Any]
348
+ Successful Response
349
+
350
+ Examples
351
+ --------
352
+ import asyncio
353
+
354
+ from usecortex-ai import AsyncCortexAI
355
+
356
+ client = AsyncCortexAI(token="YOUR_TOKEN", )
357
+ async def main() -> None:
358
+ await client.dashboard.is_organization_admin()
359
+ asyncio.run(main())
360
+ """
361
+ _response = await self._raw_client.is_organization_admin(request_options=request_options)
362
+ return _response.data
363
+
364
+ async def user_details_ep(
365
+ self, *, request_options: typing.Optional[RequestOptions] = None
366
+ ) -> typing.Optional[typing.Any]:
367
+ """
368
+ Parameters
369
+ ----------
370
+ request_options : typing.Optional[RequestOptions]
371
+ Request-specific configuration.
372
+
373
+ Returns
374
+ -------
375
+ typing.Optional[typing.Any]
376
+ Successful Response
377
+
378
+ Examples
379
+ --------
380
+ import asyncio
381
+
382
+ from usecortex-ai import AsyncCortexAI
383
+
384
+ client = AsyncCortexAI(token="YOUR_TOKEN", )
385
+ async def main() -> None:
386
+ await client.dashboard.user_details_ep()
387
+ asyncio.run(main())
388
+ """
389
+ _response = await self._raw_client.user_details_ep(request_options=request_options)
390
+ return _response.data
391
+
392
+ async def create_user(
393
+ self, *, full_name: str, request_options: typing.Optional[RequestOptions] = None
394
+ ) -> typing.Optional[typing.Any]:
395
+ """
396
+ Parameters
397
+ ----------
398
+ full_name : str
399
+
400
+ request_options : typing.Optional[RequestOptions]
401
+ Request-specific configuration.
402
+
403
+ Returns
404
+ -------
405
+ typing.Optional[typing.Any]
406
+ Successful Response
407
+
408
+ Examples
409
+ --------
410
+ import asyncio
411
+
412
+ from usecortex-ai import AsyncCortexAI
413
+
414
+ client = AsyncCortexAI(token="YOUR_TOKEN", )
415
+ async def main() -> None:
416
+ await client.dashboard.create_user(full_name='full_name', )
417
+ asyncio.run(main())
418
+ """
419
+ _response = await self._raw_client.create_user(full_name=full_name, request_options=request_options)
420
+ return _response.data
421
+
422
+ async def check_user_exists(
423
+ self, *, request_options: typing.Optional[RequestOptions] = None
424
+ ) -> typing.Optional[typing.Any]:
425
+ """
426
+ Parameters
427
+ ----------
428
+ request_options : typing.Optional[RequestOptions]
429
+ Request-specific configuration.
430
+
431
+ Returns
432
+ -------
433
+ typing.Optional[typing.Any]
434
+ Successful Response
435
+
436
+ Examples
437
+ --------
438
+ import asyncio
439
+
440
+ from usecortex-ai import AsyncCortexAI
441
+
442
+ client = AsyncCortexAI(token="YOUR_TOKEN", )
443
+ async def main() -> None:
444
+ await client.dashboard.check_user_exists()
445
+ asyncio.run(main())
446
+ """
447
+ _response = await self._raw_client.check_user_exists(request_options=request_options)
448
+ return _response.data