nucliadb-models 6.9.2.post5275__py3-none-any.whl → 6.9.2.post5276__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.
- nucliadb_models/search.py +11 -9
- {nucliadb_models-6.9.2.post5275.dist-info → nucliadb_models-6.9.2.post5276.dist-info}/METADATA +1 -1
- {nucliadb_models-6.9.2.post5275.dist-info → nucliadb_models-6.9.2.post5276.dist-info}/RECORD +5 -5
- {nucliadb_models-6.9.2.post5275.dist-info → nucliadb_models-6.9.2.post5276.dist-info}/WHEEL +0 -0
- {nucliadb_models-6.9.2.post5275.dist-info → nucliadb_models-6.9.2.post5276.dist-info}/top_level.txt +0 -0
nucliadb_models/search.py
CHANGED
|
@@ -1170,7 +1170,7 @@ ALLOWED_FIELD_TYPES: dict[str, str] = {
|
|
|
1170
1170
|
"t": "text",
|
|
1171
1171
|
"f": "file",
|
|
1172
1172
|
"u": "link",
|
|
1173
|
-
"
|
|
1173
|
+
"c": "conversation",
|
|
1174
1174
|
"a": "generic",
|
|
1175
1175
|
}
|
|
1176
1176
|
|
|
@@ -1178,16 +1178,19 @@ ALLOWED_FIELD_TYPES: dict[str, str] = {
|
|
|
1178
1178
|
class FieldExtensionStrategy(RagStrategy):
|
|
1179
1179
|
name: Literal["field_extension"] = "field_extension"
|
|
1180
1180
|
fields: list[str] = Field(
|
|
1181
|
+
default=[],
|
|
1181
1182
|
title="Fields",
|
|
1182
|
-
description="List of field ids to extend the context with. It will try to extend the retrieval context with the specified fields in the matching resources. The field ids have to be in the format `{field_type}/{field_name}`, like 'a/title', 'a/summary' for title and summary fields or 't/amend' for a text field named 'amend'.",
|
|
1183
|
-
|
|
1183
|
+
description="List of field ids to extend the context with. It will try to extend the retrieval context with the specified fields in the matching resources. The field ids have to be in the format `{field_type}/{field_name}`, like 'a/title', 'a/summary' for title and summary fields or 't/amend' for a text field named 'amend'.",
|
|
1184
|
+
)
|
|
1185
|
+
data_augmentation_field_prefixes: list[str] = Field(
|
|
1186
|
+
default=[],
|
|
1187
|
+
description="List of prefixes for data augmentation added fields to extend the context with. For example, if the prefix is 'simpson', all fields that are a result of data augmentation with that prefix will be used to extend the context.",
|
|
1184
1188
|
)
|
|
1185
1189
|
|
|
1186
|
-
@
|
|
1187
|
-
|
|
1188
|
-
def fields_validator(cls, fields) -> Self:
|
|
1190
|
+
@model_validator(mode="after")
|
|
1191
|
+
def field_extension_strategy_validator(self) -> Self:
|
|
1189
1192
|
# Check that the fields are in the format {field_type}/{field_name}
|
|
1190
|
-
for field in fields:
|
|
1193
|
+
for field in self.fields:
|
|
1191
1194
|
try:
|
|
1192
1195
|
field_type, _ = field.strip("/").split("/")
|
|
1193
1196
|
except ValueError:
|
|
@@ -1200,8 +1203,7 @@ class FieldExtensionStrategy(RagStrategy):
|
|
|
1200
1203
|
f"Field '{field}' does not have a valid field type. "
|
|
1201
1204
|
f"Valid field types are: {allowed_field_types_part}."
|
|
1202
1205
|
)
|
|
1203
|
-
|
|
1204
|
-
return fields
|
|
1206
|
+
return self
|
|
1205
1207
|
|
|
1206
1208
|
|
|
1207
1209
|
class FullResourceApplyTo(BaseModel):
|
{nucliadb_models-6.9.2.post5275.dist-info → nucliadb_models-6.9.2.post5276.dist-info}/RECORD
RENAMED
|
@@ -17,7 +17,7 @@ nucliadb_models/notifications.py,sha256=mna8-AoD_29Wds0Thl0AF0zpERnJmYGLZX1w1fUo
|
|
|
17
17
|
nucliadb_models/processing.py,sha256=nhKuHQjqCdb9zJVkYGPTLub23tK9e_lwL5OCDVymZjY,719
|
|
18
18
|
nucliadb_models/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
19
19
|
nucliadb_models/resource.py,sha256=RzCos0QRgSMkaV-p7EoceSmt7UTzt9G9be5BKF-iGrQ,9021
|
|
20
|
-
nucliadb_models/search.py,sha256=
|
|
20
|
+
nucliadb_models/search.py,sha256=gQEXJ9bXXcxswr7aOzvBeGIQlrq5TgRWIqTxKEbSoCE,96409
|
|
21
21
|
nucliadb_models/security.py,sha256=opxaDLfvk3aU0sjesK0jGrYLx5h4YCwlKKN0moYs_ig,1150
|
|
22
22
|
nucliadb_models/synonyms.py,sha256=afbaVqSQSxGLwi2PusVaLSRpkOtA5AZmWOKd1f4nl2E,690
|
|
23
23
|
nucliadb_models/text.py,sha256=60bxZnOjRHnDdezR8VfR3AZsXTOwePFPs2BKB8wxBak,3414
|
|
@@ -33,7 +33,7 @@ nucliadb_models/graph/responses.py,sha256=Sdq8OgFAL1YT-1lJyLLrkqcScvj7YTEqAUwQ-k
|
|
|
33
33
|
nucliadb_models/internal/__init__.py,sha256=zG33bUz1rHFPtvqQPWn4rDwBJt3FJodGuQYD45quiQg,583
|
|
34
34
|
nucliadb_models/internal/predict.py,sha256=Pnx6MmLfK65eExe1XnVxqmSlvMwdowewwks9BOEoqMw,2029
|
|
35
35
|
nucliadb_models/internal/shards.py,sha256=__y1OZtWGiNcPQEWfSFOj8yw458WGi7mM4vZe0K-L1Y,1691
|
|
36
|
-
nucliadb_models-6.9.2.
|
|
37
|
-
nucliadb_models-6.9.2.
|
|
38
|
-
nucliadb_models-6.9.2.
|
|
39
|
-
nucliadb_models-6.9.2.
|
|
36
|
+
nucliadb_models-6.9.2.post5276.dist-info/METADATA,sha256=-kzs6LaR18FXQmyL87mIkJuOTwmGhctfqrU9Rn1AGuY,745
|
|
37
|
+
nucliadb_models-6.9.2.post5276.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
38
|
+
nucliadb_models-6.9.2.post5276.dist-info/top_level.txt,sha256=UrY1I8oeovIRwkXLYplssTrxQdUjhSEFDFbnwaIV3tA,16
|
|
39
|
+
nucliadb_models-6.9.2.post5276.dist-info/RECORD,,
|
|
File without changes
|
{nucliadb_models-6.9.2.post5275.dist-info → nucliadb_models-6.9.2.post5276.dist-info}/top_level.txt
RENAMED
|
File without changes
|