From acacd2577e941231ae5b35bfd00d019e582743a3 Mon Sep 17 00:00:00 2001 From: Marvin Zhang Date: Mon, 10 Mar 2025 14:15:02 +0800 Subject: [PATCH] refactor: update LLMProvider model structure Simplified LLMProvider model: - Removed description, config schema, default config, and supported features - Added new field for API version - Cleaned up and focused on core provider attributes --- core/models/models/llm_provider.go | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/core/models/models/llm_provider.go b/core/models/models/llm_provider.go index b3fe910f..5acbf6c7 100644 --- a/core/models/models/llm_provider.go +++ b/core/models/models/llm_provider.go @@ -4,15 +4,11 @@ package models type LLMProvider struct { any `collection:"llm_providers"` BaseModel[LLMProvider] `bson:",inline"` - Key string `json:"key" bson:"key"` // Provider key (e.g., "openai", "anthropic", "gemini") - Name string `json:"name" bson:"name"` // Display name for UI - Description string `json:"description,omitempty" bson:"description,omitempty"` // Description of the provider - Models []string `json:"models" bson:"models"` // Models supported by this provider - ApiKey string `json:"api_key" bson:"api_key"` // API key for the provider - ApiBaseUrl string `json:"api_base_url" bson:"api_base_url"` // API base URL for the provider - Enabled bool `json:"enabled" bson:"enabled"` // Whether this provider is enabled - Priority int `json:"priority" bson:"priority"` // Priority for sorting in UI - ConfigSchema string `json:"config_schema" bson:"config_schema"` // JSON schema for configuration - DefaultConfig string `json:"default_config" bson:"default_config"` // Default configuration as JSON - SupportedFeatures []string `json:"supported_features" bson:"supported_features"` // Features supported by this provider (e.g., "function_calling", "streaming") + Key string `json:"key" bson:"key"` // Provider key (e.g., "openai", "anthropic", "gemini") + Name string `json:"name" bson:"name"` // Display name for UI + Enabled bool `json:"enabled" bson:"enabled"` // Whether this provider is enabled + ApiKey string `json:"api_key" bson:"api_key"` // API key for the provider + ApiBaseUrl string `json:"api_base_url" bson:"api_base_url"` // API base URL for the provider + ApiVersion string `json:"api_version" bson:"api_version"` // API version for the provider + Models []string `json:"models" bson:"models"` // Models supported by this provider }