Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,6 +6,10 @@ from langchain.prompts import PromptTemplate
|
|
| 6 |
from langchain.chains import LLMChain
|
| 7 |
from langchain_google_genai import ChatGoogleGenerativeAI
|
| 8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
# Set page config
|
| 11 |
st.set_page_config(page_title="Company Info Agent", layout="wide")
|
|
@@ -67,7 +71,7 @@ tools = [search_tool]
|
|
| 67 |
|
| 68 |
# --- Initializing the LLM
|
| 69 |
llm = ChatGoogleGenerativeAI(
|
| 70 |
-
api_key =
|
| 71 |
model = "gemini-2.0-flash"
|
| 72 |
)
|
| 73 |
|
|
|
|
| 6 |
from langchain.chains import LLMChain
|
| 7 |
from langchain_google_genai import ChatGoogleGenerativeAI
|
| 8 |
|
| 9 |
+
key = os.environ.get("GOOGLE_API_KEY")
|
| 10 |
+
if not key:
|
| 11 |
+
st.error("❌ GOOGLE_API_KEY not found. Please set it in your Hugging Face Secrets.")
|
| 12 |
+
st.stop()
|
| 13 |
|
| 14 |
# Set page config
|
| 15 |
st.set_page_config(page_title="Company Info Agent", layout="wide")
|
|
|
|
| 71 |
|
| 72 |
# --- Initializing the LLM
|
| 73 |
llm = ChatGoogleGenerativeAI(
|
| 74 |
+
api_key = key,
|
| 75 |
model = "gemini-2.0-flash"
|
| 76 |
)
|
| 77 |
|