mirror of
https://github.com/freeedcom/ai-codereviewer.git
synced 2025-09-09 11:17:08 +00:00
fix o3-mini getQueryConfig - update node to version 20
This commit is contained in:
parent
7b02fa303b
commit
5f1b591f6f
2 changed files with 22 additions and 9 deletions
|
@ -16,7 +16,7 @@ inputs:
|
|||
required: false
|
||||
default: ""
|
||||
runs:
|
||||
using: "node16"
|
||||
using: "node20"
|
||||
main: "dist/index.js"
|
||||
branding:
|
||||
icon: "aperture"
|
||||
|
|
29
src/main.ts
29
src/main.ts
|
@ -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({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue