Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[bot] OpenAI Batch API (`client.batches.create`) not instrumented (openai + ruby-openai gems)

Aperta
#196 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
55/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
ruby
Ambito
api, observability

Direzione di ricerca

Inizia da lib/braintrust/contrib/openai/patcher.rb e dalla relativa directory di strumentazione, quindi confronta i file corrispondenti sotto lib/braintrust/contrib/ruby_openai/. Aggiungi la copertura per la chiamata batches.create in entrambe le integrazioni, acquisendo gli input e i metadati elencati, lasciando fuori dall’ambito il recupero asincrono; il lavoro è completato quando entrambi i gem espongono la strumentazione per l’invio dei batch coerente con i patcher esistenti.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Summary

Both the official openai gem and the community ruby-openai gem expose OpenAI's Batch API (client.batches.create), which submits up to 50,000 queued generation requests (chat completions, responses, embeddings, moderations, images, or videos) for asynchronous processing at reduced cost. This is the OpenAI-gem counterpart to two gaps already tracked in this repo for other providers/gems — Anthropic's Message Batches API (#169) and RubyLLM's RubyLLM.batch (#193) — but the equivalent surface for the openai/ruby-openai gems themselves has no instrumentation at all.

What is missing

OpenAI::Resources::Batches#create(completion_window:, endpoint:, input_file_id:, ...) (official gem) and the equivalent client.batches.create(...) on ruby-openai submit a batch job referencing an uploaded JSONL file of requests targeting one of /v1/responses, /v1/chat/completions, /v1/embeddings, /v1/completions, /v1/moderations, /v1/images/generations, /v1/images/edits, or /v1/videos. This is the generative-execution-initiating call for the batch — no Patcher in this repo wraps it.

batch = client.batches.create(
  completion_window: :"24h",
  endpoint: :"/v1/chat/completions",
  input_file_id: "input_file_id"
)
What a span should capture
  • Input: input_file_id, endpoint (which underlying generative API the batch targets), completion_window
  • Metadata: provider (openai), batch id, status on creation, any request-level metadata param
  • Metrics: request_counts once available (total/completed/failed), latency of the create call

Because results are retrieved asynchronously via file download (a CRUD/retrieval operation, out of scope per this audit), the actionable instrumentation point is the create call itself — matching the pattern already proposed for the Anthropic Messages Batches and RubyLLM.batch gaps in this repo.

Braintrust docs status

not_found — https://www.braintrust.dev/docs/integrations/ai-providers/openai documents chat completions, streaming, structured outputs, tool calling, audio transcription, and multimodal content, but does not mention the Batch API in any language.

Upstream sources

Local repo files inspected

  • lib/braintrust/contrib/openai/patcher.rb — defines ChatPatcher, ResponsesPatcher, ModerationsPatcher; no BatchesPatcher
  • lib/braintrust/contrib/openai/instrumentation/ — contains chat.rb, responses.rb, moderations.rb, common.rb; no batches.rb
  • lib/braintrust/contrib/ruby_openai/patcher.rb — same three patchers registered; no batches equivalent
  • lib/braintrust/contrib/ruby_openai/instrumentation/ — same file set as official gem integration; no batches.rb
  • Grep for batch, Batch, Batches across lib/braintrust/contrib/openai/ and lib/braintrust/contrib/ruby_openai/ returns zero matches
  • Issue #169 (Anthropic Messages Batch API) and #193 (RubyLLM.batch) establish the precedent that batch-submission APIs are in-scope generative execution surfaces for this SDK
Lingua principale
Ruby
Stelle
9
Fork
10
Merge medio
3g 43m
PR unite (30g)
9

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di braintrustdata/braintrust-sdk-ruby

Tutte le issue di braintrustdata/braintrust-sdk-ruby

Issue simili

Altre issue su Ruby

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.