Skip to content
  • Auto
  • Light
  • Dark
DiscordForumGitHubSign up
View as Markdown
Copy Markdown

Open in Claude
Open in ChatGPT

Update current template from agent file (Cloud-only)

templates.update(strtemplate_name, TemplateUpdateParams**kwargs) -> TemplateUpdateResponse
patch/v1/templates/{template_name}

Updates the current working version of a template from an agent file

ParametersExpand Collapse
template_name: str
agent_file_json: Dict[str, Optional[object]]

The agent file to update the current template version from

save_existing_changes: Optional[bool]

If true, Letta will automatically save any changes as a version before updating the template

update_existing_tools: Optional[bool]

If true, update existing custom tools source_code and json_schema (source_type cannot be changed)

ReturnsExpand Collapse
class TemplateUpdateResponse:
success: bool
message: Optional[str]
Update current template from agent file (Cloud-only)
from letta_client import Letta

client = Letta(
    api_key="My API Key",
)
template = client.templates.update(
    template_name="template_name",
    agent_file_json={
        "foo": "bar"
    },
)
print(template.success)
{
  "success": true,
  "message": "message"
}
Returns Examples
{
  "success": true,
  "message": "message"
}