refactor: 清理未使用的类型定义和接口字段

- 移除 Provider 相关的 apiKeyEnvVar 字段(未实现的功能)
- 清理 Server routes 中未使用的 Core 类型导入
- 清理 UI Message 接口中未使用的 metadata 字段
This commit is contained in:
2025-12-30 10:41:38 +08:00
parent 243f8dc860
commit 5f38753f6d
16 changed files with 9 additions and 98 deletions
@@ -10,7 +10,6 @@ export const anthropicProvider: ProviderInfo = {
name: 'Anthropic',
description: 'Claude AI models by Anthropic',
builtin: true,
apiKeyEnvVar: 'ANTHROPIC_API_KEY',
models: [
{
id: 'claude-sonnet-4-20250514',
@@ -10,7 +10,6 @@ export const deepseekProvider: ProviderInfo = {
name: 'DeepSeek',
description: 'DeepSeek AI models',
builtin: true,
apiKeyEnvVar: 'DEEPSEEK_API_KEY',
models: [
{
id: 'deepseek-chat',
@@ -11,7 +11,6 @@ export const openaiProvider: ProviderInfo = {
name: 'OpenAI',
description: 'GPT models by OpenAI (also supports OpenAI-compatible APIs)',
builtin: true,
apiKeyEnvVar: 'OPENAI_API_KEY',
models: [
{
id: 'gpt-4o',
-2
View File
@@ -168,7 +168,6 @@ export class ProviderRegistry {
description: provider.info.description,
builtin: provider.info.builtin,
baseUrl: config?.baseUrl ?? provider.info.baseUrl,
apiKeyEnvVar: provider.info.apiKeyEnvVar,
models: provider.info.models,
allowCustomModels: provider.info.allowCustomModels ?? false,
config: {
@@ -200,7 +199,6 @@ export class ProviderRegistry {
description: definition.description,
builtin: false,
baseUrl: definition.baseUrl,
apiKeyEnvVar: definition.apiKeyEnvVar,
models: definition.models ?? [],
allowCustomModels: definition.allowCustomModels ?? true,
};
+1 -8
View File
@@ -48,8 +48,6 @@ export interface ProviderInfo {
builtin: boolean;
/** API 基础 URL */
baseUrl?: string;
/** API Key 环境变量名 */
apiKeyEnvVar?: string;
/** 可用模型列表 */
models: ModelInfo[];
/** 是否允许自定义模型 */
@@ -60,10 +58,8 @@ export interface ProviderInfo {
export interface ProviderConfig {
/** 提供商 ID */
id: string;
/** API Key(直接存储,不推荐) */
/** API Key */
apiKey?: string;
/** API Key 环境变量名 */
apiKeyEnvVar?: string;
/** 自定义 Base URL */
baseUrl?: string;
/** 是否启用 */
@@ -82,8 +78,6 @@ export interface CustomProviderDefinition {
description?: string;
/** API 基础 URL(必填) */
baseUrl: string;
/** API Key 环境变量名 */
apiKeyEnvVar?: string;
/** 可用模型列表 */
models?: ModelInfo[];
/** 是否允许自定义模型 */
@@ -157,7 +151,6 @@ export interface ProviderDetail {
description?: string;
builtin: boolean;
baseUrl?: string;
apiKeyEnvVar?: string;
models: ModelInfo[];
allowCustomModels: boolean;
config?: {