Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.
fix: Fix small benchmark bugs (#1826)
Matthew Zhou17192d5aa7fc
diff --git a/letta/benchmark/benchmark.py b/letta/benchmark/benchmark.pyindex 4031d4a7c..7109210e9 100644--- a/letta/benchmark/benchmark.py+++ b/letta/benchmark/benchmark.py@@ -2,11 +2,11 @@import timeimport uuid-from typing import Annotated+from typing import Annotated, Unionimport typer-from letta import create_client+from letta import LocalClient, RESTClient, create_clientfrom letta.benchmark.constants import HUMAN, PERSONA, PROMPTS, TRIESfrom letta.config import LettaConfig@@ -17,11 +17,13 @@ from letta.utils import get_human_text, get_persona_textapp = typer.Typer()-def send_message(message: str, agent_id, turn: int, fn_type: str, print_msg: bool = False, n_tries: int = TRIES):+def send_message(+ client: Union[LocalClient, RESTClient], message: str, agent_id, turn: int, fn_type: str, print_msg: bool = False, n_tries: int = TRIES+):try:print_msg = f"\t-> Now running {fn_type}. Progress: {turn}/{n_tries}"print(print_msg, end="\r", flush=True)- response = client.user_message(agent_id=agent_id, message=message, return_token_count=True)+ response = client.user_message(agent_id=agent_id, message=message)if turn + 1 == n_tries:print(" " * len(print_msg), end="\r", flush=True)@@ -65,7 +67,7 @@ def bench(agent_id = agent.idresult, msg = send_message(- message=message, agent_id=agent_id, turn=i, fn_type=fn_type, print_msg=print_messages, n_tries=n_tries+ client=client, message=message, agent_id=agent_id, turn=i, fn_type=fn_type, print_msg=print_messages, n_tries=n_tries)if print_messages: