mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-10-09 03:20:56 +00:00
Fix LLM provider resolution to use model catalog before default fallback
When no explicit provider is set on a request, resolve_provider now consults the model catalog (e.g. gpt-5.4 → openai) before falling back to the client's default provider. This fixes PR description generation sending cross-provider model IDs to the wrong provider. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
4fe05e8a71
commit
fb04333d45
1 changed files with 4 additions and 0 deletions
|
|
@ -134,9 +134,13 @@ impl Client {
|
|||
|
||||
/// Resolve the provider for a request.
|
||||
fn resolve_provider(&self, request: &Request) -> Result<Arc<dyn ProviderAdapter>, SdkError> {
|
||||
let catalog_provider =
|
||||
crate::catalog::get_model_info(&request.model).map(|info| info.provider);
|
||||
|
||||
let provider_name = request
|
||||
.provider
|
||||
.as_deref()
|
||||
.or(catalog_provider.as_deref())
|
||||
.or(self.default_provider.as_deref())
|
||||
.ok_or_else(|| SdkError::Configuration {
|
||||
message: "No provider specified and no default provider set".into(),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue