nucliadb-models 6.3.4.post3769__py3-none-any.whl → 6.3.4.post3785__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.

@@ -87,6 +87,29 @@ class GraphPath(BaseModel, extra="forbid"):
87
87
  undirected: bool = False
88
88
 
89
89
 
90
+ class Generator(str, Enum):
91
+ DATA_AUGMENTATION = "data-augmentation"
92
+ PROCESSOR = "processor"
93
+ USER = "user"
94
+
95
+
96
+ class Generated(BaseModel, extra="forbid"):
97
+ """Matches if the relation was generated by the given source"""
98
+
99
+ prop: Literal["generated"]
100
+ by: Generator = Field(description="Generator for this field.")
101
+ da_task: Optional["str"] = Field(
102
+ default=None, description="Matches relations generated by an specific DA task, given its prefix"
103
+ )
104
+
105
+ @model_validator(mode="after")
106
+ def validate_fuzzy_usage(self) -> Self:
107
+ if self.by != Generator.DATA_AUGMENTATION and self.da_task is not None:
108
+ raise ValueError("da_task can only be specified if by=data-augmentation")
109
+
110
+ return self
111
+
112
+
90
113
  ## Requests models
91
114
 
92
115
 
@@ -113,6 +136,8 @@ GraphPathQuery = Annotated[
113
136
  Annotated[AnyNode, Tag("node")],
114
137
  # relations
115
138
  Annotated[Relation, Tag("relation")],
139
+ # metadata
140
+ Annotated[Generated, Tag("generated")],
116
141
  ],
117
142
  Discriminator(graph_query_discriminator),
118
143
  ]
@@ -148,6 +173,7 @@ GraphNodesQuery = Annotated[
148
173
  Annotated[Or["GraphNodesQuery"], Tag("or")],
149
174
  Annotated[Not["GraphNodesQuery"], Tag("not")],
150
175
  Annotated[AnyNode, Tag("node")],
176
+ Annotated[Generated, Tag("generated")],
151
177
  ],
152
178
  Discriminator(graph_query_discriminator),
153
179
  ]
@@ -175,6 +201,7 @@ GraphRelationsQuery = Annotated[
175
201
  Annotated[Or["GraphRelationsQuery"], Tag("or")],
176
202
  Annotated[Not["GraphRelationsQuery"], Tag("not")],
177
203
  Annotated[Relation, Tag("relation")],
204
+ Annotated[Generated, Tag("generated")],
178
205
  ],
179
206
  Discriminator(graph_query_discriminator),
180
207
  ]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nucliadb_models
3
- Version: 6.3.4.post3769
3
+ Version: 6.3.4.post3785
4
4
  Author-email: Nuclia <nucliadb@nuclia.com>
5
5
  License: AGPL
6
6
  Project-URL: Homepage, https://nuclia.com
@@ -27,12 +27,12 @@ nucliadb_models/vectorsets.py,sha256=avxwO9JPX2k5sCniuNhh2MSsP7aRNvf1eB1-h3-Ju1o
27
27
  nucliadb_models/writer.py,sha256=OLtCGmicpVf56pXi2_myTAvStpnaBKKOVNtZzHkKKtw,8472
28
28
  nucliadb_models/agents/ingestion.py,sha256=mV7gV6VpYg4VNpc59K3275TMUJZbUzeUnp3SZzO5uxY,3137
29
29
  nucliadb_models/graph/__init__.py,sha256=eu_1UK7GlBQRg5IRUqJkxVMcBxkXeqX4SZL6fuvwjDg,897
30
- nucliadb_models/graph/requests.py,sha256=4fJgX7vti3aY6iMKC4EFMEg9MSUnh-sWeiMZPTqHQyI,6616
30
+ nucliadb_models/graph/requests.py,sha256=vbfaGVlVmgrflIwr1yV4DJEteVHsbL8wJMQb-olLFSA,7528
31
31
  nucliadb_models/graph/responses.py,sha256=3aimAHrd3YW1BXHU_ZXRoidlccRtkCcREkfCNotqgIQ,1651
32
32
  nucliadb_models/internal/__init__.py,sha256=cp15ZcFnHvpcu_5-aK2A4uUyvuZVV_MJn4bIXMa20ks,835
33
33
  nucliadb_models/internal/predict.py,sha256=5rgUPrH_98gerySOZ-TR2PX_qzCGF1_8VxyOu3bGhis,2281
34
34
  nucliadb_models/internal/shards.py,sha256=uZLsMkYWrJDHq3xy_w7snSeV2X3aDBuht9GC_MG3sKc,1976
35
- nucliadb_models-6.3.4.post3769.dist-info/METADATA,sha256=m6G0Ii8ZlEHODkAWUJdzfv9XHR30jWXSvKJ183uijL8,759
36
- nucliadb_models-6.3.4.post3769.dist-info/WHEEL,sha256=L0N565qmK-3nM2eBoMNFszYJ_MTx03_tQ0CQu1bHLYo,91
37
- nucliadb_models-6.3.4.post3769.dist-info/top_level.txt,sha256=UrY1I8oeovIRwkXLYplssTrxQdUjhSEFDFbnwaIV3tA,16
38
- nucliadb_models-6.3.4.post3769.dist-info/RECORD,,
35
+ nucliadb_models-6.3.4.post3785.dist-info/METADATA,sha256=PWZuMFRnJBE6gsGiFGd9aOteKLj7Bm1FeLx9LPhzAeM,759
36
+ nucliadb_models-6.3.4.post3785.dist-info/WHEEL,sha256=DK49LOLCYiurdXXOXwGJm6U4DkHkg4lcxjhqwRa0CP4,91
37
+ nucliadb_models-6.3.4.post3785.dist-info/top_level.txt,sha256=UrY1I8oeovIRwkXLYplssTrxQdUjhSEFDFbnwaIV3tA,16
38
+ nucliadb_models-6.3.4.post3785.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (78.0.1)
2
+ Generator: setuptools (78.0.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5