nucliadb-models 6.9.2.post5275__py3-none-any.whl → 6.9.2.post5282__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/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
- "d": "datetime",
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'.", # noqa: E501
1183
- min_length=1,
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
- @field_validator("fields", mode="after")
1187
- @classmethod
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):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nucliadb_models
3
- Version: 6.9.2.post5275
3
+ Version: 6.9.2.post5282
4
4
  Author-email: Nuclia <nucliadb@nuclia.com>
5
5
  License-Expression: Apache-2.0
6
6
  Project-URL: Homepage, https://nuclia.com
@@ -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=95ZvFFZPtxOLSKMXp-_EK5Tcrs0voB8L8P72H5AiP0g,96105
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.post5275.dist-info/METADATA,sha256=nCnsWEzCf8RJ5NU1BqsEnG9ofexTIudTrTshw453nGU,745
37
- nucliadb_models-6.9.2.post5275.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
38
- nucliadb_models-6.9.2.post5275.dist-info/top_level.txt,sha256=UrY1I8oeovIRwkXLYplssTrxQdUjhSEFDFbnwaIV3tA,16
39
- nucliadb_models-6.9.2.post5275.dist-info/RECORD,,
36
+ nucliadb_models-6.9.2.post5282.dist-info/METADATA,sha256=h112T7kGs5xMF-sWHZYYd1tVWmqk2Mt9LXvzhPulEwg,745
37
+ nucliadb_models-6.9.2.post5282.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
38
+ nucliadb_models-6.9.2.post5282.dist-info/top_level.txt,sha256=UrY1I8oeovIRwkXLYplssTrxQdUjhSEFDFbnwaIV3tA,16
39
+ nucliadb_models-6.9.2.post5282.dist-info/RECORD,,