Use ConfigKit mapping values directly
This commit is contained in:
@@ -25,7 +25,8 @@ type ProfileConfig struct {
|
||||
// It encodes fields without validating them; NewEngine validates the final
|
||||
// effective configuration after all selected source layers are combined.
|
||||
// Mapping captures a copy of supported input values at creation; unsupported
|
||||
// values fail when the source is loaded.
|
||||
// values fail when the source is loaded. ExtraParams must use ConfigKit Mapping
|
||||
// input forms; callers must explicitly convert numbers or containers as needed.
|
||||
func ProfileSource(label string, profiles []ProfileConfig) configkit.Source {
|
||||
definitions := make([]any, 0, len(profiles))
|
||||
for _, config := range profiles {
|
||||
@@ -67,7 +68,7 @@ func ProfileSource(label string, profiles []ProfileConfig) configkit.Source {
|
||||
fields["api_key_required"] = *config.APIKeyRequired
|
||||
}
|
||||
if config.ExtraParams != nil {
|
||||
fields["extra_params"] = providerMapForMapping(config.ExtraParams)
|
||||
fields["extra_params"] = config.ExtraParams
|
||||
}
|
||||
definitions = append(definitions, fields)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user