feat: change default agent type to memgpt_v2_agent (#3624)

This commit is contained in:
Sarah Wooders
2025-07-31 16:14:13 -07:00
committed by GitHub
parent fac11bec2c
commit 2823d1a84e
4 changed files with 3 additions and 7 deletions

View File

@@ -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

View File

@@ -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"),

View File

@@ -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)

View File

@@ -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