Archived
1
0
Fork 0
This repository has been archived on 2024-04-26. You can view files and clone it, but cannot push or open issues or pull requests.
akari-bot/modules/ask/tools/search.py
2023-06-20 15:29:56 +08:00

14 lines
472 B
Python

from langchain.utilities.duckduckgo_search import DuckDuckGoSearchAPIWrapper
from .utils import to_async_func, AkariTool
search = DuckDuckGoSearchAPIWrapper()
async def search(query: str):
return to_async_func(search.run)(query)
search_tool = AkariTool.from_function(
func=search,
description='DuckDuckGo Search. Useful for when you need to answer questions about current events. You should ask targeted questions and ask as few questions as possible.'
)