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
@@ -2,4 +2,4 @@
2
2
 
3
3
  import typing
4
4
 
5
- Alpha = typing.Union[float, str]
5
+ Alpha = typing.Union[str, float]
@@ -4,8 +4,7 @@ import typing
4
4
 
5
5
  from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
6
6
  from ..core.request_options import RequestOptions
7
- from ..types.graph_relations_response import GraphRelationsResponse
8
- from ..types.list_sources_response import ListSourcesResponse
7
+ from ..types.source_delete_response import SourceDeleteResponse
9
8
  from .raw_client import AsyncRawSourcesClient, RawSourcesClient
10
9
 
11
10
  # this is used as the default value for optional parameters
@@ -27,126 +26,37 @@ class SourcesClient:
27
26
  """
28
27
  return self._raw_client
29
28
 
30
- def get_all(
31
- self,
32
- *,
33
- tenant_id: str,
34
- sub_tenant_id: typing.Optional[str] = None,
35
- request_options: typing.Optional[RequestOptions] = None,
36
- ) -> ListSourcesResponse:
37
- """
38
- Retrieve all sources for a specific tenant.
39
-
40
- Use this endpoint to fetch a complete list of all sources associated with your tenant. This includes documents, files, and other content you've uploaded for processing.
41
-
42
- You can optionally specify a sub-tenant to narrow down the results to sources within that specific sub-tenant scope.
43
-
44
- Parameters
45
- ----------
46
- tenant_id : str
47
- Unique identifier for the tenant/organization
48
-
49
- sub_tenant_id : typing.Optional[str]
50
- Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
51
-
52
- request_options : typing.Optional[RequestOptions]
53
- Request-specific configuration.
54
-
55
- Returns
56
- -------
57
- ListSourcesResponse
58
- Successful Response
59
-
60
- Examples
61
- --------
62
- from usecortex-ai import CortexAI
63
-
64
- client = CortexAI(token="YOUR_TOKEN", )
65
- client.sources.get_all(tenant_id='tenant_1234', sub_tenant_id='sub_tenant_4567', )
66
- """
67
- _response = self._raw_client.get_all(
68
- tenant_id=tenant_id, sub_tenant_id=sub_tenant_id, request_options=request_options
69
- )
70
- return _response.data
71
-
72
- def get_by_ids(
29
+ def delete(
73
30
  self,
74
31
  *,
75
32
  tenant_id: str,
33
+ sub_tenant_id: str,
76
34
  source_ids: typing.Sequence[str],
77
- sub_tenant_id: typing.Optional[str] = OMIT,
78
35
  request_options: typing.Optional[RequestOptions] = None,
79
- ) -> ListSourcesResponse:
36
+ ) -> SourceDeleteResponse:
80
37
  """
81
- Retrieve specific sources by their IDs.
38
+ Remove documents and content from your knowledge base.
82
39
 
83
- Use this endpoint to fetch one or more sources by providing their unique identifiers. This is useful when you need detailed information about specific documents or content you've previously uploaded.
40
+ This endpoint permanently deletes the specified sources from your knowledge base.
41
+ Once deleted, the content will no longer be available for search or retrieval.
84
42
 
85
- Provide the source IDs in the request body along with your tenant information to get the exact sources you need.
43
+ Use this carefully as the action cannot be undone. The system will confirm successful deletion of each source ID you specify.
86
44
 
87
45
  Parameters
88
46
  ----------
89
47
  tenant_id : str
90
- Unique identifier for the tenant/organization
91
-
92
- source_ids : typing.Sequence[str]
93
- List of source IDs to fetch
94
48
 
95
- sub_tenant_id : typing.Optional[str]
96
- Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
49
+ sub_tenant_id : str
97
50
 
98
- request_options : typing.Optional[RequestOptions]
99
- Request-specific configuration.
100
-
101
- Returns
102
- -------
103
- ListSourcesResponse
104
- Successful Response
105
-
106
- Examples
107
- --------
108
- from usecortex-ai import CortexAI
109
-
110
- client = CortexAI(token="YOUR_TOKEN", )
111
- client.sources.get_by_ids(tenant_id='tenant_1234', source_ids=['CortexDoc1234', 'CortexDoc4567'], )
112
- """
113
- _response = self._raw_client.get_by_ids(
114
- tenant_id=tenant_id, source_ids=source_ids, sub_tenant_id=sub_tenant_id, request_options=request_options
115
- )
116
- return _response.data
117
-
118
- def get_graph_relations_by_id(
119
- self,
120
- *,
121
- source_id: str,
122
- tenant_id: typing.Optional[str] = None,
123
- sub_tenant_id: typing.Optional[str] = None,
124
- request_options: typing.Optional[RequestOptions] = None,
125
- ) -> GraphRelationsResponse:
126
- """
127
- Retrieve relations for a specific source.
128
-
129
- Use this endpoint to fetch all relations associated with a specific source. This is useful when you need to understand the relationships between entities within a source.
130
-
131
- Provide the source ID in the request body along with your tenant information to get the relations for that source.
132
-
133
- Parameters
134
- ----------
135
- source_id : str
136
- The source ID to fetch relations for
137
-
138
- tenant_id : typing.Optional[str]
139
- Unique identifier for the tenant/organization
140
-
141
- sub_tenant_id : typing.Optional[str]
142
- Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
51
+ source_ids : typing.Sequence[str]
52
+ List of source IDs to delete.
143
53
 
144
54
  request_options : typing.Optional[RequestOptions]
145
55
  Request-specific configuration.
146
56
 
147
57
  Returns
148
58
  -------
149
- GraphRelationsResponse
59
+ SourceDeleteResponse
150
60
  Successful Response
151
61
 
152
62
  Examples
@@ -154,10 +64,10 @@ class SourcesClient:
154
64
  from usecortex-ai import CortexAI
155
65
 
156
66
  client = CortexAI(token="YOUR_TOKEN", )
157
- client.sources.get_graph_relations_by_id(source_id='CortexDoc1234', tenant_id='tenant_1234', )
67
+ client.sources.delete(tenant_id='tenant_id', sub_tenant_id='sub_tenant_id', source_ids=['source_ids'], )
158
68
  """
159
- _response = self._raw_client.get_graph_relations_by_id(
160
- source_id=source_id, tenant_id=tenant_id, sub_tenant_id=sub_tenant_id, request_options=request_options
69
+ _response = self._raw_client.delete(
70
+ tenant_id=tenant_id, sub_tenant_id=sub_tenant_id, source_ids=source_ids, request_options=request_options
161
71
  )
162
72
  return _response.data
163
73
 
@@ -177,134 +87,37 @@ class AsyncSourcesClient:
177
87
  """
178
88
  return self._raw_client
179
89
 
180
- async def get_all(
181
- self,
182
- *,
183
- tenant_id: str,
184
- sub_tenant_id: typing.Optional[str] = None,
185
- request_options: typing.Optional[RequestOptions] = None,
186
- ) -> ListSourcesResponse:
187
- """
188
- Retrieve all sources for a specific tenant.
189
-
190
- Use this endpoint to fetch a complete list of all sources associated with your tenant. This includes documents, files, and other content you've uploaded for processing.
191
-
192
- You can optionally specify a sub-tenant to narrow down the results to sources within that specific sub-tenant scope.
193
-
194
- Parameters
195
- ----------
196
- tenant_id : str
197
- Unique identifier for the tenant/organization
198
-
199
- sub_tenant_id : typing.Optional[str]
200
- Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
201
-
202
- request_options : typing.Optional[RequestOptions]
203
- Request-specific configuration.
204
-
205
- Returns
206
- -------
207
- ListSourcesResponse
208
- Successful Response
209
-
210
- Examples
211
- --------
212
- import asyncio
213
-
214
- from usecortex-ai import AsyncCortexAI
215
-
216
- client = AsyncCortexAI(token="YOUR_TOKEN", )
217
- async def main() -> None:
218
- await client.sources.get_all(tenant_id='tenant_1234', sub_tenant_id='sub_tenant_4567', )
219
- asyncio.run(main())
220
- """
221
- _response = await self._raw_client.get_all(
222
- tenant_id=tenant_id, sub_tenant_id=sub_tenant_id, request_options=request_options
223
- )
224
- return _response.data
225
-
226
- async def get_by_ids(
90
+ async def delete(
227
91
  self,
228
92
  *,
229
93
  tenant_id: str,
94
+ sub_tenant_id: str,
230
95
  source_ids: typing.Sequence[str],
231
- sub_tenant_id: typing.Optional[str] = OMIT,
232
96
  request_options: typing.Optional[RequestOptions] = None,
233
- ) -> ListSourcesResponse:
97
+ ) -> SourceDeleteResponse:
234
98
  """
235
- Retrieve specific sources by their IDs.
99
+ Remove documents and content from your knowledge base.
236
100
 
237
- Use this endpoint to fetch one or more sources by providing their unique identifiers. This is useful when you need detailed information about specific documents or content you've previously uploaded.
101
+ This endpoint permanently deletes the specified sources from your knowledge base.
102
+ Once deleted, the content will no longer be available for search or retrieval.
238
103
 
239
- Provide the source IDs in the request body along with your tenant information to get the exact sources you need.
104
+ Use this carefully as the action cannot be undone. The system will confirm successful deletion of each source ID you specify.
240
105
 
241
106
  Parameters
242
107
  ----------
243
108
  tenant_id : str
244
- Unique identifier for the tenant/organization
245
-
246
- source_ids : typing.Sequence[str]
247
- List of source IDs to fetch
248
109
 
249
- sub_tenant_id : typing.Optional[str]
250
- Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
110
+ sub_tenant_id : str
251
111
 
252
- request_options : typing.Optional[RequestOptions]
253
- Request-specific configuration.
254
-
255
- Returns
256
- -------
257
- ListSourcesResponse
258
- Successful Response
259
-
260
- Examples
261
- --------
262
- import asyncio
263
-
264
- from usecortex-ai import AsyncCortexAI
265
-
266
- client = AsyncCortexAI(token="YOUR_TOKEN", )
267
- async def main() -> None:
268
- await client.sources.get_by_ids(tenant_id='tenant_1234', source_ids=['CortexDoc1234', 'CortexDoc4567'], )
269
- asyncio.run(main())
270
- """
271
- _response = await self._raw_client.get_by_ids(
272
- tenant_id=tenant_id, source_ids=source_ids, sub_tenant_id=sub_tenant_id, request_options=request_options
273
- )
274
- return _response.data
275
-
276
- async def get_graph_relations_by_id(
277
- self,
278
- *,
279
- source_id: str,
280
- tenant_id: typing.Optional[str] = None,
281
- sub_tenant_id: typing.Optional[str] = None,
282
- request_options: typing.Optional[RequestOptions] = None,
283
- ) -> GraphRelationsResponse:
284
- """
285
- Retrieve relations for a specific source.
286
-
287
- Use this endpoint to fetch all relations associated with a specific source. This is useful when you need to understand the relationships between entities within a source.
288
-
289
- Provide the source ID in the request body along with your tenant information to get the relations for that source.
290
-
291
- Parameters
292
- ----------
293
- source_id : str
294
- The source ID to fetch relations for
295
-
296
- tenant_id : typing.Optional[str]
297
- Unique identifier for the tenant/organization
298
-
299
- sub_tenant_id : typing.Optional[str]
300
- Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
112
+ source_ids : typing.Sequence[str]
113
+ List of source IDs to delete.
301
114
 
302
115
  request_options : typing.Optional[RequestOptions]
303
116
  Request-specific configuration.
304
117
 
305
118
  Returns
306
119
  -------
307
- GraphRelationsResponse
120
+ SourceDeleteResponse
308
121
  Successful Response
309
122
 
310
123
  Examples
@@ -315,10 +128,10 @@ class AsyncSourcesClient:
315
128
 
316
129
  client = AsyncCortexAI(token="YOUR_TOKEN", )
317
130
  async def main() -> None:
318
- await client.sources.get_graph_relations_by_id(source_id='CortexDoc1234', tenant_id='tenant_1234', )
131
+ await client.sources.delete(tenant_id='tenant_id', sub_tenant_id='sub_tenant_id', source_ids=['source_ids'], )
319
132
  asyncio.run(main())
320
133
  """
321
- _response = await self._raw_client.get_graph_relations_by_id(
322
- source_id=source_id, tenant_id=tenant_id, sub_tenant_id=sub_tenant_id, request_options=request_options
134
+ _response = await self._raw_client.delete(
135
+ tenant_id=tenant_id, sub_tenant_id=sub_tenant_id, source_ids=source_ids, request_options=request_options
323
136
  )
324
137
  return _response.data