Spaces:
Runtime error
Runtime error
Update agent.py
Browse files
agent.py
CHANGED
|
@@ -13,7 +13,7 @@ from langchain_community.vectorstores import SupabaseVectorStore
|
|
| 13 |
from langchain_core.messages import SystemMessage, HumanMessage
|
| 14 |
from langchain_core.tools import tool
|
| 15 |
from langchain.tools.retriever import create_retriever_tool
|
| 16 |
-
from
|
| 17 |
|
| 18 |
|
| 19 |
load_dotenv()
|
|
@@ -130,14 +130,7 @@ tools = [
|
|
| 130 |
def build_graph(provider: str = "huggingface"):
|
| 131 |
"""Build the graph"""
|
| 132 |
# Load environment variables from .env file
|
| 133 |
-
|
| 134 |
-
# Google Gemini
|
| 135 |
-
llm = ChatGoogleGenerativeAI(model="gemini-2.0-flash", temperature=0)
|
| 136 |
-
elif provider == "groq":
|
| 137 |
-
# Groq https://console.groq.com/docs/models
|
| 138 |
-
llm = ChatGroq(model="qwen-qwq-32b", temperature=0) # optional : qwen-qwq-32b gemma2-9b-it
|
| 139 |
-
elif provider == "huggingface":
|
| 140 |
-
llm = InferenceClientModel()
|
| 141 |
|
| 142 |
else:
|
| 143 |
raise ValueError("Invalid provider. Choose 'google', 'groq' or 'huggingface'.")
|
|
|
|
| 13 |
from langchain_core.messages import SystemMessage, HumanMessage
|
| 14 |
from langchain_core.tools import tool
|
| 15 |
from langchain.tools.retriever import create_retriever_tool
|
| 16 |
+
from langchain_openai import ChatOpenAI
|
| 17 |
|
| 18 |
|
| 19 |
load_dotenv()
|
|
|
|
| 130 |
def build_graph(provider: str = "huggingface"):
|
| 131 |
"""Build the graph"""
|
| 132 |
# Load environment variables from .env file
|
| 133 |
+
llm = ChatOpenAI(model="gpt-4o")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 134 |
|
| 135 |
else:
|
| 136 |
raise ValueError("Invalid provider. Choose 'google', 'groq' or 'huggingface'.")
|