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

# Tool Use

> Combine web search and Newspaper4k article extraction in a Groq research agent.

<Warning>
  For free and developer tiers, Groq will shut down `llama-3.3-70b-versatile` on August 16, 2026. Replace it with `openai/gpt-oss-120b` before that date. See [Groq deprecations](https://console.groq.com/docs/deprecations).
</Warning>

```python tool_use.py theme={null}
"""Please install dependencies using:
uv pip install openai ddgs newspaper4k lxml_html_clean agno
"""

import asyncio

from agno.agent import Agent
from agno.models.groq import Groq
from agno.tools.newspaper4k import Newspaper4kTools
from agno.tools.websearch import WebSearchTools

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

agent = Agent(
    model=Groq(id="llama-3.3-70b-versatile"),
    tools=[WebSearchTools(), Newspaper4kTools()],
    description="You are a senior NYT researcher writing an article on a topic.",
    instructions=[
        "For a given topic, search for the top 5 links.",
        "Then read each URL and extract the article text, if a URL isn't available, ignore it.",
        "Analyse and prepare an NYT worthy article based on the information.",
    ],
    markdown=True,
    add_datetime_to_context=True,
)

# ---------------------------------------------------------------------------
# Run Agent
# ---------------------------------------------------------------------------
if __name__ == "__main__":
    # --- Sync + Streaming ---
    agent.print_response("Simulation theory", stream=True)

    # --- Async + Streaming ---
    asyncio.run(agent.aprint_response("Simulation theory", stream=True))
```

## Run the Example

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

  <Step title="Install dependencies">
    ```bash theme={null}
    uv pip install -U agno ddgs groq lxml-html-clean newspaper4k
    ```
  </Step>

  <Step title="Export your Groq API key">
    <CodeGroup>
      ```bash Mac/Linux theme={null}
      export GROQ_API_KEY="your_groq_api_key_here"
      ```

      ```bash Windows theme={null}
      $Env:GROQ_API_KEY="your_groq_api_key_here"
      ```
    </CodeGroup>
  </Step>

  <Step title="Replace Llama 3.3">
    Replace `llama-3.3-70b-versatile` with `openai/gpt-oss-120b` in the saved file.
  </Step>

  <Step title="Run the example">
    Save the code above as `tool_use.py`, then run:

    ```bash theme={null}
    python tool_use.py
    ```
  </Step>
</Steps>

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