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
83105d0d
Unverified
Commit
83105d0d
authored
Jan 15, 2024
by
Garfield Dai
Committed by
GitHub
Jan 15, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: dataset and moderation. (#2042)
parent
7b0818b8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
basic_app_runner.py
api/core/app_runner/basic_app_runner.py
+1
-1
keywords.py
api/core/moderation/keywords/keywords.py
+1
-1
No files found.
api/core/app_runner/basic_app_runner.py
View file @
83105d0d
...
@@ -146,7 +146,7 @@ class BasicApplicationRunner(AppRunner):
...
@@ -146,7 +146,7 @@ class BasicApplicationRunner(AppRunner):
# get context from datasets
# get context from datasets
context
=
None
context
=
None
if
app_orchestration_config
.
dataset
:
if
app_orchestration_config
.
dataset
and
app_orchestration_config
.
dataset
.
dataset_ids
:
context
=
self
.
retrieve_dataset_context
(
context
=
self
.
retrieve_dataset_context
(
tenant_id
=
app_record
.
tenant_id
,
tenant_id
=
app_record
.
tenant_id
,
app_record
=
app_record
,
app_record
=
app_record
,
...
...
api/core/moderation/keywords/keywords.py
View file @
83105d0d
...
@@ -30,7 +30,7 @@ class KeywordsModeration(Moderation):
...
@@ -30,7 +30,7 @@ class KeywordsModeration(Moderation):
if
query
:
if
query
:
inputs
[
'query__'
]
=
query
inputs
[
'query__'
]
=
query
keywords_list
=
self
.
config
[
'keywords'
]
.
split
(
'
\n
'
)
keywords_list
=
[
keyword
for
keyword
in
self
.
config
[
'keywords'
]
.
split
(
'
\n
'
)
if
keyword
]
flagged
=
self
.
_is_violated
(
inputs
,
keywords_list
)
flagged
=
self
.
_is_violated
(
inputs
,
keywords_list
)
return
ModerationInputsResult
(
flagged
=
flagged
,
action
=
ModerationAction
.
DIRECT_OUTPUT
,
preset_response
=
preset_response
)
return
ModerationInputsResult
(
flagged
=
flagged
,
action
=
ModerationAction
.
DIRECT_OUTPUT
,
preset_response
=
preset_response
)
...
...
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