not-lain commited on
Commit
4ffa9cc
1 Parent(s): d2a1bab

testing envirenmental variables

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -83,7 +83,9 @@ def convert_image_to_required_format(image):
83
 
84
  def process_image_with_openai(image):
85
  image_data = convert_image_to_required_format(image)
86
- openai_api_key = os.getenv('OPENAI_API_KEY') # Make sure to have this in your .env file
 
 
87
 
88
  data_payload = {
89
  "model": "gpt-4-vision-preview",
 
83
 
84
  def process_image_with_openai(image):
85
  image_data = convert_image_to_required_format(image)
86
+ openai_api_key = os.getenv('OPENAI_API_KEY')
87
+ if openai_api_key is None:
88
+ raise Exception("OPENAI_API_KEY not found in environment variables")
89
 
90
  data_payload = {
91
  "model": "gpt-4-vision-preview",