Skip to content

Commit

Permalink
fix: 修复 azure 代理的错误
Browse files Browse the repository at this point in the history
  • Loading branch information
rxliuli committed Aug 28, 2024
1 parent d7fe0da commit 82fc82e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -28,6 +29,7 @@ function getModels(env: Record<string, string>) {
moonshot(env),
lingyiwanwu(env),
groq(env),
auzreOpenAI(env),
].filter((it) => it.requiredEnv.every((it) => it in env))
}

Expand Down
2 changes: 1 addition & 1 deletion src/llm/azure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function auzreOpenAI(env: Record<string, string>) {
'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
Expand Down

0 comments on commit 82fc82e

Please sign in to comment.