diff --git a/core/config/load.ts b/core/config/load.ts index 873577d8c..8005ff555 100644 --- a/core/config/load.ts +++ b/core/config/load.ts @@ -71,6 +71,7 @@ import { } from "../util/paths"; import { localPathToUri } from "../util/pathToUri"; +import { capitalizeFirstLetter } from "../util/text"; import { defaultContextProvidersJetBrains, defaultContextProvidersVsCode, @@ -272,7 +273,7 @@ async function intermediateToFinalConfig( { ...desc, model: modelName, - title: `${llm.title} - ${modelName}`, + title: `${modelName} - ${llm.title?.toUpperCase() === "AUTODETECT" ? capitalizeFirstLetter(llm.providerName) : llm.title} (Autodetect)`, }, ide.readFile.bind(ide), uniqueId, diff --git a/core/config/yaml/models.ts b/core/config/yaml/models.ts index c6916b010..240a7044e 100644 --- a/core/config/yaml/models.ts +++ b/core/config/yaml/models.ts @@ -3,6 +3,7 @@ import { ModelConfig } from "@continuedev/config-yaml"; import { IDE, IdeSettings, LLMOptions } from "../.."; import { BaseLLM } from "../../llm"; import { LLMClasses } from "../../llm/llms"; +import { capitalizeFirstLetter } from "../../util/text"; import { PlatformConfigMetadata } from "../profile/PlatformProfileLoader"; const AUTODETECT = "AUTODETECT"; @@ -127,7 +128,7 @@ async function autodetectModels( { ...model, model: modelName, - name: `${llm.title} - ${modelName}`, + name: `${modelName} - ${llm.title?.toUpperCase() === "AUTODETECT" ? capitalizeFirstLetter(llm.providerName) : llm.title} (Autodetect)`, }, uniqueId, ideSettings, diff --git a/core/util/text.ts b/core/util/text.ts new file mode 100644 index 000000000..e4870dfa0 --- /dev/null +++ b/core/util/text.ts @@ -0,0 +1,6 @@ +export const capitalizeFirstLetter = (val: string) => { + if (val.length === 0) { + return ""; + } + return val[0].toUpperCase() + val.slice(1); +}; diff --git a/gui/src/components/modelSelection/ModelSelectionListbox.tsx b/gui/src/components/modelSelection/ModelSelectionListbox.tsx index d48ffceed..596cddb9b 100644 --- a/gui/src/components/modelSelection/ModelSelectionListbox.tsx +++ b/gui/src/components/modelSelection/ModelSelectionListbox.tsx @@ -1,11 +1,10 @@ -import { Transition } from "@headlessui/react"; +import { Listbox, Transition } from "@headlessui/react"; import { CheckIcon, ChevronUpDownIcon, CubeIcon, } from "@heroicons/react/24/outline"; import { Fragment } from "react"; -import { Listbox } from "@headlessui/react"; import styled from "styled-components"; import { defaultBorderRadius,