(input: {
providers: readonly ConfigOptionProvider[]
currentModel: ModelSelection["model"]
currentVariant?: string
includeModelVariants?: boolean
modes?: readonly ConfigOptionMode[]
currentModeId?: string
})
| 88 | } |
| 89 | |
| 90 | export function buildConfigOptions(input: { |
| 91 | providers: readonly ConfigOptionProvider[] |
| 92 | currentModel: ModelSelection["model"] |
| 93 | currentVariant?: string |
| 94 | includeModelVariants?: boolean |
| 95 | modes?: readonly ConfigOptionMode[] |
| 96 | currentModeId?: string |
| 97 | }): SessionConfigOption[] { |
| 98 | const variants = variantsForModel(input.providers, input.currentModel) |
| 99 | const effort = buildEffortSelectOption({ variants, currentVariant: input.currentVariant }) |
| 100 | |
| 101 | return [ |
| 102 | buildModelSelectOption({ |
| 103 | providers: input.providers, |
| 104 | currentModel: input.currentModel, |
| 105 | currentVariant: input.currentVariant, |
| 106 | includeVariants: input.includeModelVariants ?? false, |
| 107 | }), |
| 108 | ...(effort ? [effort] : []), |
| 109 | ...(input.modes && input.currentModeId |
| 110 | ? [buildModeSelectOption({ modes: input.modes, currentModeId: input.currentModeId })] |
| 111 | : []), |
| 112 | ] |
| 113 | } |
| 114 | |
| 115 | export function parseModelSelection(modelId: string, providers: readonly ConfigOptionProvider[]): ModelSelection { |
| 116 | const provider = providers.find((item) => modelId.startsWith(`${item.id}/`)) |
no test coverage detected