Files
letta-server/letta/serialize_schemas/marshmallow_agent_environment_variable.py
Kian Jones f5c4ab50f4 chore: add ty + pre-commit hook and repeal even more ruff rules (#9504)
* auto fixes

* auto fix pt2 and transitive deps and undefined var checking locals()

* manual fixes (ignored or letta-code fixed)

* fix circular import

* remove all ignores, add FastAPI rules and Ruff rules

* add ty and precommit

* ruff stuff

* ty check fixes

* ty check fixes pt 2

* error on invalid
2026-02-24 10:55:11 -08:00

22 lines
652 B
Python

import uuid
from typing import Optional
from letta.orm.sandbox_config import AgentEnvironmentVariable
from letta.serialize_schemas.marshmallow_base import BaseSchema
class SerializedAgentEnvironmentVariableSchema(BaseSchema):
"""
Marshmallow schema for serializing/deserializing AgentEnvironmentVariable objects.
"""
__pydantic_model__ = None
def generate_id(self) -> Optional[str]:
# TODO: This is brittle and duplicated in orm/sandbox_config.py
return f"agent-env-{uuid.uuid4()}"
class Meta(BaseSchema.Meta):
model = AgentEnvironmentVariable
exclude = (*BaseSchema.Meta.exclude, "agent")