usecortex-ai 0.2.1__py3-none-any.whl → 0.3.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.
- usecortex_ai/__init__.py +18 -3
- usecortex_ai/client.py +3 -0
- usecortex_ai/document/__init__.py +4 -0
- usecortex_ai/document/client.py +139 -0
- usecortex_ai/document/raw_client.py +312 -0
- usecortex_ai/embeddings/client.py +48 -78
- usecortex_ai/embeddings/raw_client.py +44 -74
- usecortex_ai/fetch/client.py +2 -2
- usecortex_ai/search/client.py +88 -84
- usecortex_ai/search/raw_client.py +82 -78
- usecortex_ai/sources/client.py +26 -157
- usecortex_ai/sources/raw_client.py +22 -501
- usecortex_ai/tenant/client.py +154 -6
- usecortex_ai/tenant/raw_client.py +502 -4
- usecortex_ai/types/__init__.py +16 -2
- usecortex_ai/types/add_user_memory_response.py +36 -0
- usecortex_ai/types/app_sources_upload_data.py +10 -2
- usecortex_ai/types/attachment_model.py +34 -7
- usecortex_ai/types/batch_upload_data.py +10 -2
- usecortex_ai/types/body_scrape_webpage_upload_scrape_webpage_post.py +0 -2
- usecortex_ai/types/body_update_scrape_job_upload_update_webpage_patch.py +0 -2
- usecortex_ai/types/content_model.py +33 -6
- usecortex_ai/types/delete_memory_request.py +14 -3
- usecortex_ai/types/delete_sources.py +20 -0
- usecortex_ai/types/delete_sub_tenant_data.py +42 -0
- usecortex_ai/types/delete_user_memory_response.py +31 -0
- usecortex_ai/types/embeddings_create_collection_data.py +19 -4
- usecortex_ai/types/embeddings_delete_data.py +19 -4
- usecortex_ai/types/embeddings_get_data.py +19 -4
- usecortex_ai/types/embeddings_search_data.py +19 -4
- usecortex_ai/types/error_response.py +0 -1
- usecortex_ai/types/fetch_content_data.py +19 -5
- usecortex_ai/types/file_upload_result.py +9 -2
- usecortex_ai/types/generate_user_memory_response.py +32 -0
- usecortex_ai/types/list_sources_response.py +14 -3
- usecortex_ai/types/list_user_memories_response.py +32 -0
- usecortex_ai/types/markdown_upload_request.py +23 -5
- usecortex_ai/types/processing_status.py +14 -3
- usecortex_ai/types/relations.py +9 -2
- usecortex_ai/types/retrieve_user_memory_response.py +32 -0
- usecortex_ai/types/search_chunk.py +54 -17
- usecortex_ai/types/single_upload_data.py +10 -2
- usecortex_ai/types/source.py +34 -15
- usecortex_ai/types/source_model.py +63 -14
- usecortex_ai/types/sub_tenant_ids_data.py +29 -5
- usecortex_ai/types/tenant_create_data.py +19 -4
- usecortex_ai/types/tenant_stats.py +24 -5
- usecortex_ai/types/user_memory.py +31 -0
- usecortex_ai/upload/client.py +486 -111
- usecortex_ai/upload/raw_client.py +458 -103
- usecortex_ai/user/client.py +30 -10
- usecortex_ai/user/raw_client.py +22 -6
- usecortex_ai/user_memory/client.py +200 -56
- usecortex_ai/user_memory/raw_client.py +921 -94
- {usecortex_ai-0.2.1.dist-info → usecortex_ai-0.3.0.dist-info}/METADATA +1 -1
- usecortex_ai-0.3.0.dist-info/RECORD +101 -0
- usecortex_ai/types/source_content.py +0 -26
- usecortex_ai-0.2.1.dist-info/RECORD +0 -91
- {usecortex_ai-0.2.1.dist-info → usecortex_ai-0.3.0.dist-info}/WHEEL +0 -0
- {usecortex_ai-0.2.1.dist-info → usecortex_ai-0.3.0.dist-info}/licenses/LICENSE +0 -0
- {usecortex_ai-0.2.1.dist-info → usecortex_ai-0.3.0.dist-info}/top_level.txt +0 -0
|
@@ -4,26 +4,63 @@ 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
9
|
class SearchChunk(UniversalBaseModel):
|
|
11
|
-
chunk_uuid: str
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
10
|
+
chunk_uuid: str = pydantic.Field()
|
|
11
|
+
"""
|
|
12
|
+
Unique identifier for this content chunk
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
source_id: str = pydantic.Field()
|
|
16
|
+
"""
|
|
17
|
+
Unique identifier for the source document
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
chunk_content: str = pydantic.Field()
|
|
21
|
+
"""
|
|
22
|
+
The actual text content of this chunk
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
source_type: typing.Optional[str] = pydantic.Field(default=None)
|
|
26
|
+
"""
|
|
27
|
+
Type of the source document (file, webpage, etc.)
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
source_upload_time: typing.Optional[str] = pydantic.Field(default=None)
|
|
31
|
+
"""
|
|
32
|
+
When the source document was originally uploaded
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
source_title: typing.Optional[str] = pydantic.Field(default=None)
|
|
36
|
+
"""
|
|
37
|
+
Title or name of the source document
|
|
38
|
+
"""
|
|
39
|
+
|
|
40
|
+
source_last_updated_time: typing.Optional[str] = pydantic.Field(default=None)
|
|
41
|
+
"""
|
|
42
|
+
When the source document was last modified
|
|
43
|
+
"""
|
|
44
|
+
|
|
45
|
+
layout: typing.Optional[str] = pydantic.Field(default=None)
|
|
46
|
+
"""
|
|
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)
|
|
48
|
+
"""
|
|
49
|
+
|
|
50
|
+
relevancy_score: typing.Optional[float] = pydantic.Field(default=None)
|
|
51
|
+
"""
|
|
52
|
+
Score indicating how relevant this chunk is to your search query, with higher values indicating better matches
|
|
53
|
+
"""
|
|
54
|
+
|
|
55
|
+
document_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
|
|
56
|
+
"""
|
|
57
|
+
Metadata extracted from the source document
|
|
58
|
+
"""
|
|
59
|
+
|
|
60
|
+
tenant_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
|
|
61
|
+
"""
|
|
62
|
+
Custom metadata associated with your tenant
|
|
63
|
+
"""
|
|
27
64
|
|
|
28
65
|
if IS_PYDANTIC_V2:
|
|
29
66
|
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
@@ -7,9 +7,17 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
class SingleUploadData(UniversalBaseModel):
|
|
10
|
-
file_id: str
|
|
10
|
+
file_id: str = pydantic.Field()
|
|
11
|
+
"""
|
|
12
|
+
Unique identifier for the file being processed
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
message: str = pydantic.Field()
|
|
16
|
+
"""
|
|
17
|
+
Status message indicating document parsing scheduled or update completed
|
|
18
|
+
"""
|
|
19
|
+
|
|
11
20
|
success: typing.Optional[bool] = None
|
|
12
|
-
message: typing.Optional[str] = None
|
|
13
21
|
|
|
14
22
|
if IS_PYDANTIC_V2:
|
|
15
23
|
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
usecortex_ai/types/source.py
CHANGED
|
@@ -4,24 +4,43 @@ import typing
|
|
|
4
4
|
|
|
5
5
|
import pydantic
|
|
6
6
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
7
|
-
from .source_content import SourceContent
|
|
8
7
|
|
|
9
8
|
|
|
10
9
|
class Source(UniversalBaseModel):
|
|
11
|
-
id: str
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
+
"""
|
|
25
44
|
|
|
26
45
|
if IS_PYDANTIC_V2:
|
|
27
46
|
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
@@ -9,20 +9,69 @@ from .content_model import ContentModel
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
class SourceModel(UniversalBaseModel):
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
12
|
+
id: typing.Optional[str] = pydantic.Field(default=None)
|
|
13
|
+
"""
|
|
14
|
+
Stable, unique identifier for the source. If omitted, one may be generated upstream.
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
title: typing.Optional[str] = pydantic.Field(default=None)
|
|
18
|
+
"""
|
|
19
|
+
Short human-readable title for the source.
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
type: typing.Optional[str] = pydantic.Field(default=None)
|
|
23
|
+
"""
|
|
24
|
+
High-level category of the source (e.g., document, email, ticket).
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
description: typing.Optional[str] = pydantic.Field(default=None)
|
|
28
|
+
"""
|
|
29
|
+
Optional long-form description providing additional context.
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
note: typing.Optional[str] = pydantic.Field(default=None)
|
|
33
|
+
"""
|
|
34
|
+
Free-form notes for internal use or ingestion hints.
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
url: typing.Optional[str] = pydantic.Field(default=None)
|
|
38
|
+
"""
|
|
39
|
+
Canonical URL or reference link associated with the source.
|
|
40
|
+
"""
|
|
41
|
+
|
|
42
|
+
timestamp: typing.Optional[str] = pydantic.Field(default=None)
|
|
43
|
+
"""
|
|
44
|
+
Creation or last-updated timestamp of the source in ISO-8601 format.
|
|
45
|
+
"""
|
|
46
|
+
|
|
47
|
+
content: typing.Optional[ContentModel] = pydantic.Field(default=None)
|
|
48
|
+
"""
|
|
49
|
+
Primary content payload used for indexing and retrieval.
|
|
50
|
+
"""
|
|
51
|
+
|
|
52
|
+
tenant_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
|
|
53
|
+
"""
|
|
54
|
+
JSON string containing tenant-level document metadata (e.g., department, compliance_tag)
|
|
55
|
+
|
|
56
|
+
Example: > "{"department":"Finance","compliance_tag":"GDPR"}"
|
|
57
|
+
"""
|
|
58
|
+
|
|
59
|
+
document_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
|
|
60
|
+
"""
|
|
61
|
+
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.
|
|
62
|
+
|
|
63
|
+
Example: > "{"title":"Q1 Report.pdf","author":"Alice Smith","file_id":"custom_file_123"}"
|
|
64
|
+
"""
|
|
65
|
+
|
|
66
|
+
meta: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
|
|
67
|
+
"""
|
|
68
|
+
System-provided attributes (e.g., app_name, local file size) not intended for search filtering.
|
|
69
|
+
"""
|
|
70
|
+
|
|
71
|
+
attachments: typing.Optional[typing.List[AttachmentModel]] = pydantic.Field(default=None)
|
|
72
|
+
"""
|
|
73
|
+
Attachments related to the source such as images, PDFs, or supplemental files.
|
|
74
|
+
"""
|
|
26
75
|
|
|
27
76
|
if IS_PYDANTIC_V2:
|
|
28
77
|
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
@@ -7,11 +7,35 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
class SubTenantIdsData(UniversalBaseModel):
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
+
"""
|
|
15
39
|
|
|
16
40
|
if IS_PYDANTIC_V2:
|
|
17
41
|
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
@@ -7,10 +7,25 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
class TenantCreateData(UniversalBaseModel):
|
|
10
|
-
status: str
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
status: str = pydantic.Field()
|
|
11
|
+
"""
|
|
12
|
+
Current status of the tenant creation process
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
tenant_id: str = pydantic.Field()
|
|
16
|
+
"""
|
|
17
|
+
Unique identifier assigned to the new tenant
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
success: typing.Optional[bool] = pydantic.Field(default=None)
|
|
21
|
+
"""
|
|
22
|
+
Indicates whether the tenant creation was successful
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
message: typing.Optional[str] = pydantic.Field(default=None)
|
|
26
|
+
"""
|
|
27
|
+
Response message describing the creation result
|
|
28
|
+
"""
|
|
14
29
|
|
|
15
30
|
if IS_PYDANTIC_V2:
|
|
16
31
|
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
@@ -7,11 +7,30 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
class TenantStats(UniversalBaseModel):
|
|
10
|
-
object_count: int
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
+
"""
|
|
15
34
|
|
|
16
35
|
if IS_PYDANTIC_V2:
|
|
17
36
|
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
@@ -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
|