-
-
Notifications
You must be signed in to change notification settings - Fork 329
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Basic checks
- I searched existing issues - this hasn't been reported
- I can reproduce this consistently
- This is a RubyLLM bug, not my application code
What's broken?
When using OpenAI's word-level timestamp granularities feature, the words field from the API response was silently ignored. Users couldn't access word-level timing data even though OpenAI's API was returning it.
How to reproduce
- Call transcribe with timestamp_granularities
transcription = RubyLLM.transcribe(
'audio.wav',
model: 'whisper-1',
provider: :openai,
timestamp_granularities: ['word'],
response_format: 'verbose_json'
)
- OpenAI API returns response with 'words' array containing:
[
{"word": "Hello", "start": 0.0, "end": 0.5},
{"word": "world", "start": 0.6, "end": 1.0}
]
- Try to access the words data
transcription.words
# => undefined method `words' for an instance of RubyLLM::Transcription
The Transcription class was missing:
- words attribute reader
@wordsinstance variable assignment in initializer
Expected behavior
When calling RubyLLM.transcribe with timestamp_granularities: ['word'], the returned Transcription object should provide access to word-level timing data via the words attribute:
transcription = RubyLLM.transcribe(
'audio.wav',
model: 'whisper-1',
provider: :openai,
timestamp_granularities: ['word'],
response_format: 'verbose_json'
)
transcription.words
# => [
# {"word" => "Hello", "start" => 0.0, "end" => 0.5},
# {"word" => "world", "start" => 0.6, "end" => 1.0}
# ]
What actually happened
The words data is silently dropped and inaccessible:
transcription.words
# => undefined method `words' for an instance of RubyLLM::Transcription
The OpenAI API successfully returns the words array in the response, but:
- The Transcription class has no words attribute reader
- The
@wordsinstance variable is never assigned - The data is lost even though the provider attempts to pass it
Environment
- RubyLLM version: 1.9.1
- Ruby version: 3.3.4
- Provider: OpenAI
- Model: whisper-1
- API feature: Word-level timestamp granularities
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working