Allow for async use of SelfAskWithSearchChain (#5394)

# Allow for async use of SelfAskWithSearchChain


Co-authored-by: Dev 2049 <dev.dev2049@gmail.com>
searx_updates
Mark Pors 12 months ago committed by GitHub
parent 8121e04200
commit 0a44bfdca3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -77,7 +77,10 @@ class SelfAskWithSearchChain(AgentExecutor):
):
"""Initialize with just an LLM and a search chain."""
search_tool = Tool(
name="Intermediate Answer", func=search_chain.run, description="Search"
name="Intermediate Answer",
func=search_chain.run,
coroutine=search_chain.arun,
description="Search",
)
agent = SelfAskWithSearchAgent.from_llm_and_tools(llm, [search_tool])
super().__init__(agent=agent, tools=[search_tool], **kwargs)

Loading…
Cancel
Save