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:
parent
9eef569e4b
commit
1583e988f1
1 changed files with 7 additions and 0 deletions
|
|
@ -146,6 +146,13 @@ func (r *Registry) extractConnectorID(target interface{}) string {
|
||||||
}
|
}
|
||||||
return rt.Provider
|
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 != "" {
|
if rt.Model != "" {
|
||||||
return p.ConnectorID + ":" + rt.Model
|
return p.ConnectorID + ":" + rt.Model
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue