errchh
commited on
Commit
·
70ca1ab
1
Parent(s):
f2b97a3
change llm
Browse files- __pycache__/agent.cpython-312.pyc +0 -0
- agent.py +6 -7
__pycache__/agent.cpython-312.pyc
CHANGED
Binary files a/__pycache__/agent.cpython-312.pyc and b/__pycache__/agent.cpython-312.pyc differ
|
|
agent.py
CHANGED
@@ -3,10 +3,9 @@ import os
|
|
3 |
from dotenv import load_dotenv
|
4 |
from typing import TypedDict, List, Dict, Any, Optional, Annotated
|
5 |
|
6 |
-
from langchain_huggingface import
|
7 |
from langchain_google_genai import ChatGoogleGenerativeAI # Added ChatGoogleGenerativeAI
|
8 |
|
9 |
-
|
10 |
from langgraph.graph import StateGraph, MessagesState, START, END
|
11 |
from langgraph.graph.message import add_messages
|
12 |
from langchain_core.messages import SystemMessage, HumanMessage, AnyMessage, AIMessage
|
@@ -157,15 +156,15 @@ tools = [
|
|
157 |
# build graph function
|
158 |
def build_graph():
|
159 |
# llm
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
google_api_key=GOOGLE_API_KEY
|
164 |
)
|
165 |
print(f"DEBUG: llm object = {llm}")
|
166 |
|
167 |
# bind tools to llm
|
168 |
-
|
|
|
169 |
print(f"DEBUG: llm_with_tools object = {llm_with_tools}")
|
170 |
|
171 |
# generate AgentState and Agent graph
|
|
|
3 |
from dotenv import load_dotenv
|
4 |
from typing import TypedDict, List, Dict, Any, Optional, Annotated
|
5 |
|
6 |
+
from langchain_huggingface import ChatHuggingFace, HuggingFaceEndpoint, HuggingFaceEmbeddings
|
7 |
from langchain_google_genai import ChatGoogleGenerativeAI # Added ChatGoogleGenerativeAI
|
8 |
|
|
|
9 |
from langgraph.graph import StateGraph, MessagesState, START, END
|
10 |
from langgraph.graph.message import add_messages
|
11 |
from langchain_core.messages import SystemMessage, HumanMessage, AnyMessage, AIMessage
|
|
|
156 |
# build graph function
|
157 |
def build_graph():
|
158 |
# llm
|
159 |
+
llm = HuggingFaceEndpoint(
|
160 |
+
repo_id="deepseek-ai/DeepSeek-V3-0324",
|
161 |
+
huggingfacehub_api_token=HUGGINGFACEHUB_API_TOKEN,
|
|
|
162 |
)
|
163 |
print(f"DEBUG: llm object = {llm}")
|
164 |
|
165 |
# bind tools to llm
|
166 |
+
chat = ChatHuggingFace(llm=llm, verbose=False)
|
167 |
+
llm_with_tools = chat.bind_tools(tools)
|
168 |
print(f"DEBUG: llm_with_tools object = {llm_with_tools}")
|
169 |
|
170 |
# generate AgentState and Agent graph
|