-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Open
Google GenAI
models.generateImages() (Imagen) not instrumented (wrapper and auto-instrumentation)#1673Feature
Copy link
Labels
bot-automationIssues generated by an agent automationIssues generated by an agent automation
Description
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 proxiesgenerateContentandgenerateContentStream.generateImagescalls pass through untraced. - Auto-instrumentation config (
js/src/auto-instrumentations/configs/google-genai.ts): Only defines configs forgenerateContentInternalandgenerateContentStreamInternal. No config forgenerateImages. - 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):GoogleGenAIModelsinterface only declaresgenerateContentandgenerateContentStream. NogenerateImagesmethod.
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:
- OpenAI
images.generate(): OpenAIimages.generate()andimages.edit()not instrumented (wrapper and auto-instrumentation) #1628 - Vercel AI SDK
generateImage(): Vercel AI SDKgenerateImagenot instrumented (wrapper and auto-instrumentation) #1626 - OpenAI Responses API
image_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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bot-automationIssues generated by an agent automationIssues generated by an agent automation