cookbook/90_models/anthropic/README.md
Note: Fork and clone this repository if needed
python3 -m venv ~/.venvs/aienv
source ~/.venvs/aienv/bin/activate
ANTHROPIC_API_KEYexport ANTHROPIC_API_KEY=xxx
uv pip install -U anthropic ddgs duckdb yfinance agno
python cookbook/92_models/anthropic/basic_stream.py
python cookbook/92_models/anthropic/basic.py
python cookbook/92_models/anthropic/tool_use.py
python cookbook/92_models/anthropic/structured_output.py
python cookbook/92_models/anthropic/storage.py
Take note that claude uses OpenAI embeddings under the hood, and you will need an OpenAI API Key
export OPENAI_API_KEY=***
python cookbook/92_models/anthropic/knowledge.py
python cookbook/92_models/anthropic/memory.py
python cookbook/92_models/anthropic/image_agent.py
python cookbook/92_models/anthropic/thinking.py
python cookbook/92_models/anthropic/thinking_stream.py
python cookbook/92_models/anthropic/financial_analyst_thinking.py
output_configFor Claude 4.6 models that support adaptive thinking, use output_config to control thinking depth via the effort parameter. Keep thinking and output_config as separate top-level parameters:
python cookbook/90_models/anthropic/adaptive_thinking.py
from agno.models.anthropic import Claude
model = Claude(
id="claude-sonnet-4-6",
max_tokens=4096,
thinking={"type": "adaptive"},
output_config={"effort": "high"},
)
Valid effort values:
"low" - Most efficient, significant token savings"medium" - Balanced approach with moderate savings"high" - Default, high capability for complex reasoning"max" - Absolute maximum capability (Opus 4.6 only)