Skip to content

Commit

Permalink
Add attribute check for 'chat_history' before accessing it in agent.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ogabrielluiz committed Nov 18, 2024
1 parent a7aa3ab commit d219fb0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/backend/base/langflow/base/agents/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ async def run_agent(
max_iterations=self.max_iterations,
)
input_dict: dict[str, str | list[BaseMessage]] = {"input": self.input_value}
if self.chat_history:
if hasattr(self, "chat_history") and self.chat_history:
input_dict["chat_history"] = data_to_messages(self.chat_history)

if hasattr(self, "graph"):
Expand Down

0 comments on commit d219fb0

Please sign in to comment.