Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dify
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tech
dify
Commits
2b2dbabc
Unverified
Commit
2b2dbabc
authored
Nov 06, 2023
by
takatost
Committed by
GitHub
Nov 06, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: prompt variables validate when using external data tools (#1465)
parent
13b64bc5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
5 deletions
+0
-5
app_model_config_service.py
api/services/app_model_config_service.py
+0
-5
No files found.
api/services/app_model_config_service.py
View file @
2b2dbabc
...
@@ -250,11 +250,6 @@ class AppModelConfigService:
...
@@ -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"
]
=
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment