nucliadb-models 6.8.1.post4983__py3-none-any.whl → 6.10.0.post5694__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 nucliadb-models might be problematic. Click here for more details.
- nucliadb_models/agents/ingestion.py +4 -4
- nucliadb_models/augment.py +359 -0
- nucliadb_models/common.py +66 -57
- nucliadb_models/configuration.py +9 -9
- nucliadb_models/content_types.py +13 -11
- nucliadb_models/conversation.py +30 -29
- nucliadb_models/entities.py +17 -18
- nucliadb_models/external_index_providers.py +5 -20
- nucliadb_models/extracted.py +82 -83
- nucliadb_models/file.py +10 -11
- nucliadb_models/filters.py +78 -74
- nucliadb_models/graph/requests.py +38 -47
- nucliadb_models/hydration.py +423 -0
- nucliadb_models/internal/predict.py +7 -9
- nucliadb_models/internal/shards.py +2 -3
- nucliadb_models/labels.py +18 -11
- nucliadb_models/link.py +18 -19
- nucliadb_models/metadata.py +80 -53
- nucliadb_models/notifications.py +3 -3
- nucliadb_models/processing.py +1 -2
- nucliadb_models/resource.py +85 -102
- nucliadb_models/retrieval.py +147 -0
- nucliadb_models/search.py +360 -306
- nucliadb_models/security.py +2 -3
- nucliadb_models/text.py +7 -8
- nucliadb_models/trainset.py +1 -2
- nucliadb_models/utils.py +2 -3
- nucliadb_models/vectors.py +2 -5
- nucliadb_models/writer.py +56 -57
- {nucliadb_models-6.8.1.post4983.dist-info → nucliadb_models-6.10.0.post5694.dist-info}/METADATA +2 -3
- nucliadb_models-6.10.0.post5694.dist-info/RECORD +41 -0
- nucliadb_models-6.8.1.post4983.dist-info/RECORD +0 -38
- {nucliadb_models-6.8.1.post4983.dist-info → nucliadb_models-6.10.0.post5694.dist-info}/WHEEL +0 -0
- {nucliadb_models-6.8.1.post4983.dist-info → nucliadb_models-6.10.0.post5694.dist-info}/top_level.txt +0 -0
nucliadb_models/metadata.py
CHANGED
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
import warnings
|
|
16
16
|
from datetime import datetime
|
|
17
17
|
from enum import Enum
|
|
18
|
-
from typing import Any
|
|
18
|
+
from typing import Any
|
|
19
19
|
|
|
20
|
-
from pydantic import BaseModel, Field, model_validator
|
|
20
|
+
from pydantic import BaseModel, Field, field_validator, model_validator
|
|
21
21
|
from typing_extensions import Self
|
|
22
22
|
|
|
23
23
|
from nucliadb_models.utils import DateTime
|
|
@@ -49,7 +49,7 @@ class RelationNodeType(str, Enum):
|
|
|
49
49
|
class RelationEntity(BaseModel):
|
|
50
50
|
value: str
|
|
51
51
|
type: RelationNodeType
|
|
52
|
-
group:
|
|
52
|
+
group: str | None = None
|
|
53
53
|
|
|
54
54
|
@model_validator(mode="after")
|
|
55
55
|
def check_relation_is_valid(self) -> Self:
|
|
@@ -60,20 +60,20 @@ class RelationEntity(BaseModel):
|
|
|
60
60
|
|
|
61
61
|
|
|
62
62
|
class RelationMetadata(BaseModel):
|
|
63
|
-
paragraph_id:
|
|
64
|
-
source_start:
|
|
65
|
-
source_end:
|
|
66
|
-
to_start:
|
|
67
|
-
to_end:
|
|
68
|
-
data_augmentation_task_id:
|
|
63
|
+
paragraph_id: str | None = None
|
|
64
|
+
source_start: int | None = None
|
|
65
|
+
source_end: int | None = None
|
|
66
|
+
to_start: int | None = None
|
|
67
|
+
to_end: int | None = None
|
|
68
|
+
data_augmentation_task_id: str | None = None
|
|
69
69
|
|
|
70
70
|
|
|
71
71
|
class Relation(BaseModel):
|
|
72
72
|
relation: RelationType
|
|
73
|
-
label:
|
|
74
|
-
metadata:
|
|
73
|
+
label: str | None = None
|
|
74
|
+
metadata: RelationMetadata | None = None
|
|
75
75
|
|
|
76
|
-
from_:
|
|
76
|
+
from_: RelationEntity | None = Field(default=None, alias="from")
|
|
77
77
|
to: RelationEntity
|
|
78
78
|
|
|
79
79
|
@model_validator(mode="after")
|
|
@@ -100,9 +100,9 @@ class Relation(BaseModel):
|
|
|
100
100
|
|
|
101
101
|
|
|
102
102
|
class InputMetadata(BaseModel):
|
|
103
|
-
metadata:
|
|
104
|
-
language:
|
|
105
|
-
languages:
|
|
103
|
+
metadata: dict[str, str] = {}
|
|
104
|
+
language: str | None = None
|
|
105
|
+
languages: list[str] | None = Field(default=None, max_length=1024)
|
|
106
106
|
|
|
107
107
|
|
|
108
108
|
class ResourceProcessingStatus(Enum):
|
|
@@ -120,7 +120,7 @@ class Metadata(InputMetadata):
|
|
|
120
120
|
|
|
121
121
|
class FieldClassification(BaseModel):
|
|
122
122
|
field: FieldID
|
|
123
|
-
classifications:
|
|
123
|
+
classifications: list[Classification] = []
|
|
124
124
|
|
|
125
125
|
|
|
126
126
|
class ComputedMetadata(BaseModel):
|
|
@@ -129,12 +129,12 @@ class ComputedMetadata(BaseModel):
|
|
|
129
129
|
without having to load the whole computed metadata field.
|
|
130
130
|
"""
|
|
131
131
|
|
|
132
|
-
field_classifications:
|
|
132
|
+
field_classifications: list[FieldClassification] = []
|
|
133
133
|
|
|
134
134
|
|
|
135
135
|
class UserMetadata(BaseModel):
|
|
136
|
-
classifications:
|
|
137
|
-
relations:
|
|
136
|
+
classifications: list[UserClassification] = []
|
|
137
|
+
relations: list[Relation] = []
|
|
138
138
|
|
|
139
139
|
|
|
140
140
|
class TokenSplit(BaseModel):
|
|
@@ -154,7 +154,7 @@ class TokenSplit(BaseModel):
|
|
|
154
154
|
|
|
155
155
|
|
|
156
156
|
class ParagraphAnnotation(BaseModel):
|
|
157
|
-
classifications:
|
|
157
|
+
classifications: list[UserClassification] = []
|
|
158
158
|
key: str
|
|
159
159
|
|
|
160
160
|
|
|
@@ -169,12 +169,12 @@ class VisualSelection(BaseModel):
|
|
|
169
169
|
left: float
|
|
170
170
|
right: float
|
|
171
171
|
bottom: float
|
|
172
|
-
token_ids:
|
|
172
|
+
token_ids: list[int]
|
|
173
173
|
|
|
174
174
|
|
|
175
175
|
class PageSelections(BaseModel):
|
|
176
176
|
page: int
|
|
177
|
-
visual:
|
|
177
|
+
visual: list[VisualSelection]
|
|
178
178
|
|
|
179
179
|
def __init__(self, **data):
|
|
180
180
|
warnings.warn(
|
|
@@ -190,62 +190,89 @@ class UserFieldMetadata(BaseModel):
|
|
|
190
190
|
Field-level metadata set by the user via the rest api
|
|
191
191
|
"""
|
|
192
192
|
|
|
193
|
-
paragraphs:
|
|
194
|
-
question_answers:
|
|
193
|
+
paragraphs: list[ParagraphAnnotation] = []
|
|
194
|
+
question_answers: list[QuestionAnswerAnnotation] = []
|
|
195
195
|
field: FieldID
|
|
196
196
|
|
|
197
197
|
|
|
198
198
|
class Basic(BaseModel):
|
|
199
|
-
icon:
|
|
200
|
-
title:
|
|
201
|
-
summary:
|
|
202
|
-
thumbnail:
|
|
203
|
-
created:
|
|
204
|
-
modified:
|
|
205
|
-
metadata:
|
|
206
|
-
usermetadata:
|
|
207
|
-
fieldmetadata:
|
|
208
|
-
computedmetadata:
|
|
209
|
-
uuid:
|
|
210
|
-
last_seqid:
|
|
211
|
-
last_account_seq:
|
|
199
|
+
icon: str | None = None
|
|
200
|
+
title: str | None = None
|
|
201
|
+
summary: str | None = None
|
|
202
|
+
thumbnail: str | None = None
|
|
203
|
+
created: datetime | None = None
|
|
204
|
+
modified: datetime | None = None
|
|
205
|
+
metadata: Metadata | None = None
|
|
206
|
+
usermetadata: UserMetadata | None = None
|
|
207
|
+
fieldmetadata: list[UserFieldMetadata] | None = None
|
|
208
|
+
computedmetadata: ComputedMetadata | None = None
|
|
209
|
+
uuid: str | None = None
|
|
210
|
+
last_seqid: int | None = None
|
|
211
|
+
last_account_seq: int | None = None
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
class SyncMetadata(BaseModel):
|
|
215
|
+
file_id: str = Field(description="Identifier of the file in the origin cloud storage system")
|
|
216
|
+
auth_provider: str = Field(
|
|
217
|
+
description="Authentication provider used to access the origin cloud storage system"
|
|
218
|
+
)
|
|
212
219
|
|
|
213
220
|
|
|
214
221
|
class InputOrigin(BaseModel):
|
|
215
|
-
source_id:
|
|
216
|
-
url:
|
|
217
|
-
created:
|
|
222
|
+
source_id: str | None = None
|
|
223
|
+
url: str | None = None
|
|
224
|
+
created: DateTime | None = Field(
|
|
218
225
|
default=None,
|
|
219
226
|
description="Creation date of the resource at the origin system. This can be later used for date range filtering on search endpoints. Have a look at the advanced search documentation page: https://docs.nuclia.dev/docs/rag/advanced/search/#date-filtering",
|
|
220
227
|
)
|
|
221
|
-
modified:
|
|
228
|
+
modified: DateTime | None = Field(
|
|
222
229
|
default=None,
|
|
223
230
|
description="Modification date of the resource at the origin system. This can be later used for date range filtering on search endpoints. Have a look at the advanced search documentation page: https://docs.nuclia.dev/docs/rag/advanced/search/#date-filtering",
|
|
224
231
|
)
|
|
225
|
-
metadata:
|
|
232
|
+
metadata: dict[str, str] = Field(
|
|
226
233
|
default={},
|
|
227
234
|
title="Metadata",
|
|
228
235
|
description="Generic metadata from the resource at the origin system. It can later be used for filtering on search endpoints with '/origin.metadata/{key}/{value}'",
|
|
229
236
|
)
|
|
230
|
-
tags:
|
|
237
|
+
tags: list[str] = Field(
|
|
231
238
|
default=[],
|
|
232
239
|
title="Tags",
|
|
233
240
|
description="Resource tags about the origin system. It can later be used for filtering on search endpoints with '/origin.tags/{tag}'",
|
|
241
|
+
max_length=300,
|
|
234
242
|
)
|
|
235
|
-
collaborators:
|
|
236
|
-
filename:
|
|
237
|
-
related:
|
|
238
|
-
path:
|
|
243
|
+
collaborators: list[str] = Field(default=[], max_length=100)
|
|
244
|
+
filename: str | None = None
|
|
245
|
+
related: list[str] = Field(default=[], max_length=100)
|
|
246
|
+
path: str | None = Field(
|
|
239
247
|
default=None,
|
|
240
248
|
description="Path of the original resource. Typically used to store folder structure information of the resource at the origin system. It can be later used for filtering on search endpoints with '/origin.path/{path}'",
|
|
249
|
+
max_length=2048,
|
|
250
|
+
)
|
|
251
|
+
sync_metadata: SyncMetadata | None = Field(
|
|
252
|
+
default=None,
|
|
253
|
+
title="Sync Metadata",
|
|
254
|
+
description="Metadata related to the resource from the origin system fetched by the Progress Agentic RAG's Cloud Storage Sync service.",
|
|
241
255
|
)
|
|
242
256
|
|
|
257
|
+
@field_validator("tags")
|
|
258
|
+
def validate_tag_length(cls, tags):
|
|
259
|
+
for tag in tags:
|
|
260
|
+
if len(tag) > 512:
|
|
261
|
+
raise ValueError("Each tag must be at most 1024 characters long")
|
|
262
|
+
return tags
|
|
263
|
+
|
|
243
264
|
|
|
244
265
|
class Origin(InputOrigin):
|
|
245
266
|
# Created and modified are redefined to
|
|
246
267
|
# use native datetime objects and skip validation
|
|
247
|
-
created:
|
|
248
|
-
modified:
|
|
268
|
+
created: datetime | None = None
|
|
269
|
+
modified: datetime | None = None
|
|
270
|
+
|
|
271
|
+
tags: list[str] = Field(
|
|
272
|
+
default=[],
|
|
273
|
+
title="Tags",
|
|
274
|
+
description="Resource tags about the origin system. It can later be used for filtering on search endpoints with '/origin.tags/{tag}'",
|
|
275
|
+
)
|
|
249
276
|
|
|
250
277
|
class Source(Enum):
|
|
251
278
|
WEB = "WEB"
|
|
@@ -253,16 +280,16 @@ class Origin(InputOrigin):
|
|
|
253
280
|
API = "API"
|
|
254
281
|
PYSDK = "PYSDK"
|
|
255
282
|
|
|
256
|
-
source:
|
|
283
|
+
source: Source | None = Source.API
|
|
257
284
|
|
|
258
285
|
|
|
259
286
|
class Extra(BaseModel):
|
|
260
|
-
metadata:
|
|
287
|
+
metadata: dict[Any, Any] = Field(
|
|
261
288
|
...,
|
|
262
289
|
title="Metadata",
|
|
263
|
-
description="Arbitrary JSON metadata provided by the user that is not meant to be searchable, but can be serialized on results.",
|
|
290
|
+
description="Arbitrary JSON metadata provided by the user that is not meant to be searchable, but can be serialized on results.",
|
|
264
291
|
)
|
|
265
292
|
|
|
266
293
|
|
|
267
294
|
class Relations(BaseModel):
|
|
268
|
-
relations:
|
|
295
|
+
relations: list[Relation] | None = None
|
nucliadb_models/notifications.py
CHANGED
|
@@ -49,7 +49,7 @@ class ResourceIndexed(BaseModel):
|
|
|
49
49
|
seqid: int = Field(
|
|
50
50
|
...,
|
|
51
51
|
title="Sequence ID",
|
|
52
|
-
description="Sequence ID of the resource operation. This can be used to track completion of specific operations.",
|
|
52
|
+
description="Sequence ID of the resource operation. This can be used to track completion of specific operations.",
|
|
53
53
|
)
|
|
54
54
|
|
|
55
55
|
|
|
@@ -59,7 +59,7 @@ class ResourceWritten(BaseModel):
|
|
|
59
59
|
seqid: int = Field(
|
|
60
60
|
...,
|
|
61
61
|
title="Sequence ID",
|
|
62
|
-
description="Sequence ID of the resource operation. This can be used to track completion of specific operations.",
|
|
62
|
+
description="Sequence ID of the resource operation. This can be used to track completion of specific operations.",
|
|
63
63
|
)
|
|
64
64
|
operation: ResourceOperationType = Field(
|
|
65
65
|
..., title="Operation", description="Type of resource write operation."
|
|
@@ -77,7 +77,7 @@ class ResourceProcessed(BaseModel):
|
|
|
77
77
|
seqid: int = Field(
|
|
78
78
|
...,
|
|
79
79
|
title="Sequence ID",
|
|
80
|
-
description="Sequence ID of the resource operation. This can be used to track completion of specific operations.",
|
|
80
|
+
description="Sequence ID of the resource operation. This can be used to track completion of specific operations.",
|
|
81
81
|
)
|
|
82
82
|
ingestion_succeeded: bool = Field(
|
|
83
83
|
default=True,
|
nucliadb_models/processing.py
CHANGED
|
@@ -12,10 +12,9 @@
|
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
|
-
from typing import Optional
|
|
16
15
|
|
|
17
16
|
from pydantic import BaseModel
|
|
18
17
|
|
|
19
18
|
|
|
20
19
|
class PushProcessingOptions(BaseModel):
|
|
21
|
-
ml_text:
|
|
20
|
+
ml_text: bool | None = True
|
nucliadb_models/resource.py
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
import string
|
|
17
17
|
from datetime import datetime
|
|
18
18
|
from enum import Enum
|
|
19
|
-
from typing import Any
|
|
19
|
+
from typing import Any
|
|
20
20
|
|
|
21
21
|
from pydantic import BaseModel, Field, field_validator, model_validator
|
|
22
22
|
|
|
@@ -72,44 +72,35 @@ class ExtractedDataTypeName(str, Enum):
|
|
|
72
72
|
QA = "question_answers"
|
|
73
73
|
|
|
74
74
|
|
|
75
|
-
class ReleaseChannel(str, Enum):
|
|
76
|
-
"""
|
|
77
|
-
Deprecated. No longer used.
|
|
78
|
-
"""
|
|
79
|
-
|
|
80
|
-
STABLE = "STABLE"
|
|
81
|
-
EXPERIMENTAL = "EXPERIMENTAL"
|
|
82
|
-
|
|
83
|
-
|
|
84
75
|
class KnowledgeBoxConfig(BaseModel):
|
|
85
|
-
slug:
|
|
76
|
+
slug: SlugString | None = Field(
|
|
86
77
|
default=None, title="Slug", description="Slug for the Knowledge Box."
|
|
87
78
|
)
|
|
88
|
-
title:
|
|
89
|
-
description:
|
|
79
|
+
title: str | None = Field(default=None, title="Title", description="Title for the Knowledge Box.")
|
|
80
|
+
description: str | None = Field(
|
|
90
81
|
default=None,
|
|
91
82
|
title="Description",
|
|
92
83
|
description="Description for the Knowledge Box.",
|
|
93
84
|
)
|
|
94
|
-
learning_configuration:
|
|
85
|
+
learning_configuration: dict[str, Any] | None = Field(
|
|
95
86
|
default=None,
|
|
96
87
|
title="Learning Configuration",
|
|
97
|
-
description="Learning configuration for the Knowledge Box. If provided, NucliaDB will set the learning configuration for the Knowledge Box.",
|
|
88
|
+
description="Learning configuration for the Knowledge Box. If provided, NucliaDB will set the learning configuration for the Knowledge Box.",
|
|
98
89
|
)
|
|
99
90
|
|
|
100
|
-
external_index_provider:
|
|
91
|
+
external_index_provider: ExternalIndexProvider | None = Field(
|
|
101
92
|
default=None,
|
|
102
93
|
title="External Index Provider",
|
|
103
94
|
description="External index provider for the Knowledge Box.",
|
|
104
95
|
)
|
|
105
96
|
|
|
106
|
-
configured_external_index_provider:
|
|
97
|
+
configured_external_index_provider: dict[str, Any] | None = Field(
|
|
107
98
|
default=None,
|
|
108
99
|
title="Configured External Index Provider",
|
|
109
100
|
description="Metadata for the configured external index provider (if any)",
|
|
110
101
|
)
|
|
111
102
|
|
|
112
|
-
similarity:
|
|
103
|
+
similarity: VectorSimilarity | None = Field(
|
|
113
104
|
default=None,
|
|
114
105
|
description="This field is deprecated. Use 'learning_configuration' instead.",
|
|
115
106
|
)
|
|
@@ -126,7 +117,7 @@ class KnowledgeBoxConfig(BaseModel):
|
|
|
126
117
|
|
|
127
118
|
@field_validator("slug")
|
|
128
119
|
@classmethod
|
|
129
|
-
def id_check(cls, v:
|
|
120
|
+
def id_check(cls, v: str | None) -> str | None:
|
|
130
121
|
if v is None:
|
|
131
122
|
return v
|
|
132
123
|
|
|
@@ -145,7 +136,7 @@ class KnowledgeBoxConfig(BaseModel):
|
|
|
145
136
|
|
|
146
137
|
|
|
147
138
|
class KnowledgeBoxObjSummary(BaseModel):
|
|
148
|
-
slug:
|
|
139
|
+
slug: SlugString | None = None
|
|
149
140
|
uuid: str
|
|
150
141
|
|
|
151
142
|
|
|
@@ -158,25 +149,25 @@ class KnowledgeBoxObj(BaseModel):
|
|
|
158
149
|
The API representation of a Knowledge Box object.
|
|
159
150
|
"""
|
|
160
151
|
|
|
161
|
-
slug:
|
|
152
|
+
slug: SlugString | None = None
|
|
162
153
|
uuid: str
|
|
163
|
-
config:
|
|
164
|
-
model:
|
|
154
|
+
config: KnowledgeBoxConfig | None = None
|
|
155
|
+
model: SemanticModelMetadata | None = None
|
|
165
156
|
|
|
166
157
|
|
|
167
158
|
class KnowledgeBoxList(BaseModel):
|
|
168
|
-
kbs:
|
|
159
|
+
kbs: list[KnowledgeBoxObjSummary] = []
|
|
169
160
|
|
|
170
161
|
|
|
171
162
|
# Resources
|
|
172
163
|
|
|
173
164
|
|
|
174
165
|
class ExtractedData(BaseModel):
|
|
175
|
-
text:
|
|
176
|
-
metadata:
|
|
177
|
-
large_metadata:
|
|
178
|
-
vectors:
|
|
179
|
-
question_answers:
|
|
166
|
+
text: ExtractedText | None = None
|
|
167
|
+
metadata: FieldComputedMetadata | None = None
|
|
168
|
+
large_metadata: LargeComputedMetadata | None = None
|
|
169
|
+
vectors: VectorObject | None = None
|
|
170
|
+
question_answers: FieldQuestionAnswers | None = None
|
|
180
171
|
|
|
181
172
|
|
|
182
173
|
class TextFieldExtractedData(ExtractedData):
|
|
@@ -184,32 +175,31 @@ class TextFieldExtractedData(ExtractedData):
|
|
|
184
175
|
|
|
185
176
|
|
|
186
177
|
class FileFieldExtractedData(ExtractedData):
|
|
187
|
-
file:
|
|
178
|
+
file: FileExtractedData | None = None
|
|
188
179
|
|
|
189
180
|
|
|
190
181
|
class LinkFieldExtractedData(ExtractedData):
|
|
191
|
-
link:
|
|
182
|
+
link: LinkExtractedData | None = None
|
|
192
183
|
|
|
193
184
|
|
|
194
185
|
class ConversationFieldExtractedData(ExtractedData):
|
|
195
186
|
pass
|
|
196
187
|
|
|
197
188
|
|
|
198
|
-
ExtractedDataType =
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
]
|
|
189
|
+
ExtractedDataType = (
|
|
190
|
+
TextFieldExtractedData
|
|
191
|
+
| FileFieldExtractedData
|
|
192
|
+
| LinkFieldExtractedData
|
|
193
|
+
| ConversationFieldExtractedData
|
|
194
|
+
| None
|
|
195
|
+
)
|
|
206
196
|
|
|
207
197
|
|
|
208
198
|
class Error(BaseModel):
|
|
209
199
|
body: str
|
|
210
200
|
code: int
|
|
211
201
|
code_str: str
|
|
212
|
-
created:
|
|
202
|
+
created: datetime | None
|
|
213
203
|
severity: str
|
|
214
204
|
|
|
215
205
|
|
|
@@ -217,51 +207,51 @@ class FieldData(BaseModel): ...
|
|
|
217
207
|
|
|
218
208
|
|
|
219
209
|
class TextFieldData(BaseModel):
|
|
220
|
-
value:
|
|
221
|
-
extracted:
|
|
222
|
-
error:
|
|
223
|
-
status:
|
|
224
|
-
errors:
|
|
210
|
+
value: FieldText | None = None
|
|
211
|
+
extracted: TextFieldExtractedData | None = None
|
|
212
|
+
error: Error | None = None
|
|
213
|
+
status: str | None = None
|
|
214
|
+
errors: list[Error] | None = None
|
|
225
215
|
|
|
226
216
|
|
|
227
217
|
class FileFieldData(BaseModel):
|
|
228
|
-
value:
|
|
229
|
-
extracted:
|
|
230
|
-
error:
|
|
231
|
-
status:
|
|
232
|
-
errors:
|
|
218
|
+
value: FieldFile | None = None
|
|
219
|
+
extracted: FileFieldExtractedData | None = None
|
|
220
|
+
error: Error | None = None
|
|
221
|
+
status: str | None = None
|
|
222
|
+
errors: list[Error] | None = None
|
|
233
223
|
|
|
234
224
|
|
|
235
225
|
class LinkFieldData(BaseModel):
|
|
236
|
-
value:
|
|
237
|
-
extracted:
|
|
238
|
-
error:
|
|
239
|
-
status:
|
|
240
|
-
errors:
|
|
226
|
+
value: FieldLink | None = None
|
|
227
|
+
extracted: LinkFieldExtractedData | None = None
|
|
228
|
+
error: Error | None = None
|
|
229
|
+
status: str | None = None
|
|
230
|
+
errors: list[Error] | None = None
|
|
241
231
|
|
|
242
232
|
|
|
243
233
|
class ConversationFieldData(BaseModel):
|
|
244
|
-
value:
|
|
245
|
-
extracted:
|
|
246
|
-
error:
|
|
247
|
-
status:
|
|
248
|
-
errors:
|
|
234
|
+
value: FieldConversation | None = None
|
|
235
|
+
extracted: ConversationFieldExtractedData | None = None
|
|
236
|
+
error: Error | None = None
|
|
237
|
+
status: str | None = None
|
|
238
|
+
errors: list[Error] | None = None
|
|
249
239
|
|
|
250
240
|
|
|
251
241
|
class GenericFieldData(BaseModel):
|
|
252
|
-
value:
|
|
253
|
-
extracted:
|
|
254
|
-
error:
|
|
255
|
-
status:
|
|
256
|
-
errors:
|
|
242
|
+
value: str | None = None
|
|
243
|
+
extracted: TextFieldExtractedData | None = None
|
|
244
|
+
error: Error | None = None
|
|
245
|
+
status: str | None = None
|
|
246
|
+
errors: list[Error] | None = None
|
|
257
247
|
|
|
258
248
|
|
|
259
249
|
class ResourceData(BaseModel):
|
|
260
|
-
texts:
|
|
261
|
-
files:
|
|
262
|
-
links:
|
|
263
|
-
conversations:
|
|
264
|
-
generics:
|
|
250
|
+
texts: dict[str, TextFieldData] | None = None
|
|
251
|
+
files: dict[str, FileFieldData] | None = None
|
|
252
|
+
links: dict[str, LinkFieldData] | None = None
|
|
253
|
+
conversations: dict[str, ConversationFieldData] | None = None
|
|
254
|
+
generics: dict[str, GenericFieldData] | None = None
|
|
265
255
|
|
|
266
256
|
|
|
267
257
|
class QueueType(str, Enum):
|
|
@@ -273,29 +263,29 @@ class Resource(BaseModel):
|
|
|
273
263
|
id: str
|
|
274
264
|
|
|
275
265
|
# This first block of attributes correspond to Basic fields
|
|
276
|
-
slug:
|
|
277
|
-
title:
|
|
278
|
-
summary:
|
|
279
|
-
icon:
|
|
280
|
-
thumbnail:
|
|
281
|
-
metadata:
|
|
282
|
-
usermetadata:
|
|
283
|
-
fieldmetadata:
|
|
284
|
-
computedmetadata:
|
|
285
|
-
created:
|
|
286
|
-
modified:
|
|
287
|
-
last_seqid:
|
|
288
|
-
last_account_seq:
|
|
289
|
-
queue:
|
|
290
|
-
hidden:
|
|
291
|
-
|
|
292
|
-
origin:
|
|
293
|
-
extra:
|
|
294
|
-
relations:
|
|
295
|
-
|
|
296
|
-
data:
|
|
297
|
-
|
|
298
|
-
security:
|
|
266
|
+
slug: str | None = None
|
|
267
|
+
title: str | None = None
|
|
268
|
+
summary: str | None = None
|
|
269
|
+
icon: str | None = None
|
|
270
|
+
thumbnail: str | None = None
|
|
271
|
+
metadata: Metadata | None = None
|
|
272
|
+
usermetadata: UserMetadata | None = None
|
|
273
|
+
fieldmetadata: list[UserFieldMetadata] | None = None
|
|
274
|
+
computedmetadata: ComputedMetadata | None = None
|
|
275
|
+
created: datetime | None = None
|
|
276
|
+
modified: datetime | None = None
|
|
277
|
+
last_seqid: int | None = None
|
|
278
|
+
last_account_seq: int | None = None
|
|
279
|
+
queue: QueueType | None = None
|
|
280
|
+
hidden: bool | None = None
|
|
281
|
+
|
|
282
|
+
origin: Origin | None = None
|
|
283
|
+
extra: Extra | None = None
|
|
284
|
+
relations: list[Relation] | None = None
|
|
285
|
+
|
|
286
|
+
data: ResourceData | None = None
|
|
287
|
+
|
|
288
|
+
security: ResourceSecurity | None = Field(
|
|
299
289
|
default=None,
|
|
300
290
|
title="Security",
|
|
301
291
|
description="Resource security metadata",
|
|
@@ -309,19 +299,12 @@ class ResourcePagination(BaseModel):
|
|
|
309
299
|
|
|
310
300
|
|
|
311
301
|
class ResourceList(BaseModel):
|
|
312
|
-
resources:
|
|
302
|
+
resources: list[Resource]
|
|
313
303
|
pagination: ResourcePagination
|
|
314
304
|
|
|
315
305
|
|
|
316
306
|
class ResourceField(BaseModel):
|
|
317
307
|
field_type: FieldTypeName
|
|
318
308
|
field_id: str
|
|
319
|
-
value:
|
|
320
|
-
Union[
|
|
321
|
-
FieldText,
|
|
322
|
-
FieldFile,
|
|
323
|
-
FieldLink,
|
|
324
|
-
Conversation,
|
|
325
|
-
]
|
|
326
|
-
] = None
|
|
309
|
+
value: FieldText | FieldFile | FieldLink | Conversation | None = None
|
|
327
310
|
extracted: ExtractedDataType = None
|