-
Notifications
You must be signed in to change notification settings - Fork 1
Labels
Description
Gap
The Google GenAI image generation API (client.models.generate_images()) is not instrumented. Calling it on a client set up via setup_genai() produces no Braintrust span.
The current Google GenAI wrapper patches three methods on Models/AsyncModels: _generate_content, generate_content_stream, and embed_content. The generate_images method is not patched, so calls pass through to the original untraced implementation.
This is the Google-side equivalent of the gap tracked in #124 (OpenAI Images API).
What is missing
client.models.generate_images()(sync) — text-to-image generation using Imagen models. Should create a span logging the prompt, model, number of images, image size/aspect ratio, safety filter level, and response image metadata.client.aio.models.generate_images()(async variant)
Token metrics do not apply to image generation, but latency, model, prompt, and request/response metadata are all valuable for observability.
Braintrust docs status
not_found — the Gemini integration page does not mention image generation or Imagen.
Upstream sources
- Google GenAI image generation guide: https://ai.google.dev/gemini-api/docs/image-generation
google.genai.models.Models.generate_images()method in thegoogle-genaiPython SDK- Imagen 3 is GA and supports text-to-image, image editing, and style transfer
Local files inspected
py/src/braintrust/wrappers/google_genai/__init__.py:wrap_models()(line 60) — patches_generate_content,generate_content_stream, andembed_contentonly;generate_imagesis absentwrap_async_models()— same three methods, nogenerate_images- Zero references to
generate_images,imagen, orimage_generationin the file
py/src/braintrust/wrappers/test_google_genai.py— no image generation test cases
Reactions are currently unavailable