Skip to content

Commit b8d53ed

Browse files
committed
chore: fix format and linters
1 parent 8faea7e commit b8d53ed

File tree

6 files changed

+23
-16
lines changed

6 files changed

+23
-16
lines changed

examples/agents/todo_tools_example.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@
77
from ragbits.core.llms import LiteLLM, ToolCall
88

99

10-
async def main():
10+
async def main() -> None:
1111
"""Demonstrate the new instance-based todo approach with streaming and logging."""
12-
1312
# Create a dedicated TodoList instance for this agent
1413
my_todo_list = TodoList()
1514
my_todo_manager = create_todo_manager(my_todo_list)
@@ -32,14 +31,21 @@ async def main():
3231
- Transportation details with times, costs, parking info
3332
- Weather considerations and backup plans
3433
- Safety information and emergency contacts
35-
""" + get_todo_instruction_tpl(task_range=(3, 5)),
34+
"""
35+
+ get_todo_instruction_tpl(task_range=(3, 5)),
3636
tools=[my_todo_manager], # Use the instance-specific todo manager
37-
default_options=AgentOptions(max_turns=30)
37+
default_options=AgentOptions(max_turns=30),
3838
)
3939

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+
)
4144
# 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+
# )
4349

4450
stream = my_agent.run_streaming(query)
4551

@@ -63,9 +69,9 @@ async def main():
6369
for i, task in enumerate(tasks, 1):
6470
print(f" {i}. {task}")
6571

66-
print("\n\n" + "="*50)
72+
print("\n\n" + "=" * 50)
6773
print("🎉 Systematic hiking trip planning completed!")
6874

6975

7076
if __name__ == "__main__":
71-
asyncio.run(main())
77+
asyncio.run(main())

examples/chat/chat.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,12 @@ async def chat(
154154
yield self.create_todo_item_response(parentTask)
155155
yield self.create_todo_item_response(subtaskTask)
156156

157-
await asyncio.sleep(1)
157+
await asyncio.sleep(2)
158158
subtaskTask.status = TaskStatus.COMPLETED
159+
yield self.create_todo_item_response(subtaskTask)
160+
await asyncio.sleep(2)
159161
parentTask.status = TaskStatus.COMPLETED
160-
161162
yield self.create_todo_item_response(parentTask)
162-
yield self.create_todo_item_response(subtaskTask)
163163

164164
streaming_result = self.llm.generate_streaming([*history, {"role": "user", "content": message}])
165165
async for chunk in streaming_result:

packages/ragbits-agents/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# CHANGELOG
22

33
## Unreleased
4+
- Add support for todo lists generated by agents with examples (#823)
45

56
## 1.3.0 (2025-09-11)
67
### Changed

packages/ragbits-agents/src/ragbits/agents/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
AgentRunContext,
88
ToolCallResult,
99
)
10-
from ragbits.agents.tools import get_todo_instruction_tpl, create_todo_manager
10+
from ragbits.agents.tools import create_todo_manager, get_todo_instruction_tpl
1111
from ragbits.agents.types import QuestionAnswerAgent, QuestionAnswerPromptInput, QuestionAnswerPromptOutput
1212

1313
__all__ = [
@@ -21,6 +21,6 @@
2121
"QuestionAnswerPromptInput",
2222
"QuestionAnswerPromptOutput",
2323
"ToolCallResult",
24-
"get_todo_instruction_tpl",
2524
"create_todo_manager",
25+
"get_todo_instruction_tpl",
2626
]
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""Agent tools for extending functionality."""
22

3-
from .todo import get_todo_instruction_tpl, create_todo_manager
3+
from .todo import create_todo_manager, get_todo_instruction_tpl
44

5-
__all__ = ["create_todo_manager", "get_todo_instruction_tpl"]
5+
__all__ = ["create_todo_manager", "get_todo_instruction_tpl"]

packages/ragbits-chat/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# CHANGELOG
22

33
## Unreleased
4+
- Add todo list component to the UI, add support for todo events in API (#827)
45

56
## 1.3.0 (2025-09-11)
6-
- Add todo list component to the UI, add support for todo events in API (#827)
77

88
### Changed
99

0 commit comments

Comments
 (0)