Skip to content

Commit 5547e4e

Browse files
authored
chore: Release 1.7.2 (#3773)
# Changelog ## Improvements: - **Memory Growth on Performance Evals**: Added `memory_growth_tracking` as an attribute on `PerformanceEval` to enable additional debug logs for memory growth. ## Bug Fixes: - **Gemini 2.5 Metrics:** Fixed Gemini metrics to correctly include “thinking” tokens. - **Claude tool calling:** Fixed a bug related to parsing function call responses when using Claude models
1 parent e52748e commit 5547e4e

File tree

9 files changed

+32
-24
lines changed

9 files changed

+32
-24
lines changed

cookbook/agent_concepts/tool_concepts/custom_tools/tool_hook_with_state.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def grab_customer_profile_hook(
3535
raise ValueError(f"Customer profile for {cust_id} not found")
3636
customer_profile = agent.session_state["customer_profiles"][cust_id]
3737

38-
# Replace the customer_id with the customer_profile
38+
# Replace the customer with the customer_profile
3939
arguments["customer"] = json.dumps(customer_profile)
4040
# Call the function with the updated arguments
4141
result = function_call(**arguments)

cookbook/evals/performance/team_response_with_memory_multi_user.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import asyncio
22
import random
3+
import uuid
34

45
from agno.agent import Agent
56
from agno.eval.performance import PerformanceEval
@@ -8,6 +9,7 @@
89
from agno.models.openai import OpenAIChat
910
from agno.storage.postgres import PostgresStorage
1011
from agno.team.team import Team
12+
from agno.tools.reasoning import ReasoningTools
1113

1214
users = [
1315
"abel@example.com",
@@ -68,8 +70,8 @@ def get_activities(city: str) -> str:
6870
return f"The activities in {city} are {', '.join(selected_activities)}."
6971

7072

71-
agent_1 = Agent(
72-
agent_id="agent_1",
73+
weather_agent = Agent(
74+
agent_id="weather_agent",
7375
model=OpenAIChat(id="gpt-4o-mini"),
7476
description="You are a helpful assistant that can answer questions about the weather.",
7577
instructions="Be concise, reply with one sentence.",
@@ -79,8 +81,8 @@ def get_activities(city: str) -> str:
7981
add_history_to_messages=True,
8082
)
8183

82-
agent_2 = Agent(
83-
agent_id="agent_2",
84+
activities_agent = Agent(
85+
agent_id="activities_agent",
8486
model=OpenAIChat(id="gpt-4o-mini"),
8587
description="You are a helpful assistant that can answer questions about activities in a city.",
8688
instructions="Be concise, reply with one sentence.",
@@ -91,11 +93,12 @@ def get_activities(city: str) -> str:
9193
)
9294

9395
team = Team(
94-
members=[agent_1, agent_2],
96+
members=[weather_agent, activities_agent],
9597
model=OpenAIChat(id="gpt-4o-mini"),
9698
instructions="Be concise, reply with one sentence.",
9799
memory=memory,
98100
storage=team_storage,
101+
tools=[ReasoningTools()],
99102
markdown=True,
100103
enable_user_memories=True,
101104
add_history_to_messages=True,
@@ -108,7 +111,7 @@ async def run_team_for_user(user: str):
108111
await team.arun(
109112
message=f"I love {random_city}! What activities and weather can I expect in {random_city}?",
110113
user_id=user,
111-
session_id=f"session_{user}",
114+
session_id=f"session_{uuid.uuid4()}",
112115
)
113116

114117
tasks = []
@@ -132,11 +135,11 @@ async def run_team_for_user(user: str):
132135
warmup_runs=0,
133136
measure_runtime=False,
134137
debug_mode=True,
138+
memory_growth_tracking=True,
139+
top_n_memory_allocations=10,
135140
)
136141

137142
if __name__ == "__main__":
138143
asyncio.run(
139-
team_response_with_memory_impact.arun(
140-
print_results=True, print_summary=True, with_growth_tracking=True
141-
)
144+
team_response_with_memory_impact.arun(print_results=True, print_summary=True)
142145
)

cookbook/evals/performance/team_response_with_memory_simple.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,10 @@ async def run_team():
8585
warmup_runs=0,
8686
measure_runtime=False,
8787
debug_mode=True,
88+
memory_growth_tracking=True,
8889
)
8990

9091
if __name__ == "__main__":
9192
asyncio.run(
92-
team_response_with_memory_impact.arun(
93-
print_results=True, print_summary=True, with_growth_tracking=True
94-
)
93+
team_response_with_memory_impact.arun(print_results=True, print_summary=True)
9594
)

libs/agno/agno/eval/performance.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,7 @@ class PerformanceEval:
206206
# Print detailed results
207207
print_results: bool = False
208208
# Print detailed memory growth analysis
209-
with_growth_tracking: bool = False
210-
209+
memory_growth_tracking: bool = False
211210
# Number of memory allocations to track
212211
top_n_memory_allocations: int = 5
213212

@@ -468,7 +467,7 @@ async def _async_measure_memory_with_growth_tracking(
468467
return adjusted_usage, current_snapshot
469468

470469
def run(
471-
self, *, print_summary: bool = False, print_results: bool = False, with_growth_tracking: bool = False
470+
self, *, print_summary: bool = False, print_results: bool = False, memory_growth_tracking: bool = False
472471
) -> PerformanceResult:
473472
"""
474473
Main method to run the performance evaluation.
@@ -537,7 +536,7 @@ def run(
537536
live_log.update(status)
538537

539538
# Measure memory
540-
if self.with_growth_tracking or with_growth_tracking:
539+
if self.memory_growth_tracking or memory_growth_tracking:
541540
usage, current_snapshot = self._measure_memory_with_growth_tracking(
542541
memory_baseline, previous_snapshot
543542
)
@@ -584,7 +583,7 @@ def run(
584583
return self.result
585584

586585
async def arun(
587-
self, *, print_summary: bool = False, print_results: bool = False, with_growth_tracking: bool = False
586+
self, *, print_summary: bool = False, print_results: bool = False, memory_growth_tracking: bool = False
588587
) -> PerformanceResult:
589588
"""
590589
Async method to run the performance evaluation of async functions.
@@ -659,7 +658,7 @@ async def arun(
659658
live_log.update(status)
660659

661660
# Measure memory
662-
if self.with_growth_tracking or with_growth_tracking:
661+
if self.memory_growth_tracking or memory_growth_tracking:
663662
usage, current_snapshot = await self._async_measure_memory_with_growth_tracking(
664663
memory_baseline, previous_snapshot
665664
)

libs/agno/agno/memory/v2/db/redis.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ def __init__(
2020
port: int = 6379,
2121
db: int = 0,
2222
password: Optional[str] = None,
23+
ssl: Optional[bool] = False,
2324
expire: Optional[int] = None,
2425
):
2526
"""
@@ -31,6 +32,7 @@ def __init__(
3132
port (int): Redis port number
3233
db (int): Redis database number
3334
password (Optional[str]): Redis password if authentication is required
35+
ssl (Optional[bool]): Whether to use SSL for Redis connection
3436
expire (Optional[int]): TTL (time to live) in seconds for Redis keys. None means no expiration.
3537
"""
3638
self.prefix = prefix
@@ -41,6 +43,7 @@ def __init__(
4143
db=db,
4244
password=password,
4345
decode_responses=True, # Automatically decode responses to str
46+
ssl=ssl,
4447
)
4548
log_debug(f"Created RedisMemoryDb with prefix: '{self.prefix}'")
4649

libs/agno/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "agno"
3-
version = "1.7.1"
3+
version = "1.7.2"
44
description = "Agno: a lightweight library for building Multi-Agent Systems"
55
requires-python = ">=3.7,<4"
66
readme = "README.md"
@@ -434,4 +434,4 @@ module = [
434434
"zep_cloud.*",
435435
"oxylabs.*"
436436
]
437-
ignore_missing_imports = true
437+
ignore_missing_imports = true

libs/agno/tests/integration/agent/test_user_confirmation_flows.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,9 @@ async def get_the_weather(city: str):
311311
assert response.tools[0].tool_args == {"city": "Tokyo"}
312312

313313
# Mark the tool as confirmed
314-
response.tools[0].confirmed = True
314+
for tool_response in response.tools:
315+
if tool_response.requires_confirmation:
316+
tool_response.confirmed = True
315317
found_confirmation = True
316318
assert found_confirmation, "No tools were found to require confirmation"
317319

libs/agno/tests/integration/agent/test_user_input_flows.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,9 @@ async def get_the_weather(city: str):
119119
assert response.tools[0].tool_args == {"city": "Tokyo"}
120120

121121
# Provide user input
122-
response.tools[0].user_input_schema[0].value = "Tokyo"
122+
for tool_response in response.tools:
123+
if tool_response.requires_user_input:
124+
tool_response.user_input_schema[0].value = "Tokyo"
123125

124126
response = await agent.acontinue_run(response)
125127
assert response.is_paused is False

libs/agno/tests/integration/teams/test_memory_impact.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ def simple_function(input_text: str) -> str:
279279
mode="route",
280280
model=OpenAIChat(id="gpt-4o-mini"),
281281
members=[agent],
282-
storage=agent_storage,
282+
storage=team_storage,
283283
memory=memory,
284284
enable_user_memories=True,
285285
)

0 commit comments

Comments
 (0)