add underlyingProviderName getter

This commit is contained in:
Nate 2025-05-20 13:57:06 -07:00
parent a4f025111e
commit 82bc0bdcbb
3 changed files with 16 additions and 1 deletions

3
core/index.d.ts vendored
View file

@ -93,6 +93,7 @@ export interface ILLM
extends Omit<LLMOptions, RequiredLLMOptions>,
Required<Pick<LLMOptions, RequiredLLMOptions>> {
get providerName(): string;
get underlyingProviderName(): string;
complete(
prompt: string,
@ -842,7 +843,7 @@ export interface SlashCommand {
description: string;
prompt?: string;
params?: { [key: string]: any };
promptFile?: string
promptFile?: string;
run: (sdk: ContinueSDK) => AsyncGenerator<string | undefined>;
}

View file

@ -88,6 +88,14 @@ export abstract class BaseLLM implements ILLM {
return (this.constructor as typeof BaseLLM).providerName;
}
/**
* This exists because for the continue-proxy, sometimes we want to get the value of the underlying provider that is used on the server
* For example, the underlying provider should always be sent with dev data
*/
get underlyingProviderName(): string {
return this.providerName;
}
supportsFim(): boolean {
return false;
}

View file

@ -1,6 +1,7 @@
import {
ContinueProperties,
decodeSecretLocation,
parseProxyModelName,
SecretType,
} from "@continuedev/config-yaml";
@ -43,6 +44,11 @@ class ContinueProxy extends OpenAI {
useLegacyCompletionsEndpoint: false,
};
get underlyingProviderName(): string {
const { provider } = parseProxyModelName(this.model);
return provider;
}
protected extraBodyProperties(): Record<string, any> {
const continueProperties: ContinueProperties = {
apiKeyLocation: this.apiKeyLocation,