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.
Files changed (61) hide show
  1. usecortex_ai/__init__.py +18 -3
  2. usecortex_ai/client.py +3 -0
  3. usecortex_ai/document/__init__.py +4 -0
  4. usecortex_ai/document/client.py +139 -0
  5. usecortex_ai/document/raw_client.py +312 -0
  6. usecortex_ai/embeddings/client.py +48 -78
  7. usecortex_ai/embeddings/raw_client.py +44 -74
  8. usecortex_ai/fetch/client.py +2 -2
  9. usecortex_ai/search/client.py +88 -84
  10. usecortex_ai/search/raw_client.py +82 -78
  11. usecortex_ai/sources/client.py +26 -157
  12. usecortex_ai/sources/raw_client.py +22 -501
  13. usecortex_ai/tenant/client.py +154 -6
  14. usecortex_ai/tenant/raw_client.py +502 -4
  15. usecortex_ai/types/__init__.py +16 -2
  16. usecortex_ai/types/add_user_memory_response.py +36 -0
  17. usecortex_ai/types/app_sources_upload_data.py +10 -2
  18. usecortex_ai/types/attachment_model.py +34 -7
  19. usecortex_ai/types/batch_upload_data.py +10 -2
  20. usecortex_ai/types/body_scrape_webpage_upload_scrape_webpage_post.py +0 -2
  21. usecortex_ai/types/body_update_scrape_job_upload_update_webpage_patch.py +0 -2
  22. usecortex_ai/types/content_model.py +33 -6
  23. usecortex_ai/types/delete_memory_request.py +14 -3
  24. usecortex_ai/types/delete_sources.py +20 -0
  25. usecortex_ai/types/delete_sub_tenant_data.py +42 -0
  26. usecortex_ai/types/delete_user_memory_response.py +31 -0
  27. usecortex_ai/types/embeddings_create_collection_data.py +19 -4
  28. usecortex_ai/types/embeddings_delete_data.py +19 -4
  29. usecortex_ai/types/embeddings_get_data.py +19 -4
  30. usecortex_ai/types/embeddings_search_data.py +19 -4
  31. usecortex_ai/types/error_response.py +0 -1
  32. usecortex_ai/types/fetch_content_data.py +19 -5
  33. usecortex_ai/types/file_upload_result.py +9 -2
  34. usecortex_ai/types/generate_user_memory_response.py +32 -0
  35. usecortex_ai/types/list_sources_response.py +14 -3
  36. usecortex_ai/types/list_user_memories_response.py +32 -0
  37. usecortex_ai/types/markdown_upload_request.py +23 -5
  38. usecortex_ai/types/processing_status.py +14 -3
  39. usecortex_ai/types/relations.py +9 -2
  40. usecortex_ai/types/retrieve_user_memory_response.py +32 -0
  41. usecortex_ai/types/search_chunk.py +54 -17
  42. usecortex_ai/types/single_upload_data.py +10 -2
  43. usecortex_ai/types/source.py +34 -15
  44. usecortex_ai/types/source_model.py +63 -14
  45. usecortex_ai/types/sub_tenant_ids_data.py +29 -5
  46. usecortex_ai/types/tenant_create_data.py +19 -4
  47. usecortex_ai/types/tenant_stats.py +24 -5
  48. usecortex_ai/types/user_memory.py +31 -0
  49. usecortex_ai/upload/client.py +486 -111
  50. usecortex_ai/upload/raw_client.py +458 -103
  51. usecortex_ai/user/client.py +30 -10
  52. usecortex_ai/user/raw_client.py +22 -6
  53. usecortex_ai/user_memory/client.py +200 -56
  54. usecortex_ai/user_memory/raw_client.py +921 -94
  55. {usecortex_ai-0.2.1.dist-info → usecortex_ai-0.3.0.dist-info}/METADATA +1 -1
  56. usecortex_ai-0.3.0.dist-info/RECORD +101 -0
  57. usecortex_ai/types/source_content.py +0 -26
  58. usecortex_ai-0.2.1.dist-info/RECORD +0 -91
  59. {usecortex_ai-0.2.1.dist-info → usecortex_ai-0.3.0.dist-info}/WHEEL +0 -0
  60. {usecortex_ai-0.2.1.dist-info → usecortex_ai-0.3.0.dist-info}/licenses/LICENSE +0 -0
  61. {usecortex_ai-0.2.1.dist-info → usecortex_ai-0.3.0.dist-info}/top_level.txt +0 -0
@@ -8,13 +8,40 @@ from .content_model import ContentModel
8
8
 
9
9
 
10
10
  class AttachmentModel(UniversalBaseModel):
11
- id: typing.Optional[str] = None
12
- url: typing.Optional[str] = None
13
- title: typing.Optional[str] = None
14
- content_type: typing.Optional[str] = None
15
- content_url: typing.Optional[str] = None
16
- misc: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
17
- content: typing.Optional[ContentModel] = None
11
+ id: typing.Optional[str] = pydantic.Field(default=None)
12
+ """
13
+ Unique identifier for the attachment.
14
+ """
15
+
16
+ url: typing.Optional[str] = pydantic.Field(default=None)
17
+ """
18
+ Public or internal URL referencing the attachment resource.
19
+ """
20
+
21
+ title: typing.Optional[str] = pydantic.Field(default=None)
22
+ """
23
+ Human-readable title or filename of the attachment.
24
+ """
25
+
26
+ content_type: typing.Optional[str] = pydantic.Field(default=None)
27
+ """
28
+ MIME type of the attachment (e.g., application/pdf).
29
+ """
30
+
31
+ content_url: typing.Optional[str] = pydantic.Field(default=None)
32
+ """
33
+ Direct URL for content retrieval when different from the reference URL.
34
+ """
35
+
36
+ misc: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
37
+ """
38
+ Additional attachment attributes defined by the tenant (free-form).
39
+ """
40
+
41
+ content: typing.Optional[ContentModel] = pydantic.Field(default=None)
42
+ """
43
+ Structured content payload for the attachment when available.
44
+ """
18
45
 
19
46
  if IS_PYDANTIC_V2:
20
47
  model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
@@ -8,9 +8,17 @@ from .file_upload_result import FileUploadResult
8
8
 
9
9
 
10
10
  class BatchUploadData(UniversalBaseModel):
11
- uploaded: typing.List[FileUploadResult]
11
+ uploaded: typing.List[FileUploadResult] = pydantic.Field()
12
+ """
13
+ List of successfully uploaded files for processing
14
+ """
15
+
16
+ message: str = pydantic.Field()
17
+ """
18
+ Status message indicating batch document parsing scheduled
19
+ """
20
+
12
21
  success: typing.Optional[bool] = None
13
- message: typing.Optional[str] = None
14
22
 
15
23
  if IS_PYDANTIC_V2:
16
24
  model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
@@ -7,8 +7,6 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
7
 
8
8
 
9
9
  class BodyScrapeWebpageUploadScrapeWebpagePost(UniversalBaseModel):
10
- relations: typing.Optional[str] = None
11
-
12
10
  if IS_PYDANTIC_V2:
13
11
  model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
14
12
  else:
@@ -7,8 +7,6 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
7
 
8
8
 
9
9
  class BodyUpdateScrapeJobUploadUpdateWebpagePatch(UniversalBaseModel):
10
- relations: typing.Optional[str] = None
11
-
12
10
  if IS_PYDANTIC_V2:
13
11
  model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
14
12
  else:
@@ -9,12 +9,39 @@ from ..core.serialization import FieldMetadata
9
9
 
10
10
 
11
11
  class ContentModel(UniversalBaseModel):
12
- text: typing.Optional[str] = None
13
- html_base_64: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="html_base64")] = None
14
- csv_base_64: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="csv_base64")] = None
15
- markdown: typing.Optional[str] = None
16
- files: typing.Optional[typing.List[typing.Dict[str, typing.Optional[typing.Any]]]] = None
17
- layout: typing.Optional[typing.List[typing.Dict[str, typing.Optional[typing.Any]]]] = None
12
+ text: typing.Optional[str] = pydantic.Field(default=None)
13
+ """
14
+ Plain text content extracted or provided for indexing.
15
+ """
16
+
17
+ html_base_64: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="html_base64")] = (
18
+ pydantic.Field(default=None)
19
+ )
20
+ """
21
+ Base64-encoded HTML content preserving structure and formatting.
22
+ """
23
+
24
+ csv_base_64: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="csv_base64")] = pydantic.Field(
25
+ default=None
26
+ )
27
+ """
28
+ Base64-encoded CSV data for tabular content ingestion.
29
+ """
30
+
31
+ markdown: typing.Optional[str] = pydantic.Field(default=None)
32
+ """
33
+ Raw Markdown content to be indexed as rich text.
34
+ """
35
+
36
+ files: typing.Optional[typing.List[typing.Dict[str, typing.Optional[typing.Any]]]] = pydantic.Field(default=None)
37
+ """
38
+ List of file descriptors associated with the source (e.g., filenames, sizes).
39
+ """
40
+
41
+ layout: typing.Optional[typing.List[typing.Dict[str, typing.Optional[typing.Any]]]] = pydantic.Field(default=None)
42
+ """
43
+ Optional layout metadata such as sections or blocks to guide chunking.
44
+ """
18
45
 
19
46
  if IS_PYDANTIC_V2:
20
47
  model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
@@ -7,9 +7,20 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
7
 
8
8
 
9
9
  class DeleteMemoryRequest(UniversalBaseModel):
10
- tenant_id: str
11
- source_ids: typing.List[str]
12
- sub_tenant_id: typing.Optional[str] = None
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
+ """
13
24
 
14
25
  if IS_PYDANTIC_V2:
15
26
  model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
@@ -0,0 +1,20 @@
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 DeleteSources(UniversalBaseModel):
10
+ success: typing.Optional[bool] = None
11
+ message: typing.Optional[str] = None
12
+
13
+ if IS_PYDANTIC_V2:
14
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
15
+ else:
16
+
17
+ class Config:
18
+ frozen = True
19
+ smart_union = True
20
+ extra = pydantic.Extra.allow
@@ -0,0 +1,42 @@
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
@@ -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 DeleteUserMemoryResponse(UniversalBaseModel):
10
+ """
11
+ Response model for deleting a user memory.
12
+ """
13
+
14
+ success: bool = pydantic.Field()
15
+ """
16
+ Indicates whether the memory deletion operation was successful
17
+ """
18
+
19
+ user_memory_deleted: bool = pydantic.Field()
20
+ """
21
+ Confirms whether the specific memory was successfully deleted
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
@@ -7,10 +7,25 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
7
 
8
8
 
9
9
  class EmbeddingsCreateCollectionData(UniversalBaseModel):
10
- tenant_id: str
11
- sub_tenant_id: str
12
- success: typing.Optional[bool] = None
13
- message: typing.Optional[str] = None
10
+ tenant_id: str = pydantic.Field()
11
+ """
12
+ Identifier for the tenant/organization
13
+ """
14
+
15
+ sub_tenant_id: str = pydantic.Field()
16
+ """
17
+ Identifier for the sub-tenant within the tenant
18
+ """
19
+
20
+ success: typing.Optional[bool] = pydantic.Field(default=None)
21
+ """
22
+ Indicates whether the embeddings tenant creation completed successfully
23
+ """
24
+
25
+ message: typing.Optional[str] = pydantic.Field(default=None)
26
+ """
27
+ Status message about the tenant creation operation
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,10 +7,25 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
7
 
8
8
 
9
9
  class EmbeddingsDeleteData(UniversalBaseModel):
10
- total_deleted: int
11
- status: typing.Dict[str, bool]
12
- success: typing.Optional[bool] = None
13
- message: typing.Optional[str] = None
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
+ """
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,10 +7,25 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
7
 
8
8
 
9
9
  class EmbeddingsGetData(UniversalBaseModel):
10
- embeddings: typing.Dict[str, typing.List[float]]
11
- not_found_chunk_ids: typing.List[str]
12
- success: typing.Optional[bool] = None
13
- message: typing.Optional[str] = None
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
+ """
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,10 +7,25 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
7
 
8
8
 
9
9
  class EmbeddingsSearchData(UniversalBaseModel):
10
- chunk_ids: typing.List[str]
11
- scores: typing.List[float]
12
- success: typing.Optional[bool] = None
13
- message: typing.Optional[str] = None
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
+ """
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
@@ -10,7 +10,6 @@ class ErrorResponse(UniversalBaseModel):
10
10
  success: typing.Optional[bool] = None
11
11
  message: typing.Optional[str] = None
12
12
  error_code: typing.Optional[str] = None
13
- data: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
14
13
 
15
14
  if IS_PYDANTIC_V2:
16
15
  model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
@@ -7,11 +7,25 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
7
 
8
8
 
9
9
  class FetchContentData(UniversalBaseModel):
10
- file_id: str
11
- url: str
12
- file_content: typing.Optional[str] = None
13
- success: typing.Optional[bool] = None
14
- message: typing.Optional[str] = None
10
+ file_id: str = pydantic.Field()
11
+ """
12
+ Unique identifier for the file being fetched
13
+ """
14
+
15
+ file_content: typing.Optional[str] = pydantic.Field(default=None)
16
+ """
17
+ Content of the fetched file
18
+ """
19
+
20
+ success: typing.Optional[bool] = pydantic.Field(default=None)
21
+ """
22
+ Indicates whether the fetch operation completed successfully
23
+ """
24
+
25
+ message: typing.Optional[str] = pydantic.Field(default=None)
26
+ """
27
+ Status message about the fetch operation
28
+ """
15
29
 
16
30
  if IS_PYDANTIC_V2:
17
31
  model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
@@ -7,8 +7,15 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
7
 
8
8
 
9
9
  class FileUploadResult(UniversalBaseModel):
10
- file_id: str
11
- filename: typing.Optional[str] = None
10
+ file_id: str = pydantic.Field()
11
+ """
12
+ Unique identifier for the file being processed
13
+ """
14
+
15
+ filename: typing.Optional[str] = pydantic.Field(default=None)
16
+ """
17
+ Name of the uploaded file, if provided
18
+ """
12
19
 
13
20
  if IS_PYDANTIC_V2:
14
21
  model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
@@ -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 GenerateUserMemoryResponse(UniversalBaseModel):
11
+ """
12
+ Response model for AI-generated user memories.
13
+ """
14
+
15
+ success: bool = pydantic.Field()
16
+ """
17
+ Indicates whether the memory generation operation was successful
18
+ """
19
+
20
+ generated_user_memories: typing.Optional[typing.List[UserMemory]] = pydantic.Field(default=None)
21
+ """
22
+ Array of AI-generated memories based on your query and user context
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
@@ -8,9 +8,20 @@ from .source import Source
8
8
 
9
9
 
10
10
  class ListSourcesResponse(UniversalBaseModel):
11
- sources: typing.List[typing.Optional[Source]]
12
- success: typing.Optional[bool] = None
13
- message: typing.Optional[str] = None
11
+ sources: typing.List[typing.Optional[Source]] = pydantic.Field()
12
+ """
13
+ List of source documents retrieved
14
+ """
15
+
16
+ success: typing.Optional[bool] = pydantic.Field(default=None)
17
+ """
18
+ Indicates whether the request was successful
19
+ """
20
+
21
+ message: typing.Optional[str] = pydantic.Field(default=None)
22
+ """
23
+ Response message describing the operation result
24
+ """
14
25
 
15
26
  if IS_PYDANTIC_V2:
16
27
  model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
@@ -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: bool = pydantic.Field()
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,14 +4,32 @@ import typing
4
4
 
5
5
  import pydantic
6
6
  from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
- from .relations import Relations
8
7
 
9
8
 
10
9
  class MarkdownUploadRequest(UniversalBaseModel):
11
- content: str
12
- tenant_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
13
- document_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
14
- relations: typing.Optional[Relations] = None
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
+ """
15
33
 
16
34
  if IS_PYDANTIC_V2:
17
35
  model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
@@ -7,10 +7,21 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
7
 
8
8
 
9
9
  class ProcessingStatus(UniversalBaseModel):
10
- file_id: str
11
- indexing_status: str
10
+ file_id: str = pydantic.Field()
11
+ """
12
+ Identifier for the file whose status is being retrieved
13
+ """
14
+
15
+ indexing_status: str = pydantic.Field()
16
+ """
17
+ Current status of the file. Possible values are 'queued', 'processing', 'completed', 'failed'
18
+ """
19
+
12
20
  success: typing.Optional[bool] = None
13
- message: typing.Optional[str] = None
21
+ message: typing.Optional[str] = pydantic.Field(default=None)
22
+ """
23
+ Detailed status message about the processing operation
24
+ """
14
25
 
15
26
  if IS_PYDANTIC_V2:
16
27
  model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
@@ -7,8 +7,15 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
7
 
8
8
 
9
9
  class Relations(UniversalBaseModel):
10
- cortex_source_ids: typing.Optional[typing.List[str]] = None
11
- auto_discovery: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
10
+ cortex_source_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
11
+ """
12
+ List of cortex source IDs to directly relate with
13
+ """
14
+
15
+ auto_discovery: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
16
+ """
17
+ Key value pairs to allow cortex to automatically discover relations
18
+ """
12
19
 
13
20
  if IS_PYDANTIC_V2:
14
21
  model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
@@ -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 RetrieveUserMemoryResponse(UniversalBaseModel):
11
+ """
12
+ Response model for retrieving user memories through semantic search.
13
+ """
14
+
15
+ success: bool = pydantic.Field()
16
+ """
17
+ Indicates whether the memory retrieval operation was successful
18
+ """
19
+
20
+ retrieved_user_memories: typing.Optional[typing.List[UserMemory]] = pydantic.Field(default=None)
21
+ """
22
+ Array of user memories ranked by relevance to your search query
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