Spaces:
Sleeping
Sleeping
Update agent.py
Browse files
agent.py
CHANGED
|
@@ -6,7 +6,7 @@ from langchain_core.messages import AnyMessage, SystemMessage, HumanMessage, AIM
|
|
| 6 |
from langgraph.graph import StateGraph, START, END, MessagesState
|
| 7 |
from langgraph.prebuilt import ToolNode, tools_condition
|
| 8 |
from langchain_huggingface import HuggingFaceEndpoint, ChatHuggingFace
|
| 9 |
-
|
| 10 |
|
| 11 |
HUGGINGFACEHUB_API_TOKEN = getenv("HUGGINGFACEHUB_API_TOKEN")
|
| 12 |
|
|
@@ -16,12 +16,7 @@ HUGGINGFACEHUB_API_TOKEN = getenv("HUGGINGFACEHUB_API_TOKEN")
|
|
| 16 |
# huggingfacehub_api_token=HUGGINGFACEHUB_API_TOKEN,
|
| 17 |
#)
|
| 18 |
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
llm = HuggingFaceEndpoint(
|
| 22 |
-
url="https://api-inference.huggingface.co/models/Meta-DeepLearning/llama-2-7b-chat-hf",
|
| 23 |
-
)
|
| 24 |
-
|
| 25 |
|
| 26 |
chat = ChatHuggingFace(llm=llm, verbose=True)
|
| 27 |
tools = [add,
|
|
|
|
| 6 |
from langgraph.graph import StateGraph, START, END, MessagesState
|
| 7 |
from langgraph.prebuilt import ToolNode, tools_condition
|
| 8 |
from langchain_huggingface import HuggingFaceEndpoint, ChatHuggingFace
|
| 9 |
+
from langchain_google_genai import ChatGoogleGenerativeAI
|
| 10 |
|
| 11 |
HUGGINGFACEHUB_API_TOKEN = getenv("HUGGINGFACEHUB_API_TOKEN")
|
| 12 |
|
|
|
|
| 16 |
# huggingfacehub_api_token=HUGGINGFACEHUB_API_TOKEN,
|
| 17 |
#)
|
| 18 |
|
| 19 |
+
llm = ChatGoogleGenerativeAI(model="gemini-2.0-flash", temperature=0)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
chat = ChatHuggingFace(llm=llm, verbose=True)
|
| 22 |
tools = [add,
|