Skip to content

Commit

Permalink
Add OPENAI_MODEL environment variable
Browse files Browse the repository at this point in the history
  • Loading branch information
jhawkins11 committed Mar 20, 2024
1 parent f6d5f36 commit 2bff110
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -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*
FIREBASE_APP_ID=*replace me*
OPENAI_MODEL=*replace me*
4 changes: 2 additions & 2 deletions src/utils/generateAIArticle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const generateAIArticle = async (prompt: string): Promise<string> => {
try {
// generate completions
completions = await openai.chat.completions.create({
model: 'gpt-3.5-turbo',
model: process.env.OPENAI_MODEL,
messages: [
{
role: 'user',
Expand All @@ -18,7 +18,7 @@ export const generateAIArticle = async (prompt: string): Promise<string> => {
],
max_tokens: 2048,
n: 1,
temperature: 0.3,
temperature: 0.5,
})
} catch (error) {
console.log('error generating completions', error)
Expand Down

0 comments on commit 2bff110

Please sign in to comment.