fix: adjust invoke agent to work sync (#3789)
♻️ (agent.py): refactor the code to remove unnecessary 'await' keyword before agent.invoke() method to improve code readability and maintainability
This commit is contained in:
parent
82753064cb
commit
5b51fe892b
1 changed files with 1 additions and 1 deletions
|
|
@ -98,7 +98,7 @@ class LCAgentComponent(Component):
|
||||||
self.chat_history = self.get_chat_history_data()
|
self.chat_history = self.get_chat_history_data()
|
||||||
if self.chat_history:
|
if self.chat_history:
|
||||||
input_dict["chat_history"] = data_to_messages(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()}
|
input_dict, config={"callbacks": [AgentAsyncHandler(self.log)] + self.get_langchain_callbacks()}
|
||||||
)
|
)
|
||||||
self.status = result
|
self.status = result
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue