Skip to content

Commit

Permalink
fix: Fix models api base url
Browse files Browse the repository at this point in the history
  • Loading branch information
Amery2010 committed Oct 15, 2024
1 parent c6ab6d6 commit 42bd03d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/api/models/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ export async function GET(req: NextRequest) {
}

try {
const response = await fetch(`${geminiApiBaseUrl}/v1beta/models?key=${geminiApiKey}`)
const apiBaseUrl = geminiApiBaseUrl || 'https://generativelanguage.googleapis.com'
const response = await fetch(`${apiBaseUrl}/v1beta/models?key=${geminiApiKey}`)
return new NextResponse(response.body)
} catch (error) {
if (error instanceof Error) {
Expand Down

0 comments on commit 42bd03d

Please sign in to comment.