Examples
Image search using Giphy
Hackathon Resources
- Introduction
- Setup
- Examples
- Simple Text Agent
- Agent with Tools
- Agent with Knowledge
- Agent with Structured Outputs
- Research Agent
- YouTube Agent
- Image Input + Tools
- Image Generation using DALL-E
- Image to Structured Output
- Image Generate Audio
- Image Input + Output
- Image Transcription
- Image search using Giphy
- Audio Input
- Audio Input Output
- Audio Sentiment
- Audio Transcript
- Audio Multi Turn
- Audio Generate Podcast
- Video Input
- Video Generation with Models Lab
- Video Generation with Replicate
- Video Captions
- Video to Shorts
- Models
- Pre-built Replit Template
- 🏆 Prizes
Examples
Image search using Giphy
This agent can search for images using Giphy.
gif_search.py
from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.tools.giphy import GiphyTools
gif_agent = Agent(
name="Gif Generator Agent",
agent_id="gif_agent",
model=OpenAIChat(id="gpt-4o"),
tools=[GiphyTools()],
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.",
"Don't return the URL, only describe what you created.",
],
markdown=True,
debug_mode=True,
add_history_to_messages=True,
add_datetime_to_instructions=True,
)
gif_agent.run("Search for a gif of a cat playing with a toy")
for gif in gif_agent.run_response.images:
print("Gif File URL:", gif.url)
Usage
1
Install libraries
pip install -U agno openai
2
Export API keys
export OPENAI_API_KEY=***
export GIPHY_API_KEY=***
3
Run the agent
python gif_search.py
On this page