Spaces:
Sleeping
Sleeping
adding secrets
Browse files
app.py
CHANGED
|
@@ -12,8 +12,14 @@ from langchain_core.tools import tool
|
|
| 12 |
import gradio as gr
|
| 13 |
import numpy as np
|
| 14 |
|
| 15 |
-
|
|
|
|
| 16 |
os.environ['USER_AGENT'] = os.getenv('USER_AGENT', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
def load_web_resources(file='websites.txt'):
|
| 19 |
urls = ['https://steveblank.com/']
|
|
|
|
| 12 |
import gradio as gr
|
| 13 |
import numpy as np
|
| 14 |
|
| 15 |
+
#to run locally
|
| 16 |
+
# load_dotenv()
|
| 17 |
os.environ['USER_AGENT'] = os.getenv('USER_AGENT', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)')
|
| 18 |
+
# Load secrets from Hugging Face environment
|
| 19 |
+
openai_api_key = os.getenv("OPENAI_API_KEY")
|
| 20 |
+
tavily_api_key = os.getenv("TAVILY_API_KEY")
|
| 21 |
+
if not openai_api_key or not tavily_api_key:
|
| 22 |
+
raise ValueError("API keys not set in Hugging Face Secrets")
|
| 23 |
|
| 24 |
def load_web_resources(file='websites.txt'):
|
| 25 |
urls = ['https://steveblank.com/']
|