Unverified Commit 2c23caac authored by John Wang's avatar John Wang Committed by GitHub

fix: introduction key error (#221)

parent 9edea9bc
...@@ -80,7 +80,10 @@ class ConversationMessageTask: ...@@ -80,7 +80,10 @@ class ConversationMessageTask:
if introduction: if introduction:
prompt_template = OutLinePromptTemplate.from_template(template=PromptBuilder.process_template(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} prompt_inputs = {k: self.inputs[k] for k in prompt_template.input_variables if k in self.inputs}
try:
introduction = prompt_template.format(**prompt_inputs) introduction = prompt_template.format(**prompt_inputs)
except KeyError:
pass
if self.app_model_config.pre_prompt: if self.app_model_config.pre_prompt:
pre_prompt = PromptBuilder.process_template(self.app_model_config.pre_prompt) pre_prompt = PromptBuilder.process_template(self.app_model_config.pre_prompt)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment