DenverJones commited on
Commit
69b2570
·
verified ·
1 Parent(s): 76abb0a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -1
app.py CHANGED
@@ -39,4 +39,25 @@ def get_snowfall_forecast(city: str, date: str) -> str:
39
  return f"No snowfall data available for {city} on {date}."
40
 
41
  except Exception as e:
42
- return f"Error fetching snowfall forecast: {str(e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
  return f"No snowfall data available for {city} on {date}."
40
 
41
  except Exception as e:
42
+ return f"Error fetching snowfall forecast: {str(e)}"
43
+
44
+ # ✅ Load the Final Answer Tool
45
+ final_answer = FinalAnswerTool()
46
+
47
+ # ✅ Load the Language Model
48
+ model = HfApiModel(
49
+ max_tokens=2096,
50
+ temperature=0.5,
51
+ model_id='Qwen/Qwen2.5-Coder-32B-Instruct',
52
+ )
53
+
54
+ # ✅ Create the AI Agent with Tools
55
+ agent = CodeAgent(
56
+ model=model,
57
+ tools=[final_answer, get_snowfall_forecast], # Snowfall Forecast Tool Added
58
+ max_steps=6,
59
+ verbosity_level=1,
60
+ )
61
+
62
+ # ✅ Launch the Gradio UI
63
+ GradioUI(agent).launch()