Skip to content

armgit / sie

Public Imported from GitHub
0

Open-source inference server and production cluster for all the models your agent needs.

fix: validate unsupported template placeholders (#249)

Roopak0508e17aa323
diff --git a/packages/sie_server/src/sie_server/adapters/_utils.py b/packages/sie_server/src/sie_server/adapters/_utils.py
index ff31509f1..fd871d83d 100644
--- a/packages/sie_server/src/sie_server/adapters/_utils.py
+++ b/packages/sie_server/src/sie_server/adapters/_utils.py
@@ -117,7 +117,11 @@ def extract_texts(
kwargs: dict[str, str] = {"text": text}
if "{instruction}" in template:
kwargs["instruction"] = instruction or ""
- text = template.format(**kwargs)
+
+ try:
+ text = template.format(**kwargs)
+ except KeyError as exc:
+ raise ValueError(f"Unsupported template placeholder: {exc.args[0]!r}") from exc
elif instruction:
text = f"{instruction} {text}"