From 2823d1a84e565a21363d0745ed19b9d16443c2b9 Mon Sep 17 00:00:00 2001 From: Sarah Wooders Date: Thu, 31 Jul 2025 16:14:13 -0700 Subject: [PATCH] feat: change default agent type to `memgpt_v2_agent` (#3624) --- letta/schemas/agent.py | 2 +- tests/test_agent_serialization.py | 1 + tests/test_managers.py | 2 +- tests/test_sdk_client.py | 5 ----- 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/letta/schemas/agent.py b/letta/schemas/agent.py index 46bce4a7..c507e202 100644 --- a/letta/schemas/agent.py +++ b/letta/schemas/agent.py @@ -174,7 +174,7 @@ class CreateAgent(BaseModel, validate_assignment=True): # tool_rules: Optional[List[ToolRule]] = Field(None, description="The tool rules governing the agent.") tags: Optional[List[str]] = Field(None, description="The tags associated with the agent.") system: Optional[str] = Field(None, description="The system prompt used by the agent.") - agent_type: AgentType = Field(default_factory=lambda: AgentType.memgpt_agent, description="The type of agent.") + agent_type: AgentType = Field(default_factory=lambda: AgentType.memgpt_v2_agent, description="The type of agent.") llm_config: Optional[LLMConfig] = Field(None, description="The LLM configuration used by the agent.") embedding_config: Optional[EmbeddingConfig] = Field(None, description="The embedding configuration used by the agent.") # Note: if this is None, then we'll populate with the standard "more human than human" initial message sequence diff --git a/tests/test_agent_serialization.py b/tests/test_agent_serialization.py index a5ad070c..cc090752 100644 --- a/tests/test_agent_serialization.py +++ b/tests/test_agent_serialization.py @@ -161,6 +161,7 @@ def serialize_test_agent(server: SyncServer, default_user, default_organization, memory_blocks = [CreateBlock(label="human", value="BananaBoy"), CreateBlock(label="persona", value="I am a helpful assistant")] create_agent_request = CreateAgent( system="test system", + agent_type="memgpt_agent", memory_blocks=memory_blocks, llm_config=LLMConfig.default_config("gpt-4o-mini"), embedding_config=EmbeddingConfig.default_config(provider="openai"), diff --git a/tests/test_managers.py b/tests/test_managers.py index 9ea3c78b..892f56e7 100644 --- a/tests/test_managers.py +++ b/tests/test_managers.py @@ -767,7 +767,7 @@ async def test_create_agent_include_base_tools(server: SyncServer, default_user, # Assert the tools exist tool_names = [t.name for t in created_agent.tools] - expected_tools = calculate_base_tools(is_v2=False) + expected_tools = calculate_base_tools(is_v2=True) assert sorted(tool_names) == sorted(expected_tools) diff --git a/tests/test_sdk_client.py b/tests/test_sdk_client.py index bc826275..d3b15636 100644 --- a/tests/test_sdk_client.py +++ b/tests/test_sdk_client.py @@ -1028,11 +1028,6 @@ def test_preview_payload(client: LettaSDKClient): assert isinstance(payload["tools"], list) assert len(payload["tools"]) > 0 - tool_names = [tool["function"]["name"] for tool in payload["tools"]] - expected_tools = ["send_message", "conversation_search", "core_memory_replace", "core_memory_append"] - for tool_name in expected_tools: - assert tool_name in tool_names, f"Expected tool {tool_name} not found in tools" - for tool in payload["tools"]: assert tool["type"] == "function" assert "function" in tool