diff --git a/src/index.ts b/src/index.ts index 5e35043..8170b93 100644 --- a/src/index.ts +++ b/src/index.ts @@ -12,6 +12,7 @@ import { cors } from 'hono/cors' import { moonshot } from './llm/moonshot' import { lingyiwanwu } from './llm/lingyiwanwu' import { groq } from './llm/groq' +import { auzreOpenAI } from './llm/azure' interface Bindings { API_KEY: string @@ -28,6 +29,7 @@ function getModels(env: Record) { moonshot(env), lingyiwanwu(env), groq(env), + auzreOpenAI(env), ].filter((it) => it.requiredEnv.every((it) => it in env)) } diff --git a/src/llm/azure.ts b/src/llm/azure.ts index f5176c7..814c355 100644 --- a/src/llm/azure.ts +++ b/src/llm/azure.ts @@ -26,7 +26,7 @@ export function auzreOpenAI(env: Record) { 'AZURE_API_VERSION', 'AZURE_DEPLOYMENT_MODELS', ] - r.supportModels = env.AZURE_DEPLOYMENT_MODELS.split(',').map((it) => { + r.supportModels = (env.AZURE_DEPLOYMENT_MODELS ?? '').split(',').map((it) => { if (it.includes(':')) { const [model, deployment] = it.split(':') map[model] = deployment