Skip to content

[bot] Google GenAI interactions.create() not instrumented in JavaScript SDK — Braintrust docs list this as Python-only #2107

@braintrust-bot

Description

@braintrust-bot

Summary

The @google/genai SDK v2.0.0+ (May 7, 2026) added an Interactions API (client.interactions.create()) — a new generative execution surface for multi-turn, stateful model interactions with structured step tracking. The Braintrust Gemini integration docs explicitly acknowledge this surface but note "This feature is available in Python only." The JavaScript SDK has zero instrumentation for interactions.* — no channels, no auto-instrumentation config, no wrapper proxy.

What instrumentation is missing

SDK Method Description
client.interactions.create({ model, input, config }) Submits input to a model and returns a structured Interaction response with output_text, execution steps (thoughts, search queries, function calls), and usage metadata
client.interactions.create({ ..., stream: true }) Streaming variant returning an SSE stream of interaction events (interaction.created, interaction.completed)

This is a standard HTTP generative execution call (not WebSocket-based) that produces model-generated content with usage metrics, tool call records, and intermediate reasoning steps — directly analogous to models.generateContent() but with stateful multi-turn and structured step support.

No coverage in any instrumentation layer:

  • Auto-instrumentation config (js/src/auto-instrumentations/configs/google-genai.ts): Only targets generateContentInternal, generateContentStreamInternal, and embedContentInternal on the Models class. No Interactions class entries.
  • Channels (js/src/instrumentation/plugins/google-genai-channels.ts): Only generateContent, generateContentStream, and embedContent channels defined. No interactions channel.
  • Plugin (js/src/instrumentation/plugins/google-genai-plugin.ts): No handler for interactions.* calls.
  • Wrapper (js/src/wrappers/google-genai.ts): Only intercepts the models property on the client. No interactions property proxy.
  • Vendor types (js/src/vendor-sdk-types/google-genai.ts): GoogleGenAIClient only declares models. No interactions property.

A grep for interactions across js/src/ returns zero matches related to this API.

Braintrust docs status

supported (Python only) — The Braintrust Gemini integration page at https://www.braintrust.dev/docs/integrations/ai-providers/gemini explicitly lists interactions.create/get/delete as a supported feature but with the note: "This feature is available in Python only." This directly calls out the JavaScript instrumentation gap.

Upstream references

Precedent in this repo

The equivalent models.generateContent() is already fully instrumented including:

  • Non-streaming (generateContentInternal)
  • Streaming (generateContentStreamInternal)
  • Tool calling, grounding metadata, multi-turn content
  • Token usage metrics

The Interactions API carries the same kind of model-generated output and usage metadata and is the recommended path for multi-turn agentic workflows in @google/genai v2.

Local files inspected

  • js/src/auto-instrumentations/configs/google-genai.ts — no Interactions class configs
  • js/src/instrumentation/plugins/google-genai-channels.ts — no interactions channel
  • js/src/instrumentation/plugins/google-genai-plugin.ts — no interactions handler
  • js/src/wrappers/google-genai.ts — only models property intercepted
  • js/src/vendor-sdk-types/google-genai.ts — no interactions property on client type
  • e2e/scenarios/google-genai-instrumentation/ — no interactions test scenarios
  • Braintrust Gemini docs: https://www.braintrust.dev/docs/integrations/ai-providers/gemini — explicitly Python-only for this surface

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions