MCPcopy
hub / github.com/msgbyte/tianji / buildAIRouterGatewayHandler

Function buildAIRouterGatewayHandler

src/server/model/aiRouter.ts:1471–1483  ·  view source on GitHub ↗
(
  config: AIRouterGatewayHandlerConfig
)

Source from the content-addressed store, hash-verified

1469}
1470
1471function 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
1485class AIRouterRuntimeError extends Error {
1486 constructor(

Callers 1

Calls 3

buildOpenAIHandlerFunction · 0.85
buildAnthropicHandlerFunction · 0.85

Tested by

no test coverage detected