mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-13 06:29:07 +08:00
fix: extra input for opening statement was not suitable for prompt (#143)
This commit is contained in:
parent
c43c3098a0
commit
54a6571462
@ -177,13 +177,21 @@ Avoid mentioning that you obtained the information from the context.
|
|||||||
And answer according to the language of the user's question.
|
And answer according to the language of the user's question.
|
||||||
"""
|
"""
|
||||||
if pre_prompt:
|
if pre_prompt:
|
||||||
human_inputs.update(inputs)
|
extra_inputs = {k: inputs[k] for k in
|
||||||
|
OutLinePromptTemplate.from_template(template=pre_prompt).input_variables
|
||||||
|
if k in inputs}
|
||||||
|
if extra_inputs:
|
||||||
|
human_inputs.update(extra_inputs)
|
||||||
human_message_instruction += pre_prompt + "\n"
|
human_message_instruction += pre_prompt + "\n"
|
||||||
|
|
||||||
human_message_prompt = human_message_instruction + "Q:{query}\nA:"
|
human_message_prompt = human_message_instruction + "Q:{query}\nA:"
|
||||||
else:
|
else:
|
||||||
if pre_prompt:
|
if pre_prompt:
|
||||||
human_inputs.update(inputs)
|
extra_inputs = {k: inputs[k] for k in
|
||||||
|
OutLinePromptTemplate.from_template(template=pre_prompt).input_variables
|
||||||
|
if k in inputs}
|
||||||
|
if extra_inputs:
|
||||||
|
human_inputs.update(extra_inputs)
|
||||||
human_message_prompt = pre_prompt + "\n" + human_message_prompt
|
human_message_prompt = pre_prompt + "\n" + human_message_prompt
|
||||||
|
|
||||||
# construct main prompt
|
# construct main prompt
|
||||||
|
Loading…
x
Reference in New Issue
Block a user