fix(llm): update connector ID handling for built-in providers

- Enhanced the extractConnectorID function to correctly return the connector ID for built-in providers without appending a model, preventing the creation of non-existent composite IDs.
- Improved logic for handling connector IDs based on provider source, ensuring accurate retrieval in various scenarios.
This commit is contained in:
Max 2026-05-01 14:19:02 +08:00
parent 9eef569e4b
commit 1583e988f1

View file

@ -146,6 +146,13 @@ func (r *Registry) extractConnectorID(target interface{}) string {
}
return rt.Provider
}
// Builtin providers have model baked into the connector itself;
// appending :model would create a non-existent composite ID.
if p.Source == ProviderSourceBuiltIn {
return p.ConnectorID
}
if rt.Model != "" {
return p.ConnectorID + ":" + rt.Model
}