from agno.agent import Agent
from agno.tools.models.azure_openai import AzureOpenAITools
agent = Agent(
instructions=[
"You are an AI image generation assistant using Azure OpenAI",
"Generate high-quality images based on user descriptions",
"Provide detailed descriptions of the generated images",
],
tools=[AzureOpenAITools()],
markdown=True,
)
agent.print_response("Generate an image of a sunset over mountains")
Create a virtual environment
Terminal
and create a python virtual environment.python3 -m venv .venv
source .venv/bin/activate
Set your credentials
export AZURE_OPENAI_API_KEY=your-azure-openai-api-key
export AZURE_OPENAI_ENDPOINT=https://your-resource.openai.azure.com
export AZURE_OPENAI_IMAGE_DEPLOYMENT=your-dalle-deployment-name
export OPENAI_API_KEY=xxx
Install libraries
pip install -U requests openai agno
Run Agent
python cookbook/tools/azure_openai_tools.py