> ## Documentation Index
> Fetch the complete documentation index at: https://agno-v2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Tool Use

> Add web search to a DeepSeek V3 agent on DeepInfra and stream synchronous and asynchronous responses.

Give a DeepSeek V3 agent on DeepInfra web search tools, then stream synchronous and asynchronous responses.

> [!WARNING]
>
> DeepInfra marks the pinned `meta-llama/Llama-2-70b-chat-hf` model as deprecated, and its model page is unavailable. Replace it with `deepseek-ai/DeepSeek-V3`, which supports tool calling, before running. See [DeepInfra tool calling](https://docs.deepinfra.com/chat/tool-calling).

```python tool_use.py theme={null}
"""Run `uv pip install ddgs` to install dependencies."""

from agno.agent import Agent  # noqa
from agno.models.deepinfra import DeepInfra  # noqa
from agno.tools.websearch import WebSearchTools  # noqa
import asyncio

# ---------------------------------------------------------------------------
# Create Agent
# ---------------------------------------------------------------------------

agent = Agent(
    model=DeepInfra(id="meta-llama/Llama-2-70b-chat-hf"),
    tools=[WebSearchTools()],
    markdown=True,
)

# ---------------------------------------------------------------------------
# Run Agent
# ---------------------------------------------------------------------------
if __name__ == "__main__":
    # --- Sync + Streaming ---
    agent.print_response("Whats happening in France?", stream=True)

    # --- Async + Streaming ---
    asyncio.run(agent.aprint_response("What's the latest news about AI?", stream=True))
```

## Run the Example

<Snippet file="create-venv-step.mdx" />

**1. Install dependencies**

```bash theme={null}
uv pip install -U agno ddgs openai
```

**2. Export your DeepInfra API key**

```bash Mac/Linux theme={null}
export DEEPINFRA_API_KEY="your_deepinfra_api_key_here"
```

```bash Windows theme={null}
$Env:DEEPINFRA_API_KEY="your_deepinfra_api_key_here"
```

**3. Use a tool-capable DeepInfra model**

Replace `meta-llama/Llama-2-70b-chat-hf` with `deepseek-ai/DeepSeek-V3` in the saved file.

**4. Run the example**

Save the code above as `tool_use.py`, then run:

```bash theme={null}
python tool_use.py
```

Full source: [cookbook/90\_models/deepinfra/tool\_use.py](https://github.com/agno-agi/agno/blob/v3.0.4/cookbook/90_models/deepinfra/tool_use.py)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.