Download core/__init__.py from Salahin/Chat-PDF: direct link, hf CLI and curl.
- Browser
- Download file 474 Bytes
-
https://huggingface.co/spaces/Salahin/Chat-PDF/resolve/main/core/__init__.py
- Command line
-
hf download hf://spaces/Salahin/Chat-PDF/core/__init__.py
-
curl -L -o __init__.py https://huggingface.co/spaces/Salahin/Chat-PDF/resolve/main/core/__init__.py
474 Bytes
| import os | |
| import google.generativeai as genai | |
| from dotenv import load_dotenv | |
| # Loading environment variables | |
| load_dotenv() | |
| # Getting the Google API key from the environment variables | |
| GOOGLE_API_KEY = os.getenv("GOOGLE_API_KEY") | |
| # Raising an error if the Google API key is not set | |
| if not GOOGLE_API_KEY: | |
| raise ValueError("GOOGLE_API_KEY environment variable is not set") | |
| # Configuring the Google Generative AI with the API key | |
| genai.configure(api_key=GOOGLE_API_KEY) | |