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
ce879f6d
Commit
ce879f6d
authored
Jul 26, 2023
by
John Wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: remove </histories> in answer
parent
767b526b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
wraps.py
api/controllers/console/universal_chat/wraps.py
+1
-1
completion.py
api/core/completion.py
+3
-3
No files found.
api/controllers/console/universal_chat/wraps.py
View file @
ce879f6d
...
...
@@ -60,7 +60,7 @@ def universal_chat_app_required(view=None):
}
}),
user_input_form
=
json
.
dumps
([]),
pre_prompt
=
None
,
pre_prompt
=
''
,
agent_mode
=
json
.
dumps
({
"enabled"
:
True
,
"strategy"
:
"function_call"
,
"tools"
:
[]}),
)
...
...
api/core/completion.py
View file @
ce879f6d
...
...
@@ -257,8 +257,8 @@ And answer according to the language of the user's question.
histories
=
cls
.
get_history_messages_from_memory
(
memory
,
rest_tokens
)
human_message_prompt
+=
"
\n\n
"
if
human_message_prompt
else
""
human_message_prompt
+=
"Here is the chat histories between human and assistant, "
\
"inside <histories></histories> XML tags.
\n\n
<histories>"
human_message_prompt
+=
histories
+
"</histories>"
"inside <histories></histories> XML tags.
\n\n
<histories>
\n
"
human_message_prompt
+=
histories
+
"
\n
</histories>"
human_message_prompt
+=
query_prompt
...
...
@@ -270,7 +270,7 @@ And answer according to the language of the user's question.
messages
.
append
(
human_message
)
return
messages
,
[
'
\n
Human:'
]
return
messages
,
[
'
\n
Human:'
,
'</histories>'
]
@
classmethod
def
get_llm_callbacks
(
cls
,
llm
:
BaseLanguageModel
,
...
...
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