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
@@ -0,0 +1,35 @@
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 .source_upload_result_item import SourceUploadResultItem
8
+
9
+
10
+ class SourceUploadResponse(UniversalBaseModel):
11
+ success: typing.Optional[bool] = None
12
+ message: typing.Optional[str] = None
13
+ results: typing.Optional[typing.List[SourceUploadResultItem]] = pydantic.Field(default=None)
14
+ """
15
+ List of upload results for each source.
16
+ """
17
+
18
+ success_count: typing.Optional[int] = pydantic.Field(default=None)
19
+ """
20
+ Number of sources successfully queued.
21
+ """
22
+
23
+ failed_count: typing.Optional[int] = pydantic.Field(default=None)
24
+ """
25
+ Number of sources that failed to upload.
26
+ """
27
+
28
+ if IS_PYDANTIC_V2:
29
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
30
+ else:
31
+
32
+ class Config:
33
+ frozen = True
34
+ smart_union = True
35
+ extra = pydantic.Extra.allow
@@ -0,0 +1,38 @@
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 .source_status import SourceStatus
8
+
9
+
10
+ class SourceUploadResultItem(UniversalBaseModel):
11
+ source_id: str = pydantic.Field()
12
+ """
13
+ Unique identifier for the uploaded source.
14
+ """
15
+
16
+ filename: typing.Optional[str] = pydantic.Field(default=None)
17
+ """
18
+ Original filename if present.
19
+ """
20
+
21
+ status: typing.Optional[SourceStatus] = pydantic.Field(default=None)
22
+ """
23
+ Initial processing status.
24
+ """
25
+
26
+ error: typing.Optional[str] = pydantic.Field(default=None)
27
+ """
28
+ Error message if upload failed.
29
+ """
30
+
31
+ if IS_PYDANTIC_V2:
32
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
33
+ else:
34
+
35
+ class Config:
36
+ frozen = True
37
+ smart_union = True
38
+ 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
+ SupportedLlmProviders = typing.Union[typing.Literal["groq", "cerebras", "openai", "anthropic", "gemini"], typing.Any]
@@ -4,27 +4,29 @@ import typing
4
4
 
5
5
  import pydantic
6
6
  from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+ from .infra import Infra
8
+ from .tenant_metadata_schema_info import TenantMetadataSchemaInfo
7
9
 
8
10
 
9
- class EmbeddingsCreateCollectionData(UniversalBaseModel):
11
+ class TenantCreateResponse(UniversalBaseModel):
10
12
  tenant_id: str = pydantic.Field()
11
13
  """
12
- Identifier for the tenant/organization
14
+ Identifier provided by user
13
15
  """
14
16
 
15
- sub_tenant_id: str = pydantic.Field()
17
+ infra: Infra = pydantic.Field()
16
18
  """
17
- Identifier for the sub-tenant within the tenant
19
+ Infra status
18
20
  """
19
21
 
20
- success: typing.Optional[bool] = pydantic.Field(default=None)
22
+ metadata_schema: typing.Optional[TenantMetadataSchemaInfo] = pydantic.Field(default=None)
21
23
  """
22
- Indicates whether the embeddings tenant creation completed successfully
24
+ Summary of configured tenant metadata schema (if provided)
23
25
  """
24
26
 
25
27
  message: typing.Optional[str] = pydantic.Field(default=None)
26
28
  """
27
- Status message about the tenant creation operation
29
+ Summary message
28
30
  """
29
31
 
30
32
  if IS_PYDANTIC_V2:
@@ -4,13 +4,22 @@ import typing
4
4
 
5
5
  import pydantic
6
6
  from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
- from .triple_with_evidence import TripleWithEvidence
8
7
 
9
8
 
10
- class ExtendedContext(UniversalBaseModel):
11
- chunk_relations: typing.Optional[typing.List[TripleWithEvidence]] = pydantic.Field(default=None)
9
+ class TenantInfo(UniversalBaseModel):
10
+ tenant_id: str = pydantic.Field()
12
11
  """
13
- Relations linked with this chunk
12
+ Organization tenant ID
13
+ """
14
+
15
+ organisation: str = pydantic.Field()
16
+ """
17
+ Organization name
18
+ """
19
+
20
+ timestamp: str = pydantic.Field()
21
+ """
22
+ Creation timestamp
14
23
  """
15
24
 
16
25
  if IS_PYDANTIC_V2:
@@ -6,25 +6,24 @@ import pydantic
6
6
  from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
7
 
8
8
 
9
- class EmbeddingsSearchData(UniversalBaseModel):
10
- chunk_ids: typing.List[str] = pydantic.Field()
9
+ class TenantMetadataSchemaInfo(UniversalBaseModel):
11
10
  """
12
- List of chunk IDs that match the search query
11
+ Summary of configured tenant metadata schema fields.
13
12
  """
14
13
 
15
- scores: typing.List[float] = pydantic.Field()
14
+ field_count: int = pydantic.Field()
16
15
  """
17
- Similarity scores for each matching chunk (higher is more similar)
16
+ Number of custom metadata fields configured
18
17
  """
19
18
 
20
- success: typing.Optional[bool] = pydantic.Field(default=None)
19
+ dense_embedding_fields: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
21
20
  """
22
- Indicates whether the embeddings search operation completed successfully
21
+ Fields with dense embeddings enabled for semantic search
23
22
  """
24
23
 
25
- message: typing.Optional[str] = pydantic.Field(default=None)
24
+ sparse_embedding_fields: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
26
25
  """
27
- Status message about the search operation
26
+ Fields with sparse embeddings enabled for keyword search
28
27
  """
29
28
 
30
29
  if IS_PYDANTIC_V2:
@@ -4,27 +4,28 @@ import typing
4
4
 
5
5
  import pydantic
6
6
  from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+ from .collection_stats import CollectionStats
7
8
 
8
9
 
9
- class TenantCreateData(UniversalBaseModel):
10
- status: str = pydantic.Field()
10
+ class TenantStatsResponse(UniversalBaseModel):
11
+ tenant_id: str = pydantic.Field()
11
12
  """
12
- Current status of the tenant creation process
13
+ Tenant identifier
13
14
  """
14
15
 
15
- tenant_id: str = pydantic.Field()
16
+ normal_collection: CollectionStats = pydantic.Field()
16
17
  """
17
- Unique identifier assigned to the new tenant
18
+ Statistics for the normal (context) collection
18
19
  """
19
20
 
20
- success: typing.Optional[bool] = pydantic.Field(default=None)
21
+ memory_collection: CollectionStats = pydantic.Field()
21
22
  """
22
- Indicates whether the tenant creation was successful
23
+ Statistics for the memory collection
23
24
  """
24
25
 
25
26
  message: typing.Optional[str] = pydantic.Field(default=None)
26
27
  """
27
- Response message describing the creation result
28
+ Summary message
28
29
  """
29
30
 
30
31
  if IS_PYDANTIC_V2:
@@ -8,7 +8,7 @@ from .entity import Entity
8
8
  from .relation_evidence import RelationEvidence
9
9
 
10
10
 
11
- class TripleWithEvidence(UniversalBaseModel):
11
+ class TripletWithEvidence(UniversalBaseModel):
12
12
  """
13
13
  Triple with multiple evidence items from different chunks
14
14
  """
@@ -7,6 +7,10 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
7
 
8
8
 
9
9
  class UserAssistantPair(UniversalBaseModel):
10
+ """
11
+ Represents a user-assistant conversation pair.
12
+ """
13
+
10
14
  user: str = pydantic.Field()
11
15
  """
12
16
  User's message in the conversation
@@ -4,10 +4,9 @@ import typing
4
4
 
5
5
  import pydantic
6
6
  from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
- from .extended_context import ExtendedContext
8
7
 
9
8
 
10
- class SearchChunk(UniversalBaseModel):
9
+ class VectorStoreChunk(UniversalBaseModel):
11
10
  chunk_uuid: str = pydantic.Field()
12
11
  """
13
12
  Unique identifier for this content chunk
@@ -45,12 +44,12 @@ class SearchChunk(UniversalBaseModel):
45
44
 
46
45
  layout: typing.Optional[str] = pydantic.Field(default=None)
47
46
  """
48
- Layout of the chunk in original document. You will generally receive a stringified dict with 2 keys, `offsets` and `page`(optional). Offsets will have `document_level_start_index` and `page_level_start_index`(optional)
47
+ Layout of the chunk in original document. You will generally receive a stringified dict with 2 keys, `offsets` and `page`(optional). Offsets will have `document_level_start_index` and `page_level_start_index`(optional)
49
48
  """
50
49
 
51
50
  relevancy_score: typing.Optional[float] = pydantic.Field(default=None)
52
51
  """
53
- Score indicating how relevant this chunk is to your search query, with higher values indicating better matches
52
+ Score indicating how relevant this chunk is to your search query, with higher values indicating better matches
54
53
  """
55
54
 
56
55
  document_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
@@ -63,11 +62,6 @@ class SearchChunk(UniversalBaseModel):
63
62
  Custom metadata associated with your tenant
64
63
  """
65
64
 
66
- extra_context: typing.Optional[ExtendedContext] = pydantic.Field(default=None)
67
- """
68
- Additional context for this chunk
69
- """
70
-
71
65
  if IS_PYDANTIC_V2:
72
66
  model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
73
67
  else:
@@ -2,3 +2,6 @@
2
2
 
3
3
  # isort: skip_file
4
4
 
5
+ from .types import BodyUploadAppIngestionUploadAppPostAppSources
6
+
7
+ __all__ = ["BodyUploadAppIngestionUploadAppPostAppSources"]