diff --git a/core/config/selectedModels.ts b/core/config/selectedModels.ts index 6ad55f925..c2ef111c0 100644 --- a/core/config/selectedModels.ts +++ b/core/config/selectedModels.ts @@ -1,7 +1,7 @@ import { ModelRole } from "@continuedev/config-yaml"; import { ContinueConfig, ILLM } from ".."; -import { LLMConfigurationStatus } from "../llm/constants"; +import { LLMConfigurationStatuses } from "../llm/constants"; import { GlobalContext, GlobalContextModelSelections, @@ -52,7 +52,7 @@ export function rectifySelectedModelsFromGlobalContext( fellBack = true; } - if (newModel?.getConfigurationStatus() !== LLMConfigurationStatus.VALID) { + if (newModel?.getConfigurationStatus() !== LLMConfigurationStatuses.VALID) { break; } diff --git a/core/config/yaml/loadYaml.ts b/core/config/yaml/loadYaml.ts index 9805beb2f..33b7b4693 100644 --- a/core/config/yaml/loadYaml.ts +++ b/core/config/yaml/loadYaml.ts @@ -42,7 +42,7 @@ import { PlatformConfigMetadata } from "../profile/PlatformProfileLoader"; import { modifyAnyConfigWithSharedConfig } from "../sharedConfig"; import { getControlPlaneEnvSync } from "../../control-plane/env"; -import { LLMConfigurationStatus } from "../../llm/constants"; +import { LLMConfigurationStatuses } from "../../llm/constants"; import { llmsFromModelConfig } from "./models"; export class LocalPlatformClient implements PlatformClient { @@ -240,7 +240,7 @@ async function configYamlToContinueConfig( if ( llms.every( (llm) => - llm.getConfigurationStatus() !== LLMConfigurationStatus.VALID, + llm.getConfigurationStatus() !== LLMConfigurationStatuses.VALID, ) ) { const chatModelForApplyFallback = config.models?.find((model) => diff --git a/core/index.d.ts b/core/index.d.ts index dfccadeb6..18813703e 100644 --- a/core/index.d.ts +++ b/core/index.d.ts @@ -1,6 +1,6 @@ import { DataDestination, ModelRole, Rule } from "@continuedev/config-yaml"; import Parser from "web-tree-sitter"; -import { LLMConfigurationStatus } from "./llm/constants"; +import { LLMConfigurationStatuses } from "./llm/constants"; import { GetGhTokenArgs } from "./protocol/ide"; declare global { @@ -164,7 +164,7 @@ export interface ILLM extends LLMOptions { canPutWordsInModelsMouth?: boolean, ): string | ChatMessage[]; - getConfigurationStatus(): LLMConfigurationStatus; + getConfigurationStatus(): LLMConfigurationStatuses; } export interface ModelInstaller { @@ -976,7 +976,7 @@ export interface ModelDescription { cacheBehavior?: CacheBehavior; capabilities?: ModelCapability; roles?: ModelRole[]; - configurationStatus?: LLMConfigurationStatus; + configurationStatus?: LLMConfigurationStatuses; } export interface EmbedOptions { diff --git a/core/llm/constants.ts b/core/llm/constants.ts index 1315b865a..8532aa33b 100644 --- a/core/llm/constants.ts +++ b/core/llm/constants.ts @@ -32,7 +32,7 @@ const PROXY_URL = "http://localhost:65433"; const DEFAULT_MAX_CHUNK_SIZE = 500; // 512 - buffer for safety (in case of differing tokenizers) const DEFAULT_MAX_BATCH_SIZE = 64; -export enum LLMConfigurationStatus { +export enum LLMConfigurationStatuses { VALID = "valid", MISSING_API_KEY = "missing-api-key", } diff --git a/core/llm/index.ts b/core/llm/index.ts index ff8bad889..363e45395 100644 --- a/core/llm/index.ts +++ b/core/llm/index.ts @@ -44,7 +44,7 @@ import { DEFAULT_MAX_BATCH_SIZE, DEFAULT_MAX_CHUNK_SIZE, DEFAULT_MAX_TOKENS, - LLMConfigurationStatus, + LLMConfigurationStatuses, } from "./constants.js"; import { compileChatMessages, @@ -263,7 +263,7 @@ export abstract class BaseLLM implements ILLM { } getConfigurationStatus() { - return LLMConfigurationStatus.VALID; + return LLMConfigurationStatuses.VALID; } protected createOpenAiAdapter() { diff --git a/core/llm/llms/Relace.ts b/core/llm/llms/Relace.ts index 344ae17c5..d65a94dc1 100644 --- a/core/llm/llms/Relace.ts +++ b/core/llm/llms/Relace.ts @@ -1,5 +1,5 @@ import { LLMOptions } from "../.."; -import { LLMConfigurationStatus } from "../constants"; +import { LLMConfigurationStatuses } from "../constants"; import { LlmApiRequestType } from "../openaiTypeConverters"; import OpenAI from "./OpenAI"; @@ -13,9 +13,9 @@ export class Relace extends OpenAI { getConfigurationStatus() { if (!this.apiKey) { - return LLMConfigurationStatus.MISSING_API_KEY; + return LLMConfigurationStatuses.MISSING_API_KEY; } - return LLMConfigurationStatus.VALID; + return LLMConfigurationStatuses.VALID; } } diff --git a/core/llm/llms/stubs/ContinueProxy.ts b/core/llm/llms/stubs/ContinueProxy.ts index 4477143d2..e43e2bfe2 100644 --- a/core/llm/llms/stubs/ContinueProxy.ts +++ b/core/llm/llms/stubs/ContinueProxy.ts @@ -9,7 +9,7 @@ import { Telemetry } from "../../../util/posthog.js"; import OpenAI from "../OpenAI.js"; import type { Chunk, LLMOptions } from "../../../index.js"; -import { LLMConfigurationStatus } from "../../constants.js"; +import { LLMConfigurationStatuses } from "../../constants.js"; class ContinueProxy extends OpenAI { set controlPlaneProxyInfo(value: ControlPlaneProxyInfo) { @@ -56,15 +56,15 @@ class ContinueProxy extends OpenAI { getConfigurationStatus() { if (!this.apiKeyLocation) { - return LLMConfigurationStatus.VALID; + return LLMConfigurationStatuses.VALID; } const secretLocation = decodeSecretLocation(this.apiKeyLocation); if (secretLocation.secretType === SecretType.NotFound) { - return LLMConfigurationStatus.MISSING_API_KEY; + return LLMConfigurationStatuses.MISSING_API_KEY; } - return LLMConfigurationStatus.VALID; + return LLMConfigurationStatuses.VALID; } protected _getHeaders() { diff --git a/gui/src/pages/config/ModelRoleSelector.tsx b/gui/src/pages/config/ModelRoleSelector.tsx index 8756329f6..5af026f61 100644 --- a/gui/src/pages/config/ModelRoleSelector.tsx +++ b/gui/src/pages/config/ModelRoleSelector.tsx @@ -5,7 +5,7 @@ import { CubeIcon, } from "@heroicons/react/24/outline"; import { ModelDescription } from "core"; -import { LLMConfigurationStatus } from "core/llm/constants"; +import { LLMConfigurationStatuses } from "core/llm/constants"; import { MouseEvent, useContext, useState } from "react"; import { defaultBorderRadius } from "../../components"; import { ToolTip } from "../../components/gui/Tooltip"; @@ -101,7 +101,7 @@ const ModelRoleSelector = ({ {models.map((option, idx) => { const showMissingApiKeyMsg = option.configurationStatus === - LLMConfigurationStatus.MISSING_API_KEY; + LLMConfigurationStatuses.MISSING_API_KEY; return (