Skip to content

Commit

Permalink
fix edge
Browse files Browse the repository at this point in the history
  • Loading branch information
dokmy committed Jan 13, 2024
1 parent 4dea2d6 commit 524233d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/app/api/chat/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ const config = new Configuration({
})
const openai = new OpenAIApi(config)

export const runtime = 'edge';


export async function POST(req: Request) {
try {
Expand Down
1 change: 0 additions & 1 deletion src/app/api/search/route.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Configuration, OpenAIApi } from 'openai-edge'
import { getEmbeddings } from '@/utils/embeddings'
import { getMatchesFromEmbeddings } from '@/utils/pinecone'
import dayjs from "dayjs";
Expand Down
2 changes: 2 additions & 0 deletions src/app/utils/embeddings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ const config = new Configuration({
})
const openai = new OpenAIApi(config)

export const runtime = 'edge';

export async function getEmbeddings(input: string) {
try {
const response = await openai.createEmbedding({
Expand Down

0 comments on commit 524233d

Please sign in to comment.