7
7
from ragbits .core .llms import LiteLLM , ToolCall
8
8
9
9
10
- async def main ():
10
+ async def main () -> None :
11
11
"""Demonstrate the new instance-based todo approach with streaming and logging."""
12
-
13
12
# Create a dedicated TodoList instance for this agent
14
13
my_todo_list = TodoList ()
15
14
my_todo_manager = create_todo_manager (my_todo_list )
@@ -32,14 +31,21 @@ async def main():
32
31
- Transportation details with times, costs, parking info
33
32
- Weather considerations and backup plans
34
33
- Safety information and emergency contacts
35
- """ + get_todo_instruction_tpl (task_range = (3 , 5 )),
34
+ """
35
+ + get_todo_instruction_tpl (task_range = (3 , 5 )),
36
36
tools = [my_todo_manager ], # Use the instance-specific todo manager
37
- default_options = AgentOptions (max_turns = 30 )
37
+ default_options = AgentOptions (max_turns = 30 ),
38
38
)
39
39
40
- query = "Plan a 1-day hiking trip for 2 people in Tatra Mountains, Poland. Focus on scenic routes under 15km, avoiding crowds."
40
+ query = (
41
+ "Plan a 1-day hiking trip for 2 people in Tatra Mountains, Poland. " ,
42
+ "Focus on scenic routes under 15km, avoiding crowds." ,
43
+ )
41
44
# query = "How long is hike to Giewont from Kuźnice?"
42
- # query = "Is it difficult to finish Orla Perć? Would you recommend me to go there if I've never been in mountains before?"
45
+ # query = (
46
+ # "Is it difficult to finish Orla Perć? Would you recommend me ",
47
+ # "to go there if I've never been in mountains before?",
48
+ # )
43
49
44
50
stream = my_agent .run_streaming (query )
45
51
@@ -63,9 +69,9 @@ async def main():
63
69
for i , task in enumerate (tasks , 1 ):
64
70
print (f" { i } . { task } " )
65
71
66
- print ("\n \n " + "=" * 50 )
72
+ print ("\n \n " + "=" * 50 )
67
73
print ("🎉 Systematic hiking trip planning completed!" )
68
74
69
75
70
76
if __name__ == "__main__" :
71
- asyncio .run (main ())
77
+ asyncio .run (main ())
0 commit comments