mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-04-22 21:59:55 +08:00
fix: prompt variables validate when using external data tools (#1465)
This commit is contained in:
parent
13b64bc55a
commit
2b2dbabc11
@ -250,11 +250,6 @@ class AppModelConfigService:
|
|||||||
if not isinstance(config["pre_prompt"], str):
|
if not isinstance(config["pre_prompt"], str):
|
||||||
raise ValueError("pre_prompt must be of string type")
|
raise ValueError("pre_prompt must be of string type")
|
||||||
|
|
||||||
template_vars = re.findall(r"\{\{(\w+)\}\}", config["pre_prompt"])
|
|
||||||
for var in template_vars:
|
|
||||||
if var not in variables:
|
|
||||||
raise ValueError("Template variables in pre_prompt must be defined in user_input_form")
|
|
||||||
|
|
||||||
# agent_mode
|
# agent_mode
|
||||||
if "agent_mode" not in config or not config["agent_mode"]:
|
if "agent_mode" not in config or not config["agent_mode"]:
|
||||||
config["agent_mode"] = {
|
config["agent_mode"] = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user