Use ConfigKit mapping values directly

This commit is contained in:
2026-11-05 13:41:01 +00:00
parent 4ec35f5ca6
commit 106c808442
6 changed files with 65 additions and 126 deletions

View File

@@ -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)
}