|
|
7 часов назад | |
|---|---|---|
| .. | ||
| tool | 7 часов назад | |
| README.md | 7 часов назад | |
| run.py | 7 часов назад | |
| test.prompt | 7 часов назад | |
测试 nanobanana 图像生成工具的功能。
nanobanana: 通用的图像生成工具,根据文本描述和/或参考图像生成图片。输出格式只有图片,不能输出文字。
确保已设置 OpenRouter API Key:
export OPENROUTER_API_KEY="your-api-key"
# 或
export OPEN_ROUTER_API_KEY="your-api-key"
如果要测试图像转换功能,请在 input/ 目录中放置测试图片:
cp your-test-image.png examples/test_nanobanana/input/
cd /Users/elksmmx/Desktop/agent\ 2.10/Agent
python examples/test_nanobanana/run.py
生成的图片将保存在 output/ 目录中:
output/cat.png - 测试1生成的图片output/transformed.png - 测试2生成的图片test_nanobanana/
├── README.md # 本文件
├── run.py # 测试脚本
├── tool/ # 自定义工具
│ ├── __init__.py
│ └── nanobanana.py # nanobanana工具实现
├── input/ # 测试图片输入目录
├── output/ # 生成图片输出目录
└── .trace/ # 执行轨迹(自动生成)
google/gemini-2.5-flash-image 模型A: 请设置环境变量 OPENROUTER_API_KEY 或 OPEN_ROUTER_API_KEY
A: 检查 OpenRouter 账户是否有足够额度,或尝试其他模型
A: 修改 run.py 中的模型参数,或在调用时指定 model 参数