supermemory 3.0.0a29__py3-none-any.whl → 3.1.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.
Potentially problematic release.
This version of supermemory might be problematic. Click here for more details.
- supermemory/__init__.py +3 -1
- supermemory/_base_client.py +12 -12
- supermemory/_client.py +17 -9
- supermemory/_compat.py +48 -48
- supermemory/_models.py +50 -44
- supermemory/_qs.py +7 -7
- supermemory/_types.py +53 -12
- supermemory/_utils/__init__.py +9 -2
- supermemory/_utils/_compat.py +45 -0
- supermemory/_utils/_datetime_parse.py +136 -0
- supermemory/_utils/_transform.py +13 -3
- supermemory/_utils/_typing.py +6 -1
- supermemory/_utils/_utils.py +4 -5
- supermemory/_version.py +1 -1
- supermemory/resources/__init__.py +14 -0
- supermemory/resources/connections.py +36 -36
- supermemory/resources/documents.py +894 -0
- supermemory/resources/memories.py +222 -134
- supermemory/resources/search.py +79 -79
- supermemory/resources/settings.py +31 -31
- supermemory/types/__init__.py +9 -0
- supermemory/types/connection_create_params.py +3 -2
- supermemory/types/connection_delete_by_provider_params.py +2 -2
- supermemory/types/connection_get_by_tags_params.py +2 -2
- supermemory/types/connection_import_params.py +2 -2
- supermemory/types/connection_list_documents_params.py +2 -2
- supermemory/types/connection_list_params.py +2 -2
- supermemory/types/document_add_params.py +69 -0
- supermemory/types/document_add_response.py +11 -0
- supermemory/types/document_get_response.py +104 -0
- supermemory/types/document_list_params.py +111 -0
- supermemory/types/document_list_response.py +95 -0
- supermemory/types/document_update_params.py +69 -0
- supermemory/types/document_update_response.py +11 -0
- supermemory/types/document_upload_file_params.py +36 -0
- supermemory/types/document_upload_file_response.py +11 -0
- supermemory/types/memory_add_params.py +39 -23
- supermemory/types/memory_get_response.py +21 -20
- supermemory/types/memory_list_params.py +79 -8
- supermemory/types/memory_list_response.py +18 -17
- supermemory/types/memory_update_params.py +31 -15
- supermemory/types/memory_upload_file_params.py +20 -0
- supermemory/types/search_documents_params.py +71 -9
- supermemory/types/search_execute_params.py +71 -9
- supermemory/types/search_memories_params.py +77 -8
- supermemory/types/search_memories_response.py +10 -7
- {supermemory-3.0.0a29.dist-info → supermemory-3.1.0.dist-info}/METADATA +18 -8
- supermemory-3.1.0.dist-info/RECORD +80 -0
- supermemory-3.0.0a29.dist-info/RECORD +0 -68
- {supermemory-3.0.0a29.dist-info → supermemory-3.1.0.dist-info}/WHEEL +0 -0
- {supermemory-3.0.0a29.dist-info → supermemory-3.1.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,104 @@
|
|
|
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 datetime import datetime
|
|
5
|
+
from typing_extensions import Literal
|
|
6
|
+
|
|
7
|
+
from pydantic import Field as FieldInfo
|
|
8
|
+
|
|
9
|
+
from .._models import BaseModel
|
|
10
|
+
|
|
11
|
+
__all__ = ["DocumentGetResponse"]
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class DocumentGetResponse(BaseModel):
|
|
15
|
+
id: str
|
|
16
|
+
"""Unique identifier of the document."""
|
|
17
|
+
|
|
18
|
+
connection_id: Optional[str] = FieldInfo(alias="connectionId", default=None)
|
|
19
|
+
"""Optional ID of connection the document was created from.
|
|
20
|
+
|
|
21
|
+
This is useful for identifying the source of the document.
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
content: Optional[str] = None
|
|
25
|
+
"""The content to extract and process into a document.
|
|
26
|
+
|
|
27
|
+
This can be a URL to a website, a PDF, an image, or a video.
|
|
28
|
+
|
|
29
|
+
Plaintext: Any plaintext format
|
|
30
|
+
|
|
31
|
+
URL: A URL to a website, PDF, image, or video
|
|
32
|
+
|
|
33
|
+
We automatically detect the content type from the url's response format.
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
created_at: datetime = FieldInfo(alias="createdAt")
|
|
37
|
+
"""Creation timestamp"""
|
|
38
|
+
|
|
39
|
+
custom_id: Optional[str] = FieldInfo(alias="customId", default=None)
|
|
40
|
+
"""Optional custom ID of the document.
|
|
41
|
+
|
|
42
|
+
This could be an ID from your database that will uniquely identify this
|
|
43
|
+
document.
|
|
44
|
+
"""
|
|
45
|
+
|
|
46
|
+
metadata: Union[str, float, bool, Dict[str, object], List[object], None] = None
|
|
47
|
+
"""Optional metadata for the document.
|
|
48
|
+
|
|
49
|
+
This is used to store additional information about the document. You can use
|
|
50
|
+
this to store any additional information you need about the document. Metadata
|
|
51
|
+
can be filtered through. Keys must be strings and are case sensitive. Values can
|
|
52
|
+
be strings, numbers, or booleans. You cannot nest objects.
|
|
53
|
+
"""
|
|
54
|
+
|
|
55
|
+
og_image: Optional[str] = FieldInfo(alias="ogImage", default=None)
|
|
56
|
+
|
|
57
|
+
source: Optional[str] = None
|
|
58
|
+
"""Source of the document"""
|
|
59
|
+
|
|
60
|
+
status: Literal["unknown", "queued", "extracting", "chunking", "embedding", "indexing", "done", "failed"]
|
|
61
|
+
"""Status of the document"""
|
|
62
|
+
|
|
63
|
+
summary: Optional[str] = None
|
|
64
|
+
"""Summary of the document content"""
|
|
65
|
+
|
|
66
|
+
summary_embedding_model: Optional[str] = FieldInfo(alias="summaryEmbeddingModel", default=None)
|
|
67
|
+
|
|
68
|
+
summary_embedding_model_new: Optional[str] = FieldInfo(alias="summaryEmbeddingModelNew", default=None)
|
|
69
|
+
|
|
70
|
+
summary_embedding_new: Optional[List[float]] = FieldInfo(alias="summaryEmbeddingNew", default=None)
|
|
71
|
+
|
|
72
|
+
title: Optional[str] = None
|
|
73
|
+
"""Title of the document"""
|
|
74
|
+
|
|
75
|
+
type: Literal[
|
|
76
|
+
"text",
|
|
77
|
+
"pdf",
|
|
78
|
+
"tweet",
|
|
79
|
+
"google_doc",
|
|
80
|
+
"google_slide",
|
|
81
|
+
"google_sheet",
|
|
82
|
+
"image",
|
|
83
|
+
"video",
|
|
84
|
+
"notion_doc",
|
|
85
|
+
"webpage",
|
|
86
|
+
"onedrive",
|
|
87
|
+
]
|
|
88
|
+
"""Type of the document"""
|
|
89
|
+
|
|
90
|
+
updated_at: datetime = FieldInfo(alias="updatedAt")
|
|
91
|
+
"""Last update timestamp"""
|
|
92
|
+
|
|
93
|
+
container_tags: Optional[List[str]] = FieldInfo(alias="containerTags", default=None)
|
|
94
|
+
"""Optional tags this document should be containerized by.
|
|
95
|
+
|
|
96
|
+
This can be an ID for your user, a project ID, or any other identifier you wish
|
|
97
|
+
to use to group documents.
|
|
98
|
+
"""
|
|
99
|
+
|
|
100
|
+
raw: None = None
|
|
101
|
+
"""Raw content of the document"""
|
|
102
|
+
|
|
103
|
+
url: Optional[str] = None
|
|
104
|
+
"""URL of the document"""
|
|
@@ -0,0 +1,111 @@
|
|
|
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__ = [
|
|
12
|
+
"DocumentListParams",
|
|
13
|
+
"Filters",
|
|
14
|
+
"FiltersOr",
|
|
15
|
+
"FiltersOrOr",
|
|
16
|
+
"FiltersOrOrUnionMember0",
|
|
17
|
+
"FiltersOrOrOr",
|
|
18
|
+
"FiltersOrOrAnd",
|
|
19
|
+
"FiltersAnd",
|
|
20
|
+
"FiltersAndAnd",
|
|
21
|
+
"FiltersAndAndUnionMember0",
|
|
22
|
+
"FiltersAndAndOr",
|
|
23
|
+
"FiltersAndAndAnd",
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class DocumentListParams(TypedDict, total=False):
|
|
28
|
+
container_tags: Annotated[SequenceNotStr[str], PropertyInfo(alias="containerTags")]
|
|
29
|
+
"""Optional tags this document should be containerized by.
|
|
30
|
+
|
|
31
|
+
This can be an ID for your user, a project ID, or any other identifier you wish
|
|
32
|
+
to use to group documents.
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
filters: Filters
|
|
36
|
+
"""Optional filters to apply to the search. Can be a JSON string or Query object."""
|
|
37
|
+
|
|
38
|
+
include_content: Annotated[bool, PropertyInfo(alias="includeContent")]
|
|
39
|
+
"""Whether to include the content field in the response.
|
|
40
|
+
|
|
41
|
+
Warning: This can make responses significantly larger.
|
|
42
|
+
"""
|
|
43
|
+
|
|
44
|
+
limit: Union[str, float]
|
|
45
|
+
"""Number of items per page"""
|
|
46
|
+
|
|
47
|
+
order: Literal["asc", "desc"]
|
|
48
|
+
"""Sort order"""
|
|
49
|
+
|
|
50
|
+
page: Union[str, float]
|
|
51
|
+
"""Page number to fetch"""
|
|
52
|
+
|
|
53
|
+
sort: Literal["createdAt", "updatedAt"]
|
|
54
|
+
"""Field to sort by"""
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
class FiltersOrOrUnionMember0(TypedDict, total=False):
|
|
58
|
+
key: Required[str]
|
|
59
|
+
|
|
60
|
+
value: Required[str]
|
|
61
|
+
|
|
62
|
+
filter_type: Annotated[Literal["metadata", "numeric", "array_contains"], PropertyInfo(alias="filterType")]
|
|
63
|
+
|
|
64
|
+
negate: Union[bool, Literal["true", "false"]]
|
|
65
|
+
|
|
66
|
+
numeric_operator: Annotated[Literal[">", "<", ">=", "<=", "="], PropertyInfo(alias="numericOperator")]
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
class FiltersOrOrOr(TypedDict, total=False):
|
|
70
|
+
or_: Required[Annotated[Iterable[object], PropertyInfo(alias="OR")]]
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
class FiltersOrOrAnd(TypedDict, total=False):
|
|
74
|
+
and_: Required[Annotated[Iterable[object], PropertyInfo(alias="AND")]]
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
FiltersOrOr: TypeAlias = Union[FiltersOrOrUnionMember0, FiltersOrOrOr, FiltersOrOrAnd]
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
class FiltersOr(TypedDict, total=False):
|
|
81
|
+
or_: Required[Annotated[Iterable[FiltersOrOr], PropertyInfo(alias="OR")]]
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
class FiltersAndAndUnionMember0(TypedDict, total=False):
|
|
85
|
+
key: Required[str]
|
|
86
|
+
|
|
87
|
+
value: Required[str]
|
|
88
|
+
|
|
89
|
+
filter_type: Annotated[Literal["metadata", "numeric", "array_contains"], PropertyInfo(alias="filterType")]
|
|
90
|
+
|
|
91
|
+
negate: Union[bool, Literal["true", "false"]]
|
|
92
|
+
|
|
93
|
+
numeric_operator: Annotated[Literal[">", "<", ">=", "<=", "="], PropertyInfo(alias="numericOperator")]
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
class FiltersAndAndOr(TypedDict, total=False):
|
|
97
|
+
or_: Required[Annotated[Iterable[object], PropertyInfo(alias="OR")]]
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
class FiltersAndAndAnd(TypedDict, total=False):
|
|
101
|
+
and_: Required[Annotated[Iterable[object], PropertyInfo(alias="AND")]]
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
FiltersAndAnd: TypeAlias = Union[FiltersAndAndUnionMember0, FiltersAndAndOr, FiltersAndAndAnd]
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
class FiltersAnd(TypedDict, total=False):
|
|
108
|
+
and_: Required[Annotated[Iterable[FiltersAndAnd], PropertyInfo(alias="AND")]]
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
Filters: TypeAlias = Union[FiltersOr, FiltersAnd]
|
|
@@ -0,0 +1,95 @@
|
|
|
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 datetime import datetime
|
|
5
|
+
from typing_extensions import Literal
|
|
6
|
+
|
|
7
|
+
from pydantic import Field as FieldInfo
|
|
8
|
+
|
|
9
|
+
from .._models import BaseModel
|
|
10
|
+
|
|
11
|
+
__all__ = ["DocumentListResponse", "Memory", "Pagination"]
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class Memory(BaseModel):
|
|
15
|
+
id: str
|
|
16
|
+
"""Unique identifier of the document."""
|
|
17
|
+
|
|
18
|
+
connection_id: Optional[str] = FieldInfo(alias="connectionId", default=None)
|
|
19
|
+
"""Optional ID of connection the document was created from.
|
|
20
|
+
|
|
21
|
+
This is useful for identifying the source of the document.
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
created_at: datetime = FieldInfo(alias="createdAt")
|
|
25
|
+
"""Creation timestamp"""
|
|
26
|
+
|
|
27
|
+
custom_id: Optional[str] = FieldInfo(alias="customId", default=None)
|
|
28
|
+
"""Optional custom ID of the document.
|
|
29
|
+
|
|
30
|
+
This could be an ID from your database that will uniquely identify this
|
|
31
|
+
document.
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
metadata: Union[str, float, bool, Dict[str, object], List[object], None] = None
|
|
35
|
+
"""Optional metadata for the document.
|
|
36
|
+
|
|
37
|
+
This is used to store additional information about the document. You can use
|
|
38
|
+
this to store any additional information you need about the document. Metadata
|
|
39
|
+
can be filtered through. Keys must be strings and are case sensitive. Values can
|
|
40
|
+
be strings, numbers, or booleans. You cannot nest objects.
|
|
41
|
+
"""
|
|
42
|
+
|
|
43
|
+
status: Literal["unknown", "queued", "extracting", "chunking", "embedding", "indexing", "done", "failed"]
|
|
44
|
+
"""Status of the document"""
|
|
45
|
+
|
|
46
|
+
summary: Optional[str] = None
|
|
47
|
+
"""Summary of the document content"""
|
|
48
|
+
|
|
49
|
+
title: Optional[str] = None
|
|
50
|
+
"""Title of the document"""
|
|
51
|
+
|
|
52
|
+
type: Literal[
|
|
53
|
+
"text",
|
|
54
|
+
"pdf",
|
|
55
|
+
"tweet",
|
|
56
|
+
"google_doc",
|
|
57
|
+
"google_slide",
|
|
58
|
+
"google_sheet",
|
|
59
|
+
"image",
|
|
60
|
+
"video",
|
|
61
|
+
"notion_doc",
|
|
62
|
+
"webpage",
|
|
63
|
+
"onedrive",
|
|
64
|
+
]
|
|
65
|
+
"""Type of the document"""
|
|
66
|
+
|
|
67
|
+
updated_at: datetime = FieldInfo(alias="updatedAt")
|
|
68
|
+
"""Last update timestamp"""
|
|
69
|
+
|
|
70
|
+
container_tags: Optional[List[str]] = FieldInfo(alias="containerTags", default=None)
|
|
71
|
+
"""Optional tags this document should be containerized by.
|
|
72
|
+
|
|
73
|
+
This can be an ID for your user, a project ID, or any other identifier you wish
|
|
74
|
+
to use to group documents.
|
|
75
|
+
"""
|
|
76
|
+
|
|
77
|
+
content: Optional[str] = None
|
|
78
|
+
"""Content of the document (only included when includeContent=true)"""
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
class Pagination(BaseModel):
|
|
82
|
+
current_page: float = FieldInfo(alias="currentPage")
|
|
83
|
+
|
|
84
|
+
limit: float
|
|
85
|
+
|
|
86
|
+
total_items: float = FieldInfo(alias="totalItems")
|
|
87
|
+
|
|
88
|
+
total_pages: float = FieldInfo(alias="totalPages")
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
class DocumentListResponse(BaseModel):
|
|
92
|
+
memories: List[Memory]
|
|
93
|
+
|
|
94
|
+
pagination: Pagination
|
|
95
|
+
"""Pagination metadata"""
|
|
@@ -0,0 +1,69 @@
|
|
|
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
|
+
file_type: Annotated[str, PropertyInfo(alias="fileType")]
|
|
49
|
+
"""Optional file type override to force specific processing behavior.
|
|
50
|
+
|
|
51
|
+
Valid values: text, pdf, tweet, google_doc, google_slide, google_sheet, image,
|
|
52
|
+
video, notion_doc, webpage, onedrive
|
|
53
|
+
"""
|
|
54
|
+
|
|
55
|
+
metadata: Dict[str, Union[str, float, bool, SequenceNotStr[str]]]
|
|
56
|
+
"""Optional metadata for the document.
|
|
57
|
+
|
|
58
|
+
This is used to store additional information about the document. You can use
|
|
59
|
+
this to store any additional information you need about the document. Metadata
|
|
60
|
+
can be filtered through. Keys must be strings and are case sensitive. Values can
|
|
61
|
+
be strings, numbers, or booleans. You cannot nest objects.
|
|
62
|
+
"""
|
|
63
|
+
|
|
64
|
+
mime_type: Annotated[str, PropertyInfo(alias="mimeType")]
|
|
65
|
+
"""Required when fileType is 'image' or 'video'.
|
|
66
|
+
|
|
67
|
+
Specifies the exact MIME type to use (e.g., 'image/png', 'image/jpeg',
|
|
68
|
+
'video/mp4', 'video/webm')
|
|
69
|
+
"""
|
|
@@ -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_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 JSON string of container tags array.
|
|
19
|
+
|
|
20
|
+
This can be an ID for your user, a project ID, or any other identifier you wish
|
|
21
|
+
to use to group documents.
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
file_type: Annotated[str, PropertyInfo(alias="fileType")]
|
|
25
|
+
"""Optional file type override to force specific processing behavior.
|
|
26
|
+
|
|
27
|
+
Valid values: text, pdf, tweet, google_doc, google_slide, google_sheet, image,
|
|
28
|
+
video, notion_doc, webpage, onedrive
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
mime_type: Annotated[str, PropertyInfo(alias="mimeType")]
|
|
32
|
+
"""Required when fileType is 'image' or 'video'.
|
|
33
|
+
|
|
34
|
+
Specifies the exact MIME type to use (e.g., 'image/png', 'image/jpeg',
|
|
35
|
+
'video/mp4', 'video/webm')
|
|
36
|
+
"""
|
|
@@ -2,52 +2,68 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import Dict,
|
|
6
|
-
from typing_extensions import Annotated, TypedDict
|
|
5
|
+
from typing import Dict, Union
|
|
6
|
+
from typing_extensions import Required, Annotated, TypedDict
|
|
7
7
|
|
|
8
|
+
from .._types import SequenceNotStr
|
|
8
9
|
from .._utils import PropertyInfo
|
|
9
10
|
|
|
10
11
|
__all__ = ["MemoryAddParams"]
|
|
11
12
|
|
|
12
13
|
|
|
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
|
+
Plaintext: Any plaintext format
|
|
21
|
+
|
|
22
|
+
URL: A URL to a website, PDF, image, or video
|
|
23
|
+
|
|
24
|
+
We automatically detect the content type from the url's response format.
|
|
25
|
+
"""
|
|
26
|
+
|
|
14
27
|
container_tag: Annotated[str, PropertyInfo(alias="containerTag")]
|
|
15
|
-
"""Optional tag this
|
|
28
|
+
"""Optional tag this document should be containerized by.
|
|
16
29
|
|
|
17
30
|
This can be an ID for your user, a project ID, or any other identifier you wish
|
|
18
|
-
to use to group
|
|
31
|
+
to use to group documents.
|
|
19
32
|
"""
|
|
20
33
|
|
|
21
|
-
container_tags: Annotated[
|
|
34
|
+
container_tags: Annotated[SequenceNotStr[str], PropertyInfo(alias="containerTags")]
|
|
22
35
|
"""
|
|
23
|
-
(DEPRECATED: Use containerTag instead) Optional tags this
|
|
36
|
+
(DEPRECATED: Use containerTag instead) Optional tags this document should be
|
|
24
37
|
containerized by. This can be an ID for your user, a project ID, or any other
|
|
25
|
-
identifier you wish to use to group
|
|
38
|
+
identifier you wish to use to group documents.
|
|
26
39
|
"""
|
|
27
40
|
|
|
28
|
-
|
|
29
|
-
"""
|
|
30
|
-
|
|
31
|
-
This can be a URL to a website, a PDF, an image, or a video.
|
|
41
|
+
custom_id: Annotated[str, PropertyInfo(alias="customId")]
|
|
42
|
+
"""Optional custom ID of the document.
|
|
32
43
|
|
|
33
|
-
|
|
44
|
+
This could be an ID from your database that will uniquely identify this
|
|
45
|
+
document.
|
|
46
|
+
"""
|
|
34
47
|
|
|
35
|
-
|
|
48
|
+
file_type: Annotated[str, PropertyInfo(alias="fileType")]
|
|
49
|
+
"""Optional file type override to force specific processing behavior.
|
|
36
50
|
|
|
37
|
-
|
|
51
|
+
Valid values: text, pdf, tweet, google_doc, google_slide, google_sheet, image,
|
|
52
|
+
video, notion_doc, webpage, onedrive
|
|
38
53
|
"""
|
|
39
54
|
|
|
40
|
-
|
|
41
|
-
"""Optional
|
|
55
|
+
metadata: Dict[str, Union[str, float, bool, SequenceNotStr[str]]]
|
|
56
|
+
"""Optional metadata for the document.
|
|
42
57
|
|
|
43
|
-
This
|
|
58
|
+
This is used to store additional information about the document. You can use
|
|
59
|
+
this to store any additional information you need about the document. Metadata
|
|
60
|
+
can be filtered through. Keys must be strings and are case sensitive. Values can
|
|
61
|
+
be strings, numbers, or booleans. You cannot nest objects.
|
|
44
62
|
"""
|
|
45
63
|
|
|
46
|
-
|
|
47
|
-
"""
|
|
64
|
+
mime_type: Annotated[str, PropertyInfo(alias="mimeType")]
|
|
65
|
+
"""Required when fileType is 'image' or 'video'.
|
|
48
66
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
filtered through. Keys must be strings and are case sensitive. Values can be
|
|
52
|
-
strings, numbers, or booleans. You cannot nest objects.
|
|
67
|
+
Specifies the exact MIME type to use (e.g., 'image/png', 'image/jpeg',
|
|
68
|
+
'video/mp4', 'video/webm')
|
|
53
69
|
"""
|
|
@@ -13,16 +13,16 @@ __all__ = ["MemoryGetResponse"]
|
|
|
13
13
|
|
|
14
14
|
class MemoryGetResponse(BaseModel):
|
|
15
15
|
id: str
|
|
16
|
-
"""Unique identifier of the
|
|
16
|
+
"""Unique identifier of the document."""
|
|
17
17
|
|
|
18
18
|
connection_id: Optional[str] = FieldInfo(alias="connectionId", default=None)
|
|
19
|
-
"""Optional ID of connection the
|
|
19
|
+
"""Optional ID of connection the document was created from.
|
|
20
20
|
|
|
21
|
-
This is useful for identifying the source of the
|
|
21
|
+
This is useful for identifying the source of the document.
|
|
22
22
|
"""
|
|
23
23
|
|
|
24
24
|
content: Optional[str] = None
|
|
25
|
-
"""The content to extract and process into a
|
|
25
|
+
"""The content to extract and process into a document.
|
|
26
26
|
|
|
27
27
|
This can be a URL to a website, a PDF, an image, or a video.
|
|
28
28
|
|
|
@@ -37,30 +37,31 @@ class MemoryGetResponse(BaseModel):
|
|
|
37
37
|
"""Creation timestamp"""
|
|
38
38
|
|
|
39
39
|
custom_id: Optional[str] = FieldInfo(alias="customId", default=None)
|
|
40
|
-
"""Optional custom ID of the
|
|
40
|
+
"""Optional custom ID of the document.
|
|
41
41
|
|
|
42
|
-
This could be an ID from your database that will uniquely identify this
|
|
42
|
+
This could be an ID from your database that will uniquely identify this
|
|
43
|
+
document.
|
|
43
44
|
"""
|
|
44
45
|
|
|
45
46
|
metadata: Union[str, float, bool, Dict[str, object], List[object], None] = None
|
|
46
|
-
"""Optional metadata for the
|
|
47
|
+
"""Optional metadata for the document.
|
|
47
48
|
|
|
48
|
-
This is used to store additional information about the
|
|
49
|
-
to store any additional information you need about the
|
|
50
|
-
filtered through. Keys must be strings and are case sensitive. Values can
|
|
51
|
-
strings, numbers, or booleans. You cannot nest objects.
|
|
49
|
+
This is used to store additional information about the document. You can use
|
|
50
|
+
this to store any additional information you need about the document. Metadata
|
|
51
|
+
can be filtered through. Keys must be strings and are case sensitive. Values can
|
|
52
|
+
be strings, numbers, or booleans. You cannot nest objects.
|
|
52
53
|
"""
|
|
53
54
|
|
|
54
55
|
og_image: Optional[str] = FieldInfo(alias="ogImage", default=None)
|
|
55
56
|
|
|
56
57
|
source: Optional[str] = None
|
|
57
|
-
"""Source of the
|
|
58
|
+
"""Source of the document"""
|
|
58
59
|
|
|
59
60
|
status: Literal["unknown", "queued", "extracting", "chunking", "embedding", "indexing", "done", "failed"]
|
|
60
|
-
"""Status of the
|
|
61
|
+
"""Status of the document"""
|
|
61
62
|
|
|
62
63
|
summary: Optional[str] = None
|
|
63
|
-
"""Summary of the
|
|
64
|
+
"""Summary of the document content"""
|
|
64
65
|
|
|
65
66
|
summary_embedding_model: Optional[str] = FieldInfo(alias="summaryEmbeddingModel", default=None)
|
|
66
67
|
|
|
@@ -69,7 +70,7 @@ class MemoryGetResponse(BaseModel):
|
|
|
69
70
|
summary_embedding_new: Optional[List[float]] = FieldInfo(alias="summaryEmbeddingNew", default=None)
|
|
70
71
|
|
|
71
72
|
title: Optional[str] = None
|
|
72
|
-
"""Title of the
|
|
73
|
+
"""Title of the document"""
|
|
73
74
|
|
|
74
75
|
type: Literal[
|
|
75
76
|
"text",
|
|
@@ -84,20 +85,20 @@ class MemoryGetResponse(BaseModel):
|
|
|
84
85
|
"webpage",
|
|
85
86
|
"onedrive",
|
|
86
87
|
]
|
|
87
|
-
"""Type of the
|
|
88
|
+
"""Type of the document"""
|
|
88
89
|
|
|
89
90
|
updated_at: datetime = FieldInfo(alias="updatedAt")
|
|
90
91
|
"""Last update timestamp"""
|
|
91
92
|
|
|
92
93
|
container_tags: Optional[List[str]] = FieldInfo(alias="containerTags", default=None)
|
|
93
|
-
"""Optional tags this
|
|
94
|
+
"""Optional tags this document should be containerized by.
|
|
94
95
|
|
|
95
96
|
This can be an ID for your user, a project ID, or any other identifier you wish
|
|
96
|
-
to use to group
|
|
97
|
+
to use to group documents.
|
|
97
98
|
"""
|
|
98
99
|
|
|
99
100
|
raw: None = None
|
|
100
|
-
"""Raw content of the
|
|
101
|
+
"""Raw content of the document"""
|
|
101
102
|
|
|
102
103
|
url: Optional[str] = None
|
|
103
|
-
"""URL of the
|
|
104
|
+
"""URL of the document"""
|