Summary
The @google/genai SDK provides a stable models.generateImages() method for AI-powered image generation using Imagen models, but neither the wrapper (wrapGoogleGenAI) nor the auto-instrumentation plugin instruments it. Calls to this method produce no Braintrust spans. By contrast, OpenAI's images.generate() is tracked as a gap in #1628, and the Vercel AI SDK's generateImage() in #1626 — this is the Google GenAI equivalent.
What is missing
- Wrapper (
js/src/wrappers/google-genai.ts): wrapModels() only proxies generateContent and generateContentStream. generateImages calls pass through untraced.
- Auto-instrumentation config (
js/src/auto-instrumentations/configs/google-genai.ts): Only defines configs for generateContentInternal and generateContentStreamInternal. No config for generateImages.
- Channels (
js/src/instrumentation/plugins/google-genai-channels.ts): No channel definition for image generation.
- Plugin (
js/src/instrumentation/plugins/google-genai-plugin.ts): No handler for image generation calls.
- Vendor types (
js/src/vendor-sdk-types/google-genai.ts): GoogleGenAIModels interface only declares generateContent and generateContentStream. No generateImages method.
Upstream reference
- Imagen API docs: https://ai.google.dev/gemini-api/docs/imagen
- SDK method:
ai.models.generateImages({ model, prompt, config }) — returns generated image data.
- GA models:
imagen-4.0-generate-001, imagen-4.0-ultra-generate-001, imagen-4.0-fast-generate-001.
- Config options:
numberOfImages, aspectRatio, imageSize, personGeneration.
- This is a stable, production API — not marked experimental or preview.
Braintrust docs status
The Braintrust Gemini integration page lists generateContent and generateContentStream as supported methods. generateImages / Imagen is not mentioned (not_found).
Precedent in this repo
Image generation instrumentation gaps have been filed for other providers:
Local files inspected
js/src/wrappers/google-genai.ts
js/src/auto-instrumentations/configs/google-genai.ts
js/src/instrumentation/plugins/google-genai-channels.ts
js/src/instrumentation/plugins/google-genai-plugin.ts
js/src/vendor-sdk-types/google-genai.ts
Summary
The
@google/genaiSDK provides a stablemodels.generateImages()method for AI-powered image generation using Imagen models, but neither the wrapper (wrapGoogleGenAI) nor the auto-instrumentation plugin instruments it. Calls to this method produce no Braintrust spans. By contrast, OpenAI'simages.generate()is tracked as a gap in #1628, and the Vercel AI SDK'sgenerateImage()in #1626 — this is the Google GenAI equivalent.What is missing
js/src/wrappers/google-genai.ts):wrapModels()only proxiesgenerateContentandgenerateContentStream.generateImagescalls pass through untraced.js/src/auto-instrumentations/configs/google-genai.ts): Only defines configs forgenerateContentInternalandgenerateContentStreamInternal. No config forgenerateImages.js/src/instrumentation/plugins/google-genai-channels.ts): No channel definition for image generation.js/src/instrumentation/plugins/google-genai-plugin.ts): No handler for image generation calls.js/src/vendor-sdk-types/google-genai.ts):GoogleGenAIModelsinterface only declaresgenerateContentandgenerateContentStream. NogenerateImagesmethod.Upstream reference
ai.models.generateImages({ model, prompt, config })— returns generated image data.imagen-4.0-generate-001,imagen-4.0-ultra-generate-001,imagen-4.0-fast-generate-001.numberOfImages,aspectRatio,imageSize,personGeneration.Braintrust docs status
The Braintrust Gemini integration page lists
generateContentandgenerateContentStreamas supported methods.generateImages/ Imagen is not mentioned (not_found).Precedent in this repo
Image generation instrumentation gaps have been filed for other providers:
images.generate(): OpenAIimages.generate()andimages.edit()not instrumented (wrapper and auto-instrumentation) #1628generateImage(): Vercel AI SDKgenerateImagenot instrumented (wrapper and auto-instrumentation) #1626image_generation_calloutput is already handled withprocessImagesInOutputconverting base64 to Attachment objects — a similar approach could apply here.Local files inspected
js/src/wrappers/google-genai.tsjs/src/auto-instrumentations/configs/google-genai.tsjs/src/instrumentation/plugins/google-genai-channels.tsjs/src/instrumentation/plugins/google-genai-plugin.tsjs/src/vendor-sdk-types/google-genai.ts