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
default: ""
runs:
using: "node16"
using: "node20"
main: "dist/index.js"
branding:
icon: "aperture"

View file

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