From b79a67ca4718f491d14c8cef63e76a2a3c4e3c09 Mon Sep 17 00:00:00 2001 From: cthomas Date: Fri, 16 May 2025 14:01:10 -0700 Subject: [PATCH] chore: bump version 0.7.19 (#2643) Co-authored-by: Andy Li <55300002+cliandy@users.noreply.github.com> Co-authored-by: Kevin Lin Co-authored-by: Sarah Wooders Co-authored-by: jnjpng --- letta/__init__.py | 2 +- letta/groups/sleeptime_multi_agent_v2.py | 4 ++-- letta/llm_api/google_vertex_client.py | 2 ++ letta/services/job_manager.py | 4 ++-- pyproject.toml | 2 +- tests/integration_test_batch_api_cron_jobs.py | 11 ++--------- 6 files changed, 10 insertions(+), 15 deletions(-) diff --git a/letta/__init__.py b/letta/__init__.py index af30a21b..906a7b37 100644 --- a/letta/__init__.py +++ b/letta/__init__.py @@ -1,4 +1,4 @@ -__version__ = "0.7.18" +__version__ = "0.7.19" # import clients from letta.client.client import LocalClient, RESTClient, create_client diff --git a/letta/groups/sleeptime_multi_agent_v2.py b/letta/groups/sleeptime_multi_agent_v2.py index 9dc591f5..e2910e5b 100644 --- a/letta/groups/sleeptime_multi_agent_v2.py +++ b/letta/groups/sleeptime_multi_agent_v2.py @@ -231,7 +231,7 @@ class SleeptimeMultiAgentV2(BaseAgent): # Update job status job_update = JobUpdate( status=JobStatus.completed, - completed_at=datetime.now(timezone.utc), + completed_at=datetime.now(timezone.utc).replace(tzinfo=None), metadata={ "result": result.model_dump(mode="json"), "agent_id": sleeptime_agent_id, @@ -242,7 +242,7 @@ class SleeptimeMultiAgentV2(BaseAgent): except Exception as e: job_update = JobUpdate( status=JobStatus.failed, - completed_at=datetime.now(timezone.utc), + completed_at=datetime.now(timezone.utc).replace(tzinfo=None), metadata={"error": str(e)}, ) self.job_manager.update_job_by_id(job_id=run_id, job_update=job_update, actor=self.actor) diff --git a/letta/llm_api/google_vertex_client.py b/letta/llm_api/google_vertex_client.py index b3ab4148..7319f7fc 100644 --- a/letta/llm_api/google_vertex_client.py +++ b/letta/llm_api/google_vertex_client.py @@ -235,6 +235,8 @@ class GoogleVertexClient(GoogleAIClient): ) except json.decoder.JSONDecodeError: + if candidate.finish_reason == "MAX_TOKENS": + raise ValueError(f"Could not parse response data from LLM: exceeded max token limit") # Inner thoughts are the content by default inner_thoughts = response_message.text diff --git a/letta/services/job_manager.py b/letta/services/job_manager.py index 87f957c7..d279ac90 100644 --- a/letta/services/job_manager.py +++ b/letta/services/job_manager.py @@ -72,7 +72,7 @@ class JobManager: setattr(job, key, value) if update_data.get("status") == JobStatus.completed and not job.completed_at: - job.completed_at = get_utc_time() + job.completed_at = get_utc_time().replace(tzinfo=None) if job.callback_url: self._dispatch_callback(session, job) @@ -96,7 +96,7 @@ class JobManager: setattr(job, key, value) if update_data.get("status") == JobStatus.completed and not job.completed_at: - job.completed_at = get_utc_time() + job.completed_at = get_utc_time().replace(tzinfo=None) if job.callback_url: await self._dispatch_callback_async(session, job) diff --git a/pyproject.toml b/pyproject.toml index 74745432..37aae356 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "letta" -version = "0.7.18" +version = "0.7.19" packages = [ {include = "letta"}, ] diff --git a/tests/integration_test_batch_api_cron_jobs.py b/tests/integration_test_batch_api_cron_jobs.py index 4479b0dd..786bad13 100644 --- a/tests/integration_test_batch_api_cron_jobs.py +++ b/tests/integration_test_batch_api_cron_jobs.py @@ -16,7 +16,6 @@ from anthropic.types.beta.messages import ( BetaMessageBatchSucceededResult, ) from dotenv import load_dotenv -from letta_client import Letta from letta.config import LettaConfig from letta.helpers import ToolRulesSolver @@ -75,12 +74,6 @@ def server(): return SyncServer() -@pytest.fixture(scope="session") -def client(server_url): - """Creates a REST client for testing.""" - return Letta(base_url=server_url) - - # --- Dummy Response Factories --- # @@ -263,7 +256,7 @@ def mock_anthropic_client(server, batch_a_resp, batch_b_resp, agent_b_id, agent_ # End-to-End Test # ----------------------------- @pytest.mark.asyncio(loop_scope="session") -async def test_polling_simple_real_batch(client, default_user, server): +async def test_polling_simple_real_batch(default_user, server): # --- Step 1: Prepare test data --- # Create batch responses with different statuses # NOTE: This is a REAL batch id! @@ -404,7 +397,7 @@ async def test_polling_simple_real_batch(client, default_user, server): @pytest.mark.asyncio(loop_scope="session") -async def test_polling_mixed_batch_jobs(client, default_user, server): +async def test_polling_mixed_batch_jobs(default_user, server): """ End-to-end test for polling batch jobs with mixed statuses and idempotency.