fix o3-mini getQueryConfig - update node to version 20

This commit is contained in:
Yura Hurnyak 2025-02-03 20:02:31 +02:00
commit 5f1b591f6f
2 changed files with 22 additions and 9 deletions

View file

@ -16,7 +16,7 @@ inputs:
required: false required: false
default: "" default: ""
runs: runs:
using: "node16" using: "node20"
main: "dist/index.js" main: "dist/index.js"
branding: branding:
icon: "aperture" icon: "aperture"

View file

@ -117,14 +117,27 @@ async function getAIResponse(prompt: string): Promise<Array<{
lineNumber: string; lineNumber: string;
reviewComment: string; reviewComment: string;
}> | null> { }> | null> {
const queryConfig = {
model: OPENAI_API_MODEL, function getQueryConfig() {
temperature: 0.2, if(OPENAI_API_MODEL === "o3-mini") {
max_completion_tokens: 1400, return {
top_p: 1, model: "o3-mini",
frequency_penalty: 0, // o3-mini supports only a few options:
presence_penalty: 0, max_completion_tokens: 1400,
}; };
} else {
return {
model: OPENAI_API_MODEL,
temperature: 0.2,
max_tokens: 1400,
top_p: 1,
frequency_penalty: 0,
presence_penalty: 0
}
}
}
const queryConfig = getQueryConfig();
try { try {
const response = await openai.chat.completions.create({ const response = await openai.chat.completions.create({