Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -18,7 +18,11 @@ app = FastAPI()
|
|
18 |
logging.basicConfig(level=logging.INFO, format='%(asctime)s %(levelname)s: %(message)s')
|
19 |
|
20 |
load_dotenv()
|
21 |
-
genai
|
|
|
|
|
|
|
|
|
22 |
|
23 |
def get_pdf_text(pdf_docs):
|
24 |
text = ""
|
|
|
18 |
logging.basicConfig(level=logging.INFO, format='%(asctime)s %(levelname)s: %(message)s')
|
19 |
|
20 |
load_dotenv()
|
21 |
+
# Configure genai with the API key
|
22 |
+
api_key = os.getenv("AIzaSyD0GxR2J1JxGic807Cc89Jq6MB4aDJYgDc")
|
23 |
+
if not api_key:
|
24 |
+
raise EnvironmentError("Google API Key not found in environment variables.")
|
25 |
+
genai.configure(api_key=api_key)
|
26 |
|
27 |
def get_pdf_text(pdf_docs):
|
28 |
text = ""
|