diff --git a/scripts/konjacbot/pr.mts b/scripts/konjacbot/pr.mts index f832093..5b36835 100644 --- a/scripts/konjacbot/pr.mts +++ b/scripts/konjacbot/pr.mts @@ -27,6 +27,7 @@ const defaults = { github: 'https://github.com/vercel/next.js', web: 'https://nextjs.org/docs', }, + model: 'gpt-4o', } as const $.verbose = true @@ -94,7 +95,10 @@ async function buildPRSummary(): Promise { new OpenAI({ apiKey: defaults.apiKey, maxRetries: defaults.maxRetries, - }) + }), + { + model: defaults.model, + } ) try { diff --git a/scripts/konjacbot/translate.mts b/scripts/konjacbot/translate.mts index 59dab35..4b27ff7 100644 --- a/scripts/konjacbot/translate.mts +++ b/scripts/konjacbot/translate.mts @@ -21,6 +21,8 @@ const defaults = { lang: 'ja', promptDir: path.join(import.meta.dirname, `prompt`), isCI: process.env.CI ?? false, + temperature: 0, + model: 'gpt-4o', } as const const log = createLogger(basename(import.meta.filename)) @@ -52,7 +54,11 @@ const command = await (async () => { new OpenAI({ apiKey: defaults.apiKey, maxRetries: defaults.maxRetries, - }) + }), + { + temperature: defaults.temperature, + model: defaults.model, + } ) const systemContent = ( diff --git a/scripts/konjacbot/utils.mts b/scripts/konjacbot/utils.mts index ae4fa24..7a3b7d6 100644 --- a/scripts/konjacbot/utils.mts +++ b/scripts/konjacbot/utils.mts @@ -240,7 +240,8 @@ export function createLogger(prefix: string) { * @returns {(prompt: { system: string; user: string }) => Promise} A function that takes a prompt and returns the assistant's response as a string. */ export function createOpenAIClient( - openai: OpenAI + openai: OpenAI, + options: Omit ): (prompt: { system: string; user: string }) => Promise { async function fetch(prompt: { system: string @@ -255,7 +256,7 @@ export function createOpenAIClient( while (!isComplete) { const response = await openai.chat.completions.create({ - model: 'gpt-4o', + ...options, messages, stream: false, })