usecortex-ai 0.4.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.
Files changed (38) hide show
  1. usecortex_ai/__init__.py +10 -4
  2. usecortex_ai/client.py +0 -4
  3. usecortex_ai/dashboard/client.py +2 -30
  4. usecortex_ai/dashboard/raw_client.py +0 -28
  5. usecortex_ai/embeddings/client.py +8 -58
  6. usecortex_ai/embeddings/raw_client.py +8 -58
  7. usecortex_ai/fetch/__init__.py +3 -0
  8. usecortex_ai/fetch/client.py +42 -165
  9. usecortex_ai/fetch/raw_client.py +38 -341
  10. usecortex_ai/fetch/types/__init__.py +7 -0
  11. usecortex_ai/fetch/types/fetch_list_knowledge_response.py +8 -0
  12. usecortex_ai/raw_client.py +0 -4
  13. usecortex_ai/search/client.py +40 -108
  14. usecortex_ai/search/raw_client.py +40 -108
  15. usecortex_ai/sources/client.py +2 -16
  16. usecortex_ai/sources/raw_client.py +2 -16
  17. usecortex_ai/tenant/client.py +4 -108
  18. usecortex_ai/tenant/raw_client.py +2 -106
  19. usecortex_ai/types/__init__.py +8 -2
  20. usecortex_ai/types/forceful_relations_payload.py +27 -0
  21. usecortex_ai/types/list_content_kind.py +5 -0
  22. usecortex_ai/types/list_user_memories_response.py +32 -0
  23. usecortex_ai/types/memory_item.py +7 -1
  24. usecortex_ai/types/retrieval_result.py +4 -0
  25. usecortex_ai/types/retrieve_mode.py +1 -1
  26. usecortex_ai/types/user_memory.py +31 -0
  27. usecortex_ai/types/vector_store_chunk.py +5 -0
  28. usecortex_ai/upload/__init__.py +0 -3
  29. usecortex_ai/upload/client.py +34 -204
  30. usecortex_ai/upload/raw_client.py +30 -382
  31. {usecortex_ai-0.4.0.dist-info → usecortex_ai-0.5.1.dist-info}/METADATA +1 -1
  32. {usecortex_ai-0.4.0.dist-info → usecortex_ai-0.5.1.dist-info}/RECORD +35 -32
  33. {usecortex_ai-0.4.0.dist-info → usecortex_ai-0.5.1.dist-info}/WHEEL +1 -1
  34. usecortex_ai/types/app_sources_upload_data.py +0 -39
  35. usecortex_ai/upload/types/__init__.py +0 -7
  36. usecortex_ai/upload/types/body_upload_app_ingestion_upload_app_post_app_sources.py +0 -7
  37. {usecortex_ai-0.4.0.dist-info → usecortex_ai-0.5.1.dist-info}/licenses/LICENSE +0 -0
  38. {usecortex_ai-0.4.0.dist-info → usecortex_ai-0.5.1.dist-info}/top_level.txt +0 -0
@@ -38,47 +38,6 @@ class RawTenantClient:
38
38
  request_options: typing.Optional[RequestOptions] = None,
39
39
  ) -> HttpResponse[TenantCreateResponse]:
40
40
  """
41
- Create a tenant for your account.
42
-
43
- Use this endpoint to initialize a tenant space you can use for ingestion, embeddings, and search.
44
-
45
- **Tenant Metadata Schema**
46
-
47
- You can optionally provide a `tenant_metadata_schema` to define custom fields that will be
48
- indexed in the vector store. Each field can be configured with:
49
-
50
- - `enable_match`: Enable text filtering on this field
51
- - `enable_dense_embedding`: Create dense embeddings for semantic similarity search
52
- - `enable_sparse_embedding`: Create sparse embeddings (BM25) for keyword search
53
-
54
- **Example Request:**
55
- ```json
56
- {
57
- "tenant_id": "my-tenant",
58
- "tenant_metadata_schema": [
59
- {
60
- "name": "category",
61
- "data_type": "VARCHAR",
62
- "max_length": 256,
63
- "enable_match": true
64
- },
65
- {
66
- "name": "product_description",
67
- "data_type": "VARCHAR",
68
- "max_length": 4096,
69
- "enable_dense_embedding": true,
70
- "enable_sparse_embedding": true
71
- }
72
- ]
73
- }
74
- ```
75
-
76
- Expected outcome:
77
- - A tenant is created and returned with its identifier.
78
- - If tenant_metadata_schema is provided, the vector store collection will include
79
- the specified custom fields with their configured search capabilities.
80
- - If the tenant already exists, you receive a success message with the existing identifier.
81
-
82
41
  Parameters
83
42
  ----------
84
43
  tenant_id : str
@@ -216,17 +175,6 @@ class RawTenantClient:
216
175
  self, *, tenant_id: str, request_options: typing.Optional[RequestOptions] = None
217
176
  ) -> HttpResponse[TenantStatsResponse]:
218
177
  """
219
- Retrieve usage stats for your tenant.
220
-
221
- Use this endpoint to check whether a tenant exists and view core metrics like total
222
- indexed objects and vector dimension. This helps you validate
223
- setup and monitor ingestion.
224
-
225
- Expected outcome
226
-
227
- You receive the current object count and vector dimension for the tenant.
228
- If the tenant does not exist, you get a not-found error.
229
-
230
178
  Parameters
231
179
  ----------
232
180
  tenant_id : str
@@ -241,7 +189,7 @@ class RawTenantClient:
241
189
  Successful Response
242
190
  """
243
191
  _response = self._client_wrapper.httpx_client.request(
244
- "tenants/stats",
192
+ "tenants/monitor",
245
193
  method="GET",
246
194
  params={
247
195
  "tenant_id": tenant_id,
@@ -355,47 +303,6 @@ class AsyncRawTenantClient:
355
303
  request_options: typing.Optional[RequestOptions] = None,
356
304
  ) -> AsyncHttpResponse[TenantCreateResponse]:
357
305
  """
358
- Create a tenant for your account.
359
-
360
- Use this endpoint to initialize a tenant space you can use for ingestion, embeddings, and search.
361
-
362
- **Tenant Metadata Schema**
363
-
364
- You can optionally provide a `tenant_metadata_schema` to define custom fields that will be
365
- indexed in the vector store. Each field can be configured with:
366
-
367
- - `enable_match`: Enable text filtering on this field
368
- - `enable_dense_embedding`: Create dense embeddings for semantic similarity search
369
- - `enable_sparse_embedding`: Create sparse embeddings (BM25) for keyword search
370
-
371
- **Example Request:**
372
- ```json
373
- {
374
- "tenant_id": "my-tenant",
375
- "tenant_metadata_schema": [
376
- {
377
- "name": "category",
378
- "data_type": "VARCHAR",
379
- "max_length": 256,
380
- "enable_match": true
381
- },
382
- {
383
- "name": "product_description",
384
- "data_type": "VARCHAR",
385
- "max_length": 4096,
386
- "enable_dense_embedding": true,
387
- "enable_sparse_embedding": true
388
- }
389
- ]
390
- }
391
- ```
392
-
393
- Expected outcome:
394
- - A tenant is created and returned with its identifier.
395
- - If tenant_metadata_schema is provided, the vector store collection will include
396
- the specified custom fields with their configured search capabilities.
397
- - If the tenant already exists, you receive a success message with the existing identifier.
398
-
399
306
  Parameters
400
307
  ----------
401
308
  tenant_id : str
@@ -533,17 +440,6 @@ class AsyncRawTenantClient:
533
440
  self, *, tenant_id: str, request_options: typing.Optional[RequestOptions] = None
534
441
  ) -> AsyncHttpResponse[TenantStatsResponse]:
535
442
  """
536
- Retrieve usage stats for your tenant.
537
-
538
- Use this endpoint to check whether a tenant exists and view core metrics like total
539
- indexed objects and vector dimension. This helps you validate
540
- setup and monitor ingestion.
541
-
542
- Expected outcome
543
-
544
- You receive the current object count and vector dimension for the tenant.
545
- If the tenant does not exist, you get a not-found error.
546
-
547
443
  Parameters
548
444
  ----------
549
445
  tenant_id : str
@@ -558,7 +454,7 @@ class AsyncRawTenantClient:
558
454
  Successful Response
559
455
  """
560
456
  _response = await self._client_wrapper.httpx_client.request(
561
- "tenants/stats",
457
+ "tenants/monitor",
562
458
  method="GET",
563
459
  params={
564
460
  "tenant_id": tenant_id,
@@ -5,7 +5,6 @@
5
5
  from .actual_error_response import ActualErrorResponse
6
6
  from .add_memory_response import AddMemoryResponse
7
7
  from .api_key_info import ApiKeyInfo
8
- from .app_sources_upload_data import AppSourcesUploadData
9
8
  from .attachment_model import AttachmentModel
10
9
  from .bm_25_operator_type import Bm25OperatorType
11
10
  from .collection_stats import CollectionStats
@@ -19,10 +18,13 @@ from .delete_user_memory_response import DeleteUserMemoryResponse
19
18
  from .entity import Entity
20
19
  from .error_response import ErrorResponse
21
20
  from .fetch_mode import FetchMode
21
+ from .forceful_relations_payload import ForcefulRelationsPayload
22
22
  from .graph_context import GraphContext
23
23
  from .http_validation_error import HttpValidationError
24
24
  from .infra import Infra
25
25
  from .insert_result import InsertResult
26
+ from .list_content_kind import ListContentKind
27
+ from .list_user_memories_response import ListUserMemoriesResponse
26
28
  from .memory_item import MemoryItem
27
29
  from .memory_result_item import MemoryResultItem
28
30
  from .milvus_data_type import MilvusDataType
@@ -54,6 +56,7 @@ from .tenant_metadata_schema_info import TenantMetadataSchemaInfo
54
56
  from .tenant_stats_response import TenantStatsResponse
55
57
  from .triplet_with_evidence import TripletWithEvidence
56
58
  from .user_assistant_pair import UserAssistantPair
59
+ from .user_memory import UserMemory
57
60
  from .validation_error import ValidationError
58
61
  from .validation_error_loc_item import ValidationErrorLocItem
59
62
  from .vector_store_chunk import VectorStoreChunk
@@ -62,7 +65,6 @@ __all__ = [
62
65
  "ActualErrorResponse",
63
66
  "AddMemoryResponse",
64
67
  "ApiKeyInfo",
65
- "AppSourcesUploadData",
66
68
  "AttachmentModel",
67
69
  "Bm25OperatorType",
68
70
  "CollectionStats",
@@ -76,10 +78,13 @@ __all__ = [
76
78
  "Entity",
77
79
  "ErrorResponse",
78
80
  "FetchMode",
81
+ "ForcefulRelationsPayload",
79
82
  "GraphContext",
80
83
  "HttpValidationError",
81
84
  "Infra",
82
85
  "InsertResult",
86
+ "ListContentKind",
87
+ "ListUserMemoriesResponse",
83
88
  "MemoryItem",
84
89
  "MemoryResultItem",
85
90
  "MilvusDataType",
@@ -111,6 +116,7 @@ __all__ = [
111
116
  "TenantStatsResponse",
112
117
  "TripletWithEvidence",
113
118
  "UserAssistantPair",
119
+ "UserMemory",
114
120
  "ValidationError",
115
121
  "ValidationErrorLocItem",
116
122
  "VectorStoreChunk",
@@ -0,0 +1,27 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+
8
+
9
+ class ForcefulRelationsPayload(UniversalBaseModel):
10
+ cortex_source_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
11
+ """
12
+ Cortex source IDs to forcefully relate to the uploaded source.
13
+ """
14
+
15
+ properties: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
16
+ """
17
+ Optional properties to attach to the forceful relation.
18
+ """
19
+
20
+ if IS_PYDANTIC_V2:
21
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
22
+ else:
23
+
24
+ class Config:
25
+ frozen = True
26
+ smart_union = True
27
+ extra = pydantic.Extra.allow
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ ListContentKind = typing.Union[typing.Literal["knowledge", "memories"], typing.Any]
@@ -0,0 +1,32 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+ from .user_memory import UserMemory
8
+
9
+
10
+ class ListUserMemoriesResponse(UniversalBaseModel):
11
+ """
12
+ Response model for listing all user memories.
13
+ """
14
+
15
+ success: typing.Optional[bool] = pydantic.Field(default=None)
16
+ """
17
+ Indicates whether the memory listing operation was successful
18
+ """
19
+
20
+ user_memories: typing.Optional[typing.List[UserMemory]] = pydantic.Field(default=None)
21
+ """
22
+ Array of all user memories associated with your tenant
23
+ """
24
+
25
+ if IS_PYDANTIC_V2:
26
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
27
+ else:
28
+
29
+ class Config:
30
+ frozen = True
31
+ smart_union = True
32
+ extra = pydantic.Extra.allow
@@ -4,6 +4,7 @@ import typing
4
4
 
5
5
  import pydantic
6
6
  from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+ from .forceful_relations_payload import ForcefulRelationsPayload
7
8
  from .user_assistant_pair import UserAssistantPair
8
9
 
9
10
 
@@ -40,7 +41,7 @@ class MemoryItem(UniversalBaseModel):
40
41
 
41
42
  infer: typing.Optional[bool] = pydantic.Field(default=None)
42
43
  """
43
- If true, process and extract additional insights/inferences from the content before indexing. Useful for extracting implicit information from conversations.
44
+ If true, process and extract additional insights/inferences from the contentbefore indexingUseful for extracting implicit information from conversations
44
45
  """
45
46
 
46
47
  custom_instructions: typing.Optional[str] = pydantic.Field(default=None)
@@ -72,6 +73,11 @@ class MemoryItem(UniversalBaseModel):
72
73
  Example: > "{"title":"Q1 Report.pdf","author":"Alice Smith","file_id":"custom_file_123"}"
73
74
  """
74
75
 
76
+ relations: typing.Optional[ForcefulRelationsPayload] = pydantic.Field(default=None)
77
+ """
78
+ Forcefully connect 2 sources based on cortex source ids or common properties.
79
+ """
80
+
75
81
  if IS_PYDANTIC_V2:
76
82
  model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
77
83
  else:
@@ -15,6 +15,10 @@ class RetrievalResult(UniversalBaseModel):
15
15
 
16
16
  chunks: typing.Optional[typing.List[VectorStoreChunk]] = None
17
17
  graph_context: typing.Optional[GraphContext] = None
18
+ additional_context: typing.Optional[typing.Dict[str, VectorStoreChunk]] = pydantic.Field(default=None)
19
+ """
20
+ Map of chunk_uuid to VectorStoreChunk for extra context from forcefully related sources. Use chunk.extra_context_ids to look up chunks: extra_context[id] for id in chunk.extra_context_ids.
21
+ """
18
22
 
19
23
  if IS_PYDANTIC_V2:
20
24
  model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
@@ -2,4 +2,4 @@
2
2
 
3
3
  import typing
4
4
 
5
- RetrieveMode = typing.Union[typing.Literal["fast", "accurate"], typing.Any]
5
+ RetrieveMode = typing.Union[typing.Literal["fast", "thinking"], typing.Any]
@@ -0,0 +1,31 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+
8
+
9
+ class UserMemory(UniversalBaseModel):
10
+ """
11
+ Represents a user memory stored in the system.
12
+ """
13
+
14
+ memory_id: str = pydantic.Field()
15
+ """
16
+ Unique identifier for the user memory
17
+ """
18
+
19
+ memory_content: str = pydantic.Field()
20
+ """
21
+ The actual memory content text that was stored
22
+ """
23
+
24
+ if IS_PYDANTIC_V2:
25
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
26
+ else:
27
+
28
+ class Config:
29
+ frozen = True
30
+ smart_union = True
31
+ extra = pydantic.Extra.allow
@@ -62,6 +62,11 @@ class VectorStoreChunk(UniversalBaseModel):
62
62
  Custom metadata associated with your tenant
63
63
  """
64
64
 
65
+ extra_context_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
66
+ """
67
+ IDs of related chunks providing extra context (from forceful relations). Only present in accurate mode when sources have forceful relations.
68
+ """
69
+
65
70
  if IS_PYDANTIC_V2:
66
71
  model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
67
72
  else:
@@ -2,6 +2,3 @@
2
2
 
3
3
  # isort: skip_file
4
4
 
5
- from .types import BodyUploadAppIngestionUploadAppPostAppSources
6
-
7
- __all__ = ["BodyUploadAppIngestionUploadAppPostAppSources"]