Class: OmniAI::Google::Transcribe
- Inherits:
-
Transcribe
- Object
- Transcribe
- OmniAI::Google::Transcribe
- Includes:
- TranscribeHelpers
- Defined in:
- lib/omniai/google/transcribe.rb,
lib/omniai/google/transcribe/gemini.rb
Overview
Defined Under Namespace
Modules: Model Classes: Gemini
Constant Summary collapse
- DEFAULT_MODEL =
Model::LATEST_SHORT
- DEFAULT_RECOGNIZER =
"_"- CONTEXT =
Context.build do |context| # No custom deserializers needed - let base class handle parsing end
- GEMINI_OPTIONS =
%i[diarization word_timestamps vocabulary].freeze
Class Method Summary collapse
-
.process!(io, model:, **options) ⇒ OmniAI::Transcribe::Transcription
Gemini transcribe models (
gemini-*) take a separate path; every Chirp / Speech-to-Text model is unchanged.
Instance Method Summary collapse
-
#initialize(io, client:, model:) ⇒ Transcribe
constructor
clientis swapped forclient.for_model(model), solocationsroutes the request. - #process! ⇒ OmniAI::Transcribe::Transcription
Constructor Details
#initialize(io, client:, model:) ⇒ Transcribe
client is swapped for client.for_model(model), so locations routes the request.
53 54 55 |
# File 'lib/omniai/google/transcribe.rb', line 53 def initialize(io, client:, model:, **) super(io, client: client.for_model(model), model:, **) end |
Class Method Details
.process!(io, model:, **options) ⇒ OmniAI::Transcribe::Transcription
Gemini transcribe models (gemini-*) take a separate path; every Chirp / Speech-to-Text model is unchanged.
41 42 43 44 45 46 47 48 49 50 |
# File 'lib/omniai/google/transcribe.rb', line 41 def self.process!(io, model:, **) return Gemini.process!(io, model:, **) if Gemini.model?(model) unsupported = .keys & GEMINI_OPTIONS if unsupported.any? raise ArgumentError, "#{unsupported.join(', ')} only supported by Gemini transcribe models, not #{model}" end super end |
Instance Method Details
#process! ⇒ OmniAI::Transcribe::Transcription
60 61 62 63 64 65 66 |
# File 'lib/omniai/google/transcribe.rb', line 60 def process! if needs_async_recognition? process_async! else process_sync! end end |