Skip to content

armgit / letta

Public Imported from GitHub
0

Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.

fix: Temporarily duplicate AgentType enum (#2980)

Matthew Zhou30781c4dde95
diff --git a/letta/schemas/agent.py b/letta/schemas/agent.py
index f16e72528..c82e658f2 100644
--- a/letta/schemas/agent.py
+++ b/letta/schemas/agent.py
@@ -1,4 +1,5 @@
from datetime import datetime
+from enum import Enum
from typing import Dict, List, Optional
from pydantic import BaseModel, ConfigDict, Field, field_validator, model_validator
@@ -6,7 +7,6 @@ from pydantic import BaseModel, ConfigDict, Field, field_validator, model_valida
from letta.constants import CORE_MEMORY_LINE_NUMBER_WARNING, DEFAULT_EMBEDDING_CHUNK_SIZE
from letta.schemas.block import CreateBlock
from letta.schemas.embedding_config import EmbeddingConfig
-from letta.schemas.enums import AgentType
from letta.schemas.environment_variables import AgentEnvironmentVariable
from letta.schemas.file import FileStatus
from letta.schemas.group import Group
@@ -22,6 +22,23 @@ from letta.schemas.tool_rule import ToolRule
from letta.utils import calculate_file_defaults_based_on_context_window, create_random_username
+# TODO: Remove this upon next OSS release, there's a duplicate AgentType in enums
+# TODO: This is done in the interest of time to avoid needing to update the sandbox template IDs on cloud/rebuild
+class AgentType(str, Enum):
+ """
+ Enum to represent the type of agent.
+ """
+
+ memgpt_agent = "memgpt_agent" # the OG set of memgpt tools
+ memgpt_v2_agent = "memgpt_v2_agent" # memgpt style tools, but refreshed
+ react_agent = "react_agent" # basic react agent, no memory tools
+ workflow_agent = "workflow_agent" # workflow with auto-clearing message buffer
+ split_thread_agent = "split_thread_agent"
+ sleeptime_agent = "sleeptime_agent"
+ voice_convo_agent = "voice_convo_agent"
+ voice_sleeptime_agent = "voice_sleeptime_agent"
+
+
class AgentState(OrmMetadataBase, validate_assignment=True):
"""
Representation of an agent's state. This is the state of the agent at a given time, and is persisted in the DB backend. The state has all the information needed to recreate a persisted agent.