diff --git a/lazyllm/components/prompter/builtinPrompt.py b/lazyllm/components/prompter/builtinPrompt.py index 455ba97a..12143753 100644 --- a/lazyllm/components/prompter/builtinPrompt.py +++ b/lazyllm/components/prompter/builtinPrompt.py @@ -105,7 +105,7 @@ def _generate_prompt_dict_impl(self, instruction, input, user, history, tools, l raise TypeError("input must be a string or a dict") if user: - history[-1]["content"].insert(0, user) + history[-1]["content"] = user + history[-1]['content'] history.insert(0, {"role": "system", "content": self._system + "\n" + instruction if instruction else self._system})