Something went wrong. Try again.
This repository has no description
Something went wrong. Try again.
1.3 kB · 44 lines
123456789101112131415161718192021222324252627282930313233343536373839404142434445import { Select } from "octane-kumo/components/select";import { EFFORT_LABELS, modelEfforts, type ModelConfiguration,} from "../../shared/model-providers";
export function ModelEffortSelect({ configuration, disabled, onChange, compact = false,}: { configuration: ModelConfiguration; disabled: boolean; onChange: (configuration: ModelConfiguration) => void; compact?: boolean;}) { const efforts = modelEfforts(configuration); if (!efforts.length) return null; return ( <Select label={compact ? undefined : "Effort"} aria-label={compact ? "Effort" : undefined} className={compact ? "chat-composer-select" : undefined} side={compact ? "top" : "bottom"} size="sm" value={configuration.effort ?? "default"} disabled={disabled} items={[ { value: "default", label: "Provider default" }, ...efforts.map((value) => ({ value, label: EFFORT_LABELS[value] })), ]} onValueChange={(value) => { const { effort: _, ...model } = configuration; if (value === "default") onChange(model); else { const effort = efforts.find((effort) => effort === value); if (effort) onChange({ ...model, effort }); } }} /> );}