- Add OPENAI_LIKE_API_MODELS environment variable support - Enable fallback model parsing when /models endpoint fails - Support providers like Fireworks AI that don't allow /models requests - Format: path/to/model1:limit;path/to/model2:limit;path/to/model3:limit - Update IProviderSetting interface to include OPENAI_LIKE_API_MODELS property - Fix all linting errors and code formatting issues
26 lines
602 B
TypeScript
26 lines
602 B
TypeScript
import type { ModelInfo } from '~/lib/modules/llm/types';
|
|
|
|
export type ProviderInfo = {
|
|
staticModels: ModelInfo[];
|
|
name: string;
|
|
getDynamicModels?: (
|
|
providerName: string,
|
|
apiKeys?: Record<string, string>,
|
|
providerSettings?: IProviderSetting,
|
|
serverEnv?: Record<string, string>,
|
|
) => Promise<ModelInfo[]>;
|
|
getApiKeyLink?: string;
|
|
labelForGetApiKey?: string;
|
|
icon?: string;
|
|
};
|
|
|
|
export interface IProviderSetting {
|
|
enabled?: boolean;
|
|
baseUrl?: string;
|
|
OPENAI_LIKE_API_MODELS?: string;
|
|
}
|
|
|
|
export type IProviderConfig = ProviderInfo & {
|
|
settings: IProviderSetting;
|
|
};
|