Spaces:
Runtime error
Runtime error
File size: 977 Bytes
baeb823 538782c 79d28fc 3adfe4f ffc544c f37e95b 3adfe4f f37e95b 3adfe4f f37e95b 3adfe4f f37e95b 538782c baeb823 823995c 79d28fc 0242ef6 538782c ffc544c 0242ef6 9465031 0242ef6 f37e95b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
from .wikipedia import wiki_fetch_article, wiki_parse_html
from .search import web_search
from .code_interpreter import execute_code_multilang
from langchain_core.tools import BaseTool
from . import calculator, files
def get_all_tools() -> list[BaseTool]:
"""
Get all available tools as a list of LangChain BaseTool instances.
Returns:
List of BaseTool instances ready for use with LangChain agents
"""
tools = [
wiki_fetch_article,
wiki_parse_html,
web_search,
#execute_code_multilang, # Disabled for the repo, enable at your own risk
]
# Automatically add all functions for the remaining tools
tools.extend([getattr(calculator, name) for name in calculator.__all__])
tools.extend([getattr(files, name) for name in files.__all__])
#return [] # Disable all tools
return tools
def list_tools() -> str:
return render_text_description_and_args(get_all_tools()) # type: ignore |