usecortex-ai 0.3.5__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 (103) hide show
  1. usecortex_ai/__init__.py +84 -66
  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 +78 -62
  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/{related_chunk.py → path_triplet.py} +6 -5
  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 +20 -0
  52. usecortex_ai/types/retrieval_result.py +26 -0
  53. usecortex_ai/types/scored_path_response.py +26 -0
  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/{extended_context.py → tenant_info.py} +13 -4
  67. usecortex_ai/types/{embeddings_search_data.py → tenant_metadata_schema_info.py} +8 -9
  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} +1 -1
  70. usecortex_ai/types/user_assistant_pair.py +4 -0
  71. usecortex_ai/types/{search_chunk.py → vector_store_chunk.py} +3 -9
  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.5.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.5.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/delete_memory_request.py +0 -32
  86. usecortex_ai/types/delete_sub_tenant_data.py +0 -42
  87. usecortex_ai/types/embeddings_delete_data.py +0 -37
  88. usecortex_ai/types/embeddings_get_data.py +0 -37
  89. usecortex_ai/types/markdown_upload_request.py +0 -41
  90. usecortex_ai/types/retrieve_user_memory_response.py +0 -38
  91. usecortex_ai/types/source.py +0 -52
  92. usecortex_ai/types/sub_tenant_ids_data.py +0 -47
  93. usecortex_ai/types/tenant_stats.py +0 -42
  94. usecortex_ai/types/webpage_scrape_request.py +0 -27
  95. usecortex_ai/user/__init__.py +0 -4
  96. usecortex_ai/user/client.py +0 -145
  97. usecortex_ai/user/raw_client.py +0 -316
  98. usecortex_ai/user_memory/__init__.py +0 -4
  99. usecortex_ai/user_memory/client.py +0 -515
  100. usecortex_ai-0.3.5.dist-info/RECORD +0 -108
  101. /usecortex_ai/{document → dashboard}/__init__.py +0 -0
  102. {usecortex_ai-0.3.5.dist-info → usecortex_ai-0.4.0.dist-info}/licenses/LICENSE +0 -0
  103. {usecortex_ai-0.3.5.dist-info → usecortex_ai-0.4.0.dist-info}/top_level.txt +0 -0
usecortex_ai/__init__.py CHANGED
@@ -4,52 +4,60 @@
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,
12
+ CollectionStats,
14
13
  ContentModel,
15
- DeleteMemoryRequest,
16
- DeleteSources,
17
- DeleteSubTenantData,
14
+ CustomPropertyDefinition,
15
+ DashboardApisResponse,
16
+ DashboardSourcesResponse,
17
+ DashboardTenantsResponse,
18
+ DeleteResult,
18
19
  DeleteUserMemoryResponse,
19
- EmbeddingsCreateCollectionData,
20
- EmbeddingsDeleteData,
21
- EmbeddingsGetData,
22
- EmbeddingsSearchData,
23
20
  Entity,
24
21
  ErrorResponse,
25
- ExtendedContext,
26
- FetchContentData,
27
- FileUploadResult,
28
- GraphRelationsResponse,
22
+ FetchMode,
23
+ GraphContext,
29
24
  HttpValidationError,
30
- ListSourcesResponse,
31
- ListUserMemoriesResponse,
32
- MarkdownUploadRequest,
25
+ Infra,
26
+ InsertResult,
27
+ MemoryItem,
28
+ MemoryResultItem,
29
+ MilvusDataType,
30
+ PathTriplet,
33
31
  ProcessingStatus,
34
- RelatedChunk,
32
+ ProcessingStatusIndexingStatus,
33
+ QnASearchResponse,
34
+ RawEmbeddingDocument,
35
+ RawEmbeddingSearchResult,
36
+ RawEmbeddingVector,
35
37
  RelationEvidence,
36
- Relations,
38
+ RetrievalResult,
37
39
  RetrieveMode,
38
- RetrieveResponse,
39
- RetrieveUserMemoryResponse,
40
- SearchChunk,
41
- SingleUploadData,
42
- Source,
40
+ ScoredPathResponse,
41
+ SearchMode,
42
+ SourceDeleteResponse,
43
+ SourceDeleteResultItem,
44
+ SourceFetchResponse,
45
+ SourceGraphRelationsResponse,
46
+ SourceListResponse,
43
47
  SourceModel,
44
- SubTenantIdsData,
45
- TenantCreateData,
46
- TenantStats,
47
- TripleWithEvidence,
48
+ SourceStatus,
49
+ SourceUploadResponse,
50
+ SourceUploadResultItem,
51
+ SupportedLlmProviders,
52
+ TenantCreateResponse,
53
+ TenantInfo,
54
+ TenantMetadataSchemaInfo,
55
+ TenantStatsResponse,
56
+ TripletWithEvidence,
48
57
  UserAssistantPair,
49
- UserMemory,
50
58
  ValidationError,
51
59
  ValidationErrorLocItem,
52
- WebpageScrapeRequest,
60
+ VectorStoreChunk,
53
61
  )
54
62
  from .errors import (
55
63
  BadRequestError,
@@ -57,80 +65,90 @@ from .errors import (
57
65
  InternalServerError,
58
66
  NotFoundError,
59
67
  ServiceUnavailableError,
68
+ TooManyRequestsError,
60
69
  UnauthorizedError,
61
70
  UnprocessableEntityError,
62
71
  )
63
- from . import document, embeddings, fetch, search, sources, tenant, upload, user, user_memory
72
+ from . import dashboard, embeddings, fetch, search, sources, tenant, upload
64
73
  from .client import AsyncCortexAI, CortexAI
65
74
  from .environment import CortexAIEnvironment
66
75
  from .search import Alpha
76
+ from .upload import BodyUploadAppIngestionUploadAppPostAppSources
67
77
 
68
78
  __all__ = [
69
79
  "ActualErrorResponse",
70
- "AddUserMemoryResponse",
80
+ "AddMemoryResponse",
71
81
  "Alpha",
82
+ "ApiKeyInfo",
72
83
  "AppSourcesUploadData",
73
84
  "AsyncCortexAI",
74
85
  "AttachmentModel",
75
86
  "BadRequestError",
76
- "BatchUploadData",
77
87
  "Bm25OperatorType",
78
- "BodyScrapeWebpageUploadScrapeWebpagePost",
79
- "BodyUpdateScrapeJobUploadUpdateWebpagePatch",
88
+ "BodyUploadAppIngestionUploadAppPostAppSources",
89
+ "CollectionStats",
80
90
  "ContentModel",
81
91
  "CortexAI",
82
92
  "CortexAIEnvironment",
83
- "DeleteMemoryRequest",
84
- "DeleteSources",
85
- "DeleteSubTenantData",
93
+ "CustomPropertyDefinition",
94
+ "DashboardApisResponse",
95
+ "DashboardSourcesResponse",
96
+ "DashboardTenantsResponse",
97
+ "DeleteResult",
86
98
  "DeleteUserMemoryResponse",
87
- "EmbeddingsCreateCollectionData",
88
- "EmbeddingsDeleteData",
89
- "EmbeddingsGetData",
90
- "EmbeddingsSearchData",
91
99
  "Entity",
92
100
  "ErrorResponse",
93
- "ExtendedContext",
94
- "FetchContentData",
95
- "FileUploadResult",
101
+ "FetchMode",
96
102
  "ForbiddenError",
97
- "GraphRelationsResponse",
103
+ "GraphContext",
98
104
  "HttpValidationError",
105
+ "Infra",
106
+ "InsertResult",
99
107
  "InternalServerError",
100
- "ListSourcesResponse",
101
- "ListUserMemoriesResponse",
102
- "MarkdownUploadRequest",
108
+ "MemoryItem",
109
+ "MemoryResultItem",
110
+ "MilvusDataType",
103
111
  "NotFoundError",
112
+ "PathTriplet",
104
113
  "ProcessingStatus",
105
- "RelatedChunk",
114
+ "ProcessingStatusIndexingStatus",
115
+ "QnASearchResponse",
116
+ "RawEmbeddingDocument",
117
+ "RawEmbeddingSearchResult",
118
+ "RawEmbeddingVector",
106
119
  "RelationEvidence",
107
- "Relations",
120
+ "RetrievalResult",
108
121
  "RetrieveMode",
109
- "RetrieveResponse",
110
- "RetrieveUserMemoryResponse",
111
- "SearchChunk",
122
+ "ScoredPathResponse",
123
+ "SearchMode",
112
124
  "ServiceUnavailableError",
113
- "SingleUploadData",
114
- "Source",
125
+ "SourceDeleteResponse",
126
+ "SourceDeleteResultItem",
127
+ "SourceFetchResponse",
128
+ "SourceGraphRelationsResponse",
129
+ "SourceListResponse",
115
130
  "SourceModel",
116
- "SubTenantIdsData",
117
- "TenantCreateData",
118
- "TenantStats",
119
- "TripleWithEvidence",
131
+ "SourceStatus",
132
+ "SourceUploadResponse",
133
+ "SourceUploadResultItem",
134
+ "SupportedLlmProviders",
135
+ "TenantCreateResponse",
136
+ "TenantInfo",
137
+ "TenantMetadataSchemaInfo",
138
+ "TenantStatsResponse",
139
+ "TooManyRequestsError",
140
+ "TripletWithEvidence",
120
141
  "UnauthorizedError",
121
142
  "UnprocessableEntityError",
122
143
  "UserAssistantPair",
123
- "UserMemory",
124
144
  "ValidationError",
125
145
  "ValidationErrorLocItem",
126
- "WebpageScrapeRequest",
127
- "document",
146
+ "VectorStoreChunk",
147
+ "dashboard",
128
148
  "embeddings",
129
149
  "fetch",
130
150
  "search",
131
151
  "sources",
132
152
  "tenant",
133
153
  "upload",
134
- "user",
135
- "user_memory",
136
154
  ]
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