Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -83,6 +83,7 @@ def convert_image_to_required_format(image):
|
|
| 83 |
def process_image_with_openai(image):
|
| 84 |
image_data = convert_image_to_required_format(image)
|
| 85 |
openai_api_key = os.getenv('OPENAI_API_KEY')
|
|
|
|
| 86 |
if openai_api_key is None:
|
| 87 |
raise Exception("OPENAI_API_KEY not found in environment variables")
|
| 88 |
|
|
@@ -102,6 +103,7 @@ def process_image_with_openai(image):
|
|
| 102 |
headers={
|
| 103 |
"Content-Type": "application/json",
|
| 104 |
"Authorization": f"Bearer {openai_api_key}"
|
|
|
|
| 105 |
},
|
| 106 |
json=data_payload
|
| 107 |
)
|
|
|
|
| 83 |
def process_image_with_openai(image):
|
| 84 |
image_data = convert_image_to_required_format(image)
|
| 85 |
openai_api_key = os.getenv('OPENAI_API_KEY')
|
| 86 |
+
oai_org = os.getenv('OAI_ORG')
|
| 87 |
if openai_api_key is None:
|
| 88 |
raise Exception("OPENAI_API_KEY not found in environment variables")
|
| 89 |
|
|
|
|
| 103 |
headers={
|
| 104 |
"Content-Type": "application/json",
|
| 105 |
"Authorization": f"Bearer {openai_api_key}"
|
| 106 |
+
"OpenAI-Organization": "{oai_org}"
|
| 107 |
},
|
| 108 |
json=data_payload
|
| 109 |
)
|