mirror of
https://github.com/langflow-ai/langflow.git
synced 2026-07-26 16:05:59 +08:00
fix: allow passing curly braces in system instructions to the Agent component (#5092)
update agent system instructions
This commit is contained in:
@ -137,6 +137,8 @@ class LCAgentComponent(Component):
|
||||
max_iterations=max_iterations,
|
||||
)
|
||||
input_dict: dict[str, str | list[BaseMessage]] = {"input": self.input_value}
|
||||
if hasattr(self, "system_prompt"):
|
||||
input_dict["system_prompt"] = self.system_prompt
|
||||
if hasattr(self, "chat_history") and self.chat_history:
|
||||
input_dict["chat_history"] = data_to_messages(self.chat_history)
|
||||
|
||||
|
||||
@ -42,7 +42,7 @@ class ToolCallingAgentComponent(LCToolsAgentComponent):
|
||||
|
||||
def create_agent_runnable(self):
|
||||
messages = [
|
||||
("system", self.system_prompt),
|
||||
("system", "{system_prompt}"),
|
||||
("placeholder", "{chat_history}"),
|
||||
("human", "{input}"),
|
||||
("placeholder", "{agent_scratchpad}"),
|
||||
|
||||
Reference in New Issue
Block a user