rename to "LLMConfigurationStatuses"
This commit is contained in:
parent
46e8dd7c38
commit
fa3c5f7a15
8 changed files with 19 additions and 19 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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) =>
|
||||
|
|
|
|||
6
core/index.d.ts
vendored
6
core/index.d.ts
vendored
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -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 (
|
||||
<ListboxOption
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue