Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン
#147 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
55/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
静か
技術スタック
ruby
領域
observability

調査の方向性

lib/braintrust/contrib/openai/patcher.rb と lib/braintrust/contrib/ruby_openai/patcher.rb にある既存の patcher から始め、次にそれらの instrumentation ファイルを ModerationsPatcher パターンと比較します。不足している作業は、両方の gem で一覧にある generate、edit、variation メソッドに画像 instrumentation を追加することに限定されます。完了条件は、span が要求された prompt、metadata、画像 URL または metadata の出力、revised_prompt を取得し、バイナリ画像データを記録しないことです。

索引モデルが issue の本文から書いたものです。

説明

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
主要言語
Ruby
スター
9
フォーク
10
平均マージ
22時間 10分
マージ済み PR(30日)
6

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

braintrustdata/braintrust-sdk-ruby のほかの issue

braintrustdata/braintrust-sdk-ruby の issue をすべて見る

似ている issue

Ruby の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。