chain.    '3.547023357958959'Using the tool decorator‚ÄãTo make it easier to define custom tools, a @tool decorator is provided. This decorator can be used to quickly create a Tool from a simple function. The decorator uses the function name as the tool name by default, but this can be overridden by passing a string as the first argument. Additionally, the decorator will use the function's docstring as the tool's description.from langchain.tools import tool@tooldef search_api(query: str) -> str:    """Searches the API for the query."""    return f"Results for query {query}"search_apiYou can also provide arguments like the tool name and whether to return directly.@tool("search", return_direct=True)def search_api(query: str) -> str:    """Searches the API for the query."""    return "Results"search_api    Tool(name='search', description='search(query: str) -> str - Searches the API for the query.', args_schema=<class 'pydantic.main.SearchApi'>, return_direct=True, verbose=False, callback_manager=<langchain.callbacks.shared.SharedCallbackManager object at 0x12748c4c0>, func=<function search_api at 0x16bd66310>, coroutine=None)You can also provide args_schema to provide more information about the argument.class SearchInput(BaseModel):    query: str = Field(description="should be a search query")@tool("search", return_direct=True, args_schema=SearchInput)def search_api(query: str) -> str:    """Searches the API for the query."""    return "Results"search_api    Tool(name='search', description='search(query: str) -> str - Searches the API for the query.', args_schema=<class '__main__.SearchInput'>, return_direct=True, verbose=False, callback_manager=<langchain.callbacks.shared.SharedCallbackManager object at 0x12748c4c0>, func=<function search_api at 0x16bcf0ee0>, coroutine=None)Custom Structured Tools‚ÄãIf your functions require more structured arguments, you can use the StructuredTool class directly, or still subclass the BaseTool class.StructuredTool dataclass‚ÄãTo
When constructing your own agent, you will need to provide it with a list of Tools that it can use. Besides the actual function that is called, the Tool consists of several components:
When constructing your own agent, you will need to provide it with a list of Tools that it can use. Besides the actual function that is called, the Tool consists of several components: ->: chain.    '3.547023357958959'Using the tool decorator‚ÄãTo make it easier to define custom tools, a @tool decorator is provided. This decorator can be used to quickly create a Tool from a simple function. The decorator uses the function name as the tool name by default, but this can be overridden by passing a string as the first argument. Additionally, the decorator will use the function's docstring as the tool's description.from langchain.tools import tool@tooldef search_api(query: str) -> str:    """Searches the API for the query."""    return f"Results for query {query}"search_apiYou can also provide arguments like the tool name and whether to return directly.@tool("search", return_direct=True)def search_api(query: str) -> str:    """Searches the API for the query."""    return "Results"search_api    Tool(name='search', description='search(query: str) -> str - Searches the API for the query.', args_schema=<class 'pydantic.main.SearchApi'>, return_direct=True, verbose=False, callback_manager=<langchain.callbacks.shared.SharedCallbackManager object at 0x12748c4c0>, func=<function search_api at 0x16bd66310>, coroutine=None)You can also provide args_schema to provide more information about the argument.class SearchInput(BaseModel):    query: str = Field(description="should be a search query")@tool("search", return_direct=True, args_schema=SearchInput)def search_api(query: str) -> str:    """Searches the API for the query."""    return "Results"search_api    Tool(name='search', description='search(query: str) -> str - Searches the API for the query.', args_schema=<class '__main__.SearchInput'>, return_direct=True, verbose=False, callback_manager=<langchain.callbacks.shared.SharedCallbackManager object at 0x12748c4c0>, func=<function search_api at 0x16bcf0ee0>, coroutine=None)Custom Structured Tools‚ÄãIf your functions require more structured arguments, you can use the StructuredTool class directly, or still subclass the BaseTool class.StructuredTool dataclass‚ÄãTo