Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,8 +2,13 @@ import gradio as gr
|
|
| 2 |
import requests
|
| 3 |
|
| 4 |
def chat_with_pdf(content):
|
| 5 |
-
|
| 6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
"Content-Type": "application/json",
|
| 8 |
}
|
| 9 |
|
|
|
|
| 2 |
import requests
|
| 3 |
|
| 4 |
def chat_with_pdf(content):
|
| 5 |
+
|
| 6 |
+
api_key = os.getenv('CHATPDFKEY')
|
| 7 |
+
if not api_key:
|
| 8 |
+
return "API key (CHATPDFKEY) not set in environment variables."
|
| 9 |
+
|
| 10 |
+
headers = {
|
| 11 |
+
"x-api-key": api_key,
|
| 12 |
"Content-Type": "application/json",
|
| 13 |
}
|
| 14 |
|