Mohammad Haghir commited on
Commit ·
8415fc8
1
Parent(s): 3c704ef
update
Browse files- app.py +6 -3
- requirements.txt +1 -0
app.py
CHANGED
|
@@ -11,7 +11,8 @@ from typing import Dict
|
|
| 11 |
import operator
|
| 12 |
from typing import Annotated
|
| 13 |
|
| 14 |
-
from langchain_groq import ChatGroq
|
|
|
|
| 15 |
from langchain_core.messages import HumanMessage
|
| 16 |
|
| 17 |
from langgraph.graph import START, END, StateGraph, MessagesState
|
|
@@ -23,9 +24,11 @@ from agent_utils import wiki_ret, arxiv_ret, tavily_ret, handle_file_tool, add,
|
|
| 23 |
# --- Constants ---
|
| 24 |
DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
| 25 |
|
| 26 |
-
groq_api_key = os.getenv("GROQ_API_KEY")
|
|
|
|
| 27 |
tools = [wiki_ret, arxiv_ret, tavily_ret, handle_file_tool, add, subtract, division, multiplication, mode]
|
| 28 |
-
llm = ChatGroq(api_key=groq_api_key, model="gemma2-9b-it")
|
|
|
|
| 29 |
# llm_with_tools = llm.bind_tools(tools)
|
| 30 |
# class GraphState(TypedDict):
|
| 31 |
# messages: str #Annotated[Dict, operator.add]
|
|
|
|
| 11 |
import operator
|
| 12 |
from typing import Annotated
|
| 13 |
|
| 14 |
+
# from langchain_groq import ChatGroq
|
| 15 |
+
from langchain_openai import ChatOpenAI
|
| 16 |
from langchain_core.messages import HumanMessage
|
| 17 |
|
| 18 |
from langgraph.graph import START, END, StateGraph, MessagesState
|
|
|
|
| 24 |
# --- Constants ---
|
| 25 |
DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
| 26 |
|
| 27 |
+
# groq_api_key = os.getenv("GROQ_API_KEY")
|
| 28 |
+
openai_api_key = os.getenv("OPENAI_API_KEY")
|
| 29 |
tools = [wiki_ret, arxiv_ret, tavily_ret, handle_file_tool, add, subtract, division, multiplication, mode]
|
| 30 |
+
# llm = ChatGroq(api_key=groq_api_key, model="gemma2-9b-it")
|
| 31 |
+
llm = ChatOpenAI(api_key= openai_api_key, model = "gpt-4.1-2025-04-14")
|
| 32 |
# llm_with_tools = llm.bind_tools(tools)
|
| 33 |
# class GraphState(TypedDict):
|
| 34 |
# messages: str #Annotated[Dict, operator.add]
|
requirements.txt
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
gradio
|
| 2 |
requests
|
| 3 |
langchain-groq
|
|
|
|
| 4 |
langchain-community
|
| 5 |
langchain-core
|
| 6 |
langchain
|
|
|
|
| 1 |
gradio
|
| 2 |
requests
|
| 3 |
langchain-groq
|
| 4 |
+
langchain-openai
|
| 5 |
langchain-community
|
| 6 |
langchain-core
|
| 7 |
langchain
|