MCPcopy Create free account
hub / github.com/anomalyco/opencode / variantsForModel

Function variantsForModel

packages/opencode/src/acp/config-option.ts:193–197  ·  view source on GitHub ↗
(providers: readonly ConfigOptionProvider[], model: ModelSelection["model"])

Source from the content-addressed store, hash-verified

191}
192
193function variantsForModel(providers: readonly ConfigOptionProvider[], model: ModelSelection["model"]) {
194 return Object.keys(
195 providers.find((provider) => provider.id === model.providerID)?.models[model.modelID]?.variants ?? {},
196 )
197}
198
199function selectVariant(variant: string | undefined, variants: readonly string[]) {
200 if (variant && variants.includes(variant)) return variant

Callers 2

buildModelSelectOptionFunction · 0.85
buildConfigOptionsFunction · 0.85

Calls 1

findMethod · 0.65

Tested by

no test coverage detected