supermemory 3.3.0__py3-none-any.whl → 3.4.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.

Files changed (35) hide show
  1. supermemory/_version.py +1 -1
  2. supermemory/resources/documents.py +6 -52
  3. supermemory/resources/memories.py +6 -52
  4. supermemory/types/__init__.py +1 -0
  5. supermemory/types/connection_get_by_id_response.py +2 -3
  6. supermemory/types/connection_get_by_tags_response.py +2 -3
  7. supermemory/types/connection_list_response.py +2 -3
  8. supermemory/types/document_add_params.py +0 -14
  9. supermemory/types/document_get_response.py +5 -6
  10. supermemory/types/document_list_params.py +6 -71
  11. supermemory/types/document_list_response.py +4 -5
  12. supermemory/types/document_update_params.py +0 -14
  13. supermemory/types/document_upload_file_params.py +4 -3
  14. supermemory/types/memory_add_params.py +0 -14
  15. supermemory/types/memory_get_response.py +5 -6
  16. supermemory/types/memory_list_params.py +6 -71
  17. supermemory/types/memory_list_response.py +4 -5
  18. supermemory/types/memory_update_params.py +0 -14
  19. supermemory/types/memory_upload_file_params.py +4 -3
  20. supermemory/types/search_documents_params.py +5 -70
  21. supermemory/types/search_documents_response.py +2 -3
  22. supermemory/types/search_execute_params.py +5 -70
  23. supermemory/types/search_execute_response.py +2 -3
  24. supermemory/types/search_memories_params.py +6 -72
  25. supermemory/types/search_memories_response.py +5 -6
  26. supermemory/types/shared/__init__.py +4 -0
  27. supermemory/types/shared/and_.py +13 -0
  28. supermemory/types/shared/or_.py +13 -0
  29. supermemory/types/shared_params/__init__.py +4 -0
  30. supermemory/types/shared_params/and_.py +14 -0
  31. supermemory/types/shared_params/or_.py +14 -0
  32. {supermemory-3.3.0.dist-info → supermemory-3.4.0.dist-info}/METADATA +1 -1
  33. {supermemory-3.3.0.dist-info → supermemory-3.4.0.dist-info}/RECORD +35 -29
  34. {supermemory-3.3.0.dist-info → supermemory-3.4.0.dist-info}/WHEEL +0 -0
  35. {supermemory-3.3.0.dist-info → supermemory-3.4.0.dist-info}/licenses/LICENSE +0 -0
@@ -45,13 +45,6 @@ class DocumentUpdateParams(TypedDict, total=False):
45
45
  document.
46
46
  """
47
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
48
  metadata: Dict[str, Union[str, float, bool, SequenceNotStr[str]]]
56
49
  """Optional metadata for the document.
57
50
 
@@ -60,10 +53,3 @@ class DocumentUpdateParams(TypedDict, total=False):
60
53
  can be filtered through. Keys must be strings and are case sensitive. Values can
61
54
  be strings, numbers, or booleans. You cannot nest objects.
62
55
  """
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
- """
@@ -15,10 +15,11 @@ class DocumentUploadFileParams(TypedDict, total=False):
15
15
  """File to upload and process"""
16
16
 
17
17
  container_tags: Annotated[str, PropertyInfo(alias="containerTags")]
18
- """Optional JSON string of container tags array.
18
+ """Optional container tags.
19
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.
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.
22
23
  """
23
24
 
24
25
  file_type: Annotated[str, PropertyInfo(alias="fileType")]
@@ -45,13 +45,6 @@ class MemoryAddParams(TypedDict, total=False):
45
45
  document.
46
46
  """
47
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
48
  metadata: Dict[str, Union[str, float, bool, SequenceNotStr[str]]]
56
49
  """Optional metadata for the document.
57
50
 
@@ -60,10 +53,3 @@ class MemoryAddParams(TypedDict, total=False):
60
53
  can be filtered through. Keys must be strings and are case sensitive. Values can
61
54
  be strings, numbers, or booleans. You cannot nest objects.
62
55
  """
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
- """
@@ -1,7 +1,6 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  from typing import Dict, List, Union, Optional
4
- from datetime import datetime
5
4
  from typing_extensions import Literal
6
5
 
7
6
  from pydantic import Field as FieldInfo
@@ -33,7 +32,7 @@ class MemoryGetResponse(BaseModel):
33
32
  We automatically detect the content type from the url's response format.
34
33
  """
35
34
 
36
- created_at: datetime = FieldInfo(alias="createdAt")
35
+ created_at: str = FieldInfo(alias="createdAt")
37
36
  """Creation timestamp"""
38
37
 
39
38
  custom_id: Optional[str] = FieldInfo(alias="customId", default=None)
@@ -54,6 +53,9 @@ class MemoryGetResponse(BaseModel):
54
53
 
55
54
  og_image: Optional[str] = FieldInfo(alias="ogImage", default=None)
56
55
 
56
+ raw: object
57
+ """Raw content of the document"""
58
+
57
59
  source: Optional[str] = None
58
60
  """Source of the document"""
59
61
 
@@ -87,7 +89,7 @@ class MemoryGetResponse(BaseModel):
87
89
  ]
88
90
  """Type of the document"""
89
91
 
90
- updated_at: datetime = FieldInfo(alias="updatedAt")
92
+ updated_at: str = FieldInfo(alias="updatedAt")
91
93
  """Last update timestamp"""
92
94
 
93
95
  container_tags: Optional[List[str]] = FieldInfo(alias="containerTags", default=None)
@@ -97,8 +99,5 @@ class MemoryGetResponse(BaseModel):
97
99
  to use to group documents.
98
100
  """
99
101
 
100
- raw: None = None
101
- """Raw content of the document"""
102
-
103
102
  url: Optional[str] = None
104
103
  """URL of the document"""
@@ -2,26 +2,15 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import Union, Iterable
6
- from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict
5
+ from typing import Union
6
+ from typing_extensions import Literal, Annotated, TypeAlias, TypedDict
7
7
 
8
8
  from .._types import SequenceNotStr
9
9
  from .._utils import PropertyInfo
10
+ from .shared_params.or_ import Or
11
+ from .shared_params.and_ import And
10
12
 
11
- __all__ = [
12
- "MemoryListParams",
13
- "Filters",
14
- "FiltersOr",
15
- "FiltersOrOr",
16
- "FiltersOrOrUnionMember0",
17
- "FiltersOrOrOr",
18
- "FiltersOrOrAnd",
19
- "FiltersAnd",
20
- "FiltersAndAnd",
21
- "FiltersAndAndUnionMember0",
22
- "FiltersAndAndOr",
23
- "FiltersAndAndAnd",
24
- ]
13
+ __all__ = ["MemoryListParams", "Filters"]
25
14
 
26
15
 
27
16
  class MemoryListParams(TypedDict, total=False):
@@ -54,58 +43,4 @@ class MemoryListParams(TypedDict, total=False):
54
43
  """Field to sort by"""
55
44
 
56
45
 
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]
46
+ Filters: TypeAlias = Union[Or, And]
@@ -1,7 +1,6 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  from typing import Dict, List, Union, Optional
4
- from datetime import datetime
5
4
  from typing_extensions import Literal
6
5
 
7
6
  from pydantic import Field as FieldInfo
@@ -21,7 +20,7 @@ class Memory(BaseModel):
21
20
  This is useful for identifying the source of the document.
22
21
  """
23
22
 
24
- created_at: datetime = FieldInfo(alias="createdAt")
23
+ created_at: str = FieldInfo(alias="createdAt")
25
24
  """Creation timestamp"""
26
25
 
27
26
  custom_id: Optional[str] = FieldInfo(alias="customId", default=None)
@@ -64,7 +63,7 @@ class Memory(BaseModel):
64
63
  ]
65
64
  """Type of the document"""
66
65
 
67
- updated_at: datetime = FieldInfo(alias="updatedAt")
66
+ updated_at: str = FieldInfo(alias="updatedAt")
68
67
  """Last update timestamp"""
69
68
 
70
69
  container_tags: Optional[List[str]] = FieldInfo(alias="containerTags", default=None)
@@ -81,12 +80,12 @@ class Memory(BaseModel):
81
80
  class Pagination(BaseModel):
82
81
  current_page: float = FieldInfo(alias="currentPage")
83
82
 
84
- limit: float
85
-
86
83
  total_items: float = FieldInfo(alias="totalItems")
87
84
 
88
85
  total_pages: float = FieldInfo(alias="totalPages")
89
86
 
87
+ limit: Optional[float] = None
88
+
90
89
 
91
90
  class MemoryListResponse(BaseModel):
92
91
  memories: List[Memory]
@@ -45,13 +45,6 @@ class MemoryUpdateParams(TypedDict, total=False):
45
45
  document.
46
46
  """
47
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
48
  metadata: Dict[str, Union[str, float, bool, SequenceNotStr[str]]]
56
49
  """Optional metadata for the document.
57
50
 
@@ -60,10 +53,3 @@ class MemoryUpdateParams(TypedDict, total=False):
60
53
  can be filtered through. Keys must be strings and are case sensitive. Values can
61
54
  be strings, numbers, or booleans. You cannot nest objects.
62
55
  """
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
- """
@@ -15,10 +15,11 @@ class MemoryUploadFileParams(TypedDict, total=False):
15
15
  """File to upload and process"""
16
16
 
17
17
  container_tags: Annotated[str, PropertyInfo(alias="containerTags")]
18
- """Optional JSON string of container tags array.
18
+ """Optional container tags.
19
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.
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.
22
23
  """
23
24
 
24
25
  file_type: Annotated[str, PropertyInfo(alias="fileType")]
@@ -2,26 +2,15 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import List, Union, Iterable
5
+ from typing import List, Union
6
6
  from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict
7
7
 
8
8
  from .._types import SequenceNotStr
9
9
  from .._utils import PropertyInfo
10
+ from .shared_params.or_ import Or
11
+ from .shared_params.and_ import And
10
12
 
11
- __all__ = [
12
- "SearchDocumentsParams",
13
- "Filters",
14
- "FiltersOr",
15
- "FiltersOrOr",
16
- "FiltersOrOrUnionMember0",
17
- "FiltersOrOrOr",
18
- "FiltersOrOrAnd",
19
- "FiltersAnd",
20
- "FiltersAndAnd",
21
- "FiltersAndAndUnionMember0",
22
- "FiltersAndAndOr",
23
- "FiltersAndAndAnd",
24
- ]
13
+ __all__ = ["SearchDocumentsParams", "Filters"]
25
14
 
26
15
 
27
16
  class SearchDocumentsParams(TypedDict, total=False):
@@ -98,58 +87,4 @@ class SearchDocumentsParams(TypedDict, total=False):
98
87
  """
99
88
 
100
89
 
101
- class FiltersOrOrUnionMember0(TypedDict, total=False):
102
- key: Required[str]
103
-
104
- value: Required[str]
105
-
106
- filter_type: Annotated[Literal["metadata", "numeric", "array_contains"], PropertyInfo(alias="filterType")]
107
-
108
- negate: Union[bool, Literal["true", "false"]]
109
-
110
- numeric_operator: Annotated[Literal[">", "<", ">=", "<=", "="], PropertyInfo(alias="numericOperator")]
111
-
112
-
113
- class FiltersOrOrOr(TypedDict, total=False):
114
- or_: Required[Annotated[Iterable[object], PropertyInfo(alias="OR")]]
115
-
116
-
117
- class FiltersOrOrAnd(TypedDict, total=False):
118
- and_: Required[Annotated[Iterable[object], PropertyInfo(alias="AND")]]
119
-
120
-
121
- FiltersOrOr: TypeAlias = Union[FiltersOrOrUnionMember0, FiltersOrOrOr, FiltersOrOrAnd]
122
-
123
-
124
- class FiltersOr(TypedDict, total=False):
125
- or_: Required[Annotated[Iterable[FiltersOrOr], PropertyInfo(alias="OR")]]
126
-
127
-
128
- class FiltersAndAndUnionMember0(TypedDict, total=False):
129
- key: Required[str]
130
-
131
- value: Required[str]
132
-
133
- filter_type: Annotated[Literal["metadata", "numeric", "array_contains"], PropertyInfo(alias="filterType")]
134
-
135
- negate: Union[bool, Literal["true", "false"]]
136
-
137
- numeric_operator: Annotated[Literal[">", "<", ">=", "<=", "="], PropertyInfo(alias="numericOperator")]
138
-
139
-
140
- class FiltersAndAndOr(TypedDict, total=False):
141
- or_: Required[Annotated[Iterable[object], PropertyInfo(alias="OR")]]
142
-
143
-
144
- class FiltersAndAndAnd(TypedDict, total=False):
145
- and_: Required[Annotated[Iterable[object], PropertyInfo(alias="AND")]]
146
-
147
-
148
- FiltersAndAnd: TypeAlias = Union[FiltersAndAndUnionMember0, FiltersAndAndOr, FiltersAndAndAnd]
149
-
150
-
151
- class FiltersAnd(TypedDict, total=False):
152
- and_: Required[Annotated[Iterable[FiltersAndAnd], PropertyInfo(alias="AND")]]
153
-
154
-
155
- Filters: TypeAlias = Union[FiltersOr, FiltersAnd]
90
+ Filters: TypeAlias = Union[Or, And]
@@ -1,7 +1,6 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  from typing import Dict, List, Optional
4
- from datetime import datetime
5
4
 
6
5
  from pydantic import Field as FieldInfo
7
6
 
@@ -25,7 +24,7 @@ class Result(BaseModel):
25
24
  chunks: List[ResultChunk]
26
25
  """Matching content chunks from the document"""
27
26
 
28
- created_at: datetime = FieldInfo(alias="createdAt")
27
+ created_at: str = FieldInfo(alias="createdAt")
29
28
  """Document creation date"""
30
29
 
31
30
  document_id: str = FieldInfo(alias="documentId")
@@ -43,7 +42,7 @@ class Result(BaseModel):
43
42
  type: Optional[str] = None
44
43
  """Document type"""
45
44
 
46
- updated_at: datetime = FieldInfo(alias="updatedAt")
45
+ updated_at: str = FieldInfo(alias="updatedAt")
47
46
  """Document last update date"""
48
47
 
49
48
  content: Optional[str] = None
@@ -2,26 +2,15 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import List, Union, Iterable
5
+ from typing import List, Union
6
6
  from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict
7
7
 
8
8
  from .._types import SequenceNotStr
9
9
  from .._utils import PropertyInfo
10
+ from .shared_params.or_ import Or
11
+ from .shared_params.and_ import And
10
12
 
11
- __all__ = [
12
- "SearchExecuteParams",
13
- "Filters",
14
- "FiltersOr",
15
- "FiltersOrOr",
16
- "FiltersOrOrUnionMember0",
17
- "FiltersOrOrOr",
18
- "FiltersOrOrAnd",
19
- "FiltersAnd",
20
- "FiltersAndAnd",
21
- "FiltersAndAndUnionMember0",
22
- "FiltersAndAndOr",
23
- "FiltersAndAndAnd",
24
- ]
13
+ __all__ = ["SearchExecuteParams", "Filters"]
25
14
 
26
15
 
27
16
  class SearchExecuteParams(TypedDict, total=False):
@@ -98,58 +87,4 @@ class SearchExecuteParams(TypedDict, total=False):
98
87
  """
99
88
 
100
89
 
101
- class FiltersOrOrUnionMember0(TypedDict, total=False):
102
- key: Required[str]
103
-
104
- value: Required[str]
105
-
106
- filter_type: Annotated[Literal["metadata", "numeric", "array_contains"], PropertyInfo(alias="filterType")]
107
-
108
- negate: Union[bool, Literal["true", "false"]]
109
-
110
- numeric_operator: Annotated[Literal[">", "<", ">=", "<=", "="], PropertyInfo(alias="numericOperator")]
111
-
112
-
113
- class FiltersOrOrOr(TypedDict, total=False):
114
- or_: Required[Annotated[Iterable[object], PropertyInfo(alias="OR")]]
115
-
116
-
117
- class FiltersOrOrAnd(TypedDict, total=False):
118
- and_: Required[Annotated[Iterable[object], PropertyInfo(alias="AND")]]
119
-
120
-
121
- FiltersOrOr: TypeAlias = Union[FiltersOrOrUnionMember0, FiltersOrOrOr, FiltersOrOrAnd]
122
-
123
-
124
- class FiltersOr(TypedDict, total=False):
125
- or_: Required[Annotated[Iterable[FiltersOrOr], PropertyInfo(alias="OR")]]
126
-
127
-
128
- class FiltersAndAndUnionMember0(TypedDict, total=False):
129
- key: Required[str]
130
-
131
- value: Required[str]
132
-
133
- filter_type: Annotated[Literal["metadata", "numeric", "array_contains"], PropertyInfo(alias="filterType")]
134
-
135
- negate: Union[bool, Literal["true", "false"]]
136
-
137
- numeric_operator: Annotated[Literal[">", "<", ">=", "<=", "="], PropertyInfo(alias="numericOperator")]
138
-
139
-
140
- class FiltersAndAndOr(TypedDict, total=False):
141
- or_: Required[Annotated[Iterable[object], PropertyInfo(alias="OR")]]
142
-
143
-
144
- class FiltersAndAndAnd(TypedDict, total=False):
145
- and_: Required[Annotated[Iterable[object], PropertyInfo(alias="AND")]]
146
-
147
-
148
- FiltersAndAnd: TypeAlias = Union[FiltersAndAndUnionMember0, FiltersAndAndOr, FiltersAndAndAnd]
149
-
150
-
151
- class FiltersAnd(TypedDict, total=False):
152
- and_: Required[Annotated[Iterable[FiltersAndAnd], PropertyInfo(alias="AND")]]
153
-
154
-
155
- Filters: TypeAlias = Union[FiltersOr, FiltersAnd]
90
+ Filters: TypeAlias = Union[Or, And]
@@ -1,7 +1,6 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  from typing import Dict, List, Optional
4
- from datetime import datetime
5
4
 
6
5
  from pydantic import Field as FieldInfo
7
6
 
@@ -25,7 +24,7 @@ class Result(BaseModel):
25
24
  chunks: List[ResultChunk]
26
25
  """Matching content chunks from the document"""
27
26
 
28
- created_at: datetime = FieldInfo(alias="createdAt")
27
+ created_at: str = FieldInfo(alias="createdAt")
29
28
  """Document creation date"""
30
29
 
31
30
  document_id: str = FieldInfo(alias="documentId")
@@ -43,7 +42,7 @@ class Result(BaseModel):
43
42
  type: Optional[str] = None
44
43
  """Document type"""
45
44
 
46
- updated_at: datetime = FieldInfo(alias="updatedAt")
45
+ updated_at: str = FieldInfo(alias="updatedAt")
47
46
  """Document last update date"""
48
47
 
49
48
  content: Optional[str] = None
@@ -2,26 +2,14 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import Union, Iterable
6
- from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict
5
+ from typing import Union
6
+ from typing_extensions import Required, Annotated, TypeAlias, TypedDict
7
7
 
8
8
  from .._utils import PropertyInfo
9
+ from .shared_params.or_ import Or
10
+ from .shared_params.and_ import And
9
11
 
10
- __all__ = [
11
- "SearchMemoriesParams",
12
- "Filters",
13
- "FiltersOr",
14
- "FiltersOrOr",
15
- "FiltersOrOrUnionMember0",
16
- "FiltersOrOrOr",
17
- "FiltersOrOrAnd",
18
- "FiltersAnd",
19
- "FiltersAndAnd",
20
- "FiltersAndAndUnionMember0",
21
- "FiltersAndAndOr",
22
- "FiltersAndAndAnd",
23
- "Include",
24
- ]
12
+ __all__ = ["SearchMemoriesParams", "Filters", "Include"]
25
13
 
26
14
 
27
15
  class SearchMemoriesParams(TypedDict, total=False):
@@ -63,61 +51,7 @@ class SearchMemoriesParams(TypedDict, total=False):
63
51
  """
64
52
 
65
53
 
66
- class FiltersOrOrUnionMember0(TypedDict, total=False):
67
- key: Required[str]
68
-
69
- value: Required[str]
70
-
71
- filter_type: Annotated[Literal["metadata", "numeric", "array_contains"], PropertyInfo(alias="filterType")]
72
-
73
- negate: Union[bool, Literal["true", "false"]]
74
-
75
- numeric_operator: Annotated[Literal[">", "<", ">=", "<=", "="], PropertyInfo(alias="numericOperator")]
76
-
77
-
78
- class FiltersOrOrOr(TypedDict, total=False):
79
- or_: Required[Annotated[Iterable[object], PropertyInfo(alias="OR")]]
80
-
81
-
82
- class FiltersOrOrAnd(TypedDict, total=False):
83
- and_: Required[Annotated[Iterable[object], PropertyInfo(alias="AND")]]
84
-
85
-
86
- FiltersOrOr: TypeAlias = Union[FiltersOrOrUnionMember0, FiltersOrOrOr, FiltersOrOrAnd]
87
-
88
-
89
- class FiltersOr(TypedDict, total=False):
90
- or_: Required[Annotated[Iterable[FiltersOrOr], PropertyInfo(alias="OR")]]
91
-
92
-
93
- class FiltersAndAndUnionMember0(TypedDict, total=False):
94
- key: Required[str]
95
-
96
- value: Required[str]
97
-
98
- filter_type: Annotated[Literal["metadata", "numeric", "array_contains"], PropertyInfo(alias="filterType")]
99
-
100
- negate: Union[bool, Literal["true", "false"]]
101
-
102
- numeric_operator: Annotated[Literal[">", "<", ">=", "<=", "="], PropertyInfo(alias="numericOperator")]
103
-
104
-
105
- class FiltersAndAndOr(TypedDict, total=False):
106
- or_: Required[Annotated[Iterable[object], PropertyInfo(alias="OR")]]
107
-
108
-
109
- class FiltersAndAndAnd(TypedDict, total=False):
110
- and_: Required[Annotated[Iterable[object], PropertyInfo(alias="AND")]]
111
-
112
-
113
- FiltersAndAnd: TypeAlias = Union[FiltersAndAndUnionMember0, FiltersAndAndOr, FiltersAndAndAnd]
114
-
115
-
116
- class FiltersAnd(TypedDict, total=False):
117
- and_: Required[Annotated[Iterable[FiltersAndAnd], PropertyInfo(alias="AND")]]
118
-
119
-
120
- Filters: TypeAlias = Union[FiltersOr, FiltersAnd]
54
+ Filters: TypeAlias = Union[Or, And]
121
55
 
122
56
 
123
57
  class Include(TypedDict, total=False):
@@ -1,7 +1,6 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  from typing import Dict, List, Optional
4
- from datetime import datetime
5
4
  from typing_extensions import Literal
6
5
 
7
6
  from pydantic import Field as FieldInfo
@@ -25,7 +24,7 @@ class ResultContextChild(BaseModel):
25
24
  relation: Literal["updates", "extends", "derives"]
26
25
  """Relation type between this memory and its parent/child"""
27
26
 
28
- updated_at: datetime = FieldInfo(alias="updatedAt")
27
+ updated_at: str = FieldInfo(alias="updatedAt")
29
28
  """Contextual memory last update date"""
30
29
 
31
30
  metadata: Optional[Dict[str, object]] = None
@@ -45,7 +44,7 @@ class ResultContextParent(BaseModel):
45
44
  relation: Literal["updates", "extends", "derives"]
46
45
  """Relation type between this memory and its parent/child"""
47
46
 
48
- updated_at: datetime = FieldInfo(alias="updatedAt")
47
+ updated_at: str = FieldInfo(alias="updatedAt")
49
48
  """Contextual memory last update date"""
50
49
 
51
50
  metadata: Optional[Dict[str, object]] = None
@@ -68,10 +67,10 @@ class ResultDocument(BaseModel):
68
67
  id: str
69
68
  """Document ID"""
70
69
 
71
- created_at: datetime = FieldInfo(alias="createdAt")
70
+ created_at: str = FieldInfo(alias="createdAt")
72
71
  """Document creation date"""
73
72
 
74
- updated_at: datetime = FieldInfo(alias="updatedAt")
73
+ updated_at: str = FieldInfo(alias="updatedAt")
75
74
  """Document last update date"""
76
75
 
77
76
  metadata: Optional[Dict[str, object]] = None
@@ -100,7 +99,7 @@ class Result(BaseModel):
100
99
  similarity: float
101
100
  """Similarity score between the query and memory entry"""
102
101
 
103
- updated_at: datetime = FieldInfo(alias="updatedAt")
102
+ updated_at: str = FieldInfo(alias="updatedAt")
104
103
  """Memory last update date"""
105
104
 
106
105
  context: Optional[ResultContext] = None
@@ -0,0 +1,4 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from .or_ import Or as Or
4
+ from .and_ import And as And
@@ -0,0 +1,13 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import List
4
+
5
+ from pydantic import Field as FieldInfo
6
+
7
+ from ..._models import BaseModel
8
+
9
+ __all__ = ["And"]
10
+
11
+
12
+ class And(BaseModel):
13
+ and_: List[object] = FieldInfo(alias="AND")