fix: allow passing curly braces in system instructions to the Agent component (#5092)
update agent system instructions
This commit is contained in:
parent
90bc061d34
commit
fe4acf419b
2 changed files with 3 additions and 1 deletions
|
|
@ -137,6 +137,8 @@ class LCAgentComponent(Component):
|
||||||
max_iterations=max_iterations,
|
max_iterations=max_iterations,
|
||||||
)
|
)
|
||||||
input_dict: dict[str, str | list[BaseMessage]] = {"input": self.input_value}
|
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:
|
if hasattr(self, "chat_history") and self.chat_history:
|
||||||
input_dict["chat_history"] = data_to_messages(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):
|
def create_agent_runnable(self):
|
||||||
messages = [
|
messages = [
|
||||||
("system", self.system_prompt),
|
("system", "{system_prompt}"),
|
||||||
("placeholder", "{chat_history}"),
|
("placeholder", "{chat_history}"),
|
||||||
("human", "{input}"),
|
("human", "{input}"),
|
||||||
("placeholder", "{agent_scratchpad}"),
|
("placeholder", "{agent_scratchpad}"),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue