feat: migrate to openai.chat.completions.create

This commit is contained in:
2025-06-04 11:24:30 +09:00
parent befe7fdac3
commit 285a4fa49b

View File

@ -19,7 +19,7 @@ export async function openAI_GenerateScript(item: {
「今日のニュース記事をご紹介します…」といった導入も含め、約300文字程度でまとめてください。 「今日のニュース記事をご紹介します…」といった導入も含め、約300文字程度でまとめてください。
`; `;
const response = await openai.createChatCompletion({ const response = await openai.chat.completions.create({
model: "gpt-4o-mini", model: "gpt-4o-mini",
messages: [{ role: "user", content: prompt.trim() }], messages: [{ role: "user", content: prompt.trim() }],
temperature: 0.7, temperature: 0.7,