2023-10-18 15:19:02 +08:00
|
|
|
|
from langchain.tools import Tool
|
|
|
|
|
|
from server.agent.tools import *
|
2023-10-21 22:09:53 +08:00
|
|
|
|
|
2023-10-27 22:53:43 +08:00
|
|
|
|
## 请注意,如果你是为了使用AgentLM,在这里,你应该使用英文版本。
|
2023-10-21 22:09:53 +08:00
|
|
|
|
|
2023-09-17 11:19:16 +08:00
|
|
|
|
tools = [
|
|
|
|
|
|
Tool.from_function(
|
|
|
|
|
|
func=calculate,
|
2023-11-12 16:45:50 +08:00
|
|
|
|
name="calculate",
|
|
|
|
|
|
description="Useful for when you need to answer questions about simple calculations",
|
2023-10-27 22:53:43 +08:00
|
|
|
|
args_schema=CalculatorInput,
|
2023-09-17 11:19:16 +08:00
|
|
|
|
),
|
|
|
|
|
|
Tool.from_function(
|
2023-11-12 16:45:50 +08:00
|
|
|
|
func=arxiv,
|
|
|
|
|
|
name="arxiv",
|
|
|
|
|
|
description="A wrapper around Arxiv.org for searching and retrieving scientific articles in various fields.",
|
|
|
|
|
|
args_schema=ArxivInput,
|
2023-09-17 11:19:16 +08:00
|
|
|
|
),
|
|
|
|
|
|
Tool.from_function(
|
|
|
|
|
|
func=weathercheck,
|
2023-11-12 16:45:50 +08:00
|
|
|
|
name="weather_check",
|
2024-01-16 15:37:47 +08:00
|
|
|
|
description="Use this tools to answer questons about weather",
|
2023-11-03 18:56:27 +08:00
|
|
|
|
args_schema=WhetherSchema,
|
2023-09-28 20:19:26 +08:00
|
|
|
|
),
|
|
|
|
|
|
Tool.from_function(
|
|
|
|
|
|
func=shell,
|
2023-11-12 16:45:50 +08:00
|
|
|
|
name="shell",
|
|
|
|
|
|
description="Use Shell to execute Linux commands",
|
2023-11-03 18:56:27 +08:00
|
|
|
|
args_schema=ShellInput,
|
2023-09-28 20:19:26 +08:00
|
|
|
|
),
|
|
|
|
|
|
Tool.from_function(
|
2023-11-12 16:45:50 +08:00
|
|
|
|
func=search_knowledgebase_complex,
|
|
|
|
|
|
name="search_knowledgebase_complex",
|
|
|
|
|
|
description="Use Use this tool to search local knowledgebase and get information",
|
2023-11-03 18:56:27 +08:00
|
|
|
|
args_schema=KnowledgeSearchInput,
|
2023-10-04 12:05:46 +08:00
|
|
|
|
),
|
|
|
|
|
|
Tool.from_function(
|
|
|
|
|
|
func=search_internet,
|
2023-11-12 16:45:50 +08:00
|
|
|
|
name="search_internet",
|
|
|
|
|
|
description="Use this tool to use bing search engine to search the internet",
|
2023-11-03 18:56:27 +08:00
|
|
|
|
args_schema=SearchInternetInput,
|
2023-10-04 12:05:46 +08:00
|
|
|
|
),
|
2023-10-23 13:22:10 +08:00
|
|
|
|
Tool.from_function(
|
|
|
|
|
|
func=wolfram,
|
2023-11-12 16:45:50 +08:00
|
|
|
|
name="Wolfram",
|
|
|
|
|
|
description="Useful for when you need to calculate difficult formulas",
|
2023-10-27 22:53:43 +08:00
|
|
|
|
args_schema=WolframInput,
|
2023-10-23 13:22:10 +08:00
|
|
|
|
),
|
|
|
|
|
|
Tool.from_function(
|
2023-11-12 16:45:50 +08:00
|
|
|
|
func=search_youtube,
|
|
|
|
|
|
name="search_youtube",
|
|
|
|
|
|
description="use this tools to search youtube videos",
|
2023-10-27 22:53:43 +08:00
|
|
|
|
args_schema=YoutubeInput,
|
|
|
|
|
|
),
|
2023-09-17 11:19:16 +08:00
|
|
|
|
]
|
2023-10-18 15:19:02 +08:00
|
|
|
|
|
2023-10-27 17:56:27 +08:00
|
|
|
|
tool_names = [tool.name for tool in tools]
|