瀏覽代碼

fix: introduction key error (#221)

tags/0.3.1
John Wang 2 年之前
父節點
當前提交
2c23caacd4
No account linked to committer's email address
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4
    1
      api/core/conversation_message_task.py

+ 4
- 1
api/core/conversation_message_task.py 查看文件

@@ -80,7 +80,10 @@ class ConversationMessageTask:
if introduction:
prompt_template = OutLinePromptTemplate.from_template(template=PromptBuilder.process_template(introduction))
prompt_inputs = {k: self.inputs[k] for k in prompt_template.input_variables if k in self.inputs}
introduction = prompt_template.format(**prompt_inputs)
try:
introduction = prompt_template.format(**prompt_inputs)
except KeyError:
pass

if self.app_model_config.pre_prompt:
pre_prompt = PromptBuilder.process_template(self.app_model_config.pre_prompt)

Loading…
取消
儲存