> ## 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

> Give a function-calling Together model web search tools and run it sync, streaming, and async.

> [!WARNING]
>
> Together retired the source's `meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo` serverless model. Select a current chat model marked for function calling in the [Together serverless catalog](https://docs.together.ai/docs/serverless/models) before running. See [Together function calling](https://docs.together.ai/docs/inference/function-calling/overview).

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

import asyncio

from agno.agent import Agent
from agno.models.together import Together
from agno.tools.websearch import WebSearchTools

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

agent = Agent(
    model=Together(id="meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo"),
    tools=[WebSearchTools()],
    markdown=True,
)

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

    # --- Sync + Streaming ---
    agent.print_response("Whats happening in France?", stream=True)

    # --- Async + Streaming ---
    asyncio.run(agent.aprint_response("Whats happening in France?", 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 environment variables**

```bash Mac/Linux theme={null}
export TOGETHER_API_KEY="your_together_api_key_here"
export TOGETHER_TOOL_MODEL_ID="your_current_together_tool_model_id_here"
```

```bash Windows theme={null}
$Env:TOGETHER_API_KEY="your_together_api_key_here"
$Env:TOGETHER_TOOL_MODEL_ID="your_current_together_tool_model_id_here"
```

**3. Use a function-calling model**

Add `import os`, then replace `Together(id="meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo")` with `Together(id=os.environ["TOGETHER_TOOL_MODEL_ID"])` 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/together/tool\_use.py](https://github.com/agno-agi/agno/blob/v3.0.4/cookbook/90_models/together/tool_use.py)


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