Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,7 +3,7 @@ import gradio as gr
|
|
| 3 |
import requests
|
| 4 |
import inspect
|
| 5 |
import pandas as pd
|
| 6 |
-
from smolagents import CodeAgent, LiteLLMModel, DuckDuckGoSearchTool
|
| 7 |
|
| 8 |
# --- Constants ---
|
| 9 |
DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
|
@@ -28,9 +28,9 @@ class BasicAgent:
|
|
| 28 |
timeout=30
|
| 29 |
)
|
| 30 |
self.agent = CodeAgent(
|
| 31 |
-
tools=[DuckDuckGoSearchTool(max_results=2)], # très limité
|
| 32 |
model=self.model,
|
| 33 |
-
max_steps=
|
| 34 |
)
|
| 35 |
|
| 36 |
def __call__(self, question: str) -> str:
|
|
|
|
| 3 |
import requests
|
| 4 |
import inspect
|
| 5 |
import pandas as pd
|
| 6 |
+
from smolagents import CodeAgent, LiteLLMModel, DuckDuckGoSearchTool,VisitWebpageTool
|
| 7 |
|
| 8 |
# --- Constants ---
|
| 9 |
DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
|
|
|
| 28 |
timeout=30
|
| 29 |
)
|
| 30 |
self.agent = CodeAgent(
|
| 31 |
+
tools=[DuckDuckGoSearchTool(max_results=2),VisitWebpageTool()], # très limité
|
| 32 |
model=self.model,
|
| 33 |
+
max_steps=4 # empêche l'historique de grossir trop
|
| 34 |
)
|
| 35 |
|
| 36 |
def __call__(self, question: str) -> str:
|