feat: add new blocks field to agent model and deprecate memory field [LET-4424] (#5613)
feat: add new blocks field to agent model and deprecate memory field
This commit is contained in:
@@ -241,6 +241,7 @@ class Agent(SqlalchemyBase, OrganizationMixin, ProjectMixin, TemplateEntityMixin
|
||||
"tools": [],
|
||||
"sources": [],
|
||||
"memory": Memory(blocks=[]),
|
||||
"blocks": [],
|
||||
"identity_ids": [],
|
||||
"multi_agent_group": None,
|
||||
"tool_exec_environment_variables": [],
|
||||
@@ -262,6 +263,7 @@ class Agent(SqlalchemyBase, OrganizationMixin, ProjectMixin, TemplateEntityMixin
|
||||
],
|
||||
agent_type=self.agent_type,
|
||||
),
|
||||
"blocks": lambda: [b.to_pydantic() for b in self.core_memory],
|
||||
"identity_ids": lambda: [i.id for i in self.identities],
|
||||
"multi_agent_group": lambda: self.multi_agent_group,
|
||||
"tool_exec_environment_variables": lambda: self.tool_exec_environment_variables,
|
||||
@@ -334,6 +336,7 @@ class Agent(SqlalchemyBase, OrganizationMixin, ProjectMixin, TemplateEntityMixin
|
||||
"tools": [],
|
||||
"sources": [],
|
||||
"memory": Memory(blocks=[]),
|
||||
"blocks": [],
|
||||
"identity_ids": [],
|
||||
"multi_agent_group": None,
|
||||
"tool_exec_environment_variables": [],
|
||||
@@ -379,6 +382,7 @@ class Agent(SqlalchemyBase, OrganizationMixin, ProjectMixin, TemplateEntityMixin
|
||||
],
|
||||
agent_type=self.agent_type,
|
||||
)
|
||||
state["blocks"] = [m.to_pydantic() for m in memory]
|
||||
state["identity_ids"] = [i.id for i in identities]
|
||||
state["multi_agent_group"] = multi_agent_group
|
||||
state["tool_exec_environment_variables"] = tool_exec_environment_variables
|
||||
|
||||
Reference in New Issue
Block a user