Abbasid commited on
Commit
5a9d066
·
verified ·
1 Parent(s): f5fb638

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -7
app.py CHANGED
@@ -201,13 +201,15 @@ class HeightComparisonAgent(CodeAgent):
201
  # --- Instantiate the Subclassed Agent ---
202
  # IMPORTANT: Use the HeightComparisonAgent class, not CodeAgent directly.
203
  # Set verbosity_level=3 so the parent's run method (super().run) generates the verbose output.
204
- height_agent = HeightComparisonAgent(
205
- tools=[DuckDuckGoSearchTool(), VisitWebpageTool(), parse_height_from_text, create_comparison_statement, FinalAnswerTool()],
206
- model=llm_model,
207
- verbosity_level=3, # <<< Crucial for GradioUI to see the steps from the parent run
208
- max_steps=20, # Increased slightly just in case
209
- # planning_interval=3, # Optional
210
- )
 
 
211
 
212
  # --- Launch Gradio using GradioUI and the custom agent ---
213
  print("--- Starting Gradio Interface with GradioUI and HeightComparisonAgent ---")
 
201
  # --- Instantiate the Subclassed Agent ---
202
  # IMPORTANT: Use the HeightComparisonAgent class, not CodeAgent directly.
203
  # Set verbosity_level=3 so the parent's run method (super().run) generates the verbose output.
204
+ if llm_model is not None:
205
+ height_agent = HeightComparisonAgent(
206
+ tools=[DuckDuckGoSearchTool(), VisitWebpageTool(), parse_height_from_text, create_comparison_statement, FinalAnswerTool()],
207
+ model=llm_model,
208
+ verbosity_level=3, # <<< Crucial for GradioUI to see the steps from the parent run
209
+ max_steps=20, # Increased slightly just in case
210
+ # planning_interval=3, # Optional
211
+ )
212
+ else print('Failed to Load LiteLLM Model')
213
 
214
  # --- Launch Gradio using GradioUI and the custom agent ---
215
  print("--- Starting Gradio Interface with GradioUI and HeightComparisonAgent ---")