Files
letta-server/letta/schemas/api_key.py
Sarah Wooders 8ae1e64987 chore: migrate package name to letta (#1775)
Co-authored-by: Charles Packer <packercharles@gmail.com>
Co-authored-by: Shubham Naik <shubham.naik10@gmail.com>
Co-authored-by: Shubham Naik <shub@memgpt.ai>
2024-09-23 09:15:18 -07:00

22 lines
682 B
Python

from typing import Optional
from pydantic import Field
from letta.schemas.letta_base import LettaBase
class BaseAPIKey(LettaBase):
__id_prefix__ = "sk" # secret key
class APIKey(BaseAPIKey):
id: str = BaseAPIKey.generate_id_field()
user_id: str = Field(..., description="The unique identifier of the user associated with the token.")
key: str = Field(..., description="The key value.")
name: str = Field(..., description="Name of the token.")
class APIKeyCreate(BaseAPIKey):
user_id: str = Field(..., description="The unique identifier of the user associated with the token.")
name: Optional[str] = Field(None, description="Name of the token.")