Publish Claude Code Binaries / Stage and publish binaries (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-arm64 (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build linux-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build windows-amd64 (push) Canceled after 0s
Sync Tutti Agent Skills / sync (push) Canceled after 0s
Windows Agent Adapters / Test Windows agent adapters (push) Canceled after 0s
Windows Daemon Adapters / Test Windows daemon adapters (push) Canceled after 0s
Publish Tutti App Runtime / Publish runtime catalog (push) Canceled after 0s
40 lines
1.4 KiB
Go
40 lines
1.4 KiB
Go
package modelcatalog
|
|
|
|
import "strings"
|
|
|
|
// ComposerCatalogProjection is the provider-neutral projection of a model
|
|
// catalog into the model, reasoning, and speed dimensions exposed by a
|
|
// composer. Product services remain responsible only for localization and
|
|
// transport DTOs.
|
|
type ComposerCatalogProjection struct {
|
|
Selection ModelSelection
|
|
ReasoningOptionsByModel map[string]ReasoningProfile
|
|
}
|
|
|
|
type ReasoningProfile struct {
|
|
DefaultValue string
|
|
Options []ReasoningEffortOption
|
|
}
|
|
|
|
// ProjectComposerCatalog preserves every model's advertised capabilities and
|
|
// resolves the effective model in one shared owner. Callers must not replace an
|
|
// advertised empty capability set with provider-wide static options.
|
|
func ProjectComposerCatalog(models []ModelOption, requestedModel string) ComposerCatalogProjection {
|
|
projection := ComposerCatalogProjection{
|
|
Selection: SelectModel(models, requestedModel),
|
|
ReasoningOptionsByModel: make(map[string]ReasoningProfile),
|
|
}
|
|
for _, model := range models {
|
|
modelID := strings.TrimSpace(model.ID)
|
|
if modelID == "" || !model.ReasoningEffortsAdvertised {
|
|
continue
|
|
}
|
|
options := append([]ReasoningEffortOption(nil), model.SupportedReasoningEfforts...)
|
|
projection.ReasoningOptionsByModel[modelID] = ReasoningProfile{
|
|
DefaultValue: validReasoningDefault(options, model.DefaultReasoningEffort),
|
|
Options: options,
|
|
}
|
|
}
|
|
return projection
|
|
}
|