build and deploy new version

This commit is contained in:
Yura Hurnyak 2025-02-03 20:04:22 +02:00
commit 794702202f
2 changed files with 21 additions and 9 deletions

18
dist/index.js vendored
View file

@ -139,14 +139,26 @@ ${chunk.changes
function getAIResponse(prompt) { function getAIResponse(prompt) {
var _a, _b; var _a, _b;
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
const queryConfig = { 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, model: OPENAI_API_MODEL,
temperature: 0.2, temperature: 0.2,
max_completion_tokens: 1400, max_tokens: 1400,
top_p: 1, top_p: 1,
frequency_penalty: 0, frequency_penalty: 0,
presence_penalty: 0, presence_penalty: 0
}; };
}
}
const queryConfig = getQueryConfig();
try { try {
const response = yield openai.chat.completions.create(Object.assign(Object.assign(Object.assign({}, queryConfig), (OPENAI_API_MODEL === "o3-mini" const response = yield openai.chat.completions.create(Object.assign(Object.assign(Object.assign({}, queryConfig), (OPENAI_API_MODEL === "o3-mini"
? { response_format: { type: "json_object" } } ? { response_format: { type: "json_object" } }

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long