You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[bot] OpenAI audio transcription and speech spans missing braintrust.output_json #131
TracingHttpClient correctly creates a span for every OpenAI HTTP call, including calls to the Audio API (POST /v1/audio/transcriptions, POST /v1/audio/speech, POST /v1/audio/translations). However, InstrumentationSemConv.tagOpenAIResponse() only sets braintrust.output_json when the response body contains a choices array (Chat Completions) or an output array (Responses API). Audio endpoint responses use neither field:
Because neither shape is recognized, braintrust.output_json is never populated for these calls. The span is created and braintrust.input_json is set, but the output is silently dropped.
Relevant code
InstrumentationSemConv.java — tagOpenAIResponse() (checks for choices / output only):
// Only choices-based and output-based shapes are handled today.// Audio responses ({"text":"..."}) fall through without setting output_json.
TracingHttpClient.java — tagSpanFromBuffer() calls InstrumentationSemConv.tagLLMSpanResponse() with the raw response bytes, but the downstream parser discards unrecognized shapes.
Suggested fix
In InstrumentationSemConv.tagOpenAIResponse(), add a branch for the text-keyed transcription/translation shape:
For binary speech responses the content-type will be an audio MIME type (audio/mpeg, audio/opus, etc.); those should be skipped or represented with a placeholder rather than passing raw bytes as a string attribute.
Impact
Users calling client.audio().transcriptions().create(...) or .translations().create(...) today see an LLM span with no output, making it impossible to review the transcribed text in the Braintrust UI.
Activity