From c0c43c1b00a0ed605ff5399f53b309f988eacc9f Mon Sep 17 00:00:00 2001 From: cthomas Date: Tue, 26 Aug 2025 14:54:06 -0700 Subject: [PATCH] feat: pipe env vars through agent file v2 [LET-4054] (#4217) feat: pipe env vars through agent file v2 --- letta/server/rest_api/routers/v1/agents.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/letta/server/rest_api/routers/v1/agents.py b/letta/server/rest_api/routers/v1/agents.py index 0e2f2607..cb8eaa08 100644 --- a/letta/server/rest_api/routers/v1/agents.py +++ b/letta/server/rest_api/routers/v1/agents.py @@ -251,6 +251,7 @@ async def import_agent( override_existing_tools: bool = True, project_id: str | None = None, strip_messages: bool = False, + env_vars: Optional[dict[str, Any]] = None, ) -> List[str]: """ Import an agent using the new AgentFileSchema format. @@ -262,7 +263,11 @@ async def import_agent( try: import_result = await server.agent_serialization_manager.import_file( - schema=agent_schema, actor=actor, append_copy_suffix=append_copy_suffix, override_existing_tools=override_existing_tools + schema=agent_schema, + actor=actor, + append_copy_suffix=append_copy_suffix, + override_existing_tools=override_existing_tools, + env_vars=env_vars, ) if not import_result.success: @@ -340,6 +345,7 @@ async def import_agent_serialized( override_existing_tools=override_existing_tools, project_id=project_id, strip_messages=strip_messages, + env_vars=env_vars, ) else: # This is a legacy AgentSchema