|
|
|
@ -375,19 +375,20 @@ class KnowledgeRetrievalNode(LLMNode):
|
|
|
|
expected_value = self.graph_runtime_state.variable_pool.convert_template(
|
|
|
|
expected_value = self.graph_runtime_state.variable_pool.convert_template(
|
|
|
|
expected_value
|
|
|
|
expected_value
|
|
|
|
).value[0]
|
|
|
|
).value[0]
|
|
|
|
if expected_value.value_type == "number": # type: ignore
|
|
|
|
if hasattr(expected_value, "value_type"):
|
|
|
|
expected_value = expected_value.value # type: ignore
|
|
|
|
if expected_value.value_type == "number": # type: ignore
|
|
|
|
elif expected_value.value_type == "string": # type: ignore
|
|
|
|
expected_value = expected_value.value # type: ignore
|
|
|
|
expected_value = re.sub(r"[\r\n\t]+", " ", expected_value.text).strip() # type: ignore
|
|
|
|
elif expected_value.value_type == "string": # type: ignore
|
|
|
|
elif expected_value.value_type in (
|
|
|
|
expected_value = re.sub(r"[\r\n\t]+", " ", expected_value.text).strip() # type: ignore
|
|
|
|
"array[number]",
|
|
|
|
elif expected_value.value_type in (
|
|
|
|
"array[string]",
|
|
|
|
"array[number]",
|
|
|
|
"array[object]",
|
|
|
|
"array[string]",
|
|
|
|
"array",
|
|
|
|
"array[object]",
|
|
|
|
): # type: ignore
|
|
|
|
"array",
|
|
|
|
expected_value = expected_value.value # type: ignore
|
|
|
|
): # type: ignore
|
|
|
|
else:
|
|
|
|
expected_value = expected_value.value # type: ignore
|
|
|
|
raise ValueError("Invalid expected metadata value type")
|
|
|
|
else:
|
|
|
|
|
|
|
|
raise ValueError("Invalid expected metadata value type")
|
|
|
|
elif isinstance(expected_value, list):
|
|
|
|
elif isinstance(expected_value, list):
|
|
|
|
# For constant array values
|
|
|
|
# For constant array values
|
|
|
|
pass
|
|
|
|
pass
|
|
|
|
|