Skip to content

Commit

Permalink
fix: adjust invoke agent to work sync (#3789)
Browse files Browse the repository at this point in the history
♻️ (agent.py): refactor the code to remove unnecessary 'await' keyword before agent.invoke() method to improve code readability and maintainability
  • Loading branch information
Cristhianzl authored Sep 12, 2024
1 parent 8275306 commit 5b51fe8
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 @@ -98,7 +98,7 @@ async def run_agent(self, agent: AgentExecutor) -> Text:
self.chat_history = self.get_chat_history_data()
if self.chat_history:
input_dict["chat_history"] = data_to_messages(self.chat_history)
result = await agent.ainvoke(
result = agent.invoke(
input_dict, config={"callbacks": [AgentAsyncHandler(self.log)] + self.get_langchain_callbacks()}
)
self.status = result
Expand Down

0 comments on commit 5b51fe8

Please sign in to comment.