stephenmccartney1234 commited on
Commit
2f531cd
·
verified ·
1 Parent(s): 7efb4c1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -2,8 +2,13 @@ import gradio as gr
2
  import requests
3
 
4
  def chat_with_pdf(content):
5
- headers = {
6
- "x-api-key": "sec_5YYMlr7IeT5dzfXZiSgKdAfBKTibYEI2", # Replace with your API key
 
 
 
 
 
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