supermemory 3.7.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.
- supermemory/__init__.py +102 -0
- supermemory/_base_client.py +1995 -0
- supermemory/_client.py +683 -0
- supermemory/_compat.py +219 -0
- supermemory/_constants.py +14 -0
- supermemory/_exceptions.py +108 -0
- supermemory/_files.py +123 -0
- supermemory/_models.py +857 -0
- supermemory/_qs.py +150 -0
- supermemory/_resource.py +43 -0
- supermemory/_response.py +832 -0
- supermemory/_streaming.py +331 -0
- supermemory/_types.py +260 -0
- supermemory/_utils/__init__.py +64 -0
- supermemory/_utils/_compat.py +45 -0
- supermemory/_utils/_datetime_parse.py +136 -0
- supermemory/_utils/_logs.py +25 -0
- supermemory/_utils/_proxy.py +65 -0
- supermemory/_utils/_reflection.py +42 -0
- supermemory/_utils/_resources_proxy.py +24 -0
- supermemory/_utils/_streams.py +12 -0
- supermemory/_utils/_sync.py +58 -0
- supermemory/_utils/_transform.py +457 -0
- supermemory/_utils/_typing.py +156 -0
- supermemory/_utils/_utils.py +421 -0
- supermemory/_version.py +4 -0
- supermemory/lib/.keep +4 -0
- supermemory/py.typed +0 -0
- supermemory/resources/__init__.py +75 -0
- supermemory/resources/connections.py +807 -0
- supermemory/resources/documents.py +830 -0
- supermemory/resources/memories.py +830 -0
- supermemory/resources/search.py +657 -0
- supermemory/resources/settings.py +278 -0
- supermemory/types/__init__.py +51 -0
- supermemory/types/add_response.py +13 -0
- supermemory/types/client_add_params.py +36 -0
- supermemory/types/client_profile_params.py +21 -0
- supermemory/types/connection_create_params.py +21 -0
- supermemory/types/connection_create_response.py +19 -0
- supermemory/types/connection_delete_by_id_response.py +11 -0
- supermemory/types/connection_delete_by_provider_params.py +15 -0
- supermemory/types/connection_delete_by_provider_response.py +11 -0
- supermemory/types/connection_get_by_id_response.py +25 -0
- supermemory/types/connection_get_by_tags_params.py +15 -0
- supermemory/types/connection_get_by_tags_response.py +25 -0
- supermemory/types/connection_import_params.py +15 -0
- supermemory/types/connection_import_response.py +7 -0
- supermemory/types/connection_list_documents_params.py +15 -0
- supermemory/types/connection_list_documents_response.py +29 -0
- supermemory/types/connection_list_params.py +15 -0
- supermemory/types/connection_list_response.py +29 -0
- supermemory/types/document_add_params.py +36 -0
- supermemory/types/document_add_response.py +13 -0
- supermemory/types/document_get_response.py +103 -0
- supermemory/types/document_list_params.py +52 -0
- supermemory/types/document_list_response.py +94 -0
- supermemory/types/document_update_params.py +55 -0
- supermemory/types/document_update_response.py +13 -0
- supermemory/types/document_upload_file_params.py +44 -0
- supermemory/types/document_upload_file_response.py +13 -0
- supermemory/types/memory_add_params.py +36 -0
- supermemory/types/memory_add_response.py +13 -0
- supermemory/types/memory_get_response.py +103 -0
- supermemory/types/memory_list_params.py +52 -0
- supermemory/types/memory_list_response.py +94 -0
- supermemory/types/memory_update_params.py +55 -0
- supermemory/types/memory_update_response.py +13 -0
- supermemory/types/memory_upload_file_params.py +44 -0
- supermemory/types/memory_upload_file_response.py +13 -0
- supermemory/types/profile_response.py +35 -0
- supermemory/types/search_documents_params.py +93 -0
- supermemory/types/search_documents_response.py +60 -0
- supermemory/types/search_execute_params.py +93 -0
- supermemory/types/search_execute_response.py +60 -0
- supermemory/types/search_memories_params.py +75 -0
- supermemory/types/search_memories_response.py +123 -0
- supermemory/types/setting_get_response.py +43 -0
- supermemory/types/setting_update_params.py +44 -0
- supermemory/types/setting_update_response.py +51 -0
- supermemory-3.7.0.dist-info/METADATA +447 -0
- supermemory-3.7.0.dist-info/RECORD +84 -0
- supermemory-3.7.0.dist-info/WHEEL +4 -0
- supermemory-3.7.0.dist-info/licenses/LICENSE +201 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Dict, Union
|
|
6
|
+
from typing_extensions import Required, Annotated, TypedDict
|
|
7
|
+
|
|
8
|
+
from .._types import SequenceNotStr
|
|
9
|
+
from .._utils import PropertyInfo
|
|
10
|
+
|
|
11
|
+
__all__ = ["DocumentAddParams"]
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class DocumentAddParams(TypedDict, total=False):
|
|
15
|
+
content: Required[str]
|
|
16
|
+
"""The content to extract and process into a document.
|
|
17
|
+
|
|
18
|
+
This can be a URL to a website, a PDF, an image, or a video.
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
container_tag: Annotated[str, PropertyInfo(alias="containerTag")]
|
|
22
|
+
"""Optional tag this document should be containerized by.
|
|
23
|
+
|
|
24
|
+
Max 100 characters, alphanumeric with hyphens and underscores only.
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
container_tags: Annotated[SequenceNotStr[str], PropertyInfo(alias="containerTags")]
|
|
28
|
+
|
|
29
|
+
custom_id: Annotated[str, PropertyInfo(alias="customId")]
|
|
30
|
+
"""Optional custom ID of the document.
|
|
31
|
+
|
|
32
|
+
Max 100 characters, alphanumeric with hyphens and underscores only.
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
metadata: Dict[str, Union[str, float, bool, SequenceNotStr[str]]]
|
|
36
|
+
"""Optional metadata for the document."""
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from .._models import BaseModel
|
|
4
|
+
|
|
5
|
+
__all__ = ["DocumentAddResponse"]
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class DocumentAddResponse(BaseModel):
|
|
9
|
+
id: str
|
|
10
|
+
"""Unique identifier of the document"""
|
|
11
|
+
|
|
12
|
+
status: str
|
|
13
|
+
"""Status of the document"""
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import Dict, List, Union, Optional
|
|
4
|
+
from typing_extensions import Literal
|
|
5
|
+
|
|
6
|
+
from pydantic import Field as FieldInfo
|
|
7
|
+
|
|
8
|
+
from .._models import BaseModel
|
|
9
|
+
|
|
10
|
+
__all__ = ["DocumentGetResponse"]
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class DocumentGetResponse(BaseModel):
|
|
14
|
+
id: str
|
|
15
|
+
"""Unique identifier of the document."""
|
|
16
|
+
|
|
17
|
+
connection_id: Optional[str] = FieldInfo(alias="connectionId", default=None)
|
|
18
|
+
"""Optional ID of connection the document was created from.
|
|
19
|
+
|
|
20
|
+
This is useful for identifying the source of the document.
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
content: Optional[str] = None
|
|
24
|
+
"""The content to extract and process into a document.
|
|
25
|
+
|
|
26
|
+
This can be a URL to a website, a PDF, an image, or a video.
|
|
27
|
+
|
|
28
|
+
Plaintext: Any plaintext format
|
|
29
|
+
|
|
30
|
+
URL: A URL to a website, PDF, image, or video
|
|
31
|
+
|
|
32
|
+
We automatically detect the content type from the url's response format.
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
created_at: str = FieldInfo(alias="createdAt")
|
|
36
|
+
"""Creation timestamp"""
|
|
37
|
+
|
|
38
|
+
custom_id: Optional[str] = FieldInfo(alias="customId", default=None)
|
|
39
|
+
"""Optional custom ID of the document.
|
|
40
|
+
|
|
41
|
+
This could be an ID from your database that will uniquely identify this
|
|
42
|
+
document.
|
|
43
|
+
"""
|
|
44
|
+
|
|
45
|
+
metadata: Union[str, float, bool, Dict[str, object], List[object], None] = None
|
|
46
|
+
"""Optional metadata for the document.
|
|
47
|
+
|
|
48
|
+
This is used to store additional information about the document. You can use
|
|
49
|
+
this to store any additional information you need about the document. Metadata
|
|
50
|
+
can be filtered through. Keys must be strings and are case sensitive. Values can
|
|
51
|
+
be strings, numbers, or booleans. You cannot nest objects.
|
|
52
|
+
"""
|
|
53
|
+
|
|
54
|
+
og_image: Optional[str] = FieldInfo(alias="ogImage", default=None)
|
|
55
|
+
|
|
56
|
+
raw: object
|
|
57
|
+
"""Raw content of the document"""
|
|
58
|
+
|
|
59
|
+
source: Optional[str] = None
|
|
60
|
+
"""Source of the document"""
|
|
61
|
+
|
|
62
|
+
status: Literal["unknown", "queued", "extracting", "chunking", "embedding", "indexing", "done", "failed"]
|
|
63
|
+
"""Status of the document"""
|
|
64
|
+
|
|
65
|
+
summary: Optional[str] = None
|
|
66
|
+
"""Summary of the document content"""
|
|
67
|
+
|
|
68
|
+
summary_embedding_model: Optional[str] = FieldInfo(alias="summaryEmbeddingModel", default=None)
|
|
69
|
+
|
|
70
|
+
summary_embedding_model_new: Optional[str] = FieldInfo(alias="summaryEmbeddingModelNew", default=None)
|
|
71
|
+
|
|
72
|
+
summary_embedding_new: Optional[List[float]] = FieldInfo(alias="summaryEmbeddingNew", default=None)
|
|
73
|
+
|
|
74
|
+
title: Optional[str] = None
|
|
75
|
+
"""Title of the document"""
|
|
76
|
+
|
|
77
|
+
type: Literal[
|
|
78
|
+
"text",
|
|
79
|
+
"pdf",
|
|
80
|
+
"tweet",
|
|
81
|
+
"google_doc",
|
|
82
|
+
"google_slide",
|
|
83
|
+
"google_sheet",
|
|
84
|
+
"image",
|
|
85
|
+
"video",
|
|
86
|
+
"notion_doc",
|
|
87
|
+
"webpage",
|
|
88
|
+
"onedrive",
|
|
89
|
+
]
|
|
90
|
+
"""Type of the document"""
|
|
91
|
+
|
|
92
|
+
updated_at: str = FieldInfo(alias="updatedAt")
|
|
93
|
+
"""Last update timestamp"""
|
|
94
|
+
|
|
95
|
+
container_tags: Optional[List[str]] = FieldInfo(alias="containerTags", default=None)
|
|
96
|
+
"""Optional tags this document should be containerized by.
|
|
97
|
+
|
|
98
|
+
This can be an ID for your user, a project ID, or any other identifier you wish
|
|
99
|
+
to use to group documents.
|
|
100
|
+
"""
|
|
101
|
+
|
|
102
|
+
url: Optional[str] = None
|
|
103
|
+
"""URL of the document"""
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Union, Iterable
|
|
6
|
+
from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict
|
|
7
|
+
|
|
8
|
+
from .._types import SequenceNotStr
|
|
9
|
+
from .._utils import PropertyInfo
|
|
10
|
+
|
|
11
|
+
__all__ = ["DocumentListParams", "Filters", "FiltersOr", "FiltersAnd"]
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class DocumentListParams(TypedDict, total=False):
|
|
15
|
+
container_tags: Annotated[SequenceNotStr[str], PropertyInfo(alias="containerTags")]
|
|
16
|
+
"""Optional tags this document should be containerized by.
|
|
17
|
+
|
|
18
|
+
This can be an ID for your user, a project ID, or any other identifier you wish
|
|
19
|
+
to use to group documents.
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
filters: Filters
|
|
23
|
+
"""Optional filters to apply to the search. Can be a JSON string or Query object."""
|
|
24
|
+
|
|
25
|
+
include_content: Annotated[bool, PropertyInfo(alias="includeContent")]
|
|
26
|
+
"""Whether to include the content field in the response.
|
|
27
|
+
|
|
28
|
+
Warning: This can make responses significantly larger.
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
limit: Union[str, float]
|
|
32
|
+
"""Number of items per page"""
|
|
33
|
+
|
|
34
|
+
order: Literal["asc", "desc"]
|
|
35
|
+
"""Sort order"""
|
|
36
|
+
|
|
37
|
+
page: Union[str, float]
|
|
38
|
+
"""Page number to fetch"""
|
|
39
|
+
|
|
40
|
+
sort: Literal["createdAt", "updatedAt"]
|
|
41
|
+
"""Field to sort by"""
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class FiltersOr(TypedDict, total=False):
|
|
45
|
+
or_: Required[Annotated[Iterable[object], PropertyInfo(alias="OR")]]
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
class FiltersAnd(TypedDict, total=False):
|
|
49
|
+
and_: Required[Annotated[Iterable[object], PropertyInfo(alias="AND")]]
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
Filters: TypeAlias = Union[FiltersOr, FiltersAnd]
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import Dict, List, Union, Optional
|
|
4
|
+
from typing_extensions import Literal
|
|
5
|
+
|
|
6
|
+
from pydantic import Field as FieldInfo
|
|
7
|
+
|
|
8
|
+
from .._models import BaseModel
|
|
9
|
+
|
|
10
|
+
__all__ = ["DocumentListResponse", "Memory", "Pagination"]
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class Memory(BaseModel):
|
|
14
|
+
id: str
|
|
15
|
+
"""Unique identifier of the document."""
|
|
16
|
+
|
|
17
|
+
connection_id: Optional[str] = FieldInfo(alias="connectionId", default=None)
|
|
18
|
+
"""Optional ID of connection the document was created from.
|
|
19
|
+
|
|
20
|
+
This is useful for identifying the source of the document.
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
created_at: str = FieldInfo(alias="createdAt")
|
|
24
|
+
"""Creation timestamp"""
|
|
25
|
+
|
|
26
|
+
custom_id: Optional[str] = FieldInfo(alias="customId", default=None)
|
|
27
|
+
"""Optional custom ID of the document.
|
|
28
|
+
|
|
29
|
+
This could be an ID from your database that will uniquely identify this
|
|
30
|
+
document.
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
metadata: Union[str, float, bool, Dict[str, object], List[object], None] = None
|
|
34
|
+
"""Optional metadata for the document.
|
|
35
|
+
|
|
36
|
+
This is used to store additional information about the document. You can use
|
|
37
|
+
this to store any additional information you need about the document. Metadata
|
|
38
|
+
can be filtered through. Keys must be strings and are case sensitive. Values can
|
|
39
|
+
be strings, numbers, or booleans. You cannot nest objects.
|
|
40
|
+
"""
|
|
41
|
+
|
|
42
|
+
status: Literal["unknown", "queued", "extracting", "chunking", "embedding", "indexing", "done", "failed"]
|
|
43
|
+
"""Status of the document"""
|
|
44
|
+
|
|
45
|
+
summary: Optional[str] = None
|
|
46
|
+
"""Summary of the document content"""
|
|
47
|
+
|
|
48
|
+
title: Optional[str] = None
|
|
49
|
+
"""Title of the document"""
|
|
50
|
+
|
|
51
|
+
type: Literal[
|
|
52
|
+
"text",
|
|
53
|
+
"pdf",
|
|
54
|
+
"tweet",
|
|
55
|
+
"google_doc",
|
|
56
|
+
"google_slide",
|
|
57
|
+
"google_sheet",
|
|
58
|
+
"image",
|
|
59
|
+
"video",
|
|
60
|
+
"notion_doc",
|
|
61
|
+
"webpage",
|
|
62
|
+
"onedrive",
|
|
63
|
+
]
|
|
64
|
+
"""Type of the document"""
|
|
65
|
+
|
|
66
|
+
updated_at: str = FieldInfo(alias="updatedAt")
|
|
67
|
+
"""Last update timestamp"""
|
|
68
|
+
|
|
69
|
+
container_tags: Optional[List[str]] = FieldInfo(alias="containerTags", default=None)
|
|
70
|
+
"""Optional tags this document should be containerized by.
|
|
71
|
+
|
|
72
|
+
This can be an ID for your user, a project ID, or any other identifier you wish
|
|
73
|
+
to use to group documents.
|
|
74
|
+
"""
|
|
75
|
+
|
|
76
|
+
content: Optional[str] = None
|
|
77
|
+
"""Content of the document (only included when includeContent=true)"""
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
class Pagination(BaseModel):
|
|
81
|
+
current_page: float = FieldInfo(alias="currentPage")
|
|
82
|
+
|
|
83
|
+
total_items: float = FieldInfo(alias="totalItems")
|
|
84
|
+
|
|
85
|
+
total_pages: float = FieldInfo(alias="totalPages")
|
|
86
|
+
|
|
87
|
+
limit: Optional[float] = None
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
class DocumentListResponse(BaseModel):
|
|
91
|
+
memories: List[Memory]
|
|
92
|
+
|
|
93
|
+
pagination: Pagination
|
|
94
|
+
"""Pagination metadata"""
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Dict, Union
|
|
6
|
+
from typing_extensions import Annotated, TypedDict
|
|
7
|
+
|
|
8
|
+
from .._types import SequenceNotStr
|
|
9
|
+
from .._utils import PropertyInfo
|
|
10
|
+
|
|
11
|
+
__all__ = ["DocumentUpdateParams"]
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class DocumentUpdateParams(TypedDict, total=False):
|
|
15
|
+
container_tag: Annotated[str, PropertyInfo(alias="containerTag")]
|
|
16
|
+
"""Optional tag this document should be containerized by.
|
|
17
|
+
|
|
18
|
+
This can be an ID for your user, a project ID, or any other identifier you wish
|
|
19
|
+
to use to group documents.
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
container_tags: Annotated[SequenceNotStr[str], PropertyInfo(alias="containerTags")]
|
|
23
|
+
"""
|
|
24
|
+
(DEPRECATED: Use containerTag instead) Optional tags this document should be
|
|
25
|
+
containerized by. This can be an ID for your user, a project ID, or any other
|
|
26
|
+
identifier you wish to use to group documents.
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
content: str
|
|
30
|
+
"""The content to extract and process into a document.
|
|
31
|
+
|
|
32
|
+
This can be a URL to a website, a PDF, an image, or a video.
|
|
33
|
+
|
|
34
|
+
Plaintext: Any plaintext format
|
|
35
|
+
|
|
36
|
+
URL: A URL to a website, PDF, image, or video
|
|
37
|
+
|
|
38
|
+
We automatically detect the content type from the url's response format.
|
|
39
|
+
"""
|
|
40
|
+
|
|
41
|
+
custom_id: Annotated[str, PropertyInfo(alias="customId")]
|
|
42
|
+
"""Optional custom ID of the document.
|
|
43
|
+
|
|
44
|
+
This could be an ID from your database that will uniquely identify this
|
|
45
|
+
document.
|
|
46
|
+
"""
|
|
47
|
+
|
|
48
|
+
metadata: Dict[str, Union[str, float, bool, SequenceNotStr[str]]]
|
|
49
|
+
"""Optional metadata for the document.
|
|
50
|
+
|
|
51
|
+
This is used to store additional information about the document. You can use
|
|
52
|
+
this to store any additional information you need about the document. Metadata
|
|
53
|
+
can be filtered through. Keys must be strings and are case sensitive. Values can
|
|
54
|
+
be strings, numbers, or booleans. You cannot nest objects.
|
|
55
|
+
"""
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from .._models import BaseModel
|
|
4
|
+
|
|
5
|
+
__all__ = ["DocumentUpdateResponse"]
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class DocumentUpdateResponse(BaseModel):
|
|
9
|
+
id: str
|
|
10
|
+
"""Unique identifier of the document"""
|
|
11
|
+
|
|
12
|
+
status: str
|
|
13
|
+
"""Status of the document"""
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing_extensions import Required, Annotated, TypedDict
|
|
6
|
+
|
|
7
|
+
from .._types import FileTypes
|
|
8
|
+
from .._utils import PropertyInfo
|
|
9
|
+
|
|
10
|
+
__all__ = ["DocumentUploadFileParams"]
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class DocumentUploadFileParams(TypedDict, total=False):
|
|
14
|
+
file: Required[FileTypes]
|
|
15
|
+
"""File to upload and process"""
|
|
16
|
+
|
|
17
|
+
container_tags: Annotated[str, PropertyInfo(alias="containerTags")]
|
|
18
|
+
"""Optional container tags.
|
|
19
|
+
|
|
20
|
+
Can be either a JSON string of an array (e.g., '["user_123", "project_123"]') or
|
|
21
|
+
a single string (e.g., 'user_123'). Single strings will be automatically
|
|
22
|
+
converted to an array.
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
file_type: Annotated[str, PropertyInfo(alias="fileType")]
|
|
26
|
+
"""Optional file type override to force specific processing behavior.
|
|
27
|
+
|
|
28
|
+
Valid values: text, pdf, tweet, google_doc, google_slide, google_sheet, image,
|
|
29
|
+
video, notion_doc, webpage, onedrive
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
metadata: str
|
|
33
|
+
"""Optional metadata for the document as a JSON string.
|
|
34
|
+
|
|
35
|
+
This is used to store additional information about the document. Keys must be
|
|
36
|
+
strings and values can be strings, numbers, or booleans.
|
|
37
|
+
"""
|
|
38
|
+
|
|
39
|
+
mime_type: Annotated[str, PropertyInfo(alias="mimeType")]
|
|
40
|
+
"""Required when fileType is 'image' or 'video'.
|
|
41
|
+
|
|
42
|
+
Specifies the exact MIME type to use (e.g., 'image/png', 'image/jpeg',
|
|
43
|
+
'video/mp4', 'video/webm')
|
|
44
|
+
"""
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from .._models import BaseModel
|
|
4
|
+
|
|
5
|
+
__all__ = ["DocumentUploadFileResponse"]
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class DocumentUploadFileResponse(BaseModel):
|
|
9
|
+
id: str
|
|
10
|
+
"""Unique identifier of the document"""
|
|
11
|
+
|
|
12
|
+
status: str
|
|
13
|
+
"""Status of the document"""
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Dict, Union
|
|
6
|
+
from typing_extensions import Required, Annotated, TypedDict
|
|
7
|
+
|
|
8
|
+
from .._types import SequenceNotStr
|
|
9
|
+
from .._utils import PropertyInfo
|
|
10
|
+
|
|
11
|
+
__all__ = ["MemoryAddParams"]
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class MemoryAddParams(TypedDict, total=False):
|
|
15
|
+
content: Required[str]
|
|
16
|
+
"""The content to extract and process into a document.
|
|
17
|
+
|
|
18
|
+
This can be a URL to a website, a PDF, an image, or a video.
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
container_tag: Annotated[str, PropertyInfo(alias="containerTag")]
|
|
22
|
+
"""Optional tag this document should be containerized by.
|
|
23
|
+
|
|
24
|
+
Max 100 characters, alphanumeric with hyphens and underscores only.
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
container_tags: Annotated[SequenceNotStr[str], PropertyInfo(alias="containerTags")]
|
|
28
|
+
|
|
29
|
+
custom_id: Annotated[str, PropertyInfo(alias="customId")]
|
|
30
|
+
"""Optional custom ID of the document.
|
|
31
|
+
|
|
32
|
+
Max 100 characters, alphanumeric with hyphens and underscores only.
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
metadata: Dict[str, Union[str, float, bool, SequenceNotStr[str]]]
|
|
36
|
+
"""Optional metadata for the document."""
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from .._models import BaseModel
|
|
4
|
+
|
|
5
|
+
__all__ = ["MemoryAddResponse"]
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class MemoryAddResponse(BaseModel):
|
|
9
|
+
id: str
|
|
10
|
+
"""Unique identifier of the document"""
|
|
11
|
+
|
|
12
|
+
status: str
|
|
13
|
+
"""Status of the document"""
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import Dict, List, Union, Optional
|
|
4
|
+
from typing_extensions import Literal
|
|
5
|
+
|
|
6
|
+
from pydantic import Field as FieldInfo
|
|
7
|
+
|
|
8
|
+
from .._models import BaseModel
|
|
9
|
+
|
|
10
|
+
__all__ = ["MemoryGetResponse"]
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class MemoryGetResponse(BaseModel):
|
|
14
|
+
id: str
|
|
15
|
+
"""Unique identifier of the document."""
|
|
16
|
+
|
|
17
|
+
connection_id: Optional[str] = FieldInfo(alias="connectionId", default=None)
|
|
18
|
+
"""Optional ID of connection the document was created from.
|
|
19
|
+
|
|
20
|
+
This is useful for identifying the source of the document.
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
content: Optional[str] = None
|
|
24
|
+
"""The content to extract and process into a document.
|
|
25
|
+
|
|
26
|
+
This can be a URL to a website, a PDF, an image, or a video.
|
|
27
|
+
|
|
28
|
+
Plaintext: Any plaintext format
|
|
29
|
+
|
|
30
|
+
URL: A URL to a website, PDF, image, or video
|
|
31
|
+
|
|
32
|
+
We automatically detect the content type from the url's response format.
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
created_at: str = FieldInfo(alias="createdAt")
|
|
36
|
+
"""Creation timestamp"""
|
|
37
|
+
|
|
38
|
+
custom_id: Optional[str] = FieldInfo(alias="customId", default=None)
|
|
39
|
+
"""Optional custom ID of the document.
|
|
40
|
+
|
|
41
|
+
This could be an ID from your database that will uniquely identify this
|
|
42
|
+
document.
|
|
43
|
+
"""
|
|
44
|
+
|
|
45
|
+
metadata: Union[str, float, bool, Dict[str, object], List[object], None] = None
|
|
46
|
+
"""Optional metadata for the document.
|
|
47
|
+
|
|
48
|
+
This is used to store additional information about the document. You can use
|
|
49
|
+
this to store any additional information you need about the document. Metadata
|
|
50
|
+
can be filtered through. Keys must be strings and are case sensitive. Values can
|
|
51
|
+
be strings, numbers, or booleans. You cannot nest objects.
|
|
52
|
+
"""
|
|
53
|
+
|
|
54
|
+
og_image: Optional[str] = FieldInfo(alias="ogImage", default=None)
|
|
55
|
+
|
|
56
|
+
raw: object
|
|
57
|
+
"""Raw content of the document"""
|
|
58
|
+
|
|
59
|
+
source: Optional[str] = None
|
|
60
|
+
"""Source of the document"""
|
|
61
|
+
|
|
62
|
+
status: Literal["unknown", "queued", "extracting", "chunking", "embedding", "indexing", "done", "failed"]
|
|
63
|
+
"""Status of the document"""
|
|
64
|
+
|
|
65
|
+
summary: Optional[str] = None
|
|
66
|
+
"""Summary of the document content"""
|
|
67
|
+
|
|
68
|
+
summary_embedding_model: Optional[str] = FieldInfo(alias="summaryEmbeddingModel", default=None)
|
|
69
|
+
|
|
70
|
+
summary_embedding_model_new: Optional[str] = FieldInfo(alias="summaryEmbeddingModelNew", default=None)
|
|
71
|
+
|
|
72
|
+
summary_embedding_new: Optional[List[float]] = FieldInfo(alias="summaryEmbeddingNew", default=None)
|
|
73
|
+
|
|
74
|
+
title: Optional[str] = None
|
|
75
|
+
"""Title of the document"""
|
|
76
|
+
|
|
77
|
+
type: Literal[
|
|
78
|
+
"text",
|
|
79
|
+
"pdf",
|
|
80
|
+
"tweet",
|
|
81
|
+
"google_doc",
|
|
82
|
+
"google_slide",
|
|
83
|
+
"google_sheet",
|
|
84
|
+
"image",
|
|
85
|
+
"video",
|
|
86
|
+
"notion_doc",
|
|
87
|
+
"webpage",
|
|
88
|
+
"onedrive",
|
|
89
|
+
]
|
|
90
|
+
"""Type of the document"""
|
|
91
|
+
|
|
92
|
+
updated_at: str = FieldInfo(alias="updatedAt")
|
|
93
|
+
"""Last update timestamp"""
|
|
94
|
+
|
|
95
|
+
container_tags: Optional[List[str]] = FieldInfo(alias="containerTags", default=None)
|
|
96
|
+
"""Optional tags this document should be containerized by.
|
|
97
|
+
|
|
98
|
+
This can be an ID for your user, a project ID, or any other identifier you wish
|
|
99
|
+
to use to group documents.
|
|
100
|
+
"""
|
|
101
|
+
|
|
102
|
+
url: Optional[str] = None
|
|
103
|
+
"""URL of the document"""
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Union, Iterable
|
|
6
|
+
from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict
|
|
7
|
+
|
|
8
|
+
from .._types import SequenceNotStr
|
|
9
|
+
from .._utils import PropertyInfo
|
|
10
|
+
|
|
11
|
+
__all__ = ["MemoryListParams", "Filters", "FiltersOr", "FiltersAnd"]
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class MemoryListParams(TypedDict, total=False):
|
|
15
|
+
container_tags: Annotated[SequenceNotStr[str], PropertyInfo(alias="containerTags")]
|
|
16
|
+
"""Optional tags this document should be containerized by.
|
|
17
|
+
|
|
18
|
+
This can be an ID for your user, a project ID, or any other identifier you wish
|
|
19
|
+
to use to group documents.
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
filters: Filters
|
|
23
|
+
"""Optional filters to apply to the search. Can be a JSON string or Query object."""
|
|
24
|
+
|
|
25
|
+
include_content: Annotated[bool, PropertyInfo(alias="includeContent")]
|
|
26
|
+
"""Whether to include the content field in the response.
|
|
27
|
+
|
|
28
|
+
Warning: This can make responses significantly larger.
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
limit: Union[str, float]
|
|
32
|
+
"""Number of items per page"""
|
|
33
|
+
|
|
34
|
+
order: Literal["asc", "desc"]
|
|
35
|
+
"""Sort order"""
|
|
36
|
+
|
|
37
|
+
page: Union[str, float]
|
|
38
|
+
"""Page number to fetch"""
|
|
39
|
+
|
|
40
|
+
sort: Literal["createdAt", "updatedAt"]
|
|
41
|
+
"""Field to sort by"""
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class FiltersOr(TypedDict, total=False):
|
|
45
|
+
or_: Required[Annotated[Iterable[object], PropertyInfo(alias="OR")]]
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
class FiltersAnd(TypedDict, total=False):
|
|
49
|
+
and_: Required[Annotated[Iterable[object], PropertyInfo(alias="AND")]]
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
Filters: TypeAlias = Union[FiltersOr, FiltersAnd]
|