Spaces:
Runtime error
Runtime error
Upload 3 files
Browse files- agent.py +3 -2
- requirements.txt +3 -3
agent.py
CHANGED
@@ -15,6 +15,9 @@ from langchain_core.messages import SystemMessage, HumanMessage
|
|
15 |
from langchain_core.tools import tool
|
16 |
from langchain.tools.retriever import create_retriever_tool
|
17 |
from supabase.client import Client, create_client
|
|
|
|
|
|
|
18 |
|
19 |
load_dotenv()
|
20 |
|
@@ -171,10 +174,8 @@ def build_graph(provider: str = "openai"):
|
|
171 |
"""Build the graph"""
|
172 |
# Load environment variables from .env file
|
173 |
if provider == "openai":
|
174 |
-
from langchain.chat_models import ChatOpenAI
|
175 |
llm = ChatOpenAI(model_name="gpt-4", temperature=0)
|
176 |
elif provider == "anthropic":
|
177 |
-
from langchain.chat_models import ChatAnthropic
|
178 |
llm = ChatAnthropic(model="claude-v1", temperature=0)
|
179 |
elif provider == "google":
|
180 |
# Google Gemini
|
|
|
15 |
from langchain_core.tools import tool
|
16 |
from langchain.tools.retriever import create_retriever_tool
|
17 |
from supabase.client import Client, create_client
|
18 |
+
from langchain_openai import ChatOpenAI
|
19 |
+
from langchain_anthropic import ChatAnthropic
|
20 |
+
|
21 |
|
22 |
load_dotenv()
|
23 |
|
|
|
174 |
"""Build the graph"""
|
175 |
# Load environment variables from .env file
|
176 |
if provider == "openai":
|
|
|
177 |
llm = ChatOpenAI(model_name="gpt-4", temperature=0)
|
178 |
elif provider == "anthropic":
|
|
|
179 |
llm = ChatAnthropic(model="claude-v1", temperature=0)
|
180 |
elif provider == "google":
|
181 |
# Google Gemini
|
requirements.txt
CHANGED
@@ -1,7 +1,6 @@
|
|
1 |
gradio
|
2 |
requests
|
3 |
langchain
|
4 |
-
langchain-community
|
5 |
langchain-core
|
6 |
langchain-google-genai
|
7 |
langchain-huggingface
|
@@ -17,6 +16,7 @@ wikipedia
|
|
17 |
pgvector
|
18 |
python-dotenv
|
19 |
sentence-transformers
|
20 |
-
|
21 |
-
openai
|
22 |
anthropic
|
|
|
|
|
|
1 |
gradio
|
2 |
requests
|
3 |
langchain
|
|
|
4 |
langchain-core
|
5 |
langchain-google-genai
|
6 |
langchain-huggingface
|
|
|
16 |
pgvector
|
17 |
python-dotenv
|
18 |
sentence-transformers
|
19 |
+
openai
|
|
|
20 |
anthropic
|
21 |
+
langchain-openai
|
22 |
+
langchain-anthropic
|