Skip to content
Draft
1 change: 1 addition & 0 deletions packages/types/src/global-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ export const SECRET_STATE_KEYS = [
"ioIntelligenceApiKey",
"vercelAiGatewayApiKey",
"basetenApiKey",
"azureApiKey",
] as const

// Global secrets that are part of GlobalSettings (not ProviderSettings)
Expand Down
17 changes: 17 additions & 0 deletions packages/types/src/provider-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ export const providerNames = [
...customProviders,
...fauxProviders,
"anthropic",
"azure",
"bedrock",
"baseten",
"cerebras",
Expand Down Expand Up @@ -417,12 +418,20 @@ const basetenSchema = apiModelIdProviderModelSchema.extend({
basetenApiKey: z.string().optional(),
})

const azureSchema = apiModelIdProviderModelSchema.extend({
azureApiKey: z.string().optional(),
azureResourceName: z.string().optional(),
azureDeploymentName: z.string().optional(),
azureApiVersion: z.string().optional(),
})

const defaultSchema = z.object({
apiProvider: z.undefined(),
})

export const providerSettingsSchemaDiscriminated = z.discriminatedUnion("apiProvider", [
anthropicSchema.merge(z.object({ apiProvider: z.literal("anthropic") })),
azureSchema.merge(z.object({ apiProvider: z.literal("azure") })),
openRouterSchema.merge(z.object({ apiProvider: z.literal("openrouter") })),
bedrockSchema.merge(z.object({ apiProvider: z.literal("bedrock") })),
vertexSchema.merge(z.object({ apiProvider: z.literal("vertex") })),
Expand Down Expand Up @@ -464,6 +473,7 @@ export const providerSettingsSchemaDiscriminated = z.discriminatedUnion("apiProv
export const providerSettingsSchema = z.object({
apiProvider: providerNamesSchema.optional(),
...anthropicSchema.shape,
...azureSchema.shape,
...openRouterSchema.shape,
...bedrockSchema.shape,
...vertexSchema.shape,
Expand Down Expand Up @@ -552,6 +562,7 @@ export const isTypicalProvider = (key: unknown): key is TypicalProvider =>

export const modelIdKeysByProvider: Record<TypicalProvider, ModelIdKey> = {
anthropic: "apiModelId",
azure: "apiModelId",
openrouter: "openRouterModelId",
bedrock: "apiModelId",
vertex: "apiModelId",
Expand Down Expand Up @@ -628,6 +639,12 @@ export const MODELS_BY_PROVIDER: Record<
label: "Anthropic",
models: Object.keys(anthropicModels),
},
azure: {
id: "azure",
label: "Azure AI Foundry",
// Azure uses deployment names configured by the user (not a fixed upstream model ID list)
models: [],
},
bedrock: {
id: "bedrock",
label: "Amazon Bedrock",
Expand Down
Loading
Loading