cookbook/tools/dalle_tools.py
from agno.agent import Agent
from agno.tools.dalle import DalleTools
# 使用 DALL-E 工具创建 Agent
agent = Agent(tools=[DalleTools()], name="DALL-E Image Generator")
# 示例 1:使用默认设置生成基本图像
agent.print_response("Generate an image of a futuristic city with flying cars and tall skyscrapers", markdown=True)
# 示例 2:使用自定义设置生成图像
custom_dalle = Dalle(model="dall-e-3", size="1792x1024", quality="hd", style="natural")
agent_custom = Agent(
tools=[custom_dalle],
name="Custom DALL-E Generator",
show_tool_calls=True,
)
agent_custom.print_response("Create a panoramic nature scene showing a peaceful mountain lake at sunset", markdown=True)