Spaces:
Sleeping
Sleeping
Add deplay between steps and max steps
Browse files
app.py
CHANGED
@@ -29,6 +29,13 @@ Tool Use Guidelines:
|
|
29 |
|
30 |
DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
# Agent wrapper using LiteLLMModel
|
33 |
class MyAgent:
|
34 |
def __init__(self):
|
@@ -51,6 +58,10 @@ class MyAgent:
|
|
51 |
],
|
52 |
model=self.model,
|
53 |
add_base_tools=True,
|
|
|
|
|
|
|
|
|
54 |
)
|
55 |
|
56 |
def __call__(self, question: str) -> str:
|
|
|
29 |
|
30 |
DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
31 |
|
32 |
+
def delay_execution_10(pagent, **kwargs) -> bool:
|
33 |
+
"""
|
34 |
+
Delays the execution for 10 seconds.
|
35 |
+
"""
|
36 |
+
time.sleep(10)
|
37 |
+
return True
|
38 |
+
|
39 |
# Agent wrapper using LiteLLMModel
|
40 |
class MyAgent:
|
41 |
def __init__(self):
|
|
|
58 |
],
|
59 |
model=self.model,
|
60 |
add_base_tools=True,
|
61 |
+
max_steps=5,
|
62 |
+
additional_authorized_imports=['*'],
|
63 |
+
planning_interval=5,
|
64 |
+
step_callbacks=[delay_execution_10],
|
65 |
)
|
66 |
|
67 |
def __call__(self, question: str) -> str:
|