nucliadb-models 6.3.4.post3705__py3-none-any.whl → 6.3.4.post3721__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/graph/requests.py +41 -1
- {nucliadb_models-6.3.4.post3705.dist-info → nucliadb_models-6.3.4.post3721.dist-info}/METADATA +2 -2
- {nucliadb_models-6.3.4.post3705.dist-info → nucliadb_models-6.3.4.post3721.dist-info}/RECORD +5 -5
- {nucliadb_models-6.3.4.post3705.dist-info → nucliadb_models-6.3.4.post3721.dist-info}/WHEEL +1 -1
- {nucliadb_models-6.3.4.post3705.dist-info → nucliadb_models-6.3.4.post3721.dist-info}/top_level.txt +0 -0
|
@@ -23,8 +23,10 @@ from typing import Annotated, Literal, Optional, Union
|
|
|
23
23
|
from pydantic import BaseModel, Discriminator, Field, Tag, model_validator
|
|
24
24
|
from typing_extensions import Self
|
|
25
25
|
|
|
26
|
-
from nucliadb_models.filters import And, Not, Or, filter_discriminator
|
|
26
|
+
from nucliadb_models.filters import And, FieldFilterExpression, Not, Or, filter_discriminator
|
|
27
27
|
from nucliadb_models.metadata import RelationNodeType, RelationType
|
|
28
|
+
from nucliadb_models.search import SearchParamDefaults
|
|
29
|
+
from nucliadb_models.security import RequestSecurity
|
|
28
30
|
|
|
29
31
|
## Models for graph nodes and relations
|
|
30
32
|
|
|
@@ -116,8 +118,26 @@ GraphPathQuery = Annotated[
|
|
|
116
118
|
]
|
|
117
119
|
|
|
118
120
|
|
|
121
|
+
class GraphFilterExpression(BaseModel, extra="forbid"):
|
|
122
|
+
"""Returns only relations from documents that match this filter expression.
|
|
123
|
+
Filtering examples can be found here: https://docs.nuclia.dev/docs/rag/advanced/search_filters
|
|
124
|
+
"""
|
|
125
|
+
|
|
126
|
+
field: FieldFilterExpression = Field(description="Filter to apply to fields")
|
|
127
|
+
|
|
128
|
+
|
|
119
129
|
class GraphSearchRequest(BaseGraphSearchRequest):
|
|
120
130
|
query: GraphPathQuery
|
|
131
|
+
filter_expression: Optional[GraphFilterExpression] = Field(
|
|
132
|
+
default=None,
|
|
133
|
+
title="Filter resource by an expression",
|
|
134
|
+
description=(
|
|
135
|
+
"Returns only relations from documents that match this filter expression."
|
|
136
|
+
"Filtering examples can be found here: https://docs.nuclia.dev/docs/rag/advanced/search_filters "
|
|
137
|
+
),
|
|
138
|
+
)
|
|
139
|
+
security: Optional[RequestSecurity] = SearchParamDefaults.security.to_pydantic_field()
|
|
140
|
+
show_hidden: bool = SearchParamDefaults.show_hidden.to_pydantic_field()
|
|
121
141
|
|
|
122
142
|
|
|
123
143
|
# Nodes search
|
|
@@ -135,6 +155,16 @@ GraphNodesQuery = Annotated[
|
|
|
135
155
|
|
|
136
156
|
class GraphNodesSearchRequest(BaseGraphSearchRequest):
|
|
137
157
|
query: GraphNodesQuery
|
|
158
|
+
filter_expression: Optional[GraphFilterExpression] = Field(
|
|
159
|
+
default=None,
|
|
160
|
+
title="Filter resource by an expression",
|
|
161
|
+
description=(
|
|
162
|
+
"Returns only relations from documents that match this filter expression."
|
|
163
|
+
"Filtering examples can be found here: https://docs.nuclia.dev/docs/rag/advanced/search_filters "
|
|
164
|
+
),
|
|
165
|
+
)
|
|
166
|
+
security: Optional[RequestSecurity] = SearchParamDefaults.security.to_pydantic_field()
|
|
167
|
+
show_hidden: bool = SearchParamDefaults.show_hidden.to_pydantic_field()
|
|
138
168
|
|
|
139
169
|
|
|
140
170
|
# Relations search
|
|
@@ -152,6 +182,16 @@ GraphRelationsQuery = Annotated[
|
|
|
152
182
|
|
|
153
183
|
class GraphRelationsSearchRequest(BaseGraphSearchRequest):
|
|
154
184
|
query: GraphRelationsQuery
|
|
185
|
+
filter_expression: Optional[GraphFilterExpression] = Field(
|
|
186
|
+
default=None,
|
|
187
|
+
title="Filter resource by an expression",
|
|
188
|
+
description=(
|
|
189
|
+
"Returns only relations from documents that match this filter expression."
|
|
190
|
+
"Filtering examples can be found here: https://docs.nuclia.dev/docs/rag/advanced/search_filters "
|
|
191
|
+
),
|
|
192
|
+
)
|
|
193
|
+
security: Optional[RequestSecurity] = SearchParamDefaults.security.to_pydantic_field()
|
|
194
|
+
show_hidden: bool = SearchParamDefaults.show_hidden.to_pydantic_field()
|
|
155
195
|
|
|
156
196
|
|
|
157
197
|
# We need this to avoid issues with pydantic and generic types defined in another module
|
{nucliadb_models-6.3.4.post3705.dist-info → nucliadb_models-6.3.4.post3721.dist-info}/RECORD
RENAMED
|
@@ -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=
|
|
30
|
+
nucliadb_models/graph/requests.py,sha256=4fJgX7vti3aY6iMKC4EFMEg9MSUnh-sWeiMZPTqHQyI,6616
|
|
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.
|
|
36
|
-
nucliadb_models-6.3.4.
|
|
37
|
-
nucliadb_models-6.3.4.
|
|
38
|
-
nucliadb_models-6.3.4.
|
|
35
|
+
nucliadb_models-6.3.4.post3721.dist-info/METADATA,sha256=QlqYSc8PRhLDzkcojiOAG-wBY7o1eXBr2lrzYE8dKT4,759
|
|
36
|
+
nucliadb_models-6.3.4.post3721.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
|
|
37
|
+
nucliadb_models-6.3.4.post3721.dist-info/top_level.txt,sha256=UrY1I8oeovIRwkXLYplssTrxQdUjhSEFDFbnwaIV3tA,16
|
|
38
|
+
nucliadb_models-6.3.4.post3721.dist-info/RECORD,,
|
{nucliadb_models-6.3.4.post3705.dist-info → nucliadb_models-6.3.4.post3721.dist-info}/top_level.txt
RENAMED
|
File without changes
|