1- /**
2- * Server-only provider registry
3- *
4- * This module contains the actual provider implementations with executeRequest functions.
5- * It should ONLY be imported from server-side code (API routes, executor handlers, etc.)
6- *
7- * Client-side code should use @/providers/utils for model lists and metadata.
8- */
9-
101import { createLogger } from '@/lib/logs/console/logger'
112import { anthropicProvider } from '@/providers/anthropic'
123import { azureOpenAIProvider } from '@/providers/azure-openai'
@@ -25,10 +16,6 @@ import { xAIProvider } from '@/providers/xai'
2516
2617const logger = createLogger ( 'ProviderRegistry' )
2718
28- /**
29- * Server-side provider registry with full implementations.
30- * This includes executeRequest functions that use server-only dependencies.
31- */
3219const providerRegistry : Record < ProviderId , ProviderConfig > = {
3320 openai : openaiProvider ,
3421 anthropic : anthropicProvider ,
@@ -45,13 +32,6 @@ const providerRegistry: Record<ProviderId, ProviderConfig> = {
4532 ollama : ollamaProvider ,
4633}
4734
48- /**
49- * Get a provider implementation for execution.
50- * This returns the full provider config including executeRequest.
51- *
52- * @param providerId - The provider ID
53- * @returns The provider config or undefined if not found
54- */
5535export async function getProviderExecutor (
5636 providerId : ProviderId
5737) : Promise < ProviderConfig | undefined > {
@@ -63,10 +43,6 @@ export async function getProviderExecutor(
6343 return provider
6444}
6545
66- /**
67- * Initialize all providers that have an initialize function.
68- * Called at server startup.
69- */
7046export async function initializeProviders ( ) : Promise < void > {
7147 for ( const [ id , provider ] of Object . entries ( providerRegistry ) ) {
7248 if ( provider . initialize ) {
0 commit comments