Sonu313131 commited on
Commit
8264839
·
verified ·
1 Parent(s): f359605

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -4
app.py CHANGED
@@ -11,6 +11,7 @@ from huggingface_hub import login
11
  DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
12
 
13
  login(token=os.environ["HUGGINGFACEHUB_API_TOKEN"])
 
14
 
15
  search_tool = DuckDuckGoSearchTool()
16
 
@@ -18,11 +19,20 @@ async def run_and_submit_all(profile: gr.OAuthProfile | None):
18
  log_output = ""
19
 
20
  try:
21
- agent = CodeAgent(
 
22
  tools=[search_tool],
23
- model=InferenceClientModel(model="mistralai/Magistral-Small-2506", provider="featherless-ai"),
24
- max_steps=5,
25
- verbosity_level=2
 
 
 
 
 
 
 
 
26
  )
27
  except Exception as e:
28
  yield f"Error initializing agent: {e}", None, log_output
 
11
  DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
12
 
13
  login(token=os.environ["HUGGINGFACEHUB_API_TOKEN"])
14
+ openai_key = os.environ.get("OPENAI_API_KEY")
15
 
16
  search_tool = DuckDuckGoSearchTool()
17
 
 
19
  log_output = ""
20
 
21
  try:
22
+
23
+ agent = ToolCallingAgentAgent(
24
  tools=[search_tool],
25
+ model=InferenceClientModel(
26
+ model="gpt-3.5-turbo",
27
+ provider="openai",
28
+ model_kwargs={
29
+ "api_key": os.environ.get("OPENAI_API_KEY"),
30
+ "temperature": 0,
31
+ "max_tokens": 256
32
+ }
33
+ ),
34
+ max_steps=7,
35
+ verbosity_level=2
36
  )
37
  except Exception as e:
38
  yield f"Error initializing agent: {e}", None, log_output