mirror of
https://github.com/fosrl/pangolin.git
synced 2026-08-06 20:51:36 +02:00
add provider specific auth modes
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import { z } from "zod";
|
||||
import {
|
||||
AI_PROVIDER_AUTH_TYPES,
|
||||
providerRequiresUpstreamUrl,
|
||||
type AiProviderAuthType,
|
||||
type AiProviderRoutingMode,
|
||||
type AiProviderType
|
||||
} from "@server/lib/aiProviderDefaults";
|
||||
@@ -17,7 +19,7 @@ export const aiProviderTypeSchema = z.enum([
|
||||
"custom"
|
||||
]);
|
||||
|
||||
export const aiAuthTypeSchema = z.enum(["bearer"]);
|
||||
export const aiAuthTypeSchema = z.enum(AI_PROVIDER_AUTH_TYPES);
|
||||
|
||||
export const aiRoutingModeSchema = z.enum(["url", "target"]);
|
||||
|
||||
@@ -25,7 +27,7 @@ export function refineProviderUpstreamFields(
|
||||
data: {
|
||||
type: AiProviderType;
|
||||
upstreamUrl?: string | null;
|
||||
authType?: "bearer" | null;
|
||||
authType?: AiProviderAuthType | null;
|
||||
routingMode?: AiProviderRoutingMode | null;
|
||||
},
|
||||
ctx: z.RefinementCtx
|
||||
|
||||
Reference in New Issue
Block a user