add a target routing provider for custom target resources

This commit is contained in:
Owen
2026-08-05 17:53:45 -04:00
parent aba27a7bbf
commit 656eea5bb1
2 changed files with 209 additions and 0 deletions
+5
View File
@@ -28,6 +28,7 @@ import {
providerHasCapability,
type AiCapability
} from "@server/lib/aiCapabilities";
import { proxyAiGatewayToSiteTarget } from "@server/routers/aiGateway/targetRouting";
import {
SESSION_COOKIE_NAME,
validateSessionToken
@@ -486,6 +487,10 @@ export async function handleAiGatewayProxy(
const { provider } = selection;
if (provider.type === "custom" && provider.routingMode === "target") {
return await proxyAiGatewayToSiteTarget(req, res, provider);
}
const upstreamUrl = provider.upstreamUrl;
const authType = provider.authType as AiProviderAuthType;