Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion crates/goose/src/providers/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,27 @@ pub trait Provider: Send + Sync {
) -> Result<(Message, ProviderUsage), ProviderError> {
let model_config = self.get_model_config();
let fast_config = model_config.use_fast_model();
self.complete_with_model(&fast_config, system, messages, tools)

match self
.complete_with_model(&fast_config, system, messages, tools)
.await
{
Ok(result) => Ok(result),
Err(e) => {
if fast_config.model_name != model_config.model_name {
tracing::warn!(
"Fast model {} failed with error: {}. Falling back to regular model {}",
fast_config.model_name,
e,
model_config.model_name
);
self.complete_with_model(&model_config, system, messages, tools)
.await
} else {
Err(e)
}
}
}
}

/// Get the model config from the provider
Expand Down
Loading