usecortex-ai 0.5.0__py3-none-any.whl → 0.5.1__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.
- usecortex_ai/__init__.py +8 -4
- usecortex_ai/client.py +0 -4
- usecortex_ai/dashboard/client.py +2 -30
- usecortex_ai/dashboard/raw_client.py +0 -28
- usecortex_ai/embeddings/client.py +8 -58
- usecortex_ai/embeddings/raw_client.py +8 -58
- usecortex_ai/fetch/__init__.py +3 -0
- usecortex_ai/fetch/client.py +42 -165
- usecortex_ai/fetch/raw_client.py +38 -341
- usecortex_ai/fetch/types/__init__.py +7 -0
- usecortex_ai/fetch/types/fetch_list_knowledge_response.py +8 -0
- usecortex_ai/raw_client.py +0 -4
- usecortex_ai/search/client.py +36 -124
- usecortex_ai/search/raw_client.py +36 -124
- usecortex_ai/sources/client.py +2 -16
- usecortex_ai/sources/raw_client.py +2 -16
- usecortex_ai/tenant/client.py +4 -108
- usecortex_ai/tenant/raw_client.py +2 -106
- usecortex_ai/types/__init__.py +6 -2
- usecortex_ai/types/list_content_kind.py +5 -0
- usecortex_ai/types/list_user_memories_response.py +32 -0
- usecortex_ai/types/retrieval_result.py +1 -1
- usecortex_ai/types/retrieve_mode.py +1 -1
- usecortex_ai/types/user_memory.py +31 -0
- usecortex_ai/upload/__init__.py +0 -3
- usecortex_ai/upload/client.py +34 -204
- usecortex_ai/upload/raw_client.py +30 -382
- {usecortex_ai-0.5.0.dist-info → usecortex_ai-0.5.1.dist-info}/METADATA +1 -1
- {usecortex_ai-0.5.0.dist-info → usecortex_ai-0.5.1.dist-info}/RECORD +32 -30
- {usecortex_ai-0.5.0.dist-info → usecortex_ai-0.5.1.dist-info}/licenses/LICENSE +21 -21
- {usecortex_ai-0.5.0.dist-info → usecortex_ai-0.5.1.dist-info}/top_level.txt +0 -0
- usecortex_ai/types/app_sources_upload_data.py +0 -39
- usecortex_ai/upload/types/__init__.py +0 -7
- usecortex_ai/upload/types/body_upload_app_ingestion_upload_app_post_app_sources.py +0 -7
- {usecortex_ai-0.5.0.dist-info → usecortex_ai-0.5.1.dist-info}/WHEEL +0 -0
usecortex_ai/__init__.py
CHANGED
|
@@ -6,7 +6,6 @@ from .types import (
|
|
|
6
6
|
ActualErrorResponse,
|
|
7
7
|
AddMemoryResponse,
|
|
8
8
|
ApiKeyInfo,
|
|
9
|
-
AppSourcesUploadData,
|
|
10
9
|
AttachmentModel,
|
|
11
10
|
Bm25OperatorType,
|
|
12
11
|
CollectionStats,
|
|
@@ -25,6 +24,8 @@ from .types import (
|
|
|
25
24
|
HttpValidationError,
|
|
26
25
|
Infra,
|
|
27
26
|
InsertResult,
|
|
27
|
+
ListContentKind,
|
|
28
|
+
ListUserMemoriesResponse,
|
|
28
29
|
MemoryItem,
|
|
29
30
|
MemoryResultItem,
|
|
30
31
|
MilvusDataType,
|
|
@@ -56,6 +57,7 @@ from .types import (
|
|
|
56
57
|
TenantStatsResponse,
|
|
57
58
|
TripletWithEvidence,
|
|
58
59
|
UserAssistantPair,
|
|
60
|
+
UserMemory,
|
|
59
61
|
ValidationError,
|
|
60
62
|
ValidationErrorLocItem,
|
|
61
63
|
VectorStoreChunk,
|
|
@@ -73,20 +75,18 @@ from .errors import (
|
|
|
73
75
|
from . import dashboard, embeddings, fetch, search, sources, tenant, upload
|
|
74
76
|
from .client import AsyncCortexAI, CortexAI
|
|
75
77
|
from .environment import CortexAIEnvironment
|
|
78
|
+
from .fetch import FetchListKnowledgeResponse
|
|
76
79
|
from .search import Alpha
|
|
77
|
-
from .upload import BodyUploadAppIngestionUploadAppPostAppSources
|
|
78
80
|
|
|
79
81
|
__all__ = [
|
|
80
82
|
"ActualErrorResponse",
|
|
81
83
|
"AddMemoryResponse",
|
|
82
84
|
"Alpha",
|
|
83
85
|
"ApiKeyInfo",
|
|
84
|
-
"AppSourcesUploadData",
|
|
85
86
|
"AsyncCortexAI",
|
|
86
87
|
"AttachmentModel",
|
|
87
88
|
"BadRequestError",
|
|
88
89
|
"Bm25OperatorType",
|
|
89
|
-
"BodyUploadAppIngestionUploadAppPostAppSources",
|
|
90
90
|
"CollectionStats",
|
|
91
91
|
"ContentModel",
|
|
92
92
|
"CortexAI",
|
|
@@ -99,6 +99,7 @@ __all__ = [
|
|
|
99
99
|
"DeleteUserMemoryResponse",
|
|
100
100
|
"Entity",
|
|
101
101
|
"ErrorResponse",
|
|
102
|
+
"FetchListKnowledgeResponse",
|
|
102
103
|
"FetchMode",
|
|
103
104
|
"ForbiddenError",
|
|
104
105
|
"ForcefulRelationsPayload",
|
|
@@ -107,6 +108,8 @@ __all__ = [
|
|
|
107
108
|
"Infra",
|
|
108
109
|
"InsertResult",
|
|
109
110
|
"InternalServerError",
|
|
111
|
+
"ListContentKind",
|
|
112
|
+
"ListUserMemoriesResponse",
|
|
110
113
|
"MemoryItem",
|
|
111
114
|
"MemoryResultItem",
|
|
112
115
|
"MilvusDataType",
|
|
@@ -143,6 +146,7 @@ __all__ = [
|
|
|
143
146
|
"UnauthorizedError",
|
|
144
147
|
"UnprocessableEntityError",
|
|
145
148
|
"UserAssistantPair",
|
|
149
|
+
"UserMemory",
|
|
146
150
|
"ValidationError",
|
|
147
151
|
"ValidationErrorLocItem",
|
|
148
152
|
"VectorStoreChunk",
|
usecortex_ai/client.py
CHANGED
|
@@ -103,8 +103,6 @@ class CortexAI:
|
|
|
103
103
|
self, *, request_options: typing.Optional[RequestOptions] = None
|
|
104
104
|
) -> typing.Optional[typing.Any]:
|
|
105
105
|
"""
|
|
106
|
-
Endpoint that serves Prometheus metrics.
|
|
107
|
-
|
|
108
106
|
Parameters
|
|
109
107
|
----------
|
|
110
108
|
request_options : typing.Optional[RequestOptions]
|
|
@@ -213,8 +211,6 @@ class AsyncCortexAI:
|
|
|
213
211
|
self, *, request_options: typing.Optional[RequestOptions] = None
|
|
214
212
|
) -> typing.Optional[typing.Any]:
|
|
215
213
|
"""
|
|
216
|
-
Endpoint that serves Prometheus metrics.
|
|
217
|
-
|
|
218
214
|
Parameters
|
|
219
215
|
----------
|
|
220
216
|
request_options : typing.Optional[RequestOptions]
|
usecortex_ai/dashboard/client.py
CHANGED
|
@@ -27,11 +27,6 @@ class DashboardClient:
|
|
|
27
27
|
|
|
28
28
|
def list_apis(self, *, request_options: typing.Optional[RequestOptions] = None) -> DashboardApisResponse:
|
|
29
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
30
|
Parameters
|
|
36
31
|
----------
|
|
37
32
|
request_options : typing.Optional[RequestOptions]
|
|
@@ -56,10 +51,6 @@ class DashboardClient:
|
|
|
56
51
|
self, *, tenant_id: str, sub_tenant_id: str, request_options: typing.Optional[RequestOptions] = None
|
|
57
52
|
) -> DashboardSourcesResponse:
|
|
58
53
|
"""
|
|
59
|
-
List all sources for a tenant/sub-tenant combination.
|
|
60
|
-
|
|
61
|
-
Uses the same logic as the existing get_sources function.
|
|
62
|
-
|
|
63
54
|
Parameters
|
|
64
55
|
----------
|
|
65
56
|
tenant_id : str
|
|
@@ -81,7 +72,7 @@ class DashboardClient:
|
|
|
81
72
|
from usecortex-ai import CortexAI
|
|
82
73
|
|
|
83
74
|
client = CortexAI(token="YOUR_TOKEN", )
|
|
84
|
-
client.dashboard.list_sources(tenant_id='
|
|
75
|
+
client.dashboard.list_sources(tenant_id='tenant_1234', sub_tenant_id='sub_tenant_4567', )
|
|
85
76
|
"""
|
|
86
77
|
_response = self._raw_client.list_sources(
|
|
87
78
|
tenant_id=tenant_id, sub_tenant_id=sub_tenant_id, request_options=request_options
|
|
@@ -90,11 +81,6 @@ class DashboardClient:
|
|
|
90
81
|
|
|
91
82
|
def list_tenants(self, *, request_options: typing.Optional[RequestOptions] = None) -> DashboardTenantsResponse:
|
|
92
83
|
"""
|
|
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
84
|
Parameters
|
|
99
85
|
----------
|
|
100
86
|
request_options : typing.Optional[RequestOptions]
|
|
@@ -231,11 +217,6 @@ class AsyncDashboardClient:
|
|
|
231
217
|
|
|
232
218
|
async def list_apis(self, *, request_options: typing.Optional[RequestOptions] = None) -> DashboardApisResponse:
|
|
233
219
|
"""
|
|
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
220
|
Parameters
|
|
240
221
|
----------
|
|
241
222
|
request_options : typing.Optional[RequestOptions]
|
|
@@ -264,10 +245,6 @@ class AsyncDashboardClient:
|
|
|
264
245
|
self, *, tenant_id: str, sub_tenant_id: str, request_options: typing.Optional[RequestOptions] = None
|
|
265
246
|
) -> DashboardSourcesResponse:
|
|
266
247
|
"""
|
|
267
|
-
List all sources for a tenant/sub-tenant combination.
|
|
268
|
-
|
|
269
|
-
Uses the same logic as the existing get_sources function.
|
|
270
|
-
|
|
271
248
|
Parameters
|
|
272
249
|
----------
|
|
273
250
|
tenant_id : str
|
|
@@ -292,7 +269,7 @@ class AsyncDashboardClient:
|
|
|
292
269
|
|
|
293
270
|
client = AsyncCortexAI(token="YOUR_TOKEN", )
|
|
294
271
|
async def main() -> None:
|
|
295
|
-
await client.dashboard.list_sources(tenant_id='
|
|
272
|
+
await client.dashboard.list_sources(tenant_id='tenant_1234', sub_tenant_id='sub_tenant_4567', )
|
|
296
273
|
asyncio.run(main())
|
|
297
274
|
"""
|
|
298
275
|
_response = await self._raw_client.list_sources(
|
|
@@ -304,11 +281,6 @@ class AsyncDashboardClient:
|
|
|
304
281
|
self, *, request_options: typing.Optional[RequestOptions] = None
|
|
305
282
|
) -> DashboardTenantsResponse:
|
|
306
283
|
"""
|
|
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
284
|
Parameters
|
|
313
285
|
----------
|
|
314
286
|
request_options : typing.Optional[RequestOptions]
|
|
@@ -28,11 +28,6 @@ class RawDashboardClient:
|
|
|
28
28
|
self, *, request_options: typing.Optional[RequestOptions] = None
|
|
29
29
|
) -> HttpResponse[DashboardApisResponse]:
|
|
30
30
|
"""
|
|
31
|
-
List all API keys for dashboard view.
|
|
32
|
-
|
|
33
|
-
Uses Firebase authentication to identify the user and returns API keys
|
|
34
|
-
associated with that user.
|
|
35
|
-
|
|
36
31
|
Parameters
|
|
37
32
|
----------
|
|
38
33
|
request_options : typing.Optional[RequestOptions]
|
|
@@ -144,10 +139,6 @@ class RawDashboardClient:
|
|
|
144
139
|
self, *, tenant_id: str, sub_tenant_id: str, request_options: typing.Optional[RequestOptions] = None
|
|
145
140
|
) -> HttpResponse[DashboardSourcesResponse]:
|
|
146
141
|
"""
|
|
147
|
-
List all sources for a tenant/sub-tenant combination.
|
|
148
|
-
|
|
149
|
-
Uses the same logic as the existing get_sources function.
|
|
150
|
-
|
|
151
142
|
Parameters
|
|
152
143
|
----------
|
|
153
144
|
tenant_id : str
|
|
@@ -269,11 +260,6 @@ class RawDashboardClient:
|
|
|
269
260
|
self, *, request_options: typing.Optional[RequestOptions] = None
|
|
270
261
|
) -> HttpResponse[DashboardTenantsResponse]:
|
|
271
262
|
"""
|
|
272
|
-
List all tenants for dashboard view.
|
|
273
|
-
|
|
274
|
-
Uses Firebase authentication to identify the user and returns tenant
|
|
275
|
-
mappings associated with that user's organization.
|
|
276
|
-
|
|
277
263
|
Parameters
|
|
278
264
|
----------
|
|
279
265
|
request_options : typing.Optional[RequestOptions]
|
|
@@ -550,11 +536,6 @@ class AsyncRawDashboardClient:
|
|
|
550
536
|
self, *, request_options: typing.Optional[RequestOptions] = None
|
|
551
537
|
) -> AsyncHttpResponse[DashboardApisResponse]:
|
|
552
538
|
"""
|
|
553
|
-
List all API keys for dashboard view.
|
|
554
|
-
|
|
555
|
-
Uses Firebase authentication to identify the user and returns API keys
|
|
556
|
-
associated with that user.
|
|
557
|
-
|
|
558
539
|
Parameters
|
|
559
540
|
----------
|
|
560
541
|
request_options : typing.Optional[RequestOptions]
|
|
@@ -666,10 +647,6 @@ class AsyncRawDashboardClient:
|
|
|
666
647
|
self, *, tenant_id: str, sub_tenant_id: str, request_options: typing.Optional[RequestOptions] = None
|
|
667
648
|
) -> AsyncHttpResponse[DashboardSourcesResponse]:
|
|
668
649
|
"""
|
|
669
|
-
List all sources for a tenant/sub-tenant combination.
|
|
670
|
-
|
|
671
|
-
Uses the same logic as the existing get_sources function.
|
|
672
|
-
|
|
673
650
|
Parameters
|
|
674
651
|
----------
|
|
675
652
|
tenant_id : str
|
|
@@ -791,11 +768,6 @@ class AsyncRawDashboardClient:
|
|
|
791
768
|
self, *, request_options: typing.Optional[RequestOptions] = None
|
|
792
769
|
) -> AsyncHttpResponse[DashboardTenantsResponse]:
|
|
793
770
|
"""
|
|
794
|
-
List all tenants for dashboard view.
|
|
795
|
-
|
|
796
|
-
Uses Firebase authentication to identify the user and returns tenant
|
|
797
|
-
mappings associated with that user's organization.
|
|
798
|
-
|
|
799
771
|
Parameters
|
|
800
772
|
----------
|
|
801
773
|
request_options : typing.Optional[RequestOptions]
|
|
@@ -39,16 +39,6 @@ class EmbeddingsClient:
|
|
|
39
39
|
request_options: typing.Optional[RequestOptions] = None,
|
|
40
40
|
) -> InsertResult:
|
|
41
41
|
"""
|
|
42
|
-
Upload pre-computed embeddings for advanced similarity search.
|
|
43
|
-
|
|
44
|
-
This endpoint accepts vector embeddings that you’ve generated externally,
|
|
45
|
-
allowing you to integrate with custom embedding models or existing vector databases.
|
|
46
|
-
The embeddings represent chunks of your content as numerical vectors.
|
|
47
|
-
|
|
48
|
-
The system stores these embeddings and makes them available for semantic search and similarity matching.
|
|
49
|
-
Use this when you want to leverage specialized embedding models or have existing vector representations.
|
|
50
|
-
When upsert=True, existing embeddings with the same chunk_id will be updated.
|
|
51
|
-
|
|
52
42
|
Parameters
|
|
53
43
|
----------
|
|
54
44
|
tenant_id : str
|
|
@@ -76,7 +66,7 @@ class EmbeddingsClient:
|
|
|
76
66
|
from usecortex-ai import CortexAI, RawEmbeddingDocument, RawEmbeddingVector
|
|
77
67
|
|
|
78
68
|
client = CortexAI(token="YOUR_TOKEN", )
|
|
79
|
-
client.embeddings.insert(tenant_id='
|
|
69
|
+
client.embeddings.insert(tenant_id='tenant_1234', embeddings=[RawEmbeddingDocument(source_id='<source_id>', embeddings=[RawEmbeddingVector(chunk_id='<chunk_id>', embedding=[1.1], ), RawEmbeddingVector(chunk_id='<chunk_id>', embedding=[1.1], )], ), RawEmbeddingDocument(source_id='<source_id>', embeddings=[RawEmbeddingVector(chunk_id='<chunk_id>', embedding=[1.1], ), RawEmbeddingVector(chunk_id='<chunk_id>', embedding=[1.1], )], )], )
|
|
80
70
|
"""
|
|
81
71
|
_response = self._raw_client.insert(
|
|
82
72
|
tenant_id=tenant_id,
|
|
@@ -99,13 +89,6 @@ class EmbeddingsClient:
|
|
|
99
89
|
request_options: typing.Optional[RequestOptions] = None,
|
|
100
90
|
) -> typing.List[RawEmbeddingSearchResult]:
|
|
101
91
|
"""
|
|
102
|
-
Find similar chunks using an embedding vector.
|
|
103
|
-
|
|
104
|
-
Use this to retrieve the most similar chunk IDs to a single query embedding.
|
|
105
|
-
|
|
106
|
-
Expected outcome:
|
|
107
|
-
- You receive the closest chunk IDs with optional similarity scores.
|
|
108
|
-
|
|
109
92
|
Parameters
|
|
110
93
|
----------
|
|
111
94
|
tenant_id : str
|
|
@@ -139,7 +122,7 @@ class EmbeddingsClient:
|
|
|
139
122
|
from usecortex-ai import CortexAI
|
|
140
123
|
|
|
141
124
|
client = CortexAI(token="YOUR_TOKEN", )
|
|
142
|
-
client.embeddings.search(tenant_id='
|
|
125
|
+
client.embeddings.search(tenant_id='tenant_1234', sub_tenant_id='sub_tenant_4567', query_embedding=[1.1], )
|
|
143
126
|
"""
|
|
144
127
|
_response = self._raw_client.search(
|
|
145
128
|
tenant_id=tenant_id,
|
|
@@ -164,9 +147,6 @@ class EmbeddingsClient:
|
|
|
164
147
|
request_options: typing.Optional[RequestOptions] = None,
|
|
165
148
|
) -> typing.List[RawEmbeddingSearchResult]:
|
|
166
149
|
"""
|
|
167
|
-
Retrieve embeddings for specific chunk IDs.
|
|
168
|
-
Use this when you already know the chunk IDs and need their corresponding embeddings.
|
|
169
|
-
|
|
170
150
|
Parameters
|
|
171
151
|
----------
|
|
172
152
|
tenant_id : str
|
|
@@ -200,7 +180,7 @@ class EmbeddingsClient:
|
|
|
200
180
|
from usecortex-ai import CortexAI
|
|
201
181
|
|
|
202
182
|
client = CortexAI(token="YOUR_TOKEN", )
|
|
203
|
-
client.embeddings.filter(tenant_id='
|
|
183
|
+
client.embeddings.filter(tenant_id='tenant_1234', sub_tenant_id='sub_tenant_4567', )
|
|
204
184
|
"""
|
|
205
185
|
_response = self._raw_client.filter(
|
|
206
186
|
tenant_id=tenant_id,
|
|
@@ -223,11 +203,6 @@ class EmbeddingsClient:
|
|
|
223
203
|
request_options: typing.Optional[RequestOptions] = None,
|
|
224
204
|
) -> DeleteResult:
|
|
225
205
|
"""
|
|
226
|
-
Delete embedding chunks by chunk ID.
|
|
227
|
-
|
|
228
|
-
Use this to remove specific chunks from your embeddings index when they are no longer
|
|
229
|
-
valid or should not appear in results.
|
|
230
|
-
|
|
231
206
|
Parameters
|
|
232
207
|
----------
|
|
233
208
|
tenant_id : str
|
|
@@ -255,7 +230,7 @@ class EmbeddingsClient:
|
|
|
255
230
|
from usecortex-ai import CortexAI
|
|
256
231
|
|
|
257
232
|
client = CortexAI(token="YOUR_TOKEN", )
|
|
258
|
-
client.embeddings.delete(tenant_id='
|
|
233
|
+
client.embeddings.delete(tenant_id='tenant_1234', )
|
|
259
234
|
"""
|
|
260
235
|
_response = self._raw_client.delete(
|
|
261
236
|
tenant_id=tenant_id,
|
|
@@ -292,16 +267,6 @@ class AsyncEmbeddingsClient:
|
|
|
292
267
|
request_options: typing.Optional[RequestOptions] = None,
|
|
293
268
|
) -> InsertResult:
|
|
294
269
|
"""
|
|
295
|
-
Upload pre-computed embeddings for advanced similarity search.
|
|
296
|
-
|
|
297
|
-
This endpoint accepts vector embeddings that you’ve generated externally,
|
|
298
|
-
allowing you to integrate with custom embedding models or existing vector databases.
|
|
299
|
-
The embeddings represent chunks of your content as numerical vectors.
|
|
300
|
-
|
|
301
|
-
The system stores these embeddings and makes them available for semantic search and similarity matching.
|
|
302
|
-
Use this when you want to leverage specialized embedding models or have existing vector representations.
|
|
303
|
-
When upsert=True, existing embeddings with the same chunk_id will be updated.
|
|
304
|
-
|
|
305
270
|
Parameters
|
|
306
271
|
----------
|
|
307
272
|
tenant_id : str
|
|
@@ -333,7 +298,7 @@ class AsyncEmbeddingsClient:
|
|
|
333
298
|
|
|
334
299
|
client = AsyncCortexAI(token="YOUR_TOKEN", )
|
|
335
300
|
async def main() -> None:
|
|
336
|
-
await client.embeddings.insert(tenant_id='
|
|
301
|
+
await client.embeddings.insert(tenant_id='tenant_1234', embeddings=[RawEmbeddingDocument(source_id='<source_id>', embeddings=[RawEmbeddingVector(chunk_id='<chunk_id>', embedding=[1.1], ), RawEmbeddingVector(chunk_id='<chunk_id>', embedding=[1.1], )], ), RawEmbeddingDocument(source_id='<source_id>', embeddings=[RawEmbeddingVector(chunk_id='<chunk_id>', embedding=[1.1], ), RawEmbeddingVector(chunk_id='<chunk_id>', embedding=[1.1], )], )], )
|
|
337
302
|
asyncio.run(main())
|
|
338
303
|
"""
|
|
339
304
|
_response = await self._raw_client.insert(
|
|
@@ -357,13 +322,6 @@ class AsyncEmbeddingsClient:
|
|
|
357
322
|
request_options: typing.Optional[RequestOptions] = None,
|
|
358
323
|
) -> typing.List[RawEmbeddingSearchResult]:
|
|
359
324
|
"""
|
|
360
|
-
Find similar chunks using an embedding vector.
|
|
361
|
-
|
|
362
|
-
Use this to retrieve the most similar chunk IDs to a single query embedding.
|
|
363
|
-
|
|
364
|
-
Expected outcome:
|
|
365
|
-
- You receive the closest chunk IDs with optional similarity scores.
|
|
366
|
-
|
|
367
325
|
Parameters
|
|
368
326
|
----------
|
|
369
327
|
tenant_id : str
|
|
@@ -400,7 +358,7 @@ class AsyncEmbeddingsClient:
|
|
|
400
358
|
|
|
401
359
|
client = AsyncCortexAI(token="YOUR_TOKEN", )
|
|
402
360
|
async def main() -> None:
|
|
403
|
-
await client.embeddings.search(tenant_id='
|
|
361
|
+
await client.embeddings.search(tenant_id='tenant_1234', sub_tenant_id='sub_tenant_4567', query_embedding=[1.1], )
|
|
404
362
|
asyncio.run(main())
|
|
405
363
|
"""
|
|
406
364
|
_response = await self._raw_client.search(
|
|
@@ -426,9 +384,6 @@ class AsyncEmbeddingsClient:
|
|
|
426
384
|
request_options: typing.Optional[RequestOptions] = None,
|
|
427
385
|
) -> typing.List[RawEmbeddingSearchResult]:
|
|
428
386
|
"""
|
|
429
|
-
Retrieve embeddings for specific chunk IDs.
|
|
430
|
-
Use this when you already know the chunk IDs and need their corresponding embeddings.
|
|
431
|
-
|
|
432
387
|
Parameters
|
|
433
388
|
----------
|
|
434
389
|
tenant_id : str
|
|
@@ -465,7 +420,7 @@ class AsyncEmbeddingsClient:
|
|
|
465
420
|
|
|
466
421
|
client = AsyncCortexAI(token="YOUR_TOKEN", )
|
|
467
422
|
async def main() -> None:
|
|
468
|
-
await client.embeddings.filter(tenant_id='
|
|
423
|
+
await client.embeddings.filter(tenant_id='tenant_1234', sub_tenant_id='sub_tenant_4567', )
|
|
469
424
|
asyncio.run(main())
|
|
470
425
|
"""
|
|
471
426
|
_response = await self._raw_client.filter(
|
|
@@ -489,11 +444,6 @@ class AsyncEmbeddingsClient:
|
|
|
489
444
|
request_options: typing.Optional[RequestOptions] = None,
|
|
490
445
|
) -> DeleteResult:
|
|
491
446
|
"""
|
|
492
|
-
Delete embedding chunks by chunk ID.
|
|
493
|
-
|
|
494
|
-
Use this to remove specific chunks from your embeddings index when they are no longer
|
|
495
|
-
valid or should not appear in results.
|
|
496
|
-
|
|
497
447
|
Parameters
|
|
498
448
|
----------
|
|
499
449
|
tenant_id : str
|
|
@@ -524,7 +474,7 @@ class AsyncEmbeddingsClient:
|
|
|
524
474
|
|
|
525
475
|
client = AsyncCortexAI(token="YOUR_TOKEN", )
|
|
526
476
|
async def main() -> None:
|
|
527
|
-
await client.embeddings.delete(tenant_id='
|
|
477
|
+
await client.embeddings.delete(tenant_id='tenant_1234', )
|
|
528
478
|
asyncio.run(main())
|
|
529
479
|
"""
|
|
530
480
|
_response = await self._raw_client.delete(
|
|
@@ -39,16 +39,6 @@ class RawEmbeddingsClient:
|
|
|
39
39
|
request_options: typing.Optional[RequestOptions] = None,
|
|
40
40
|
) -> HttpResponse[InsertResult]:
|
|
41
41
|
"""
|
|
42
|
-
Upload pre-computed embeddings for advanced similarity search.
|
|
43
|
-
|
|
44
|
-
This endpoint accepts vector embeddings that you’ve generated externally,
|
|
45
|
-
allowing you to integrate with custom embedding models or existing vector databases.
|
|
46
|
-
The embeddings represent chunks of your content as numerical vectors.
|
|
47
|
-
|
|
48
|
-
The system stores these embeddings and makes them available for semantic search and similarity matching.
|
|
49
|
-
Use this when you want to leverage specialized embedding models or have existing vector representations.
|
|
50
|
-
When upsert=True, existing embeddings with the same chunk_id will be updated.
|
|
51
|
-
|
|
52
42
|
Parameters
|
|
53
43
|
----------
|
|
54
44
|
tenant_id : str
|
|
@@ -72,7 +62,7 @@ class RawEmbeddingsClient:
|
|
|
72
62
|
Successful Response
|
|
73
63
|
"""
|
|
74
64
|
_response = self._client_wrapper.httpx_client.request(
|
|
75
|
-
"embeddings/
|
|
65
|
+
"embeddings/insert_raw_embeddings",
|
|
76
66
|
method="POST",
|
|
77
67
|
json={
|
|
78
68
|
"tenant_id": tenant_id,
|
|
@@ -192,13 +182,6 @@ class RawEmbeddingsClient:
|
|
|
192
182
|
request_options: typing.Optional[RequestOptions] = None,
|
|
193
183
|
) -> HttpResponse[typing.List[RawEmbeddingSearchResult]]:
|
|
194
184
|
"""
|
|
195
|
-
Find similar chunks using an embedding vector.
|
|
196
|
-
|
|
197
|
-
Use this to retrieve the most similar chunk IDs to a single query embedding.
|
|
198
|
-
|
|
199
|
-
Expected outcome:
|
|
200
|
-
- You receive the closest chunk IDs with optional similarity scores.
|
|
201
|
-
|
|
202
185
|
Parameters
|
|
203
186
|
----------
|
|
204
187
|
tenant_id : str
|
|
@@ -228,7 +211,7 @@ class RawEmbeddingsClient:
|
|
|
228
211
|
Successful Response
|
|
229
212
|
"""
|
|
230
213
|
_response = self._client_wrapper.httpx_client.request(
|
|
231
|
-
"embeddings/
|
|
214
|
+
"embeddings/search_raw_embeddings",
|
|
232
215
|
method="POST",
|
|
233
216
|
json={
|
|
234
217
|
"tenant_id": tenant_id,
|
|
@@ -348,9 +331,6 @@ class RawEmbeddingsClient:
|
|
|
348
331
|
request_options: typing.Optional[RequestOptions] = None,
|
|
349
332
|
) -> HttpResponse[typing.List[RawEmbeddingSearchResult]]:
|
|
350
333
|
"""
|
|
351
|
-
Retrieve embeddings for specific chunk IDs.
|
|
352
|
-
Use this when you already know the chunk IDs and need their corresponding embeddings.
|
|
353
|
-
|
|
354
334
|
Parameters
|
|
355
335
|
----------
|
|
356
336
|
tenant_id : str
|
|
@@ -380,7 +360,7 @@ class RawEmbeddingsClient:
|
|
|
380
360
|
Successful Response
|
|
381
361
|
"""
|
|
382
362
|
_response = self._client_wrapper.httpx_client.request(
|
|
383
|
-
"embeddings/
|
|
363
|
+
"embeddings/filter_raw_embeddings",
|
|
384
364
|
method="POST",
|
|
385
365
|
json={
|
|
386
366
|
"tenant_id": tenant_id,
|
|
@@ -498,11 +478,6 @@ class RawEmbeddingsClient:
|
|
|
498
478
|
request_options: typing.Optional[RequestOptions] = None,
|
|
499
479
|
) -> HttpResponse[DeleteResult]:
|
|
500
480
|
"""
|
|
501
|
-
Delete embedding chunks by chunk ID.
|
|
502
|
-
|
|
503
|
-
Use this to remove specific chunks from your embeddings index when they are no longer
|
|
504
|
-
valid or should not appear in results.
|
|
505
|
-
|
|
506
481
|
Parameters
|
|
507
482
|
----------
|
|
508
483
|
tenant_id : str
|
|
@@ -526,7 +501,7 @@ class RawEmbeddingsClient:
|
|
|
526
501
|
Successful Response
|
|
527
502
|
"""
|
|
528
503
|
_response = self._client_wrapper.httpx_client.request(
|
|
529
|
-
"embeddings/
|
|
504
|
+
"embeddings/delete_raw_embeddings",
|
|
530
505
|
method="DELETE",
|
|
531
506
|
params={
|
|
532
507
|
"tenant_id": tenant_id,
|
|
@@ -643,16 +618,6 @@ class AsyncRawEmbeddingsClient:
|
|
|
643
618
|
request_options: typing.Optional[RequestOptions] = None,
|
|
644
619
|
) -> AsyncHttpResponse[InsertResult]:
|
|
645
620
|
"""
|
|
646
|
-
Upload pre-computed embeddings for advanced similarity search.
|
|
647
|
-
|
|
648
|
-
This endpoint accepts vector embeddings that you’ve generated externally,
|
|
649
|
-
allowing you to integrate with custom embedding models or existing vector databases.
|
|
650
|
-
The embeddings represent chunks of your content as numerical vectors.
|
|
651
|
-
|
|
652
|
-
The system stores these embeddings and makes them available for semantic search and similarity matching.
|
|
653
|
-
Use this when you want to leverage specialized embedding models or have existing vector representations.
|
|
654
|
-
When upsert=True, existing embeddings with the same chunk_id will be updated.
|
|
655
|
-
|
|
656
621
|
Parameters
|
|
657
622
|
----------
|
|
658
623
|
tenant_id : str
|
|
@@ -676,7 +641,7 @@ class AsyncRawEmbeddingsClient:
|
|
|
676
641
|
Successful Response
|
|
677
642
|
"""
|
|
678
643
|
_response = await self._client_wrapper.httpx_client.request(
|
|
679
|
-
"embeddings/
|
|
644
|
+
"embeddings/insert_raw_embeddings",
|
|
680
645
|
method="POST",
|
|
681
646
|
json={
|
|
682
647
|
"tenant_id": tenant_id,
|
|
@@ -796,13 +761,6 @@ class AsyncRawEmbeddingsClient:
|
|
|
796
761
|
request_options: typing.Optional[RequestOptions] = None,
|
|
797
762
|
) -> AsyncHttpResponse[typing.List[RawEmbeddingSearchResult]]:
|
|
798
763
|
"""
|
|
799
|
-
Find similar chunks using an embedding vector.
|
|
800
|
-
|
|
801
|
-
Use this to retrieve the most similar chunk IDs to a single query embedding.
|
|
802
|
-
|
|
803
|
-
Expected outcome:
|
|
804
|
-
- You receive the closest chunk IDs with optional similarity scores.
|
|
805
|
-
|
|
806
764
|
Parameters
|
|
807
765
|
----------
|
|
808
766
|
tenant_id : str
|
|
@@ -832,7 +790,7 @@ class AsyncRawEmbeddingsClient:
|
|
|
832
790
|
Successful Response
|
|
833
791
|
"""
|
|
834
792
|
_response = await self._client_wrapper.httpx_client.request(
|
|
835
|
-
"embeddings/
|
|
793
|
+
"embeddings/search_raw_embeddings",
|
|
836
794
|
method="POST",
|
|
837
795
|
json={
|
|
838
796
|
"tenant_id": tenant_id,
|
|
@@ -952,9 +910,6 @@ class AsyncRawEmbeddingsClient:
|
|
|
952
910
|
request_options: typing.Optional[RequestOptions] = None,
|
|
953
911
|
) -> AsyncHttpResponse[typing.List[RawEmbeddingSearchResult]]:
|
|
954
912
|
"""
|
|
955
|
-
Retrieve embeddings for specific chunk IDs.
|
|
956
|
-
Use this when you already know the chunk IDs and need their corresponding embeddings.
|
|
957
|
-
|
|
958
913
|
Parameters
|
|
959
914
|
----------
|
|
960
915
|
tenant_id : str
|
|
@@ -984,7 +939,7 @@ class AsyncRawEmbeddingsClient:
|
|
|
984
939
|
Successful Response
|
|
985
940
|
"""
|
|
986
941
|
_response = await self._client_wrapper.httpx_client.request(
|
|
987
|
-
"embeddings/
|
|
942
|
+
"embeddings/filter_raw_embeddings",
|
|
988
943
|
method="POST",
|
|
989
944
|
json={
|
|
990
945
|
"tenant_id": tenant_id,
|
|
@@ -1102,11 +1057,6 @@ class AsyncRawEmbeddingsClient:
|
|
|
1102
1057
|
request_options: typing.Optional[RequestOptions] = None,
|
|
1103
1058
|
) -> AsyncHttpResponse[DeleteResult]:
|
|
1104
1059
|
"""
|
|
1105
|
-
Delete embedding chunks by chunk ID.
|
|
1106
|
-
|
|
1107
|
-
Use this to remove specific chunks from your embeddings index when they are no longer
|
|
1108
|
-
valid or should not appear in results.
|
|
1109
|
-
|
|
1110
1060
|
Parameters
|
|
1111
1061
|
----------
|
|
1112
1062
|
tenant_id : str
|
|
@@ -1130,7 +1080,7 @@ class AsyncRawEmbeddingsClient:
|
|
|
1130
1080
|
Successful Response
|
|
1131
1081
|
"""
|
|
1132
1082
|
_response = await self._client_wrapper.httpx_client.request(
|
|
1133
|
-
"embeddings/
|
|
1083
|
+
"embeddings/delete_raw_embeddings",
|
|
1134
1084
|
method="DELETE",
|
|
1135
1085
|
params={
|
|
1136
1086
|
"tenant_id": tenant_id,
|