Spaces:
Runtime error
Runtime error
testing envirenmental variables
Browse files
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')
|
|
|
|
|
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",
|