feat: replace agent.identity_ids with agent.identities [LET-5803] (#5673)
feat: replace agent.identity_ids with agent.identities
This commit is contained in:
@@ -16692,6 +16692,16 @@
|
||||
"type": "array",
|
||||
"title": "Identity Ids",
|
||||
"description": "The ids of the identities associated with this agent.",
|
||||
"default": [],
|
||||
"deprecated": true
|
||||
},
|
||||
"identities": {
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/Identity"
|
||||
},
|
||||
"type": "array",
|
||||
"title": "Identities",
|
||||
"description": "The identities associated with this agent.",
|
||||
"default": []
|
||||
},
|
||||
"message_buffer_autoclear": {
|
||||
|
||||
@@ -243,6 +243,7 @@ class Agent(SqlalchemyBase, OrganizationMixin, ProjectMixin, TemplateEntityMixin
|
||||
"memory": Memory(blocks=[]),
|
||||
"blocks": [],
|
||||
"identity_ids": [],
|
||||
"identities": [],
|
||||
"multi_agent_group": None,
|
||||
"tool_exec_environment_variables": [],
|
||||
"secrets": [],
|
||||
@@ -265,6 +266,7 @@ class Agent(SqlalchemyBase, OrganizationMixin, ProjectMixin, TemplateEntityMixin
|
||||
),
|
||||
"blocks": lambda: [b.to_pydantic() for b in self.core_memory],
|
||||
"identity_ids": lambda: [i.id for i in self.identities],
|
||||
"identities": lambda: [i.to_pydantic() for i in self.identities],
|
||||
"multi_agent_group": lambda: self.multi_agent_group,
|
||||
"tool_exec_environment_variables": lambda: self.tool_exec_environment_variables,
|
||||
"secrets": lambda: self.tool_exec_environment_variables,
|
||||
@@ -338,6 +340,7 @@ class Agent(SqlalchemyBase, OrganizationMixin, ProjectMixin, TemplateEntityMixin
|
||||
"memory": Memory(blocks=[]),
|
||||
"blocks": [],
|
||||
"identity_ids": [],
|
||||
"identities": [],
|
||||
"multi_agent_group": None,
|
||||
"tool_exec_environment_variables": [],
|
||||
"secrets": [],
|
||||
@@ -384,6 +387,7 @@ class Agent(SqlalchemyBase, OrganizationMixin, ProjectMixin, TemplateEntityMixin
|
||||
)
|
||||
state["blocks"] = [m.to_pydantic() for m in memory]
|
||||
state["identity_ids"] = [i.id for i in identities]
|
||||
state["identities"] = [i.to_pydantic() for i in identities]
|
||||
state["multi_agent_group"] = multi_agent_group
|
||||
state["tool_exec_environment_variables"] = tool_exec_environment_variables
|
||||
state["secrets"] = tool_exec_environment_variables
|
||||
|
||||
@@ -12,6 +12,7 @@ from letta.schemas.enums import PrimitiveType
|
||||
from letta.schemas.environment_variables import AgentEnvironmentVariable
|
||||
from letta.schemas.file import FileStatus
|
||||
from letta.schemas.group import Group
|
||||
from letta.schemas.identity import Identity
|
||||
from letta.schemas.letta_base import OrmMetadataBase
|
||||
from letta.schemas.llm_config import LLMConfig
|
||||
from letta.schemas.memory import Memory
|
||||
@@ -104,7 +105,8 @@ class AgentState(OrmMetadataBase, validate_assignment=True):
|
||||
base_template_id: Optional[str] = Field(None, description="The base template id of the agent.")
|
||||
deployment_id: Optional[str] = Field(None, description="The id of the deployment.")
|
||||
entity_id: Optional[str] = Field(None, description="The id of the entity within the template.")
|
||||
identity_ids: List[str] = Field([], description="The ids of the identities associated with this agent.")
|
||||
identity_ids: List[str] = Field([], description="The ids of the identities associated with this agent.", deprecated=True)
|
||||
identities: List[Identity] = Field([], description="The identities associated with this agent.")
|
||||
|
||||
# An advanced configuration that makes it so this agent does not remember any previous messages
|
||||
message_buffer_autoclear: bool = Field(
|
||||
|
||||
@@ -1076,6 +1076,7 @@ async def test_agent_state_schema_unchanged(server: SyncServer):
|
||||
"deployment_id": (str, type(None)),
|
||||
"entity_id": (str, type(None)),
|
||||
"identity_ids": list,
|
||||
"identities": list,
|
||||
# Advanced configuration
|
||||
"message_buffer_autoclear": bool,
|
||||
"enable_sleeptime": (bool, type(None)),
|
||||
|
||||
Reference in New Issue
Block a user