Skip to content

Commit

Permalink
Add openai key redundantly for github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
zacharyLYH committed Nov 29, 2023
1 parent 6a9a5a1 commit 2f0bed8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/api/code/score/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import OpenAI from "openai";
const promptHeader =
"Compare code B against code A. Using as few tokens as possible, output a percentage of similaritiy in semantics and intent.";

const openai = new OpenAI();
const openai = new OpenAI({
apiKey: process.env.OPENAI_API_KEY,
});

async function openAiCall(prompt: string) {
const chatCompletion = await openai.chat.completions.create({
Expand Down

0 comments on commit 2f0bed8

Please sign in to comment.