Skip to main content
To build effective agents, start simple: a model, tools, and instructions. Once that works, layer in more functionality as needed.
weather_agent.py

Run Your Agent

1

Set up your environment

2

Install Definable

3

Export your API key

4

Run

How It Works

  1. The agent sends your message and tool definitions to the model.
  2. The model decides which tools to call (if any).
  3. Tools execute and results are returned to the model.
  4. The model produces a final text response.
This loop repeats until the model responds without tool calls or max_iterations is reached.

Development vs Production

Use agent.run() for production. It returns a typed RunOutput with content, messages, metrics, and status.
You can use string shorthand instead of importing model classes:
Supported providers: openai, deepseek, moonshot, xai, anthropic, mistral, google, perplexity, ollama, openrouter.

Next Steps