mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-11 22:12:23 +00:00
chore: remove deprecated GetAvailableModels and ModelInfo
- Remove deprecated config.ModelInfo type (use providers.ModelInfo) - Remove deprecated GetAvailableModels function (always returned nil) - Remove associated test - Update AISettingsResponse to use providers.ModelInfo
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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{
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user