better autodetect names

This commit is contained in:
Dallin Romney 2025-03-06 11:59:46 -08:00
parent 71eb67d2ab
commit 954d91cfe8
4 changed files with 11 additions and 4 deletions

View file

@ -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,

View file

@ -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,

6
core/util/text.ts Normal file
View file

@ -0,0 +1,6 @@
export const capitalizeFirstLetter = (val: string) => {
if (val.length === 0) {
return "";
}
return val[0].toUpperCase() + val.slice(1);
};

View file

@ -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,