MemGPT/letta/schemas/environment_variables.py
Matthew Zhou d9a0996c29
fix: Bug fixes (#2377)
Co-authored-by: Charles Packer <packercharles@gmail.com>
Co-authored-by: cthomas <caren@letta.com>
Co-authored-by: mlong93 <35275280+mlong93@users.noreply.github.com>
Co-authored-by: Mindy Long <mindy@letta.com>
Co-authored-by: Shubham Naik <shubham.naik10@gmail.com>
Co-authored-by: Shubham Naik <shub@memgpt.ai>
Co-authored-by: dboyliao <qmalliao@gmail.com>
Co-authored-by: Sarah Wooders <sarahwooders@gmail.com>
Co-authored-by: Nuno Rocha <nunuroxa@gmail.com>
Co-authored-by: Theo Conrads <theo.conrads@ella-lab.io>
Co-authored-by: Jyotirmaya Mahanta <jyotirmaya.mahanta@gmail.com>
Co-authored-by: Stephan Fitzpatrick <knowsuchagency@gmail.com>
Co-authored-by: Stephan Fitzpatrick <stephan@knowsuchagency.com>
Co-authored-by: Krishnakumar R (KK) <65895020+kk-src@users.noreply.github.com>
2025-01-22 17:06:31 -08:00

63 lines
2.4 KiB
Python

from typing import Optional
from pydantic import Field
from letta.schemas.letta_base import LettaBase, OrmMetadataBase
# Base Environment Variable
class EnvironmentVariableBase(OrmMetadataBase):
id: str = Field(..., description="The unique identifier for the environment variable.")
key: str = Field(..., description="The name of the environment variable.")
value: str = Field(..., description="The value of the environment variable.")
description: Optional[str] = Field(None, description="An optional description of the environment variable.")
organization_id: Optional[str] = Field(None, description="The ID of the organization this environment variable belongs to.")
class EnvironmentVariableCreateBase(LettaBase):
key: str = Field(..., description="The name of the environment variable.")
value: str = Field(..., description="The value of the environment variable.")
description: Optional[str] = Field(None, description="An optional description of the environment variable.")
class EnvironmentVariableUpdateBase(LettaBase):
key: Optional[str] = Field(None, description="The name of the environment variable.")
value: Optional[str] = Field(None, description="The value of the environment variable.")
description: Optional[str] = Field(None, description="An optional description of the environment variable.")
# Environment Variable
class SandboxEnvironmentVariableBase(EnvironmentVariableBase):
__id_prefix__ = "sandbox-env"
sandbox_config_id: str = Field(..., description="The ID of the sandbox config this environment variable belongs to.")
class SandboxEnvironmentVariable(SandboxEnvironmentVariableBase):
id: str = SandboxEnvironmentVariableBase.generate_id_field()
class SandboxEnvironmentVariableCreate(EnvironmentVariableCreateBase):
pass
class SandboxEnvironmentVariableUpdate(EnvironmentVariableUpdateBase):
pass
# Agent-Specific Environment Variable
class AgentEnvironmentVariableBase(EnvironmentVariableBase):
__id_prefix__ = "agent-env"
agent_id: str = Field(..., description="The ID of the agent this environment variable belongs to.")
class AgentEnvironmentVariable(AgentEnvironmentVariableBase):
id: str = AgentEnvironmentVariableBase.generate_id_field()
class AgentEnvironmentVariableCreate(EnvironmentVariableCreateBase):
pass
class AgentEnvironmentVariableUpdate(EnvironmentVariableUpdateBase):
pass