Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lvwzhen committed May 4, 2023
1 parent 6ae9d68 commit ea8aba8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pages/api/vector-search.ts
Expand Up @@ -11,7 +11,7 @@ export const config = {
}

const openAiKey = process.env.OPENAI_KEY
const openAiBaseUrl = process.env.OPENAI_BASE_URL
const openAiBaseUrl = process.env.OPENAI_BASE_URL || 'api.openai.com';
const supabaseUrl = process.env.NEXT_PUBLIC_SUPABASE_URL
const supabaseServiceKey = process.env.SUPABASE_SERVICE_ROLE_KEY

Expand Down Expand Up @@ -45,7 +45,7 @@ export default async function handler(req: NextRequest) {

// Moderate the content to comply with OpenAI T&C
const sanitizedQuery = query.trim()
const moderationResponse = await fetch('https://' + openAiBaseUrl + '/v1/v1/moderations', {
const moderationResponse = await fetch('https://' + openAiBaseUrl + '/v1/moderations', {
method: 'POST',
headers: {
Authorization: `Bearer ${openAiKey}`,
Expand All @@ -65,7 +65,7 @@ export default async function handler(req: NextRequest) {
})
}

const embeddingResponse = await fetch('https://' + openAiBaseUrl + '/v1/v1/embeddings', {
const embeddingResponse = await fetch('https://' + openAiBaseUrl + '/v1/embeddings', {
method: 'POST',
headers: {
Authorization: `Bearer ${openAiKey}`,
Expand Down

0 comments on commit ea8aba8

Please sign in to comment.