usecortex-ai 0.3.6__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 (106) hide show
  1. usecortex_ai/__init__.py +80 -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 +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 +74 -66
  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/path_triplet.py +3 -18
  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 +24 -5
  52. usecortex_ai/types/retrieval_result.py +26 -0
  53. usecortex_ai/types/scored_path_response.py +5 -19
  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/{webpage_scrape_request.py → tenant_info.py} +10 -5
  67. usecortex_ai/types/{scored_triplet_response.py → tenant_metadata_schema_info.py} +8 -15
  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} +5 -1
  70. usecortex_ai/types/user_assistant_pair.py +4 -0
  71. usecortex_ai/types/{search_chunk.py → vector_store_chunk.py} +3 -14
  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.6.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.6.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/chunk_graph_relations_response.py +0 -33
  86. usecortex_ai/types/delete_memory_request.py +0 -32
  87. usecortex_ai/types/delete_sub_tenant_data.py +0 -42
  88. usecortex_ai/types/embeddings_delete_data.py +0 -37
  89. usecortex_ai/types/embeddings_get_data.py +0 -37
  90. usecortex_ai/types/embeddings_search_data.py +0 -37
  91. usecortex_ai/types/extended_context.py +0 -17
  92. usecortex_ai/types/markdown_upload_request.py +0 -41
  93. usecortex_ai/types/related_chunk.py +0 -22
  94. usecortex_ai/types/retrieve_user_memory_response.py +0 -38
  95. usecortex_ai/types/source.py +0 -52
  96. usecortex_ai/types/sub_tenant_ids_data.py +0 -47
  97. usecortex_ai/types/tenant_stats.py +0 -42
  98. usecortex_ai/user/__init__.py +0 -4
  99. usecortex_ai/user/client.py +0 -145
  100. usecortex_ai/user/raw_client.py +0 -316
  101. usecortex_ai/user_memory/__init__.py +0 -4
  102. usecortex_ai/user_memory/client.py +0 -515
  103. usecortex_ai-0.3.6.dist-info/RECORD +0 -112
  104. /usecortex_ai/{document → dashboard}/__init__.py +0 -0
  105. {usecortex_ai-0.3.6.dist-info → usecortex_ai-0.4.0.dist-info}/licenses/LICENSE +0 -0
  106. {usecortex_ai-0.3.6.dist-info → usecortex_ai-0.4.0.dist-info}/top_level.txt +0 -0
@@ -1,17 +0,0 @@
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 BodyUpdateScrapeJobUploadUpdateWebpagePatch(UniversalBaseModel):
10
- if IS_PYDANTIC_V2:
11
- model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
12
- else:
13
-
14
- class Config:
15
- frozen = True
16
- smart_union = True
17
- extra = pydantic.Extra.allow
@@ -1,33 +0,0 @@
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 .scored_path_response import ScoredPathResponse
8
- from .scored_triplet_response import ScoredTripletResponse
9
-
10
-
11
- class ChunkGraphRelationsResponse(UniversalBaseModel):
12
- """
13
- Graph relations with group_id -> triplet mapping
14
- """
15
-
16
- entity_paths: typing.Optional[typing.List[ScoredPathResponse]] = pydantic.Field(default=None)
17
- """
18
- Multi-hop paths connecting entities from the query, reranked by relevance. Each path is a chain of connected triplets.
19
- """
20
-
21
- chunk_triplets: typing.Optional[typing.Dict[str, ScoredTripletResponse]] = pydantic.Field(default=None)
22
- """
23
- Mapping of group_id to scored triplet. Use chunk.graph_triplet_ids to find which groups belong to a chunk.
24
- """
25
-
26
- if IS_PYDANTIC_V2:
27
- model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
28
- else:
29
-
30
- class Config:
31
- frozen = True
32
- smart_union = True
33
- extra = pydantic.Extra.allow
@@ -1,32 +0,0 @@
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 DeleteMemoryRequest(UniversalBaseModel):
10
- tenant_id: str = pydantic.Field()
11
- """
12
- Unique identifier for the tenant/organization
13
- """
14
-
15
- source_ids: typing.List[str] = pydantic.Field()
16
- """
17
- List of source IDs to delete
18
- """
19
-
20
- sub_tenant_id: typing.Optional[str] = pydantic.Field(default=None)
21
- """
22
- Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
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
@@ -1,42 +0,0 @@
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 DeleteSubTenantData(UniversalBaseModel):
10
- status: str = pydantic.Field()
11
- """
12
- The status of the deletion operation.
13
- """
14
-
15
- tenant_id: str = pydantic.Field()
16
- """
17
- The tenant ID from which the sub-tenant was deleted.
18
- """
19
-
20
- sub_tenant_id: str = pydantic.Field()
21
- """
22
- The ID of the sub-tenant that was deleted.
23
- """
24
-
25
- success: typing.Optional[bool] = pydantic.Field(default=None)
26
- """
27
- Indicates whether the sub-tenant deletion was successful.
28
- """
29
-
30
- message: typing.Optional[str] = pydantic.Field(default=None)
31
- """
32
- Response message describing the operation result.
33
- """
34
-
35
- if IS_PYDANTIC_V2:
36
- model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
37
- else:
38
-
39
- class Config:
40
- frozen = True
41
- smart_union = True
42
- extra = pydantic.Extra.allow
@@ -1,37 +0,0 @@
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 EmbeddingsDeleteData(UniversalBaseModel):
10
- total_deleted: int = pydantic.Field()
11
- """
12
- Total number of embeddings that were successfully deleted
13
- """
14
-
15
- status: typing.Dict[str, bool] = pydantic.Field()
16
- """
17
- Dictionary mapping chunk IDs to their deletion status (true if deleted successfully). Example: {'chunk_1234': true}
18
- """
19
-
20
- success: typing.Optional[bool] = pydantic.Field(default=None)
21
- """
22
- Indicates whether the embeddings deletion operation completed successfully
23
- """
24
-
25
- message: typing.Optional[str] = pydantic.Field(default=None)
26
- """
27
- Status message about the deletion operation
28
- """
29
-
30
- if IS_PYDANTIC_V2:
31
- model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
32
- else:
33
-
34
- class Config:
35
- frozen = True
36
- smart_union = True
37
- extra = pydantic.Extra.allow
@@ -1,37 +0,0 @@
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 EmbeddingsGetData(UniversalBaseModel):
10
- embeddings: typing.Dict[str, typing.List[float]] = pydantic.Field()
11
- """
12
- Dictionary mapping chunk IDs to their embedding vectors (lists of float values)
13
- """
14
-
15
- not_found_chunk_ids: typing.List[str] = pydantic.Field()
16
- """
17
- List of chunk IDs that were not found in the embeddings collection
18
- """
19
-
20
- success: typing.Optional[bool] = pydantic.Field(default=None)
21
- """
22
- Indicates whether the embeddings retrieval operation completed successfully
23
- """
24
-
25
- message: typing.Optional[str] = pydantic.Field(default=None)
26
- """
27
- Status message about the retrieval operation
28
- """
29
-
30
- if IS_PYDANTIC_V2:
31
- model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
32
- else:
33
-
34
- class Config:
35
- frozen = True
36
- smart_union = True
37
- extra = pydantic.Extra.allow
@@ -1,37 +0,0 @@
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 EmbeddingsSearchData(UniversalBaseModel):
10
- chunk_ids: typing.List[str] = pydantic.Field()
11
- """
12
- List of chunk IDs that match the search query
13
- """
14
-
15
- scores: typing.List[float] = pydantic.Field()
16
- """
17
- Similarity scores for each matching chunk (higher is more similar)
18
- """
19
-
20
- success: typing.Optional[bool] = pydantic.Field(default=None)
21
- """
22
- Indicates whether the embeddings search operation completed successfully
23
- """
24
-
25
- message: typing.Optional[str] = pydantic.Field(default=None)
26
- """
27
- Status message about the search operation
28
- """
29
-
30
- if IS_PYDANTIC_V2:
31
- model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
32
- else:
33
-
34
- class Config:
35
- frozen = True
36
- smart_union = True
37
- extra = pydantic.Extra.allow
@@ -1,17 +0,0 @@
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 ExtendedContext(UniversalBaseModel):
10
- if IS_PYDANTIC_V2:
11
- model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
12
- else:
13
-
14
- class Config:
15
- frozen = True
16
- smart_union = True
17
- extra = pydantic.Extra.allow
@@ -1,41 +0,0 @@
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 MarkdownUploadRequest(UniversalBaseModel):
10
- content: str = pydantic.Field()
11
- """
12
- The text or markdown content to upload
13
- """
14
-
15
- file_id: typing.Optional[str] = pydantic.Field(default=None)
16
- """
17
- Optional file ID for the uploaded content. If not provided, will be generated automatically.
18
- """
19
-
20
- tenant_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
21
- """
22
- JSON string containing tenant-level document metadata (e.g., department, compliance_tag)
23
-
24
- Example: > "{"department":"Finance","compliance_tag":"GDPR"}"
25
- """
26
-
27
- document_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
28
- """
29
- JSON string containing document-specific metadata (e.g., title, author, file_id). If file_id is not provided, the system will generate an ID automatically.
30
-
31
- Example: > "{"title":"Q1 Report.pdf","author":"Alice Smith","file_id":"custom_file_123"}"
32
- """
33
-
34
- if IS_PYDANTIC_V2:
35
- model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
36
- else:
37
-
38
- class Config:
39
- frozen = True
40
- smart_union = True
41
- extra = pydantic.Extra.allow
@@ -1,22 +0,0 @@
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 RelatedChunk(UniversalBaseModel):
10
- source_id: str
11
- chunk_uuid: str
12
- chunk_content: str
13
- source_title: typing.Optional[str] = None
14
-
15
- if IS_PYDANTIC_V2:
16
- model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
17
- else:
18
-
19
- class Config:
20
- frozen = True
21
- smart_union = True
22
- extra = pydantic.Extra.allow
@@ -1,38 +0,0 @@
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 .scored_path_response import ScoredPathResponse
8
- from .user_memory import UserMemory
9
-
10
-
11
- class RetrieveUserMemoryResponse(UniversalBaseModel):
12
- """
13
- Response model for retrieving user memories through semantic search.
14
- """
15
-
16
- success: bool = pydantic.Field()
17
- """
18
- Indicates whether the memory retrieval operation was successful
19
- """
20
-
21
- retrieved_user_memories: typing.Optional[typing.List[UserMemory]] = pydantic.Field(default=None)
22
- """
23
- Array of user memories ranked by relevance to your search query
24
- """
25
-
26
- relations: typing.Optional[typing.List[ScoredPathResponse]] = pydantic.Field(default=None)
27
- """
28
- Array of scored relations extracted from the user query via knowledge graph search
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
@@ -1,52 +0,0 @@
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 Source(UniversalBaseModel):
10
- id: str = pydantic.Field()
11
- """
12
- Unique identifier for the source document
13
- """
14
-
15
- title: str = pydantic.Field()
16
- """
17
- Display title of the source document
18
- """
19
-
20
- type: str = pydantic.Field()
21
- """
22
- Type of content (document, file, text, etc.)
23
- """
24
-
25
- timestamp: str = pydantic.Field()
26
- """
27
- When the source was originally created or uploaded
28
- """
29
-
30
- description: typing.Optional[str] = pydantic.Field(default=None)
31
- """
32
- Brief summary or description of the source content
33
- """
34
-
35
- document_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
36
- """
37
- Additional metadata specific to the document
38
- """
39
-
40
- tenant_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
41
- """
42
- Metadata related to the tenant and organizational context
43
- """
44
-
45
- if IS_PYDANTIC_V2:
46
- model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
47
- else:
48
-
49
- class Config:
50
- frozen = True
51
- smart_union = True
52
- extra = pydantic.Extra.allow
@@ -1,47 +0,0 @@
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 SubTenantIdsData(UniversalBaseModel):
10
- tenant_id: str = pydantic.Field()
11
- """
12
- The tenant ID that was queried
13
- """
14
-
15
- sub_tenant_ids: typing.List[str] = pydantic.Field()
16
- """
17
- Array of all sub-tenant IDs within the tenant
18
- """
19
-
20
- count: int = pydantic.Field()
21
- """
22
- Total number of sub-tenants found
23
- """
24
-
25
- tenant_schema: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
26
- """
27
- Schema configuration for the tenant collection
28
- """
29
-
30
- success: typing.Optional[bool] = pydantic.Field(default=None)
31
- """
32
- Indicates whether the sub-tenant retrieval was successful
33
- """
34
-
35
- message: typing.Optional[str] = pydantic.Field(default=None)
36
- """
37
- Response message describing the operation result
38
- """
39
-
40
- if IS_PYDANTIC_V2:
41
- model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
42
- else:
43
-
44
- class Config:
45
- frozen = True
46
- smart_union = True
47
- extra = pydantic.Extra.allow
@@ -1,42 +0,0 @@
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 TenantStats(UniversalBaseModel):
10
- object_count: int = pydantic.Field()
11
- """
12
- Total number of objects stored for this tenant
13
- """
14
-
15
- tenant_id: str = pydantic.Field()
16
- """
17
- identifier for the tenant
18
- """
19
-
20
- vector_dimension: typing.Optional[int] = pydantic.Field(default=None)
21
- """
22
- Dimensions of the vector embeddings used for this tenant. Null when the tenant is empty.
23
- """
24
-
25
- success: typing.Optional[bool] = pydantic.Field(default=None)
26
- """
27
- Indicates whether the stats retrieval was successful
28
- """
29
-
30
- message: typing.Optional[str] = pydantic.Field(default=None)
31
- """
32
- Response message describing the operation result
33
- """
34
-
35
- if IS_PYDANTIC_V2:
36
- model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
37
- else:
38
-
39
- class Config:
40
- frozen = True
41
- smart_union = True
42
- extra = pydantic.Extra.allow
@@ -1,4 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-
3
- # isort: skip_file
4
-
@@ -1,145 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-
3
- import typing
4
-
5
- from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
6
- from ..core.request_options import RequestOptions
7
- from ..types.tenant_create_data import TenantCreateData
8
- from .raw_client import AsyncRawUserClient, RawUserClient
9
-
10
- # this is used as the default value for optional parameters
11
- OMIT = typing.cast(typing.Any, ...)
12
-
13
-
14
- class UserClient:
15
- def __init__(self, *, client_wrapper: SyncClientWrapper):
16
- self._raw_client = RawUserClient(client_wrapper=client_wrapper)
17
-
18
- @property
19
- def with_raw_response(self) -> RawUserClient:
20
- """
21
- Retrieves a raw implementation of this client that returns raw responses.
22
-
23
- Returns
24
- -------
25
- RawUserClient
26
- """
27
- return self._raw_client
28
-
29
- def create_tenant(
30
- self,
31
- *,
32
- tenant_id: typing.Optional[str] = None,
33
- note: typing.Optional[str] = None,
34
- tenant_metadata_schema: typing.Optional[typing.Sequence[typing.Dict[str, typing.Optional[typing.Any]]]] = OMIT,
35
- request_options: typing.Optional[RequestOptions] = None,
36
- ) -> TenantCreateData:
37
- """
38
- Create a tenant for your account.
39
-
40
- Use this endpoint to initialize a tenant space you can use for ingestion, embeddings, and search. Optionally include a metadata schema to enforce consistent attributes across documents.
41
-
42
- Expected outcome
43
- - A tenant is created and returned with its identifier.
44
- - If the tenant already exists, you receive a success message with the existing identifier.
45
-
46
- Parameters
47
- ----------
48
- tenant_id : typing.Optional[str]
49
- Unique identifier for the tenant/organization
50
-
51
- note : typing.Optional[str]
52
-
53
- tenant_metadata_schema : typing.Optional[typing.Sequence[typing.Dict[str, typing.Optional[typing.Any]]]]
54
-
55
- request_options : typing.Optional[RequestOptions]
56
- Request-specific configuration.
57
-
58
- Returns
59
- -------
60
- TenantCreateData
61
- Successful Response
62
-
63
- Examples
64
- --------
65
- from usecortex-ai import CortexAI
66
-
67
- client = CortexAI(token="YOUR_TOKEN", )
68
- client.user.create_tenant(note='<str>', )
69
- """
70
- _response = self._raw_client.create_tenant(
71
- tenant_id=tenant_id,
72
- note=note,
73
- tenant_metadata_schema=tenant_metadata_schema,
74
- request_options=request_options,
75
- )
76
- return _response.data
77
-
78
-
79
- class AsyncUserClient:
80
- def __init__(self, *, client_wrapper: AsyncClientWrapper):
81
- self._raw_client = AsyncRawUserClient(client_wrapper=client_wrapper)
82
-
83
- @property
84
- def with_raw_response(self) -> AsyncRawUserClient:
85
- """
86
- Retrieves a raw implementation of this client that returns raw responses.
87
-
88
- Returns
89
- -------
90
- AsyncRawUserClient
91
- """
92
- return self._raw_client
93
-
94
- async def create_tenant(
95
- self,
96
- *,
97
- tenant_id: typing.Optional[str] = None,
98
- note: typing.Optional[str] = None,
99
- tenant_metadata_schema: typing.Optional[typing.Sequence[typing.Dict[str, typing.Optional[typing.Any]]]] = OMIT,
100
- request_options: typing.Optional[RequestOptions] = None,
101
- ) -> TenantCreateData:
102
- """
103
- Create a tenant for your account.
104
-
105
- Use this endpoint to initialize a tenant space you can use for ingestion, embeddings, and search. Optionally include a metadata schema to enforce consistent attributes across documents.
106
-
107
- Expected outcome
108
- - A tenant is created and returned with its identifier.
109
- - If the tenant already exists, you receive a success message with the existing identifier.
110
-
111
- Parameters
112
- ----------
113
- tenant_id : typing.Optional[str]
114
- Unique identifier for the tenant/organization
115
-
116
- note : typing.Optional[str]
117
-
118
- tenant_metadata_schema : typing.Optional[typing.Sequence[typing.Dict[str, typing.Optional[typing.Any]]]]
119
-
120
- request_options : typing.Optional[RequestOptions]
121
- Request-specific configuration.
122
-
123
- Returns
124
- -------
125
- TenantCreateData
126
- Successful Response
127
-
128
- Examples
129
- --------
130
- import asyncio
131
-
132
- from usecortex-ai import AsyncCortexAI
133
-
134
- client = AsyncCortexAI(token="YOUR_TOKEN", )
135
- async def main() -> None:
136
- await client.user.create_tenant(note='<str>', )
137
- asyncio.run(main())
138
- """
139
- _response = await self._raw_client.create_tenant(
140
- tenant_id=tenant_id,
141
- note=note,
142
- tenant_metadata_schema=tenant_metadata_schema,
143
- request_options=request_options,
144
- )
145
- return _response.data