LLM Learning Hub

workspace/llm-course/home

Tools

Tools are external functions (APIs, calculators, databases) with a defined name, description, and JSON-schema parameter spec that an LLM can invoke to interact with the outside world.

What is Tools?

Tools are external functions (APIs, calculators, databases) with a defined name, description, and JSON-schema parameter spec that an LLM can invoke to interact with the outside world.

Tools are external functions (APIs, calculators, databases) with a defined name, description, and JSON-schema parameter spec that an LLM can invoke to interact with the outside world.

Where is it used?

OpenAI function calling, Anthropic tool use, and LangChain `@tool` decorator define tools; Claude, GPT-4, and Llama-3.1-Instruct are trained to emit structured tool-call requests.

How to build it

Define `def get_weather(city: str) -> str: ...`, wrap with `langchain.tools.tool`, pass `[get_weather]` to `create_tool_calling_agent`, and let the LLM emit `{"name": "get_weather", "args": {"city": "SF"}}`.