pub struct TranscriptionManager { /* private fields */ }Expand description
Manages multiple transcription / STT providers and routes transcription
requests. The manager is implicitly per-agent: the runtime-active
agent’s transcription_provider reference is the resolved alias for
transcribe() calls. there is no global default-provider concept.
Implementations§
Source§impl TranscriptionManager
impl TranscriptionManager
Sourcepub fn new(config: &TranscriptionConfig) -> Result<TranscriptionManager, Error>
pub fn new(config: &TranscriptionConfig) -> Result<TranscriptionManager, Error>
Build a TranscriptionManager from a TranscriptionConfig. The
resolved agent alias starts empty; orchestrators that wire the
manager to a specific agent should call
with_agent_transcription_provider to set it.
Sourcepub fn with_agent_transcription_provider(
self,
alias: impl Into<String>,
) -> TranscriptionManager
pub fn with_agent_transcription_provider( self, alias: impl Into<String>, ) -> TranscriptionManager
Set the resolved agent transcription_provider alias. Called by
orchestrators that bind this manager to a specific agent at startup.
Subsequent transcribe calls dispatch to this alias.
Sourcepub async fn transcribe(
&self,
audio_data: &[u8],
file_name: &str,
) -> Result<String, Error>
pub async fn transcribe( &self, audio_data: &[u8], file_name: &str, ) -> Result<String, Error>
Transcribe audio using the runtime-active agent’s resolved
transcription_provider. Fails loud when the agent has no
transcription_provider configured — there is no global default.
Sourcepub async fn transcribe_with_provider(
&self,
audio_data: &[u8],
file_name: &str,
transcription_provider: &str,
) -> Result<String, Error>
pub async fn transcribe_with_provider( &self, audio_data: &[u8], file_name: &str, transcription_provider: &str, ) -> Result<String, Error>
Transcribe audio using a specific named transcription_provider.
Sourcepub fn available_providers(&self) -> Vec<&str>
pub fn available_providers(&self) -> Vec<&str>
List registered transcription_provider names.
Auto Trait Implementations§
impl Freeze for TranscriptionManager
impl !RefUnwindSafe for TranscriptionManager
impl Send for TranscriptionManager
impl Sync for TranscriptionManager
impl Unpin for TranscriptionManager
impl UnsafeUnpin for TranscriptionManager
impl !UnwindSafe for TranscriptionManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more