From 2bff110f3310a3bfbd00315d691dfd751c58159e Mon Sep 17 00:00:00 2001 From: jhawkins11 Date: Wed, 20 Mar 2024 16:34:56 -0500 Subject: [PATCH] Add OPENAI_MODEL environment variable --- .env.example | 3 ++- src/utils/generateAIArticle.ts | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.env.example b/.env.example index a8abadb..177958f 100644 --- a/.env.example +++ b/.env.example @@ -5,4 +5,5 @@ FIREBASE_AUTH_DOMAIN=*replace me* FIREBASE_PROJECT_ID=*replace me* FIREBASE_STORAGE_BUCKET=*replace me* FIREBASE_MESSAGING_SENDER_ID=*replace me* -FIREBASE_APP_ID=*replace me* \ No newline at end of file +FIREBASE_APP_ID=*replace me* +OPENAI_MODEL=*replace me* \ No newline at end of file diff --git a/src/utils/generateAIArticle.ts b/src/utils/generateAIArticle.ts index 282311a..721f148 100644 --- a/src/utils/generateAIArticle.ts +++ b/src/utils/generateAIArticle.ts @@ -9,7 +9,7 @@ export const generateAIArticle = async (prompt: string): Promise => { try { // generate completions completions = await openai.chat.completions.create({ - model: 'gpt-3.5-turbo', + model: process.env.OPENAI_MODEL, messages: [ { role: 'user', @@ -18,7 +18,7 @@ export const generateAIArticle = async (prompt: string): Promise => { ], max_tokens: 2048, n: 1, - temperature: 0.3, + temperature: 0.5, }) } catch (error) { console.log('error generating completions', error)