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
4c8608dc
Unverified
Commit
4c8608dc
authored
Sep 01, 2023
by
takatost
Committed by
GitHub
Sep 01, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: optimize conversation title generation output must be a valid JSON (#1077)
parent
a6b0f788
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
1 deletion
+2
-1
prompts.py
api/core/prompt/prompts.py
+1
-0
generate_conversation_name_when_first_message_created.py
.../generate_conversation_name_when_first_message_created.py
+1
-1
No files found.
api/core/prompt/prompts.py
View file @
4c8608dc
...
@@ -3,6 +3,7 @@ CONVERSATION_TITLE_PROMPT = """You need to decompose the user's input into "subj
...
@@ -3,6 +3,7 @@ CONVERSATION_TITLE_PROMPT = """You need to decompose the user's input into "subj
Notice: the language type user using is abundant, can be English, Chinese, Español, Arabic, Japanese, and etc.
Notice: the language type user using is abundant, can be English, Chinese, Español, Arabic, Japanese, and etc.
MAKE SURE your output is the SAME language as the user's input!
MAKE SURE your output is the SAME language as the user's input!
Your output is restricted only to: (Input language) Intention + Subject(short as possible)
Your output is restricted only to: (Input language) Intention + Subject(short as possible)
Your output MUST be a valid JSON.
Tip: When the user's question is directed at you (the language model), you can add an emoji to make it more fun.
Tip: When the user's question is directed at you (the language model), you can add an emoji to make it more fun.
...
...
api/events/event_handlers/generate_conversation_name_when_first_message_created.py
View file @
4c8608dc
...
@@ -26,7 +26,7 @@ def handle(sender, **kwargs):
...
@@ -26,7 +26,7 @@ def handle(sender, **kwargs):
conversation
.
name
=
name
conversation
.
name
=
name
except
:
except
:
conversation
.
name
=
'New
Chat
'
conversation
.
name
=
'New
conversation
'
db
.
session
.
add
(
conversation
)
db
.
session
.
add
(
conversation
)
db
.
session
.
commit
()
db
.
session
.
commit
()
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