mirror of
https://github.com/outbackdingo/optimclaw.git
synced 2026-08-25 14:53:34 +00:00
refactor(llm): move transcription module into src/llm/ (#1559)
* refactor(llm): move transcription module into src/llm/ Transcription is an LLM capability (Whisper, Chat Completions audio). Move it from a top-level module into src/llm/transcription/ to reflect this, and update all references across the codebase. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> * style: fix rustfmt formatting after module move Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
1a62febe67
commit
fbce9a5fe3
@@ -162,7 +162,7 @@ pub struct AgentDeps {
|
||||
/// HTTP interceptor for trace recording/replay.
|
||||
pub http_interceptor: Option<Arc<dyn crate::llm::recording::HttpInterceptor>>,
|
||||
/// Audio transcription middleware for voice messages.
|
||||
pub transcription: Option<Arc<crate::transcription::TranscriptionMiddleware>>,
|
||||
pub transcription: Option<Arc<crate::llm::transcription::TranscriptionMiddleware>>,
|
||||
/// Document text extraction middleware for PDF, DOCX, PPTX, etc.
|
||||
pub document_extraction: Option<Arc<crate::document_extraction::DocumentExtractionMiddleware>>,
|
||||
/// Sandbox readiness state for full-job routine dispatch.
|
||||
|
||||
@@ -89,7 +89,9 @@ impl TranscriptionConfig {
|
||||
}
|
||||
|
||||
/// Create the transcription provider if enabled and configured.
|
||||
pub fn create_provider(&self) -> Option<Box<dyn crate::transcription::TranscriptionProvider>> {
|
||||
pub fn create_provider(
|
||||
&self,
|
||||
) -> Option<Box<dyn crate::llm::transcription::TranscriptionProvider>> {
|
||||
if !self.enabled {
|
||||
return None;
|
||||
}
|
||||
@@ -103,10 +105,11 @@ impl TranscriptionConfig {
|
||||
"Audio transcription enabled via Chat Completions API"
|
||||
);
|
||||
|
||||
let mut provider = crate::transcription::ChatCompletionsTranscriptionProvider::new(
|
||||
api_key.clone(),
|
||||
)
|
||||
.with_model(&self.model);
|
||||
let mut provider =
|
||||
crate::llm::transcription::ChatCompletionsTranscriptionProvider::new(
|
||||
api_key.clone(),
|
||||
)
|
||||
.with_model(&self.model);
|
||||
|
||||
if let Some(ref base_url) = self.base_url {
|
||||
provider = provider.with_base_url(base_url);
|
||||
@@ -121,7 +124,7 @@ impl TranscriptionConfig {
|
||||
);
|
||||
|
||||
let mut provider =
|
||||
crate::transcription::OpenAiWhisperProvider::new(api_key.clone())
|
||||
crate::llm::transcription::OpenAiWhisperProvider::new(api_key.clone())
|
||||
.with_model(&self.model);
|
||||
|
||||
if let Some(ref base_url) = self.base_url {
|
||||
|
||||
@@ -72,7 +72,6 @@ pub mod skills;
|
||||
pub mod timezone;
|
||||
pub mod tools;
|
||||
pub mod tracing_fmt;
|
||||
pub mod transcription;
|
||||
pub mod tunnel;
|
||||
pub mod util;
|
||||
pub mod webhooks;
|
||||
|
||||
@@ -35,6 +35,7 @@ mod rig_adapter;
|
||||
pub mod session;
|
||||
pub mod smart_routing;
|
||||
mod token_refreshing;
|
||||
pub mod transcription;
|
||||
|
||||
#[cfg(test)]
|
||||
mod codex_test_helpers;
|
||||
|
||||
+5
-4
@@ -846,10 +846,11 @@ async fn async_main() -> anyhow::Result<()> {
|
||||
cost_guard: components.cost_guard,
|
||||
sse_tx: sse_sender,
|
||||
http_interceptor,
|
||||
transcription: config
|
||||
.transcription
|
||||
.create_provider()
|
||||
.map(|p| Arc::new(ironclaw::transcription::TranscriptionMiddleware::new(p))),
|
||||
transcription: config.transcription.create_provider().map(|p| {
|
||||
Arc::new(ironclaw::llm::transcription::TranscriptionMiddleware::new(
|
||||
p,
|
||||
))
|
||||
}),
|
||||
document_extraction: Some(Arc::new(
|
||||
ironclaw::document_extraction::DocumentExtractionMiddleware::new(),
|
||||
)),
|
||||
|
||||
Reference in New Issue
Block a user