Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

chore: remove deprecated GetAvailableModels and ModelInfo

rcourtmande2cb7a29bd1
diff --git a/internal/api/ai_handlers.go b/internal/api/ai_handlers.go
index af8020d676..393b8a87f5 100644
--- a/internal/api/ai_handlers.go
+++ b/internal/api/ai_handlers.go
@@ -789,13 +789,13 @@ type AISettingsResponse struct {
AuthMethod string `json:"auth_method"` // "api_key" or "oauth"
OAuthConnected bool `json:"oauth_connected"` // true if OAuth tokens are configured
// Patrol settings for token efficiency
- PatrolSchedulePreset string `json:"patrol_schedule_preset"` // DEPRECATED: legacy preset
- PatrolIntervalMinutes int `json:"patrol_interval_minutes"` // Patrol interval in minutes (0 = disabled)
- PatrolEnabled bool `json:"patrol_enabled"` // true if patrol is enabled
- PatrolAutoFix bool `json:"patrol_auto_fix"` // true if patrol can auto-fix issues
- AlertTriggeredAnalysis bool `json:"alert_triggered_analysis"` // true if AI analyzes when alerts fire
- UseProactiveThresholds bool `json:"use_proactive_thresholds"` // true if patrol warns before thresholds (false = use exact thresholds)
- AvailableModels []config.ModelInfo `json:"available_models"` // List of models for current provider
+ PatrolSchedulePreset string `json:"patrol_schedule_preset"` // DEPRECATED: legacy preset
+ PatrolIntervalMinutes int `json:"patrol_interval_minutes"` // Patrol interval in minutes (0 = disabled)
+ PatrolEnabled bool `json:"patrol_enabled"` // true if patrol is enabled
+ PatrolAutoFix bool `json:"patrol_auto_fix"` // true if patrol can auto-fix issues
+ AlertTriggeredAnalysis bool `json:"alert_triggered_analysis"` // true if AI analyzes when alerts fire
+ UseProactiveThresholds bool `json:"use_proactive_thresholds"` // true if patrol warns before thresholds (false = use exact thresholds)
+ AvailableModels []providers.ModelInfo `json:"available_models"` // List of models for current provider
// Multi-provider credentials - shows which providers are configured
AnthropicConfigured bool `json:"anthropic_configured"` // true if Anthropic API key or OAuth is set
OpenAIConfigured bool `json:"openai_configured"` // true if OpenAI API key is set
diff --git a/internal/config/ai.go b/internal/config/ai.go
index 9f2e5f4ccd..4979ace6f4 100644
--- a/internal/config/ai.go
+++ b/internal/config/ai.go
@@ -124,21 +124,6 @@ const (
DefaultGeminiBaseURL = "https://generativelanguage.googleapis.com/v1beta"
)
-// ModelInfo represents information about an available model
-// Deprecated: Use providers.ModelInfo instead - models are now fetched dynamically from APIs
-type ModelInfo struct {
- ID string `json:"id"`
- Name string `json:"name"`
- Description string `json:"description,omitempty"`
- IsDefault bool `json:"is_default,omitempty"`
-}
-
-// GetAvailableModels is deprecated - models are now fetched dynamically from provider APIs
-// This returns nil; use the /api/ai/models endpoint instead which queries the actual API
-func GetAvailableModels(provider string) []ModelInfo {
- return nil
-}
-
// NewDefaultAIConfig returns an AIConfig with sensible defaults
func NewDefaultAIConfig() *AIConfig {
return &AIConfig{
diff --git a/internal/config/ai_config_test.go b/internal/config/ai_config_test.go
index 5754d852ca..490a07be40 100644
--- a/internal/config/ai_config_test.go
+++ b/internal/config/ai_config_test.go
@@ -837,14 +837,6 @@ func TestAIConfig_IsAlertTriggeredAnalysisEnabled(t *testing.T) {
})
}
-func TestGetAvailableModels(t *testing.T) {
- // This function is deprecated and should return nil
- result := GetAvailableModels(AIProviderAnthropic)
- if result != nil {
- t.Error("GetAvailableModels should return nil (deprecated)")
- }
-}
-
func TestNewDefaultAIConfig(t *testing.T) {
config := NewDefaultAIConfig()