'Simulated (no API call) — heuristic expansion of deterministic audit', 'openai' => 'OpenAI (Chat Completions; works with any OpenAI-compatible endpoint)', 'anthropic' => 'Anthropic (not implemented yet)', 'local' => 'Local model endpoint (not implemented yet)', 'custom' => 'Custom HTTP endpoint (not implemented yet)', ]; } /** * Resolve the active provider. Falls back to simulated when: * - settings.enabled is false * - settings.provider is unknown * - the configured provider's class is not yet implemented */ public static function get_active_provider(): SA_Orch_LLM_Provider_Interface { $settings = SA_Orch_LLM_Settings::get(); if ( empty( $settings['enabled'] ) ) { return new SA_Orch_LLM_Provider_Simulated(); } $instance = self::instantiate( (string) ( $settings['provider'] ?? '' ) ); if ( $instance instanceof SA_Orch_LLM_Provider_Interface ) { return $instance; } // Fallback return new SA_Orch_LLM_Provider_Simulated(); } private static function instantiate( $id ): ?SA_Orch_LLM_Provider_Interface { switch ( $id ) { case 'simulated': return new SA_Orch_LLM_Provider_Simulated(); case 'openai': return new SA_Orch_LLM_Provider_OpenAI(); // Future: add cases here as providers land. // case 'anthropic': return new SA_Orch_LLM_Provider_Anthropic(); // case 'local': return new SA_Orch_LLM_Provider_Local(); // case 'custom': return new SA_Orch_LLM_Provider_Custom(); } return null; } }