errchh commited on
Commit
70ca1ab
·
1 Parent(s): f2b97a3

change llm

Browse files
Files changed (2) hide show
  1. __pycache__/agent.cpython-312.pyc +0 -0
  2. 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 HuggingFaceEmbeddings # Removed ChatHuggingFace, HuggingFaceEndpoint
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
- # Using ChatGoogleGenerativeAI as the LLM
161
- llm = ChatGoogleGenerativeAI(
162
- model="gemini-2.5-flash-preview-04-17",
163
- google_api_key=GOOGLE_API_KEY
164
  )
165
  print(f"DEBUG: llm object = {llm}")
166
 
167
  # bind tools to llm
168
- llm_with_tools = llm.bind_tools(tools)
 
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