Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -5,11 +5,12 @@ from langchain.tools import Tool
|
|
5 |
from langchain.agents import initialize_agent
|
6 |
from langchain.agents import AgentType
|
7 |
from langchain.tools import DuckDuckGoSearchRun
|
|
|
8 |
from google.colab import userdata # Securely storing API keys
|
9 |
|
10 |
|
11 |
# Configure LangChain LLM with Gemini
|
12 |
-
llm = ChatGoogleGenerativeAI(model="gemini-1.5-flash", google_api_key=
|
13 |
|
14 |
# Use DuckDuckGo Search (no API key needed)
|
15 |
ddgs = DuckDuckGoSearchRun()
|
|
|
5 |
from langchain.agents import initialize_agent
|
6 |
from langchain.agents import AgentType
|
7 |
from langchain.tools import DuckDuckGoSearchRun
|
8 |
+
import os
|
9 |
from google.colab import userdata # Securely storing API keys
|
10 |
|
11 |
|
12 |
# Configure LangChain LLM with Gemini
|
13 |
+
llm = ChatGoogleGenerativeAI(model="gemini-1.5-flash", google_api_key=os.getenv("gemini_api"))
|
14 |
|
15 |
# Use DuckDuckGo Search (no API key needed)
|
16 |
ddgs = DuckDuckGoSearchRun()
|