sarath2803 commited on
Commit
35b3bc6
·
verified ·
1 Parent(s): 2e4dcb5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -9,6 +9,7 @@ from typing import TypedDict, List, Dict, Any, Optional
9
  from langgraph.graph import StateGraph, END
10
  from langchain_openai import ChatOpenAI
11
  from langchain_core.messages import HumanMessage
 
12
 
13
  # (Keep Constants as is)
14
  # --- Constants ---
@@ -140,10 +141,14 @@ class BasicAgent:
140
  If you are not able to find the answer using the tools privided, you can use the web_search tool.
141
  If you are given a task to create an image,you can use the image_generation_tool.
142
  """
143
- llm = ChatOpenAI(model="gpt-4o", temperature=0)
 
 
 
 
144
  self.agent= CodeAgent(
145
  tools = [add, subtract, multiply, divide, web_search, image_generation_tool],
146
- model=llm,
147
  )
148
  def __call__(self, question: str, context: str = "") -> str:
149
  print(f"Agent received question (first 50 chars): {question[:50]}...")
 
9
  from langgraph.graph import StateGraph, END
10
  from langchain_openai import ChatOpenAI
11
  from langchain_core.messages import HumanMessage
12
+ from smol_agents.llms import InferenceClientModel
13
 
14
  # (Keep Constants as is)
15
  # --- Constants ---
 
141
  If you are not able to find the answer using the tools privided, you can use the web_search tool.
142
  If you are given a task to create an image,you can use the image_generation_tool.
143
  """
144
+ model = InferenceClientModel(
145
+ model_id="gpt-4.5-preview",
146
+ token=os.environ["OPENAI_API_KEY"],
147
+ provider="openai"
148
+ )
149
  self.agent= CodeAgent(
150
  tools = [add, subtract, multiply, divide, web_search, image_generation_tool],
151
+ model=model,
152
  )
153
  def __call__(self, question: str, context: str = "") -> str:
154
  print(f"Agent received question (first 50 chars): {question[:50]}...")