Metadata variable value fix (#16665)

This commit is contained in:
Jyong
2025-03-25 09:07:11 +08:00
committed by GitHub
parent 360986f38d
commit 86a1859d02
2 changed files with 12 additions and 3 deletions

View File

@@ -900,7 +900,10 @@ class DatasetRetrieval:
return str(inputs.get(key, f"{{{{{key}}}}}"))
pattern = re.compile(r"\{\{(\w+)\}\}")
return pattern.sub(replacer, text)
output = pattern.sub(replacer, text)
if isinstance(output, str):
output = re.sub(r"[\r\n\t]+", " ", output).strip()
return output
def _automatic_metadata_filter_func(
self, dataset_ids: list, query: str, tenant_id: str, user_id: str, metadata_model_config: ModelConfig