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
usecortex_ai/__init__.py CHANGED
@@ -4,56 +4,61 @@
4
4
 
5
5
  from .types import (
6
6
  ActualErrorResponse,
7
- AddUserMemoryResponse,
7
+ AddMemoryResponse,
8
+ ApiKeyInfo,
8
9
  AppSourcesUploadData,
9
10
  AttachmentModel,
10
- BatchUploadData,
11
11
  Bm25OperatorType,
12
- BodyScrapeWebpageUploadScrapeWebpagePost,
13
- BodyUpdateScrapeJobUploadUpdateWebpagePatch,
14
- ChunkGraphRelationsResponse,
12
+ CollectionStats,
15
13
  ContentModel,
16
- DeleteMemoryRequest,
17
- DeleteSources,
18
- DeleteSubTenantData,
14
+ CustomPropertyDefinition,
15
+ DashboardApisResponse,
16
+ DashboardSourcesResponse,
17
+ DashboardTenantsResponse,
18
+ DeleteResult,
19
19
  DeleteUserMemoryResponse,
20
- EmbeddingsCreateCollectionData,
21
- EmbeddingsDeleteData,
22
- EmbeddingsGetData,
23
- EmbeddingsSearchData,
24
20
  Entity,
25
21
  ErrorResponse,
26
- ExtendedContext,
27
- FetchContentData,
28
- FileUploadResult,
29
- GraphRelationsResponse,
22
+ FetchMode,
23
+ ForcefulRelationsPayload,
24
+ GraphContext,
30
25
  HttpValidationError,
31
- ListSourcesResponse,
32
- ListUserMemoriesResponse,
33
- MarkdownUploadRequest,
26
+ Infra,
27
+ InsertResult,
28
+ MemoryItem,
29
+ MemoryResultItem,
30
+ MilvusDataType,
34
31
  PathTriplet,
35
32
  ProcessingStatus,
36
- RelatedChunk,
33
+ ProcessingStatusIndexingStatus,
34
+ QnASearchResponse,
35
+ RawEmbeddingDocument,
36
+ RawEmbeddingSearchResult,
37
+ RawEmbeddingVector,
37
38
  RelationEvidence,
38
- Relations,
39
+ RetrievalResult,
39
40
  RetrieveMode,
40
- RetrieveResponse,
41
- RetrieveUserMemoryResponse,
42
41
  ScoredPathResponse,
43
- ScoredTripletResponse,
44
- SearchChunk,
45
- SingleUploadData,
46
- Source,
42
+ SearchMode,
43
+ SourceDeleteResponse,
44
+ SourceDeleteResultItem,
45
+ SourceFetchResponse,
46
+ SourceGraphRelationsResponse,
47
+ SourceListResponse,
47
48
  SourceModel,
48
- SubTenantIdsData,
49
- TenantCreateData,
50
- TenantStats,
51
- TripleWithEvidence,
49
+ SourceStatus,
50
+ SourceUploadResponse,
51
+ SourceUploadResultItem,
52
+ SupportedLlmProviders,
53
+ TenantCreateResponse,
54
+ TenantInfo,
55
+ TenantMetadataSchemaInfo,
56
+ TenantStatsResponse,
57
+ TripletWithEvidence,
52
58
  UserAssistantPair,
53
- UserMemory,
54
59
  ValidationError,
55
60
  ValidationErrorLocItem,
56
- WebpageScrapeRequest,
61
+ VectorStoreChunk,
57
62
  )
58
63
  from .errors import (
59
64
  BadRequestError,
@@ -61,84 +66,91 @@ from .errors import (
61
66
  InternalServerError,
62
67
  NotFoundError,
63
68
  ServiceUnavailableError,
69
+ TooManyRequestsError,
64
70
  UnauthorizedError,
65
71
  UnprocessableEntityError,
66
72
  )
67
- from . import document, embeddings, fetch, search, sources, tenant, upload, user, user_memory
73
+ from . import dashboard, embeddings, fetch, search, sources, tenant, upload
68
74
  from .client import AsyncCortexAI, CortexAI
69
75
  from .environment import CortexAIEnvironment
70
76
  from .search import Alpha
77
+ from .upload import BodyUploadAppIngestionUploadAppPostAppSources
71
78
 
72
79
  __all__ = [
73
80
  "ActualErrorResponse",
74
- "AddUserMemoryResponse",
81
+ "AddMemoryResponse",
75
82
  "Alpha",
83
+ "ApiKeyInfo",
76
84
  "AppSourcesUploadData",
77
85
  "AsyncCortexAI",
78
86
  "AttachmentModel",
79
87
  "BadRequestError",
80
- "BatchUploadData",
81
88
  "Bm25OperatorType",
82
- "BodyScrapeWebpageUploadScrapeWebpagePost",
83
- "BodyUpdateScrapeJobUploadUpdateWebpagePatch",
84
- "ChunkGraphRelationsResponse",
89
+ "BodyUploadAppIngestionUploadAppPostAppSources",
90
+ "CollectionStats",
85
91
  "ContentModel",
86
92
  "CortexAI",
87
93
  "CortexAIEnvironment",
88
- "DeleteMemoryRequest",
89
- "DeleteSources",
90
- "DeleteSubTenantData",
94
+ "CustomPropertyDefinition",
95
+ "DashboardApisResponse",
96
+ "DashboardSourcesResponse",
97
+ "DashboardTenantsResponse",
98
+ "DeleteResult",
91
99
  "DeleteUserMemoryResponse",
92
- "EmbeddingsCreateCollectionData",
93
- "EmbeddingsDeleteData",
94
- "EmbeddingsGetData",
95
- "EmbeddingsSearchData",
96
100
  "Entity",
97
101
  "ErrorResponse",
98
- "ExtendedContext",
99
- "FetchContentData",
100
- "FileUploadResult",
102
+ "FetchMode",
101
103
  "ForbiddenError",
102
- "GraphRelationsResponse",
104
+ "ForcefulRelationsPayload",
105
+ "GraphContext",
103
106
  "HttpValidationError",
107
+ "Infra",
108
+ "InsertResult",
104
109
  "InternalServerError",
105
- "ListSourcesResponse",
106
- "ListUserMemoriesResponse",
107
- "MarkdownUploadRequest",
110
+ "MemoryItem",
111
+ "MemoryResultItem",
112
+ "MilvusDataType",
108
113
  "NotFoundError",
109
114
  "PathTriplet",
110
115
  "ProcessingStatus",
111
- "RelatedChunk",
116
+ "ProcessingStatusIndexingStatus",
117
+ "QnASearchResponse",
118
+ "RawEmbeddingDocument",
119
+ "RawEmbeddingSearchResult",
120
+ "RawEmbeddingVector",
112
121
  "RelationEvidence",
113
- "Relations",
122
+ "RetrievalResult",
114
123
  "RetrieveMode",
115
- "RetrieveResponse",
116
- "RetrieveUserMemoryResponse",
117
124
  "ScoredPathResponse",
118
- "ScoredTripletResponse",
119
- "SearchChunk",
125
+ "SearchMode",
120
126
  "ServiceUnavailableError",
121
- "SingleUploadData",
122
- "Source",
127
+ "SourceDeleteResponse",
128
+ "SourceDeleteResultItem",
129
+ "SourceFetchResponse",
130
+ "SourceGraphRelationsResponse",
131
+ "SourceListResponse",
123
132
  "SourceModel",
124
- "SubTenantIdsData",
125
- "TenantCreateData",
126
- "TenantStats",
127
- "TripleWithEvidence",
133
+ "SourceStatus",
134
+ "SourceUploadResponse",
135
+ "SourceUploadResultItem",
136
+ "SupportedLlmProviders",
137
+ "TenantCreateResponse",
138
+ "TenantInfo",
139
+ "TenantMetadataSchemaInfo",
140
+ "TenantStatsResponse",
141
+ "TooManyRequestsError",
142
+ "TripletWithEvidence",
128
143
  "UnauthorizedError",
129
144
  "UnprocessableEntityError",
130
145
  "UserAssistantPair",
131
- "UserMemory",
132
146
  "ValidationError",
133
147
  "ValidationErrorLocItem",
134
- "WebpageScrapeRequest",
135
- "document",
148
+ "VectorStoreChunk",
149
+ "dashboard",
136
150
  "embeddings",
137
151
  "fetch",
138
152
  "search",
139
153
  "sources",
140
154
  "tenant",
141
155
  "upload",
142
- "user",
143
- "user_memory",
144
156
  ]
usecortex_ai/client.py CHANGED
@@ -5,7 +5,7 @@ import typing
5
5
  import httpx
6
6
  from .core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
7
7
  from .core.request_options import RequestOptions
8
- from .document.client import AsyncDocumentClient, DocumentClient
8
+ from .dashboard.client import AsyncDashboardClient, DashboardClient
9
9
  from .embeddings.client import AsyncEmbeddingsClient, EmbeddingsClient
10
10
  from .environment import CortexAIEnvironment
11
11
  from .fetch.client import AsyncFetchClient, FetchClient
@@ -14,8 +14,6 @@ from .search.client import AsyncSearchClient, SearchClient
14
14
  from .sources.client import AsyncSourcesClient, SourcesClient
15
15
  from .tenant.client import AsyncTenantClient, TenantClient
16
16
  from .upload.client import AsyncUploadClient, UploadClient
17
- from .user.client import AsyncUserClient, UserClient
18
- from .user_memory.client import AsyncUserMemoryClient, UserMemoryClient
19
17
 
20
18
 
21
19
  class CortexAI:
@@ -82,15 +80,13 @@ class CortexAI:
82
80
  timeout=_defaulted_timeout,
83
81
  )
84
82
  self._raw_client = RawCortexAI(client_wrapper=self._client_wrapper)
85
- self.search = SearchClient(client_wrapper=self._client_wrapper)
86
- self.sources = SourcesClient(client_wrapper=self._client_wrapper)
87
- self.user_memory = UserMemoryClient(client_wrapper=self._client_wrapper)
88
- self.fetch = FetchClient(client_wrapper=self._client_wrapper)
89
83
  self.upload = UploadClient(client_wrapper=self._client_wrapper)
90
- self.embeddings = EmbeddingsClient(client_wrapper=self._client_wrapper)
91
- self.user = UserClient(client_wrapper=self._client_wrapper)
92
84
  self.tenant = TenantClient(client_wrapper=self._client_wrapper)
93
- self.document = DocumentClient(client_wrapper=self._client_wrapper)
85
+ self.embeddings = EmbeddingsClient(client_wrapper=self._client_wrapper)
86
+ self.fetch = FetchClient(client_wrapper=self._client_wrapper)
87
+ self.sources = SourcesClient(client_wrapper=self._client_wrapper)
88
+ self.search = SearchClient(client_wrapper=self._client_wrapper)
89
+ self.dashboard = DashboardClient(client_wrapper=self._client_wrapper)
94
90
 
95
91
  @property
96
92
  def with_raw_response(self) -> RawCortexAI:
@@ -103,8 +99,12 @@ class CortexAI:
103
99
  """
104
100
  return self._raw_client
105
101
 
106
- def root_get(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Optional[typing.Any]:
102
+ def metrics_metrics_get(
103
+ self, *, request_options: typing.Optional[RequestOptions] = None
104
+ ) -> typing.Optional[typing.Any]:
107
105
  """
106
+ Endpoint that serves Prometheus metrics.
107
+
108
108
  Parameters
109
109
  ----------
110
110
  request_options : typing.Optional[RequestOptions]
@@ -120,9 +120,9 @@ class CortexAI:
120
120
  from usecortex-ai import CortexAI
121
121
 
122
122
  client = CortexAI(token="YOUR_TOKEN", )
123
- client.root_get()
123
+ client.metrics_metrics_get()
124
124
  """
125
- _response = self._raw_client.root_get(request_options=request_options)
125
+ _response = self._raw_client.metrics_metrics_get(request_options=request_options)
126
126
  return _response.data
127
127
 
128
128
 
@@ -190,15 +190,13 @@ class AsyncCortexAI:
190
190
  timeout=_defaulted_timeout,
191
191
  )
192
192
  self._raw_client = AsyncRawCortexAI(client_wrapper=self._client_wrapper)
193
- self.search = AsyncSearchClient(client_wrapper=self._client_wrapper)
194
- self.sources = AsyncSourcesClient(client_wrapper=self._client_wrapper)
195
- self.user_memory = AsyncUserMemoryClient(client_wrapper=self._client_wrapper)
196
- self.fetch = AsyncFetchClient(client_wrapper=self._client_wrapper)
197
193
  self.upload = AsyncUploadClient(client_wrapper=self._client_wrapper)
198
- self.embeddings = AsyncEmbeddingsClient(client_wrapper=self._client_wrapper)
199
- self.user = AsyncUserClient(client_wrapper=self._client_wrapper)
200
194
  self.tenant = AsyncTenantClient(client_wrapper=self._client_wrapper)
201
- self.document = AsyncDocumentClient(client_wrapper=self._client_wrapper)
195
+ self.embeddings = AsyncEmbeddingsClient(client_wrapper=self._client_wrapper)
196
+ self.fetch = AsyncFetchClient(client_wrapper=self._client_wrapper)
197
+ self.sources = AsyncSourcesClient(client_wrapper=self._client_wrapper)
198
+ self.search = AsyncSearchClient(client_wrapper=self._client_wrapper)
199
+ self.dashboard = AsyncDashboardClient(client_wrapper=self._client_wrapper)
202
200
 
203
201
  @property
204
202
  def with_raw_response(self) -> AsyncRawCortexAI:
@@ -211,8 +209,12 @@ class AsyncCortexAI:
211
209
  """
212
210
  return self._raw_client
213
211
 
214
- async def root_get(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Optional[typing.Any]:
212
+ async def metrics_metrics_get(
213
+ self, *, request_options: typing.Optional[RequestOptions] = None
214
+ ) -> typing.Optional[typing.Any]:
215
215
  """
216
+ Endpoint that serves Prometheus metrics.
217
+
216
218
  Parameters
217
219
  ----------
218
220
  request_options : typing.Optional[RequestOptions]
@@ -231,10 +233,10 @@ class AsyncCortexAI:
231
233
 
232
234
  client = AsyncCortexAI(token="YOUR_TOKEN", )
233
235
  async def main() -> None:
234
- await client.root_get()
236
+ await client.metrics_metrics_get()
235
237
  asyncio.run(main())
236
238
  """
237
- _response = await self._raw_client.root_get(request_options=request_options)
239
+ _response = await self._raw_client.metrics_metrics_get(request_options=request_options)
238
240
  return _response.data
239
241
 
240
242