-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Summary
The OpenAI Node SDK provides stable images.generate() and images.edit() methods for AI-powered image generation (DALL-E 3/gpt-image-1), but neither the wrapper (wrapOpenAI) nor the auto-instrumentation plugin instruments them. Calls to these methods produce no Braintrust spans. By contrast, OpenAI embeddings.create() and moderations.create() — also "secondary" AI model APIs — are fully instrumented.
What is missing
- Wrapper (
js/src/wrappers/oai.ts): No proxy forimagesresource. Onlychat.completions,embeddings,moderations, andresponsesare wrapped. - Auto-instrumentation config (
js/src/auto-instrumentations/configs/openai.ts): No config entry forimages.generateorimages.edit. - Channels (
js/src/instrumentation/plugins/openai-channels.ts): No channel definitions for image generation. - Plugin (
js/src/instrumentation/plugins/openai-plugin.ts): No handler for image generation calls.
Upstream reference
- OpenAI Images API: https://platform.openai.com/docs/api-reference/images
- OpenAI Node SDK
Imagesclass: https://github.com/openai/openai-node/blob/master/src/resources/images.ts - Methods:
generate()(text-to-image, supports DALL-E 3 and gpt-image-1),edit()(image editing with streaming support),createVariation()(DALL-E 2 only). generate()supports both streaming (ImageGenStreamEvent) and non-streaming (ImagesResponse) modes.- These are stable, production APIs — not beta or experimental.
Braintrust docs status
The Braintrust wrapper docs page broadly mentions tracing "GPT models, embeddings, and other OpenAI APIs" but does not specifically enumerate images support (unclear).
Note on Responses API overlap
The OpenAI Responses API can generate images via the image_generation built-in tool, and this repo does instrument responses.create() including image_generation_call output conversion to Attachments (via processImagesInOutput in openai-plugin.ts). However, many users still use the dedicated images.generate() endpoint directly, especially for DALL-E 3 and gpt-image-1 workflows that don't use the Responses API.
Precedent in this repo
OpenAI embeddings and moderations — similarly "secondary" model APIs — are instrumented in all three layers:
- Wrapper:
js/src/wrappers/oai.ts - Auto-instrumentation config:
js/src/auto-instrumentations/configs/openai.ts - Plugin:
js/src/instrumentation/plugins/openai-plugin.ts
Local files inspected
js/src/wrappers/oai.tsjs/src/auto-instrumentations/configs/openai.tsjs/src/instrumentation/plugins/openai-channels.tsjs/src/instrumentation/plugins/openai-plugin.tsjs/src/vendor-sdk-types/openai.tsjs/src/vendor-sdk-types/openai-common.ts