mirror of
https://github.com/freeedcom/ai-codereviewer.git
synced 2025-11-10 10:34:11 +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
|
required: false
|
||||||
default: ""
|
default: ""
|
||||||
runs:
|
runs:
|
||||||
using: "node16"
|
using: "node20"
|
||||||
main: "dist/index.js"
|
main: "dist/index.js"
|
||||||
branding:
|
branding:
|
||||||
icon: "aperture"
|
icon: "aperture"
|
||||||
|
|
|
||||||
29
src/main.ts
29
src/main.ts
|
|
@ -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({
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue