@netlify/agent-runner-cli 1.173.0 → 1.174.0-image-prompt.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -177,24 +177,35 @@ for await (const chunk of stream) {
177
177
 
178
178
  ## Image Generation
179
179
 
180
- ### OpenAI (gpt-image-1)
180
+ Use a Gemini image model, also known as "Nano Banana": pick a `gemini` model with `image` in its name from the Available Models list. No provider API key is needed — construct the client from the AI Gateway variables, which are always set. The gateway serves the Gemini REST API directly at its base URL, with no provider path prefix. Generated images come back as inline data parts:
181
181
 
182
182
  ```typescript
183
- import OpenAI from 'openai'
183
+ import { GoogleGenAI } from '@google/genai'
184
184
 
185
- const openai = new OpenAI()
185
+ const ai = new GoogleGenAI({
186
+ apiKey: process.env.NETLIFY_AI_GATEWAY_KEY,
187
+ httpOptions: { baseUrl: process.env.NETLIFY_AI_GATEWAY_BASE_URL?.replace(/\/$/, '') },
188
+ })
186
189
 
187
- const result = await openai.images.generate({
188
- model: 'gpt-image-1',
189
- prompt: 'A cute otter in a river',
190
+ const response = await ai.models.generateContent({
191
+ model: 'gemini-3.1-flash-image',
192
+ contents: 'A cute otter in a river',
190
193
  })
191
194
 
192
- const imageBase64 = result.data[0].b64_json
195
+ for (const part of response.candidates[0].content.parts) {
196
+ if (part.inlineData) {
197
+ const imageBase64 = part.inlineData.data
198
+ }
199
+ }
193
200
  ```
194
201
 
195
- Image generation is also available via the Responses API with the `image_generation` tool:
202
+ If the project already uses the OpenAI SDK, image generation is also available via the Responses API with the `image_generation` tool:
196
203
 
197
204
  ```typescript
205
+ import OpenAI from 'openai'
206
+
207
+ const openai = new OpenAI()
208
+
198
209
  const response = await openai.responses.create({
199
210
  model: 'gpt-4o',
200
211
  input: 'Create a simple logo',
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@netlify/agent-runner-cli",
3
3
  "type": "module",
4
- "version": "1.173.0",
4
+ "version": "1.174.0-image-prompt.1",
5
5
  "description": "CLI tool for running Netlify agents",
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",