Adjusted error linked with the llm
Browse files
app.py
CHANGED
|
@@ -7,9 +7,9 @@ import re
|
|
| 7 |
import math
|
| 8 |
import json
|
| 9 |
import unicodedata
|
|
|
|
| 10 |
from langgraph.prebuilt import create_react_agent
|
| 11 |
from langchain_core.messages import SystemMessage
|
| 12 |
-
from langchain_huggingface import ChatHuggingFace, HuggingFaceEndpoint
|
| 13 |
from langchain_core.tools import tool
|
| 14 |
from langchain_community.tools import DuckDuckGoSearchRun
|
| 15 |
from langchain_community.utilities import WikipediaAPIWrapper
|
|
@@ -124,16 +124,14 @@ class BasicAgent:
|
|
| 124 |
def __init__(self):
|
| 125 |
print("Initializing LangGraph ReAct Agent with Llama 3.3 70B...")
|
| 126 |
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
max_new_tokens=1024,
|
| 132 |
temperature=0.1,
|
| 133 |
-
|
| 134 |
)
|
| 135 |
-
|
| 136 |
-
|
| 137 |
tools = [
|
| 138 |
web_search,
|
| 139 |
wikipedia_search,
|
|
|
|
| 7 |
import math
|
| 8 |
import json
|
| 9 |
import unicodedata
|
| 10 |
+
from langchain_openai import ChatOpenAI
|
| 11 |
from langgraph.prebuilt import create_react_agent
|
| 12 |
from langchain_core.messages import SystemMessage
|
|
|
|
| 13 |
from langchain_core.tools import tool
|
| 14 |
from langchain_community.tools import DuckDuckGoSearchRun
|
| 15 |
from langchain_community.utilities import WikipediaAPIWrapper
|
|
|
|
| 124 |
def __init__(self):
|
| 125 |
print("Initializing LangGraph ReAct Agent with Llama 3.3 70B...")
|
| 126 |
|
| 127 |
+
llm = ChatOpenAI(
|
| 128 |
+
model="Qwen/Qwen2.5-72B-Instruct", # supporta tool calling
|
| 129 |
+
base_url="https://router.huggingface.co/v1",
|
| 130 |
+
api_key=os.getenv("HF_TOKEN"),
|
|
|
|
| 131 |
temperature=0.1,
|
| 132 |
+
max_tokens=1024,
|
| 133 |
)
|
| 134 |
+
|
|
|
|
| 135 |
tools = [
|
| 136 |
web_search,
|
| 137 |
wikipedia_search,
|