Skip to content

Commit c6d8224

Browse files
ysolankykausmeowsdirkbrnd
authored
chore: Release 2.0.3 (#4529)
# Changelog ## New Features: - **WorkflowTools**: Added `WorkflowTools` as a tool for agents and teams that allows the agent/team to run a workflow. Also has reasoning support for think/analyze. - **MemoryTools**: Added `MemoryTools` as a tool for agents and teams to add, update, delete memories. Also has reasoning support for think/analyze. - **Gemini TTS**: Added support for Gemini Text to Speech. - Added support for `encoding` to be passed on reader class. ## Improvements: - **AgentOS `kwargs` on runs:** Added support for additional arguments on running an agent/team/workflow via `AgentOS` API. ## Bug Fixes: - **Cerebras:** Fixed issues with `parallel_tool_calls` in Cerebras model. - **OpenAIResponses:** Fixed a bug with `store=False` in `OpenAIResponses` class. - **AgentOS Slack Interface**: the events endpoint was wrongly exposed on `slack/slack/events`, it is now exposed on `slack/events` - **AgentOS WhatsApp Interface:** fixed a bug where some messages wouldn’t be sent. - **Team MemoryManager**: Added `memory_manager` parameter to Teams. - **FixedSizeChunking:** Default chunk_size increased to 5000. - **Parser Model output in `print_response_stream`:** In streaming case the structured output from parser model was not being displayed json formatted in cli. --------- Co-authored-by: Kaustubh <[email protected]> Co-authored-by: Dirk Brand <[email protected]>
1 parent f843592 commit c6d8224

File tree

11 files changed

+62
-43
lines changed

11 files changed

+62
-43
lines changed

cookbook/memory/08_memory_tools.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"You are a trip planner bot and you are helping the user plan their trip.",
3030
"You should use the DuckDuckGoTools to get information about the destination and activities.",
3131
"You should use the MemoryTools to store information about the user for future reference.",
32+
"Don't ask the user for more information, make up what you don't know.",
3233
],
3334
markdown=True,
3435
)

cookbook/models/anthropic/web_fetch.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
model=Claude(
66
id="claude-opus-4-1-20250805",
77
default_headers={"anthropic-beta": "web-fetch-2025-09-10"},
8-
98
),
109
tools=[
1110
{
@@ -17,4 +16,7 @@
1716
markdown=True,
1817
)
1918

20-
agent.print_response("Tell me more about https://en.wikipedia.org/wiki/Glacier_National_Park_(U.S.)", stream=True)
19+
agent.print_response(
20+
"Tell me more about https://en.wikipedia.org/wiki/Glacier_National_Park_(U.S.)",
21+
stream=True,
22+
)

cookbook/models/openai/responses/reasoning_o3_mini.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
agent = Agent(
66
model=OpenAIResponses(id="o3-mini"),
7-
tools=[YFinanceTools(enable_all=True)],
7+
tools=[YFinanceTools()],
88
markdown=True,
99
)
1010

cookbook/workflows/_06_advanced_concepts/_06_other/workflow_tools.py

Lines changed: 33 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -99,41 +99,40 @@ def prepare_input_for_writer(step_input: StepInput) -> StepOutput:
9999

100100

101101
# Create and use workflow
102-
if __name__ == "__main__":
103-
content_creation_workflow = Workflow(
104-
name="Blog Post Workflow",
105-
description="Automated blog post creation from Hackernews and the web",
106-
db=SqliteDb(
107-
session_table="workflow_session",
108-
db_file="tmp/workflow.db",
109-
),
110-
steps=[
111-
prepare_input_for_web_search,
112-
research_team,
113-
prepare_input_for_writer,
114-
writer_agent,
115-
],
116-
)
102+
content_creation_workflow = Workflow(
103+
name="Blog Post Workflow",
104+
description="Automated blog post creation from Hackernews and the web",
105+
db=SqliteDb(
106+
session_table="workflow_session",
107+
db_file="tmp/workflow.db",
108+
),
109+
steps=[
110+
prepare_input_for_web_search,
111+
research_team,
112+
prepare_input_for_writer,
113+
writer_agent,
114+
],
115+
)
117116

118-
workflow_tools = WorkflowTools(
119-
workflow=content_creation_workflow,
120-
add_few_shot=True,
121-
few_shot_examples=FEW_SHOT_EXAMPLES,
122-
async_mode=True,
123-
)
117+
workflow_tools = WorkflowTools(
118+
workflow=content_creation_workflow,
119+
add_few_shot=True,
120+
few_shot_examples=FEW_SHOT_EXAMPLES,
121+
async_mode=True,
122+
)
124123

125-
agent = Agent(
126-
model=OpenAIChat(id="gpt-5-mini"),
127-
tools=[workflow_tools],
128-
markdown=True,
129-
)
124+
agent = Agent(
125+
model=OpenAIChat(id="gpt-5-mini"),
126+
tools=[workflow_tools],
127+
markdown=True,
128+
)
130129

131-
asyncio.run(
132-
agent.aprint_response(
133-
"Create a blog post with the following title: Quantum Computing in 2025",
134-
instructions="When you run the workflow using the `run_workflow` tool, remember to pass `additional_data` as a dictionary of key-value pairs.",
135-
markdown=True,
136-
stream=True,
137-
debug_mode=True,
138-
)
130+
asyncio.run(
131+
agent.aprint_response(
132+
"Create a blog post with the following title: Quantum Computing in 2025",
133+
instructions="When you run the workflow using the `run_workflow` tool, remember to pass `additional_data` as a dictionary of key-value pairs.",
134+
markdown=True,
135+
stream=True,
136+
debug_mode=True,
139137
)
138+
)

libs/agno/agno/models/openai/responses.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -879,7 +879,7 @@ def _parse_provider_response(self, response: Response, **kwargs) -> ModelRespons
879879

880880
# Add role
881881
model_response.role = "assistant"
882-
reasoning_summary: str = ""
882+
reasoning_summary: Optional[str] = None
883883

884884
for output in response.output:
885885
# Add content

libs/agno/agno/run/agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ def to_dict(self) -> Dict[str, Any]:
536536

537537
return _dict
538538

539-
def to_json(self, separators=(",", ":"), indent: Optional[int] = 2) -> str:
539+
def to_json(self, separators=(", ", ": "), indent: Optional[int] = 2) -> str:
540540
import json
541541

542542
try:

libs/agno/agno/run/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def to_dict(self) -> Dict[str, Any]:
115115

116116
return _dict
117117

118-
def to_json(self, separators=(",", ":"), indent: Optional[int] = 2) -> str:
118+
def to_json(self, separators=(", ", ": "), indent: Optional[int] = 2) -> str:
119119
import json
120120

121121
try:

libs/agno/agno/run/team.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ def to_dict(self) -> Dict[str, Any]:
489489

490490
return _dict
491491

492-
def to_json(self, separators=(",", ":"), indent: Optional[int] = 2) -> str:
492+
def to_json(self, separators=(", ", ": "), indent: Optional[int] = 2) -> str:
493493
import json
494494

495495
try:

libs/agno/agno/run/workflow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def to_dict(self) -> Dict[str, Any]:
9191

9292
return _dict
9393

94-
def to_json(self, separators=(",", ":"), indent: Optional[int] = 2) -> str:
94+
def to_json(self, separators=(", ", ": "), indent: Optional[int] = 2) -> str:
9595
import json
9696

9797
try:

libs/agno/agno/tools/memory.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class MemoryTools(Toolkit):
1313
def __init__(
1414
self,
1515
db: BaseDb,
16+
enable_get_memories: bool = True,
1617
enable_add_memory: bool = True,
1718
enable_update_memory: bool = True,
1819
enable_delete_memory: bool = True,
@@ -42,6 +43,8 @@ def __init__(
4243
tools: List[Any] = []
4344
if enable_think or all:
4445
tools.append(self.think)
46+
if enable_get_memories or all:
47+
tools.append(self.get_memories)
4548
if enable_add_memory or all:
4649
tools.append(self.add_memory)
4750
if enable_update_memory or all:
@@ -90,6 +93,20 @@ def think(self, session_state: Dict[str, Any], thought: str) -> str:
9093
log_error(f"Error recording memory thought: {e}")
9194
return f"Error recording memory thought: {e}"
9295

96+
def get_memories(self, session_state: Dict[str, Any]) -> str:
97+
"""
98+
Use this tool to get a list of memories from the database.
99+
"""
100+
try:
101+
# Get user info from session state
102+
user_id = session_state.get("current_user_id") if session_state else None
103+
104+
memories = self.db.get_user_memories(user_id=user_id)
105+
return json.dumps([memory.to_dict() for memory in memories], indent=2) # type: ignore
106+
except Exception as e:
107+
log_error(f"Error getting memories: {e}")
108+
return json.dumps({"error": str(e)}, indent=2)
109+
93110
def add_memory(
94111
self,
95112
session_state: Dict[str, Any],

0 commit comments

Comments
 (0)