( config: AIRouterGatewayHandlerConfig )
| 1469 | } |
| 1470 | |
| 1471 | function buildAIRouterGatewayHandler( |
| 1472 | config: AIRouterGatewayHandlerConfig |
| 1473 | ): RequestHandler { |
| 1474 | if (config.builder === 'openai-chat') { |
| 1475 | return buildOpenAIHandler(config.options); |
| 1476 | } |
| 1477 | |
| 1478 | if (config.builder === 'openai-responses') { |
| 1479 | return buildOpenAIResponsesHandler(config.options); |
| 1480 | } |
| 1481 | |
| 1482 | return buildAnthropicHandler(config.options); |
| 1483 | } |
| 1484 | |
| 1485 | class AIRouterRuntimeError extends Error { |
| 1486 | constructor( |
no test coverage detected