Use dotenv to populate environment vars

This commit is contained in:
John Goyette 2023-11-18 15:07:18 -05:00
parent 1174275b5b
commit 48bc877dbb
2 changed files with 9 additions and 1 deletions

View File

@ -6,6 +6,14 @@ import time
import simpleaudio as sa
import errno
from elevenlabs import generate, play, set_api_key, voices
from dotenv import load_dotenv
# import environment from dotenv file (.env)
# .env file should have API keys as follows
# OPENAI_API_KEY=<YOUR-API-KEY>
# ELEVENLABS_API_KEY=<YOUR-API-KEY>
# ELEVENLABS_VOICE_ID=<YOUR-VOICE-ID>
load_dotenv()
client = OpenAI()
@ -46,7 +54,7 @@ def generate_new_line(base64_image):
{"type": "text", "text": "Describe this image"},
{
"type": "image_url",
"image_url": f"data:image/jpeg;base64,{base64_image}",
"image_url": f"data:image/jpeg;base64,{base64_image}"
},
],
},

Binary file not shown.