Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[BOT ISSUE] OpenAI Images API not instrumented (openai + ruby-openai gems)

Open
#147 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
55/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Quiet
Tech stack
ruby
Domain
observability

Research direction

Start with the existing patchers in lib/braintrust/contrib/openai/patcher.rb and lib/braintrust/contrib/ruby_openai/patcher.rb, then compare their instrumentation files for the ModerationsPatcher pattern. The missing work is scoped to adding image instrumentation for the listed generate, edit, and variation methods in both gems. Done means spans capture the requested prompt, metadata, image URL or metadata output, and revised_prompt without recording binary image data.

Written by the indexing model from the issue text.

Description

Summary

The OpenAI Images API (client.images.generate) is available in both the official openai gem and the ruby-openai gem, but is not instrumented by this SDK. Image generation (DALL-E, gpt-image-1) is a stable generative AI API that creates images from text prompts. This is the same class of gap as the already-filed audio API issue (#146), and is distinct from the RubyLLM paint() gap (#136) which covers a different library.

What is missing

Official openai gem

Three resource methods under OpenAI::Resources::Images:

  • client.images.generate(...) — Text-to-image generation using DALL-E 3 or gpt-image-1. Accepts prompt, model, size, quality, style, n, response_format, background, output_format, output_compression, and more. Returns typed OpenAI::Models::ImagesResponse.
  • client.images.edit(...) — Image editing with text prompts. Accepts image file + prompt + mask.
  • client.images.create_variation(...) — Image variations from an existing image.

The official SDK also has streaming variants (generate_stream_raw, edit_stream_raw).

ruby-openai gem

Equivalent methods with hash-based parameters:

  • client.images.generate(parameters: { prompt:, model:, size:, quality:, ... })
  • client.images.edit(parameters: { ... })
  • client.images.variations(parameters: { ... })

Documented in the README with DALL-E 2 and DALL-E 3 examples.

Expected instrumentation

A new ImagesPatcher (following the existing ModerationsPatcher pattern) for each gem:

Image generation spans should capture:

  • Input: the text prompt
  • Metadata: model (e.g., dall-e-3, gpt-image-1), size, quality, style, n, response_format, provider, endpoint
  • Output: image URL(s) or metadata (not the binary/base64 image data itself)
  • Metrics: revised_prompt (when the model modifies the original prompt)

Braintrust docs status

not_found — Braintrust docs at https://www.braintrust.dev/docs/guides/tracing and the integrations pages do not mention image generation instrumentation. All examples focus on chat completions, embeddings, and audio.

Upstream sources

Local repo files inspected

  • lib/braintrust/contrib/openai/patcher.rb — defines ChatPatcher, ResponsesPatcher, ModerationsPatcher but no ImagesPatcher
  • lib/braintrust/contrib/openai/instrumentation/ — contains chat.rb, responses.rb, moderations.rb but no images.rb
  • lib/braintrust/contrib/ruby_openai/patcher.rb — defines ChatPatcher, ResponsesPatcher, ModerationsPatcher but no ImagesPatcher
  • lib/braintrust/contrib/ruby_openai/instrumentation/ — contains chat.rb, responses.rb, moderations.rb but no images.rb
  • Grep for images, dall, ImagesPatcher across lib/braintrust/ returns zero relevant matches
Dominant language
Ruby
Stars
9
Forks
10
Avg merge
22h 10m
Merged PRs (30d)
6

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from braintrustdata/braintrust-sdk-ruby

All issues in braintrustdata/braintrust-sdk-ruby

Similar issues

More Ruby issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.