// // ProviderRegistry.swift // Zyquo Router // // Author: Simon-Pierre Boucher // Mail: contact@spboucher.ai // import Foundation /// Resolves the right client for a provider or custom model. The only place /// that knows which wire format each provider speaks. enum ProviderRegistry { static func client(for model: AIModel) -> ProviderClient { switch model.provider.wireFormat { case .anthropicMessages: return AnthropicClient() case .openAIChatCompletions: return OpenAICompatibleClient( provider: model.provider, baseURLOverride: model.customBaseURL ) } } static func client(for provider: ProviderID) -> ProviderClient { switch provider.wireFormat { case .anthropicMessages: return AnthropicClient() case .openAIChatCompletions: return OpenAICompatibleClient(provider: provider) } } }