nucliadb-models 6.9.2.post5254__py3-none-any.whl → 6.9.3.post5346__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.

@@ -86,7 +86,7 @@ class FieldConversation(BaseModel):
86
86
 
87
87
 
88
88
  class InputMessageContent(BaseModel):
89
- text: str = Field(max_length=10 * 1024)
89
+ text: str = Field()
90
90
  format: MessageFormat = MessageFormat.PLAIN
91
91
  attachments: List[FileB64] = Field(default=[], max_length=50)
92
92
  attachments_fields: List[FieldRef] = Field(default=[], max_length=50)
@@ -129,7 +129,6 @@ class InputConversationField(BaseModel):
129
129
  messages: List[InputMessage] = Field(
130
130
  default_factory=list,
131
131
  description="List of messages in the conversation field. Each message must have a unique ident. A single conversation can contain up to 51,200 messages. You can add up to 2,048 messages per request.",
132
- max_length=2048,
133
132
  )
134
133
  extract_strategy: Optional[str] = Field(
135
134
  default=None,
@@ -246,10 +246,11 @@ class Hydration(BaseModel, extra="forbid"):
246
246
  ParagraphId = Annotated[
247
247
  str,
248
248
  StringConstraints(
249
- pattern=r"^[0-9a-f]{32}/[acftu]/[a-zA-Z0-9:_-]+/[0-9]+-[0-9]+$",
250
- min_length=32 + 1 + 1 + 1 + 1 + 1 + 3,
249
+ # resource-uuid/field-type/field-id/[split-id/]paragraph-id
250
+ pattern=r"^[0-9a-f]{32}/[acftu]/[a-zA-Z0-9:_-]+/([^/]{1,128}/)?[0-9]+-[0-9]+$",
251
+ min_length=32 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 3,
251
252
  # max field id of 250 and 10 digit paragraphs. More than enough
252
- max_length=32 + 1 + 1 + 1 + 250 + 1 + 21,
253
+ max_length=32 + 1 + 1 + 1 + 250 + 1 + 128 + 1 + 21,
253
254
  ),
254
255
  ]
255
256
 
nucliadb_models/search.py CHANGED
@@ -79,8 +79,9 @@ ANSWER_JSON_SCHEMA_EXAMPLE = {
79
79
  class ModelParamDefaults:
80
80
  applied_autofilters = ParamDefault(
81
81
  default=[],
82
- title="Autofilters",
83
- description="List of filters automatically applied to the search query",
82
+ title="Applied autofilters",
83
+ description="[deprecated] list of filters automatically applied to the search query",
84
+ deprecated=True,
84
85
  )
85
86
 
86
87
 
@@ -296,6 +297,8 @@ class KnowledgeboxSearchResults(JsonBaseModel):
296
297
  relations: Optional[Relations] = None
297
298
  nodes: Optional[list[dict[str, str]]] = None
298
299
  shards: Optional[list[str]] = None
300
+
301
+ # TODO: remove on a future major release
299
302
  autofilters: list[str] = ModelParamDefaults.applied_autofilters.to_pydantic_field()
300
303
 
301
304
 
@@ -481,12 +484,6 @@ class SearchParamDefaults:
481
484
  description="The list of facets to calculate. The facets follow the same syntax as filters: https://docs.nuclia.dev/docs/rag/advanced/search-filters", # noqa: E501
482
485
  max_items=50,
483
486
  )
484
- autofilter = ParamDefault(
485
- default=False,
486
- title="Automatic search filtering",
487
- description="[Deprecated] If set to true, the search will automatically add filters to the query. For example, it will filter results containing the entities detected in the query", # noqa: E501
488
- deprecated=True,
489
- )
490
487
  chat_query = ParamDefault(
491
488
  default=...,
492
489
  title="Query",
@@ -877,7 +874,9 @@ class BaseSearchRequest(AuditMetadataBase):
877
874
  vectorset: Optional[str] = SearchParamDefaults.vectorset.to_pydantic_field()
878
875
  with_duplicates: bool = SearchParamDefaults.with_duplicates.to_pydantic_field()
879
876
  with_synonyms: bool = SearchParamDefaults.with_synonyms.to_pydantic_field()
880
- autofilter: bool = SearchParamDefaults.autofilter.to_pydantic_field()
877
+ # autofilter is deprecated and its logic was removed. We're just keeping it in the model definition to
878
+ # avoid breaking changes in the python sdks. Please remove on a future major release.
879
+ autofilter: SkipJsonSchema[bool] = False
881
880
  resource_filters: list[str] = SearchParamDefaults.resource_filters.to_pydantic_field()
882
881
  security: Optional[RequestSecurity] = SearchParamDefaults.security.to_pydantic_field()
883
882
  show_hidden: bool = SearchParamDefaults.show_hidden.to_pydantic_field()
@@ -1171,7 +1170,7 @@ ALLOWED_FIELD_TYPES: dict[str, str] = {
1171
1170
  "t": "text",
1172
1171
  "f": "file",
1173
1172
  "u": "link",
1174
- "d": "datetime",
1173
+ "c": "conversation",
1175
1174
  "a": "generic",
1176
1175
  }
1177
1176
 
@@ -1179,16 +1178,19 @@ ALLOWED_FIELD_TYPES: dict[str, str] = {
1179
1178
  class FieldExtensionStrategy(RagStrategy):
1180
1179
  name: Literal["field_extension"] = "field_extension"
1181
1180
  fields: list[str] = Field(
1181
+ default=[],
1182
1182
  title="Fields",
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'.", # noqa: E501
1184
- 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.",
1185
1188
  )
1186
1189
 
1187
- @field_validator("fields", mode="after")
1188
- @classmethod
1189
- def fields_validator(cls, fields) -> Self:
1190
+ @model_validator(mode="after")
1191
+ def field_extension_strategy_validator(self) -> Self:
1190
1192
  # Check that the fields are in the format {field_type}/{field_name}
1191
- for field in fields:
1193
+ for field in self.fields:
1192
1194
  try:
1193
1195
  field_type, _ = field.strip("/").split("/")
1194
1196
  except ValueError:
@@ -1201,8 +1203,7 @@ class FieldExtensionStrategy(RagStrategy):
1201
1203
  f"Field '{field}' does not have a valid field type. "
1202
1204
  f"Valid field types are: {allowed_field_types_part}."
1203
1205
  )
1204
-
1205
- return fields
1206
+ return self
1206
1207
 
1207
1208
 
1208
1209
  class FullResourceApplyTo(BaseModel):
@@ -1620,7 +1621,11 @@ class AskRequest(AuditMetadataBase):
1620
1621
  description="Image that will be used together with the query text for retrieval and then sent to the LLM as part of the context. "
1621
1622
  "If a query image is provided, the `extra_context_images` and `rag_images_strategies` will be disabled.",
1622
1623
  )
1623
- autofilter: bool = SearchParamDefaults.autofilter.to_pydantic_field()
1624
+
1625
+ # autofilter is deprecated and its logic was removed. We're just keeping it in the model definition to
1626
+ # avoid breaking changes in the python sdks. Please remove on a future major release.
1627
+ autofilter: SkipJsonSchema[bool] = False
1628
+
1624
1629
  highlight: bool = SearchParamDefaults.highlight.to_pydantic_field()
1625
1630
  resource_filters: list[str] = SearchParamDefaults.resource_filters.to_pydantic_field()
1626
1631
  prompt: Optional[Union[str, CustomPrompt]] = Field(
@@ -1,19 +1,18 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nucliadb_models
3
- Version: 6.9.2.post5254
3
+ Version: 6.9.3.post5346
4
4
  Author-email: Nuclia <nucliadb@nuclia.com>
5
5
  License-Expression: Apache-2.0
6
6
  Project-URL: Homepage, https://nuclia.com
7
7
  Project-URL: Repository, https://github.com/nuclia/nucliadb
8
8
  Classifier: Development Status :: 4 - Beta
9
9
  Classifier: Programming Language :: Python
10
- Classifier: Programming Language :: Python :: 3.9
11
10
  Classifier: Programming Language :: Python :: 3.10
12
11
  Classifier: Programming Language :: Python :: 3.11
13
12
  Classifier: Programming Language :: Python :: 3.12
14
13
  Classifier: Programming Language :: Python :: 3 :: Only
15
14
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
16
- Requires-Python: <4,>=3.9
15
+ Requires-Python: <4,>=3.10
17
16
  Description-Content-Type: text/markdown
18
17
  Requires-Dist: pydantic!=2.11.5,!=2.11.6,>=2.6
19
18
 
@@ -2,14 +2,14 @@ nucliadb_models/__init__.py,sha256=3y8-htogKuCZcbhaUZdSjTeEjUSeec9aRWyL8AlKCyM,1
2
2
  nucliadb_models/common.py,sha256=2dtKG4ZNi9p-yoNY76Uvyu1SlMeNYpH-MnuU3Q6w9Js,8169
3
3
  nucliadb_models/configuration.py,sha256=BBrJsNjP324Cw_5J3dBrGwvpkHQYbXEo3TUaI9IqAOg,2449
4
4
  nucliadb_models/content_types.py,sha256=36Ga-iGf4ivCqgtXC7imFgegrwHB117s9eqP62JtGv0,3456
5
- nucliadb_models/conversation.py,sha256=Ts-h7gMf18rw9tbjF2X__vNtMshHRDqbLua_VXb1qOE,5126
5
+ nucliadb_models/conversation.py,sha256=k9bKhkDiqhqmdrDfDPNoUfG7-2H_-KAyuOnETd8zV0E,5081
6
6
  nucliadb_models/entities.py,sha256=i-7Y8qmFRRTih5zw0ajv1U_iiXexe66M3TK8hUikQZk,2356
7
7
  nucliadb_models/export_import.py,sha256=mNm9IArOLnC6TLupkwqVFhxD5d08mpIVOVFneECv8UA,1073
8
8
  nucliadb_models/external_index_providers.py,sha256=pL3leo4MkuJOnKlU1Sg6GT_mnK_VUBxGui-RPmDYVWU,1126
9
9
  nucliadb_models/extracted.py,sha256=Owz7LC3le3Dvau3TtRiO8NY84meOf6IxN-RrOqqpMPs,5593
10
10
  nucliadb_models/file.py,sha256=tXtgB9c7i2ADsnJ7HdbXyroAmXadGvOeA49htBh7BZo,2263
11
11
  nucliadb_models/filters.py,sha256=NQI2-4AFzzJuZy8NeY3jXlTbbU5wxiwMCP-5DrD-7lE,14759
12
- nucliadb_models/hydration.py,sha256=7SFnAcTQRE9etVccpph6aA1AUqsHVwkzT4YF6Uzl0Gs,14262
12
+ nucliadb_models/hydration.py,sha256=Yo8eM99q9wcaCJj8stL5z3k63ouC3LVANZIZLULZxRQ,14363
13
13
  nucliadb_models/labels.py,sha256=9zqRgkpZuX3kUPwsTTgCH7JyOWK7dM5pwyuHJR86YdU,3949
14
14
  nucliadb_models/link.py,sha256=PF5hHLwdOed5TMBTxtokkgWtMh1bFnORZjybh0NwVCw,2526
15
15
  nucliadb_models/metadata.py,sha256=OOKGy_83NtlG1QKQZEwMuwu4wbVEe7P30Y2QvnGSDto,8933
@@ -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=tUedQpOY1OKnhCybnU-0dae3f6QjoN3rDVhwgDgLj5Y,96008
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.post5254.dist-info/METADATA,sha256=tm8qgHEYjjOdfu1xJeFlvKgEKhqRrBwKSBEfOQqZEpg,794
37
- nucliadb_models-6.9.2.post5254.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
38
- nucliadb_models-6.9.2.post5254.dist-info/top_level.txt,sha256=UrY1I8oeovIRwkXLYplssTrxQdUjhSEFDFbnwaIV3tA,16
39
- nucliadb_models-6.9.2.post5254.dist-info/RECORD,,
36
+ nucliadb_models-6.9.3.post5346.dist-info/METADATA,sha256=BOTbOylsqvvrFfcED7AD3qnYGEBib8Q66Q0amWDcXDw,745
37
+ nucliadb_models-6.9.3.post5346.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
38
+ nucliadb_models-6.9.3.post5346.dist-info/top_level.txt,sha256=UrY1I8oeovIRwkXLYplssTrxQdUjhSEFDFbnwaIV3tA,16
39
+ nucliadb_models-6.9.3.post5346.dist-info/RECORD,,