usecortex-ai 0.2.1__tar.gz → 0.3.0__tar.gz

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 (120) hide show
  1. {usecortex_ai-0.2.1/src/usecortex_ai.egg-info → usecortex_ai-0.3.0}/PKG-INFO +1 -1
  2. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/pyproject.toml +1 -1
  3. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/__init__.py +18 -3
  4. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/client.py +3 -0
  5. usecortex_ai-0.3.0/src/usecortex_ai/document/client.py +139 -0
  6. {usecortex_ai-0.2.1/src/usecortex_ai/tenant → usecortex_ai-0.3.0/src/usecortex_ai/document}/raw_client.py +54 -25
  7. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/embeddings/client.py +48 -78
  8. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/embeddings/raw_client.py +44 -74
  9. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/fetch/client.py +2 -2
  10. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/search/client.py +88 -84
  11. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/search/raw_client.py +82 -78
  12. usecortex_ai-0.3.0/src/usecortex_ai/sources/client.py +139 -0
  13. usecortex_ai-0.3.0/src/usecortex_ai/sources/raw_client.py +312 -0
  14. {usecortex_ai-0.2.1/src/usecortex_ai/sources → usecortex_ai-0.3.0/src/usecortex_ai/tenant}/client.py +83 -85
  15. {usecortex_ai-0.2.1/src/usecortex_ai/sources → usecortex_ai-0.3.0/src/usecortex_ai/tenant}/raw_client.py +86 -96
  16. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/types/__init__.py +16 -2
  17. usecortex_ai-0.3.0/src/usecortex_ai/types/add_user_memory_response.py +36 -0
  18. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/types/app_sources_upload_data.py +10 -2
  19. usecortex_ai-0.3.0/src/usecortex_ai/types/attachment_model.py +53 -0
  20. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/types/batch_upload_data.py +10 -2
  21. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/types/body_scrape_webpage_upload_scrape_webpage_post.py +0 -2
  22. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/types/body_update_scrape_job_upload_update_webpage_patch.py +0 -2
  23. usecortex_ai-0.3.0/src/usecortex_ai/types/content_model.py +53 -0
  24. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/types/delete_memory_request.py +14 -3
  25. usecortex_ai-0.2.1/src/usecortex_ai/types/single_upload_data.py → usecortex_ai-0.3.0/src/usecortex_ai/types/delete_sources.py +1 -2
  26. usecortex_ai-0.3.0/src/usecortex_ai/types/delete_sub_tenant_data.py +42 -0
  27. usecortex_ai-0.3.0/src/usecortex_ai/types/delete_user_memory_response.py +31 -0
  28. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/types/embeddings_create_collection_data.py +19 -4
  29. usecortex_ai-0.3.0/src/usecortex_ai/types/embeddings_delete_data.py +37 -0
  30. usecortex_ai-0.3.0/src/usecortex_ai/types/embeddings_get_data.py +37 -0
  31. usecortex_ai-0.3.0/src/usecortex_ai/types/embeddings_search_data.py +37 -0
  32. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/types/error_response.py +0 -1
  33. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/types/fetch_content_data.py +19 -5
  34. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/types/file_upload_result.py +9 -2
  35. usecortex_ai-0.3.0/src/usecortex_ai/types/generate_user_memory_response.py +32 -0
  36. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/types/list_sources_response.py +14 -3
  37. usecortex_ai-0.3.0/src/usecortex_ai/types/list_user_memories_response.py +32 -0
  38. usecortex_ai-0.3.0/src/usecortex_ai/types/markdown_upload_request.py +41 -0
  39. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/types/processing_status.py +14 -3
  40. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/types/relations.py +9 -2
  41. usecortex_ai-0.3.0/src/usecortex_ai/types/retrieve_user_memory_response.py +32 -0
  42. usecortex_ai-0.3.0/src/usecortex_ai/types/search_chunk.py +72 -0
  43. usecortex_ai-0.2.1/src/usecortex_ai/types/embeddings_delete_data.py → usecortex_ai-0.3.0/src/usecortex_ai/types/single_upload_data.py +11 -4
  44. usecortex_ai-0.3.0/src/usecortex_ai/types/source.py +52 -0
  45. usecortex_ai-0.3.0/src/usecortex_ai/types/source_model.py +83 -0
  46. usecortex_ai-0.3.0/src/usecortex_ai/types/sub_tenant_ids_data.py +47 -0
  47. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/types/tenant_create_data.py +19 -4
  48. usecortex_ai-0.3.0/src/usecortex_ai/types/tenant_stats.py +42 -0
  49. usecortex_ai-0.3.0/src/usecortex_ai/types/user_memory.py +31 -0
  50. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/upload/client.py +486 -111
  51. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/upload/raw_client.py +458 -103
  52. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/user/client.py +30 -10
  53. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/user/raw_client.py +22 -6
  54. usecortex_ai-0.3.0/src/usecortex_ai/user_memory/__init__.py +4 -0
  55. usecortex_ai-0.3.0/src/usecortex_ai/user_memory/client.py +587 -0
  56. usecortex_ai-0.3.0/src/usecortex_ai/user_memory/raw_client.py +1478 -0
  57. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0/src/usecortex_ai.egg-info}/PKG-INFO +1 -1
  58. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai.egg-info/SOURCES.txt +11 -1
  59. usecortex_ai-0.2.1/src/usecortex_ai/tenant/client.py +0 -120
  60. usecortex_ai-0.2.1/src/usecortex_ai/types/attachment_model.py +0 -26
  61. usecortex_ai-0.2.1/src/usecortex_ai/types/content_model.py +0 -26
  62. usecortex_ai-0.2.1/src/usecortex_ai/types/embeddings_get_data.py +0 -22
  63. usecortex_ai-0.2.1/src/usecortex_ai/types/embeddings_search_data.py +0 -22
  64. usecortex_ai-0.2.1/src/usecortex_ai/types/markdown_upload_request.py +0 -23
  65. usecortex_ai-0.2.1/src/usecortex_ai/types/search_chunk.py +0 -35
  66. usecortex_ai-0.2.1/src/usecortex_ai/types/source.py +0 -33
  67. usecortex_ai-0.2.1/src/usecortex_ai/types/source_content.py +0 -26
  68. usecortex_ai-0.2.1/src/usecortex_ai/types/source_model.py +0 -34
  69. usecortex_ai-0.2.1/src/usecortex_ai/types/sub_tenant_ids_data.py +0 -23
  70. usecortex_ai-0.2.1/src/usecortex_ai/types/tenant_stats.py +0 -23
  71. usecortex_ai-0.2.1/src/usecortex_ai/user_memory/client.py +0 -443
  72. usecortex_ai-0.2.1/src/usecortex_ai/user_memory/raw_client.py +0 -651
  73. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/LICENSE +0 -0
  74. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/README.md +0 -0
  75. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/setup.cfg +0 -0
  76. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/core/__init__.py +0 -0
  77. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/core/api_error.py +0 -0
  78. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/core/client_wrapper.py +0 -0
  79. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/core/datetime_utils.py +0 -0
  80. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/core/file.py +0 -0
  81. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/core/force_multipart.py +0 -0
  82. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/core/http_client.py +0 -0
  83. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/core/http_response.py +0 -0
  84. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/core/jsonable_encoder.py +0 -0
  85. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/core/pydantic_utilities.py +0 -0
  86. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/core/query_encoder.py +0 -0
  87. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/core/remove_none_from_dict.py +0 -0
  88. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/core/request_options.py +0 -0
  89. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/core/serialization.py +0 -0
  90. {usecortex_ai-0.2.1/src/usecortex_ai/embeddings → usecortex_ai-0.3.0/src/usecortex_ai/document}/__init__.py +0 -0
  91. {usecortex_ai-0.2.1/src/usecortex_ai/fetch → usecortex_ai-0.3.0/src/usecortex_ai/embeddings}/__init__.py +0 -0
  92. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/environment.py +0 -0
  93. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/errors/__init__.py +0 -0
  94. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/errors/bad_request_error.py +0 -0
  95. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/errors/forbidden_error.py +0 -0
  96. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/errors/internal_server_error.py +0 -0
  97. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/errors/not_found_error.py +0 -0
  98. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/errors/service_unavailable_error.py +0 -0
  99. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/errors/unauthorized_error.py +0 -0
  100. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/errors/unprocessable_entity_error.py +0 -0
  101. {usecortex_ai-0.2.1/src/usecortex_ai/sources → usecortex_ai-0.3.0/src/usecortex_ai/fetch}/__init__.py +0 -0
  102. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/fetch/raw_client.py +0 -0
  103. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/raw_client.py +0 -0
  104. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/search/__init__.py +0 -0
  105. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/search/types/__init__.py +0 -0
  106. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/search/types/alpha.py +0 -0
  107. {usecortex_ai-0.2.1/src/usecortex_ai/tenant → usecortex_ai-0.3.0/src/usecortex_ai/sources}/__init__.py +0 -0
  108. {usecortex_ai-0.2.1/src/usecortex_ai/upload → usecortex_ai-0.3.0/src/usecortex_ai/tenant}/__init__.py +0 -0
  109. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/types/actual_error_response.py +0 -0
  110. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/types/bm_25_operator_type.py +0 -0
  111. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/types/extended_context.py +0 -0
  112. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/types/http_validation_error.py +0 -0
  113. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/types/related_chunk.py +0 -0
  114. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/types/validation_error.py +0 -0
  115. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai/types/validation_error_loc_item.py +0 -0
  116. {usecortex_ai-0.2.1/src/usecortex_ai/user → usecortex_ai-0.3.0/src/usecortex_ai/upload}/__init__.py +0 -0
  117. {usecortex_ai-0.2.1/src/usecortex_ai/user_memory → usecortex_ai-0.3.0/src/usecortex_ai/user}/__init__.py +0 -0
  118. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai.egg-info/dependency_links.txt +0 -0
  119. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai.egg-info/requires.txt +0 -0
  120. {usecortex_ai-0.2.1 → usecortex_ai-0.3.0}/src/usecortex_ai.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: usecortex-ai
3
- Version: 0.2.1
3
+ Version: 0.3.0
4
4
  Summary: The official Python SDK for the Cortex AI platform.
5
5
  Author-email: Nishkarsh Shrivastava <nishkarsh@usecortex.ai>
6
6
  License: Copyright (c) 2024 Cortex AI
@@ -9,7 +9,7 @@ build-backend = "setuptools.build_meta"
9
9
  name = "usecortex-ai"
10
10
 
11
11
  # Start with an initial version
12
- version = "0.2.1"
12
+ version = "0.3.0"
13
13
 
14
14
  authors = [
15
15
  { name = "Nishkarsh Shrivastava", email = "nishkarsh@usecortex.ai" },
@@ -4,6 +4,7 @@
4
4
 
5
5
  from .types import (
6
6
  ActualErrorResponse,
7
+ AddUserMemoryResponse,
7
8
  AppSourcesUploadData,
8
9
  AttachmentModel,
9
10
  BatchUploadData,
@@ -12,6 +13,9 @@ from .types import (
12
13
  BodyUpdateScrapeJobUploadUpdateWebpagePatch,
13
14
  ContentModel,
14
15
  DeleteMemoryRequest,
16
+ DeleteSources,
17
+ DeleteSubTenantData,
18
+ DeleteUserMemoryResponse,
15
19
  EmbeddingsCreateCollectionData,
16
20
  EmbeddingsDeleteData,
17
21
  EmbeddingsGetData,
@@ -20,20 +24,23 @@ from .types import (
20
24
  ExtendedContext,
21
25
  FetchContentData,
22
26
  FileUploadResult,
27
+ GenerateUserMemoryResponse,
23
28
  HttpValidationError,
24
29
  ListSourcesResponse,
30
+ ListUserMemoriesResponse,
25
31
  MarkdownUploadRequest,
26
32
  ProcessingStatus,
27
33
  RelatedChunk,
28
34
  Relations,
35
+ RetrieveUserMemoryResponse,
29
36
  SearchChunk,
30
37
  SingleUploadData,
31
38
  Source,
32
- SourceContent,
33
39
  SourceModel,
34
40
  SubTenantIdsData,
35
41
  TenantCreateData,
36
42
  TenantStats,
43
+ UserMemory,
37
44
  ValidationError,
38
45
  ValidationErrorLocItem,
39
46
  )
@@ -46,13 +53,14 @@ from .errors import (
46
53
  UnauthorizedError,
47
54
  UnprocessableEntityError,
48
55
  )
49
- from . import embeddings, fetch, search, sources, tenant, upload, user, user_memory
56
+ from . import document, embeddings, fetch, search, sources, tenant, upload, user, user_memory
50
57
  from .client import AsyncCortexAI, CortexAI
51
58
  from .environment import CortexAIEnvironment
52
59
  from .search import Alpha
53
60
 
54
61
  __all__ = [
55
62
  "ActualErrorResponse",
63
+ "AddUserMemoryResponse",
56
64
  "Alpha",
57
65
  "AppSourcesUploadData",
58
66
  "AsyncCortexAI",
@@ -66,6 +74,9 @@ __all__ = [
66
74
  "CortexAI",
67
75
  "CortexAIEnvironment",
68
76
  "DeleteMemoryRequest",
77
+ "DeleteSources",
78
+ "DeleteSubTenantData",
79
+ "DeleteUserMemoryResponse",
69
80
  "EmbeddingsCreateCollectionData",
70
81
  "EmbeddingsDeleteData",
71
82
  "EmbeddingsGetData",
@@ -75,27 +86,31 @@ __all__ = [
75
86
  "FetchContentData",
76
87
  "FileUploadResult",
77
88
  "ForbiddenError",
89
+ "GenerateUserMemoryResponse",
78
90
  "HttpValidationError",
79
91
  "InternalServerError",
80
92
  "ListSourcesResponse",
93
+ "ListUserMemoriesResponse",
81
94
  "MarkdownUploadRequest",
82
95
  "NotFoundError",
83
96
  "ProcessingStatus",
84
97
  "RelatedChunk",
85
98
  "Relations",
99
+ "RetrieveUserMemoryResponse",
86
100
  "SearchChunk",
87
101
  "ServiceUnavailableError",
88
102
  "SingleUploadData",
89
103
  "Source",
90
- "SourceContent",
91
104
  "SourceModel",
92
105
  "SubTenantIdsData",
93
106
  "TenantCreateData",
94
107
  "TenantStats",
95
108
  "UnauthorizedError",
96
109
  "UnprocessableEntityError",
110
+ "UserMemory",
97
111
  "ValidationError",
98
112
  "ValidationErrorLocItem",
113
+ "document",
99
114
  "embeddings",
100
115
  "fetch",
101
116
  "search",
@@ -5,6 +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
9
  from .embeddings.client import AsyncEmbeddingsClient, EmbeddingsClient
9
10
  from .environment import CortexAIEnvironment
10
11
  from .fetch.client import AsyncFetchClient, FetchClient
@@ -89,6 +90,7 @@ class CortexAI:
89
90
  self.embeddings = EmbeddingsClient(client_wrapper=self._client_wrapper)
90
91
  self.user = UserClient(client_wrapper=self._client_wrapper)
91
92
  self.tenant = TenantClient(client_wrapper=self._client_wrapper)
93
+ self.document = DocumentClient(client_wrapper=self._client_wrapper)
92
94
 
93
95
  @property
94
96
  def with_raw_response(self) -> RawCortexAI:
@@ -196,6 +198,7 @@ class AsyncCortexAI:
196
198
  self.embeddings = AsyncEmbeddingsClient(client_wrapper=self._client_wrapper)
197
199
  self.user = AsyncUserClient(client_wrapper=self._client_wrapper)
198
200
  self.tenant = AsyncTenantClient(client_wrapper=self._client_wrapper)
201
+ self.document = AsyncDocumentClient(client_wrapper=self._client_wrapper)
199
202
 
200
203
  @property
201
204
  def with_raw_response(self) -> AsyncRawCortexAI:
@@ -0,0 +1,139 @@
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.delete_sources import DeleteSources
8
+ from .raw_client import AsyncRawDocumentClient, RawDocumentClient
9
+
10
+ # this is used as the default value for optional parameters
11
+ OMIT = typing.cast(typing.Any, ...)
12
+
13
+
14
+ class DocumentClient:
15
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
16
+ self._raw_client = RawDocumentClient(client_wrapper=client_wrapper)
17
+
18
+ @property
19
+ def with_raw_response(self) -> RawDocumentClient:
20
+ """
21
+ Retrieves a raw implementation of this client that returns raw responses.
22
+
23
+ Returns
24
+ -------
25
+ RawDocumentClient
26
+ """
27
+ return self._raw_client
28
+
29
+ def delete(
30
+ self,
31
+ *,
32
+ tenant_id: str,
33
+ source_ids: typing.Sequence[str],
34
+ sub_tenant_id: typing.Optional[str] = OMIT,
35
+ request_options: typing.Optional[RequestOptions] = None,
36
+ ) -> DeleteSources:
37
+ """
38
+ Remove documents and content from your knowledge base.
39
+
40
+ This endpoint permanently deletes the specified sources from your knowledge base. Once deleted, the content will no longer be available for search or retrieval.
41
+
42
+ Use this carefully as the action cannot be undone. The system will confirm successful deletion of each source ID you specify.
43
+
44
+ Parameters
45
+ ----------
46
+ tenant_id : str
47
+ Unique identifier for the tenant/organization
48
+
49
+ source_ids : typing.Sequence[str]
50
+ List of source IDs to delete
51
+
52
+ sub_tenant_id : typing.Optional[str]
53
+ Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
54
+
55
+ request_options : typing.Optional[RequestOptions]
56
+ Request-specific configuration.
57
+
58
+ Returns
59
+ -------
60
+ DeleteSources
61
+ Successful Response
62
+
63
+ Examples
64
+ --------
65
+ from usecortex-ai import CortexAI
66
+
67
+ client = CortexAI(token="YOUR_TOKEN", )
68
+ client.document.delete(tenant_id='tenant_1234', source_ids=['CortexDoc1234', 'CortexDoc4567'], )
69
+ """
70
+ _response = self._raw_client.delete(
71
+ tenant_id=tenant_id, source_ids=source_ids, sub_tenant_id=sub_tenant_id, request_options=request_options
72
+ )
73
+ return _response.data
74
+
75
+
76
+ class AsyncDocumentClient:
77
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
78
+ self._raw_client = AsyncRawDocumentClient(client_wrapper=client_wrapper)
79
+
80
+ @property
81
+ def with_raw_response(self) -> AsyncRawDocumentClient:
82
+ """
83
+ Retrieves a raw implementation of this client that returns raw responses.
84
+
85
+ Returns
86
+ -------
87
+ AsyncRawDocumentClient
88
+ """
89
+ return self._raw_client
90
+
91
+ async def delete(
92
+ self,
93
+ *,
94
+ tenant_id: str,
95
+ source_ids: typing.Sequence[str],
96
+ sub_tenant_id: typing.Optional[str] = OMIT,
97
+ request_options: typing.Optional[RequestOptions] = None,
98
+ ) -> DeleteSources:
99
+ """
100
+ Remove documents and content from your knowledge base.
101
+
102
+ This endpoint permanently deletes the specified sources from your knowledge base. Once deleted, the content will no longer be available for search or retrieval.
103
+
104
+ Use this carefully as the action cannot be undone. The system will confirm successful deletion of each source ID you specify.
105
+
106
+ Parameters
107
+ ----------
108
+ tenant_id : str
109
+ Unique identifier for the tenant/organization
110
+
111
+ source_ids : typing.Sequence[str]
112
+ List of source IDs to delete
113
+
114
+ sub_tenant_id : typing.Optional[str]
115
+ Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
116
+
117
+ request_options : typing.Optional[RequestOptions]
118
+ Request-specific configuration.
119
+
120
+ Returns
121
+ -------
122
+ DeleteSources
123
+ Successful Response
124
+
125
+ Examples
126
+ --------
127
+ import asyncio
128
+
129
+ from usecortex-ai import AsyncCortexAI
130
+
131
+ client = AsyncCortexAI(token="YOUR_TOKEN", )
132
+ async def main() -> None:
133
+ await client.document.delete(tenant_id='tenant_1234', source_ids=['CortexDoc1234', 'CortexDoc4567'], )
134
+ asyncio.run(main())
135
+ """
136
+ _response = await self._raw_client.delete(
137
+ tenant_id=tenant_id, source_ids=source_ids, sub_tenant_id=sub_tenant_id, request_options=request_options
138
+ )
139
+ return _response.data
@@ -16,54 +16,70 @@ from ..errors.service_unavailable_error import ServiceUnavailableError
16
16
  from ..errors.unauthorized_error import UnauthorizedError
17
17
  from ..errors.unprocessable_entity_error import UnprocessableEntityError
18
18
  from ..types.actual_error_response import ActualErrorResponse
19
- from ..types.tenant_stats import TenantStats
19
+ from ..types.delete_sources import DeleteSources
20
20
 
21
+ # this is used as the default value for optional parameters
22
+ OMIT = typing.cast(typing.Any, ...)
21
23
 
22
- class RawTenantClient:
24
+
25
+ class RawDocumentClient:
23
26
  def __init__(self, *, client_wrapper: SyncClientWrapper):
24
27
  self._client_wrapper = client_wrapper
25
28
 
26
- def stats(
29
+ def delete(
27
30
  self,
28
31
  *,
29
32
  tenant_id: str,
30
- sub_tenant_id: typing.Optional[str] = None,
33
+ source_ids: typing.Sequence[str],
34
+ sub_tenant_id: typing.Optional[str] = OMIT,
31
35
  request_options: typing.Optional[RequestOptions] = None,
32
- ) -> HttpResponse[TenantStats]:
36
+ ) -> HttpResponse[DeleteSources]:
33
37
  """
34
- Get tenant stats.
38
+ Remove documents and content from your knowledge base.
39
+
40
+ This endpoint permanently deletes the specified sources from your knowledge base. Once deleted, the content will no longer be available for search or retrieval.
35
41
 
36
- This endpoint returns stats for tenant.
42
+ Use this carefully as the action cannot be undone. The system will confirm successful deletion of each source ID you specify.
37
43
 
38
44
  Parameters
39
45
  ----------
40
46
  tenant_id : str
47
+ Unique identifier for the tenant/organization
48
+
49
+ source_ids : typing.Sequence[str]
50
+ List of source IDs to delete
41
51
 
42
52
  sub_tenant_id : typing.Optional[str]
53
+ Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
43
54
 
44
55
  request_options : typing.Optional[RequestOptions]
45
56
  Request-specific configuration.
46
57
 
47
58
  Returns
48
59
  -------
49
- HttpResponse[TenantStats]
60
+ HttpResponse[DeleteSources]
50
61
  Successful Response
51
62
  """
52
63
  _response = self._client_wrapper.httpx_client.request(
53
- "tenant/stats",
54
- method="GET",
55
- params={
64
+ "document/delete",
65
+ method="DELETE",
66
+ json={
56
67
  "tenant_id": tenant_id,
68
+ "source_ids": source_ids,
57
69
  "sub_tenant_id": sub_tenant_id,
58
70
  },
71
+ headers={
72
+ "content-type": "application/json",
73
+ },
59
74
  request_options=request_options,
75
+ omit=OMIT,
60
76
  )
61
77
  try:
62
78
  if 200 <= _response.status_code < 300:
63
79
  _data = typing.cast(
64
- TenantStats,
80
+ DeleteSources,
65
81
  parse_obj_as(
66
- type_=TenantStats, # type: ignore
82
+ type_=DeleteSources, # type: ignore
67
83
  object_=_response.json(),
68
84
  ),
69
85
  )
@@ -151,51 +167,64 @@ class RawTenantClient:
151
167
  raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
152
168
 
153
169
 
154
- class AsyncRawTenantClient:
170
+ class AsyncRawDocumentClient:
155
171
  def __init__(self, *, client_wrapper: AsyncClientWrapper):
156
172
  self._client_wrapper = client_wrapper
157
173
 
158
- async def stats(
174
+ async def delete(
159
175
  self,
160
176
  *,
161
177
  tenant_id: str,
162
- sub_tenant_id: typing.Optional[str] = None,
178
+ source_ids: typing.Sequence[str],
179
+ sub_tenant_id: typing.Optional[str] = OMIT,
163
180
  request_options: typing.Optional[RequestOptions] = None,
164
- ) -> AsyncHttpResponse[TenantStats]:
181
+ ) -> AsyncHttpResponse[DeleteSources]:
165
182
  """
166
- Get tenant stats.
183
+ Remove documents and content from your knowledge base.
167
184
 
168
- This endpoint returns stats for tenant.
185
+ This endpoint permanently deletes the specified sources from your knowledge base. Once deleted, the content will no longer be available for search or retrieval.
186
+
187
+ Use this carefully as the action cannot be undone. The system will confirm successful deletion of each source ID you specify.
169
188
 
170
189
  Parameters
171
190
  ----------
172
191
  tenant_id : str
192
+ Unique identifier for the tenant/organization
193
+
194
+ source_ids : typing.Sequence[str]
195
+ List of source IDs to delete
173
196
 
174
197
  sub_tenant_id : typing.Optional[str]
198
+ Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
175
199
 
176
200
  request_options : typing.Optional[RequestOptions]
177
201
  Request-specific configuration.
178
202
 
179
203
  Returns
180
204
  -------
181
- AsyncHttpResponse[TenantStats]
205
+ AsyncHttpResponse[DeleteSources]
182
206
  Successful Response
183
207
  """
184
208
  _response = await self._client_wrapper.httpx_client.request(
185
- "tenant/stats",
186
- method="GET",
187
- params={
209
+ "document/delete",
210
+ method="DELETE",
211
+ json={
188
212
  "tenant_id": tenant_id,
213
+ "source_ids": source_ids,
189
214
  "sub_tenant_id": sub_tenant_id,
190
215
  },
216
+ headers={
217
+ "content-type": "application/json",
218
+ },
191
219
  request_options=request_options,
220
+ omit=OMIT,
192
221
  )
193
222
  try:
194
223
  if 200 <= _response.status_code < 300:
195
224
  _data = typing.cast(
196
- TenantStats,
225
+ DeleteSources,
197
226
  parse_obj_as(
198
- type_=TenantStats, # type: ignore
227
+ type_=DeleteSources, # type: ignore
199
228
  object_=_response.json(),
200
229
  ),
201
230
  )