fix metadata
This commit is contained in:
parent
5b4589951d
commit
7990219aa4
@ -103,9 +103,9 @@ class Condition(BaseModel):
|
||||
Conditon detail
|
||||
"""
|
||||
|
||||
metadata_name: str
|
||||
name: str
|
||||
comparison_operator: SupportedComparisonOperator
|
||||
value: str | Sequence[str] | None = None
|
||||
value: str | Sequence[str] | None | int | float = None
|
||||
|
||||
|
||||
class MetadataFilteringCondition(BaseModel):
|
||||
|
@ -301,7 +301,7 @@ class KnowledgeRetrievalNode(LLMNode):
|
||||
)
|
||||
elif node_data.metadata_filtering_mode == "manual":
|
||||
for condition in node_data.metadata_filtering_conditions.conditions:
|
||||
metadata_name = condition.metadata_name
|
||||
metadata_name = condition.name
|
||||
expected_value = condition.value
|
||||
if isinstance(expected_value, str):
|
||||
expected_value = self.graph_runtime_state.variable_pool.convert_template(expected_value).text
|
||||
@ -380,7 +380,7 @@ class KnowledgeRetrievalNode(LLMNode):
|
||||
return []
|
||||
return automatic_metadata_filters
|
||||
|
||||
def _process_metadata_filter_func(*, condition: str, metadata_name: str, value: str, query):
|
||||
def _process_metadata_filter_func(self, condition: str, metadata_name: str, value: str, query):
|
||||
match condition:
|
||||
case "contains":
|
||||
query = query.filter(Document.doc_metadata[metadata_name].like(f"%{value}%"))
|
||||
|
Loading…
Reference in New Issue
Block a user