Skip to content

armgit / letta

Public Imported from GitHub
0

Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.

docs: remove schemas from docstrings (#6059)

Sarah Wooders19e6b09da54c
diff --git a/letta/schemas/agent.py b/letta/schemas/agent.py
index 025925bbe..fffacb9d2 100644
--- a/letta/schemas/agent.py
+++ b/letta/schemas/agent.py
@@ -58,20 +58,7 @@ AgentRelationships = Literal[
class AgentState(OrmMetadataBase, validate_assignment=True):
- """
- Representation of an agent's state. This is the state of the agent at a given time, and is persisted in the DB backend. The state has all the information needed to recreate a persisted agent.
-
- Parameters:
- id (str): The unique identifier of the agent.
- name (str): The name of the agent (must be unique to the user).
- created_at (datetime): The datetime the agent was created.
- message_ids (List[str]): The ids of the messages in the agent's in-context memory.
- memory (Memory): The in-context memory of the agent.
- tools (List[str]): The tools used by the agent. This includes any memory editing functions specified in `memory`.
- system (str): The system prompt used by the agent.
- llm_config (LLMConfig): The LLM configuration used by the agent.
- embedding_config (EmbeddingConfig): The embedding configuration used by the agent.
- """
+ """Representation of an agent's state. This is the state of the agent at a given time, and is persisted in the DB backend. The state has all the information needed to recreate a persisted agent."""
__id_prefix__ = PrimitiveType.AGENT.value
diff --git a/letta/schemas/archive.py b/letta/schemas/archive.py
index e9a54a6cf..08c863d9c 100644
--- a/letta/schemas/archive.py
+++ b/letta/schemas/archive.py
@@ -22,17 +22,7 @@ class ArchiveBase(OrmMetadataBase):
class Archive(ArchiveBase):
- """
- Representation of an archive - a collection of archival passages that can be shared between agents.
-
- Parameters:
- id (str): The unique identifier of the archive.
- name (str): The name of the archive.
- description (str): A description of the archive.
- organization_id (str): The organization this archive belongs to.
- created_at (datetime): The creation date of the archive.
- metadata (dict): Additional metadata for the archive.
- """
+ """Representation of an archive - a collection of archival passages that can be shared between agents."""
id: str = ArchiveBase.generate_id_field()
created_at: datetime = Field(..., description="The creation date of the archive")
diff --git a/letta/schemas/block.py b/letta/schemas/block.py
index 487f22442..4f7b89818 100644
--- a/letta/schemas/block.py
+++ b/letta/schemas/block.py
@@ -80,20 +80,7 @@ class BaseBlock(LettaBase, validate_assignment=True):
class Block(BaseBlock):
- """
- A Block represents a reserved section of the LLM's context window which is editable. `Block` objects contained in the `Memory` object, which is able to edit the Block values.
-
- Parameters:
- label (str): The label of the block (e.g. 'human', 'persona'). This defines a category for the block.
- value (str): The value of the block. This is the string that is represented in the context window.
- limit (int): The character limit of the block.
- is_template (bool): Whether the block is a template (e.g. saved human/persona options). Non-template blocks are not stored in the database and are ephemeral, while templated blocks are stored in the database.
- label (str): The label of the block (e.g. 'human', 'persona'). This defines a category for the block.
- template_name (str): The name of the block template (if it is a template).
- description (str): Description of the block.
- metadata (Dict): Metadata of the block.
- user_id (str): The unique identifier of the user associated with the block.
- """
+ """A Block represents a reserved section of the LLM's context window."""
id: str = BaseBlock.generate_id_field()
diff --git a/letta/schemas/folder.py b/letta/schemas/folder.py
index 149dd3a1f..46ae5c0c0 100644
--- a/letta/schemas/folder.py
+++ b/letta/schemas/folder.py
@@ -23,17 +23,7 @@ class BaseFolder(LettaBase):
class Folder(BaseFolder):
- """
- Representation of a folder, which is a collection of files and passages.
-
- Parameters:
- id (str): The ID of the folder
- name (str): The name of the folder.
- embedding_config (EmbeddingConfig): The embedding configuration used by the folder.
- user_id (str): The ID of the user that created the folder.
- metadata (dict): Metadata associated with the folder.
- description (str): The description of the folder.
- """
+ """Representation of a folder, which is a collection of files and passages."""
id: str = BaseFolder.generate_id_field()
embedding_config: EmbeddingConfig = Field(..., description="The embedding configuration used by the folder.")
diff --git a/letta/schemas/job.py b/letta/schemas/job.py
index 26393967c..835929d73 100644
--- a/letta/schemas/job.py
+++ b/letta/schemas/job.py
@@ -44,17 +44,7 @@ class JobBase(OrmMetadataBase):
class Job(JobBase):
- """
- Representation of offline jobs, used for tracking status of data loading tasks (involving parsing and embedding files).
-
- Parameters:
- id (str): The unique identifier of the job.
- status (JobStatus): The status of the job.
- created_at (datetime): The unix timestamp of when the job was created.
- completed_at (datetime): The unix timestamp of when the job was completed.
- user_id (str): The unique identifier of the user associated with the.
-
- """
+ """Representation of offline jobs, used for tracking status of data loading tasks (involving parsing and embedding files)."""
id: str = JobBase.generate_id_field()
user_id: Optional[str] = Field(None, description="The unique identifier of the user associated with the job.")
diff --git a/letta/schemas/passage.py b/letta/schemas/passage.py
index 327a882d0..046580c6e 100644
--- a/letta/schemas/passage.py
+++ b/letta/schemas/passage.py
@@ -31,19 +31,7 @@ class PassageBase(OrmMetadataBase):
class Passage(PassageBase):
- """
- Representation of a passage, which is stored in archival memory.
-
- Parameters:
- text (str): The text of the passage.
- embedding (List[float]): The embedding of the passage.
- embedding_config (EmbeddingConfig): The embedding configuration used by the passage.
- created_at (datetime): The creation date of the passage.
- organization_id (str): The unique identifier of the organization associated with the passage.
- archive_id (str): The unique identifier of the archive containing this passage.
- source_id (str): The data source of the passage.
- file_id (str): The unique identifier of the file associated with the passage.
- """
+ """Representation of a passage, which is stored in archival memory."""
id: str = PassageBase.generate_id_field()
diff --git a/letta/schemas/run.py b/letta/schemas/run.py
index e01f3781d..53d43e460 100644
--- a/letta/schemas/run.py
+++ b/letta/schemas/run.py
@@ -15,22 +15,7 @@ class RunBase(LettaBase):
class Run(RunBase):
- """
- Representation of a run - a conversation or processing session for an agent.
- Runs track when agents process messages and maintain the relationship between agents, steps, and messages.
-
- Parameters:
- id (str): The unique identifier of the run (prefixed with 'run-').
- status (JobStatus): The current status of the run.
- created_at (datetime): The timestamp when the run was created.
- completed_at (datetime): The timestamp when the run was completed.
- agent_id (str): The unique identifier of the agent associated with the run.
- base_template_id (str): The base template ID that the run belongs to.
- stop_reason (StopReasonType): The reason why the run was stopped.
- background (bool): Whether the run was created in background mode.
- metadata (dict): Additional metadata for the run.
- request_config (LettaRequestConfig): The request configuration for the run.
- """
+ """Representation of a run - a conversation or processing session for an agent. Runs track when agents process messages and maintain the relationship between agents, steps, and messages."""
id: str = RunBase.generate_id_field()
diff --git a/letta/schemas/source.py b/letta/schemas/source.py
index 69a16719a..26a533e81 100644
--- a/letta/schemas/source.py
+++ b/letta/schemas/source.py
@@ -24,17 +24,7 @@ class BaseSource(LettaBase):
class Source(BaseSource):
- """
- Representation of a source, which is a collection of files and passages.
-
- Parameters:
- id (str): The ID of the source
- name (str): The name of the source.
- embedding_config (EmbeddingConfig): The embedding configuration used by the source.
- user_id (str): The ID of the user that created the source.
- metadata (dict): Metadata associated with the source.
- description (str): The description of the source.
- """
+ """(Deprecated: Use Folder) Representation of a source, which is a collection of files and passages."""
id: str = BaseSource.generate_id_field()
embedding_config: EmbeddingConfig = Field(..., description="The embedding configuration used by the source.")
diff --git a/letta/schemas/tool.py b/letta/schemas/tool.py
index 4c21bb330..baab6f5f9 100644
--- a/letta/schemas/tool.py
+++ b/letta/schemas/tool.py
@@ -33,17 +33,7 @@ class BaseTool(LettaBase):
class Tool(BaseTool):
- """
- Representation of a tool, which is a function that can be called by the agent.
-
- Parameters:
- id (str): The unique identifier of the tool.
- name (str): The name of the function.
- tags (List[str]): Metadata tags.
- source_code (str): The source code of the function.
- json_schema (Dict): The JSON schema of the function.
-
- """
+ """Representation of a tool, which is a function that can be called by the agent."""
id: str = BaseTool.generate_id_field()
tool_type: ToolType = Field(ToolType.CUSTOM, description="The type of the tool.")
diff --git a/letta/schemas/user.py b/letta/schemas/user.py
index 1a657af46..45aa871e4 100644
--- a/letta/schemas/user.py
+++ b/letta/schemas/user.py
@@ -13,14 +13,7 @@ class UserBase(LettaBase):
class User(UserBase):
- """
- Representation of a user.
-
- Parameters:
- id (str): The unique identifier of the user.
- name (str): The name of the user.
- created_at (datetime): The creation date of the user.
- """
+ """Representation of a user."""
id: str = UserBase.generate_id_field()
organization_id: Optional[str] = Field(DEFAULT_ORG_ID, description="The organization id of the user")