a1n2a3s4w commited on
Commit
f883b9b
·
verified ·
1 Parent(s): 90ac9b4

Changing the API provider

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -12,7 +12,7 @@ from langgraph.graph import StateGraph, END
12
  from langgraph.prebuilt import ToolNode
13
  from langchain_core.messages import HumanMessage, SystemMessage, AIMessage
14
  from langchain_core.tools import tool
15
- from langchain_openai import ChatOpenAI
16
  from langchain_community.tools import DuckDuckGoSearchRun, WikipediaQueryRun
17
  from langchain_community.utilities import WikipediaAPIWrapper
18
  from langchain_experimental.tools import PythonREPLTool
@@ -103,9 +103,8 @@ TOOLS = [calculator, search_tool, wiki_tool, python_tool, read_downloaded_file]
103
  # =========================================================
104
  # MODEL
105
  # =========================================================
106
- # Requires OPENAI_API_KEY set as a Space secret.
107
- # Swap model= for "gpt-4o" if you have budget for better accuracy.
108
- llm = ChatOpenAI(model="gpt-4o", temperature=0)
109
  llm_with_tools = llm.bind_tools(TOOLS)
110
 
111
  SYSTEM_PROMPT = """You are a general AI assistant answering benchmark questions that will be
@@ -348,7 +347,7 @@ with gr.Blocks() as demo:
348
  gr.Markdown(
349
  """
350
  **Instructions:**
351
- 1. Set `OPENAI_API_KEY` as a secret in your Space settings.
352
  2. Log in with the button below.
353
  3. Click 'Run Evaluation & Submit All Answers'.
354
 
 
12
  from langgraph.prebuilt import ToolNode
13
  from langchain_core.messages import HumanMessage, SystemMessage, AIMessage
14
  from langchain_core.tools import tool
15
+ from langchain_groq import ChatGroq
16
  from langchain_community.tools import DuckDuckGoSearchRun, WikipediaQueryRun
17
  from langchain_community.utilities import WikipediaAPIWrapper
18
  from langchain_experimental.tools import PythonREPLTool
 
103
  # =========================================================
104
  # MODEL
105
  # =========================================================
106
+ # Requires GROQ_API_KEY set as a Space secret (free — get one at console.groq.com).
107
+ llm = ChatGroq(model="llama-3.3-70b-versatile", temperature=0)
 
108
  llm_with_tools = llm.bind_tools(TOOLS)
109
 
110
  SYSTEM_PROMPT = """You are a general AI assistant answering benchmark questions that will be
 
347
  gr.Markdown(
348
  """
349
  **Instructions:**
350
+ 1. Set `GROQ_API_KEY` as a secret in your Space settings (free, get one at console.groq.com).
351
  2. Log in with the button below.
352
  3. Click 'Run Evaluation & Submit All Answers'.
353