Skip to content

[bot] Instrument @google/genai models.editImage() #2029

@braintrust-bot

Description

@braintrust-bot

Gap

models.editImage() in @google/genai is not instrumented. The method edits an image based on a text prompt and a list of reference images (Imagen image editing), and is a stable generative execution API.

Evidence

  • SDK source: src/models.ts in googleapis/js-genai exposes editImage() as a public method on the Models class alongside the already-instrumented generateContent and embedContent.
  • Current instrumentation: js/src/instrumentation/plugins/google-genai-channels.ts and google-genai-plugin.ts only cover models.generateContent, models.generateContentStream, and models.embedContent.
  • Vendor types: js/src/vendor-sdk-types/google-genai.tsGoogleGenAIModels interface does not include editImage.
  • Auto-instrumentation config: js/src/auto-instrumentations/configs/google-genai.ts only instruments generateContentInternal, generateContentStreamInternal, and embedContent/embedContentInternal.

Proposed work

  1. Add editImage to GoogleGenAIModels vendor type interface.
  2. Add a channel for models.editImage in google-genai-channels.ts.
  3. Instrument the channel in google-genai-plugin.ts to capture the prompt input and image output as an LLM span.
  4. Add auto-instrumentation config targeting the underlying internal method in google-genai.ts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions