# Giphy Tools (/examples/tools/giphy-tools)



```python title="giphy_tools.py"
"""
Giphy Tools
=============================

Demonstrates giphy tools.
"""

from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.tools.giphy import GiphyTools

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


"""Create an agent specialized in creating gifs using Giphy """

# Example 1: Enable specific Giphy functions
gif_agent = Agent(
    name="Gif Generator Agent",
    model=OpenAIChat(id="gpt-5.6-luna"),
    tools=[GiphyTools(limit=5, enable_search_gifs=True)],
    description="You are an AI agent that can generate gifs using Giphy.",
    instructions=[
        "When the user asks you to create a gif, come up with the appropriate Giphy query and use the `search_gifs` tool to find the appropriate gif.",
    ],
)

# Example 2: Enable all Giphy functions
gif_agent_all = Agent(
    name="Full Giphy Agent",
    model=OpenAIChat(id="gpt-5.6-luna"),
    tools=[GiphyTools(limit=10, all=True)],
    description="You are an AI agent with full Giphy capabilities.",
    instructions=[
        "Use Giphy to find the perfect GIF for any situation or mood.",
        "Consider the user's context and preferences when searching.",
    ],
)

# ---------------------------------------------------------------------------
# Run Agent
# ---------------------------------------------------------------------------
if __name__ == "__main__":
    gif_agent.print_response("I want a gif to send to a friend for their birthday.")
```

`search_gifs` searches existing Giphy GIFs and attaches the returned image URLs. It does not generate new animation or send a message to your friend. `limit=5` sets the maximum requested search results; the provider can return fewer.

## Run the Example [#run-the-example]

<Steps>
    <Step title="Set up your virtual environment">
      <CodeBlockTabs defaultValue="Mac">
        <CodeBlockTabsList>
          <CodeBlockTabsTrigger value="Mac">
            Mac
          </CodeBlockTabsTrigger>

          <CodeBlockTabsTrigger value="Windows">
            Windows
          </CodeBlockTabsTrigger>
        </CodeBlockTabsList>

        <CodeBlockTab value="Mac">
          ```bash
          uv venv --python 3.12
          source .venv/bin/activate
          ```
        </CodeBlockTab>

        <CodeBlockTab value="Windows">
          ```bash
          uv venv --python 3.12
          .venv\Scripts\activate
          ```
        </CodeBlockTab>
      </CodeBlockTabs>
    </Step>

  <Step title="Install dependencies">
    ```bash
    uv pip install -U agno openai
    ```
  </Step>

  <Step title="Export your API keys">
    <CodeBlockTabs defaultValue="Mac/Linux">
      <CodeBlockTabsList>
        <CodeBlockTabsTrigger value="Mac/Linux">
          Mac/Linux
        </CodeBlockTabsTrigger>

        <CodeBlockTabsTrigger value="Windows">
          Windows
        </CodeBlockTabsTrigger>
      </CodeBlockTabsList>

      <CodeBlockTab value="Mac/Linux">
        ```bash
        export GIPHY_API_KEY="your_giphy_api_key_here"
        export OPENAI_API_KEY="your_openai_api_key_here"
        ```
      </CodeBlockTab>

      <CodeBlockTab value="Windows">
        ```bash
        $Env:GIPHY_API_KEY="your_giphy_api_key_here"
        $Env:OPENAI_API_KEY="your_openai_api_key_here"
        ```
      </CodeBlockTab>
    </CodeBlockTabs>
  </Step>

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

    ```bash
    python giphy_tools.py
    ```
  </Step>
</Steps>

Full source: [cookbook/91\_tools/giphy\_tools.py](https://github.com/agno-agi/agno/blob/8f36eaf2d18e91afa7b327eec66a3cd3685dcb87/cookbook/91_tools/giphy_tools.py)
