print(tool.description) # >> A wrapper around Wikipedia. Useful for when you need to answer general questions about people, places, companies, facts, historical events, or other subjects. Input should be a search query.
classCustomCalculatorTool(BaseTool): name = "Calculator" description = "useful for when you need to answer questions about math" args_schema: Type[BaseModel] = CalculatorInput return_direct: bool = True
defmultiply(a: int, b: int) -> int: """Multiply two numbers.""" return a * b
multiply = StructuredTool.from_function( func=multiply, name="Calculator", description="multiply numbers", # coroutine= ... <- you can specify an async method if desired as well )
# 定义入参结构 classCalculatorInput(BaseModel): a: int = Field(description="first number") b: int = Field(description="second number")
defmultiply(a: int, b: int) -> int: """Multiply two numbers.""" return a * b
multiply = StructuredTool.from_function( func=multiply, name="Calculator", description="multiply numbers", args_schema=CalculatorInput, return_direct=True, # coroutine= ... <- you can specify an async method if desired as well )
# 打印下信息 tools = toolkit.get_tools() for tool in tools: print(tool.name) print(tool.description) print("--------------")
1 2 3 4 5 6 7 8 9 10 11 12
sql_db_query Inputto this tool is a detailed and correct SQL query, output is a result from the database. If the query isnot correct, an error message will be returned. If an error is returned, rewrite the query, check the query, and try again. If you encounter an issue withUnknowncolumn'xxxx'in'field list', use sql_db_schema to query the correct table fields. -------------- sql_db_schema Inputto this tool is a comma-separated list oftables, output is the schemaand sample rowsfor those tables. Be sure that the tables actually exist by calling sql_db_list_tables first! Example Input: table1, table2, table3 -------------- sql_db_list_tables Inputis an empty string, output is a comma separated list oftablesin the database. -------------- sql_db_query_checker Use this tool todoublecheckif your query is correct before executing it. Always use this tool before executing a query with sql_db_query! --------------