Skip to content

Latest commit

 

History

History
7919 lines (5423 loc) · 90.1 KB

File metadata and controls

7919 lines (5423 loc) · 90.1 KB

Reference

Tools

client.tools.retrieve(...)

📝 Description

Get a tool by ID

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.tools.retrieve(
    tool_id="tool_id",
)

⚙️ Parameters

tool_id: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.tools.delete(...)

📝 Description

Delete a tool by name

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.tools.delete(
    tool_id="tool_id",
)

⚙️ Parameters

tool_id: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.tools.modify(...)

📝 Description

Update an existing tool

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.tools.modify(
    tool_id="tool_id",
)

⚙️ Parameters

tool_id: str

description: typing.Optional[str] — The description of the tool.

tags: typing.Optional[typing.Sequence[str]] — Metadata tags.

source_code: typing.Optional[str] — The source code of the function.

source_type: typing.Optional[str] — The type of the source code.

json_schema: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] — The JSON schema of the function (auto-generated from source_code if not provided)

args_json_schema: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] — The args JSON schema of the function.

return_char_limit: typing.Optional[int] — The maximum number of characters in the response.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.tools.list(...)

📝 Description

Get a list of all tools available to agents belonging to the org of the user

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.tools.list()

⚙️ Parameters

after: typing.Optional[str]

limit: typing.Optional[int]

name: typing.Optional[str]

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.tools.create(...)

📝 Description

Create a new tool

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.tools.create(
    source_code="source_code",
)

⚙️ Parameters

source_code: str — The source code of the function.

description: typing.Optional[str] — The description of the tool.

tags: typing.Optional[typing.Sequence[str]] — Metadata tags.

source_type: typing.Optional[str] — The source type of the function.

json_schema: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] — The JSON schema of the function (auto-generated from source_code if not provided)

args_json_schema: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] — The args JSON schema of the function.

return_char_limit: typing.Optional[int] — The maximum number of characters in the response.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.tools.upsert(...)

📝 Description

Create or update a tool

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.tools.upsert(
    source_code="source_code",
)

⚙️ Parameters

source_code: str — The source code of the function.

description: typing.Optional[str] — The description of the tool.

tags: typing.Optional[typing.Sequence[str]] — Metadata tags.

source_type: typing.Optional[str] — The source type of the function.

json_schema: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] — The JSON schema of the function (auto-generated from source_code if not provided)

args_json_schema: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] — The args JSON schema of the function.

return_char_limit: typing.Optional[int] — The maximum number of characters in the response.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.tools.add_base_tool()

📝 Description

Upsert base tools

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.tools.add_base_tool()

⚙️ Parameters

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.tools.run_tool_from_source(...)

📝 Description

Attempt to build a tool from source, then run it on the provided arguments

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.tools.run_tool_from_source(
    source_code="source_code",
    args={"key": "value"},
)

⚙️ Parameters

source_code: str — The source code of the function.

args: typing.Dict[str, typing.Optional[typing.Any]] — The arguments to pass to the tool.

env_vars: typing.Optional[typing.Dict[str, str]] — The environment variables to pass to the tool.

name: typing.Optional[str] — The name of the tool to run.

source_type: typing.Optional[str] — The type of the source code.

args_json_schema: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] — The args JSON schema of the function.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.tools.list_composio_apps()

📝 Description

Get a list of all Composio apps

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.tools.list_composio_apps()

⚙️ Parameters

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.tools.list_composio_actions_by_app(...)

📝 Description

Get a list of all Composio actions for a specific app

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.tools.list_composio_actions_by_app(
    composio_app_name="composio_app_name",
)

⚙️ Parameters

composio_app_name: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.tools.add_composio_tool(...)

📝 Description

Add a new Composio tool by action name (Composio refers to each tool as an Action)

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.tools.add_composio_tool(
    composio_action_name="composio_action_name",
)

⚙️ Parameters

composio_action_name: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Sources

client.sources.retrieve(...)

📝 Description

Get all sources

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.sources.retrieve(
    source_id="source_id",
)

⚙️ Parameters

source_id: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.sources.delete(...)

📝 Description

Delete a data source.

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.sources.delete(
    source_id="source_id",
)

⚙️ Parameters

source_id: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.sources.modify(...)

📝 Description

Update the name or documentation of an existing data source.

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.sources.modify(
    source_id="source_id",
)

⚙️ Parameters

source_id: str

name: typing.Optional[str] — The name of the source.

description: typing.Optional[str] — The description of the source.

metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] — Metadata associated with the source.

embedding_config: typing.Optional[EmbeddingConfig] — The embedding configuration used by the source.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.sources.get_by_name(...)

📝 Description

Get a source by name

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.sources.get_by_name(
    source_name="source_name",
)

⚙️ Parameters

source_name: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.sources.list()

📝 Description

List all data sources created by a user.

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.sources.list()

⚙️ Parameters

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.sources.create(...)

📝 Description

Create a new data source.

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.sources.create(
    name="name",
)

⚙️ Parameters

name: str — The name of the source.

embedding_config: typing.Optional[EmbeddingConfig] — The embedding configuration used by the source.

description: typing.Optional[str] — The description of the source.

metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] — Metadata associated with the source.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Agents

client.agents.list(...)

📝 Description

List all agents associated with a given user. This endpoint retrieves a list of all agents and their configurations associated with the specified user ID.

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.agents.list()

⚙️ Parameters

name: typing.Optional[str] — Name of the agent

tags: typing.Optional[typing.Union[str, typing.Sequence[str]]] — List of tags to filter agents by

match_all_tags: typing.Optional[bool] — If True, only returns agents that match ALL given tags. Otherwise, return agents that have ANY of the passed in tags.

before: typing.Optional[str] — Cursor for pagination

after: typing.Optional[str] — Cursor for pagination

limit: typing.Optional[int] — Limit for pagination

query_text: typing.Optional[str] — Search agents by name

project_id: typing.Optional[str] — Search agents by project id

template_id: typing.Optional[str] — Search agents by template id

base_template_id: typing.Optional[str] — Search agents by base template id

identifier_id: typing.Optional[str] — Search agents by identifier id

identifier_keys: typing.Optional[typing.Union[str, typing.Sequence[str]]] — Search agents by identifier keys

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.agents.create(...)

📝 Description

Create a new agent with the specified configuration.

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.agents.create()

⚙️ Parameters

project: typing.Optional[str]

name: typing.Optional[str] — The name of the agent.

memory_blocks: typing.Optional[typing.Sequence[CreateBlock]] — The blocks to create in the agent's in-context memory.

tools: typing.Optional[typing.Sequence[str]] — The tools used by the agent.

tool_ids: typing.Optional[typing.Sequence[str]] — The ids of the tools used by the agent.

source_ids: typing.Optional[typing.Sequence[str]] — The ids of the sources used by the agent.

block_ids: typing.Optional[typing.Sequence[str]] — The ids of the blocks used by the agent.

tool_rules: typing.Optional[typing.Sequence[CreateAgentRequestToolRulesItem]] — The tool rules governing the agent.

tags: typing.Optional[typing.Sequence[str]] — The tags associated with the agent.

system: typing.Optional[str] — The system prompt used by the agent.

agent_type: typing.Optional[AgentType] — The type of agent.

llm_config: typing.Optional[LlmConfig] — The LLM configuration used by the agent.

embedding_config: typing.Optional[EmbeddingConfig] — The embedding configuration used by the agent.

initial_message_sequence: typing.Optional[typing.Sequence[MessageCreate]] — The initial set of messages to put in the agent's in-context memory.

include_base_tools: typing.Optional[bool] — If true, attaches the Letta core tools (e.g. archival_memory and core_memory related functions).

include_multi_agent_tools: typing.Optional[bool] — If true, attaches the Letta multi-agent tools (e.g. sending a message to another agent).

include_base_tool_rules: typing.Optional[bool] — If true, attaches the Letta base tool rules (e.g. deny all tools not explicitly allowed).

description: typing.Optional[str] — The description of the agent.

metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] — The metadata of the agent.

model: typing.Optional[str] — The LLM configuration handle used by the agent, specified in the format provider/model-name, as an alternative to specifying llm_config.

embedding: typing.Optional[str] — The embedding configuration handle used by the agent, specified in the format provider/model-name.

context_window_limit: typing.Optional[int] — The context window limit used by the agent.

embedding_chunk_size: typing.Optional[int] — The embedding chunk size used by the agent.

from_template: typing.Optional[str] — The template id used to configure the agent

template: typing.Optional[bool] — Whether the agent is a template

create_agent_request_project: typing.Optional[str] — Deprecated: Project should now be passed via the X-Project header instead of in the request body. If using the sdk, this can be done via the new x_project field below.

tool_exec_environment_variables: typing.Optional[typing.Dict[str, typing.Optional[str]]] — The environment variables for tool execution specific to this agent.

memory_variables: typing.Optional[typing.Dict[str, typing.Optional[str]]] — The variables that should be set for the agent.

project_id: typing.Optional[str] — The id of the project the agent belongs to.

template_id: typing.Optional[str] — The id of the template the agent belongs to.

base_template_id: typing.Optional[str] — The base template id of the agent.

identity_ids: typing.Optional[typing.Sequence[str]] — The ids of the identities associated with this agent.

message_buffer_autoclear: typing.Optional[bool] — If set to True, the agent will not remember previous messages (though the agent will still retain state via core memory blocks and archival/recall memory). Not recommended unless you have an advanced use case.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.agents.retrieve(...)

📝 Description

Get the state of the agent.

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.agents.retrieve(
    agent_id="agent_id",
)

⚙️ Parameters

agent_id: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.agents.delete(...)

📝 Description

Delete an agent.

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.agents.delete(
    agent_id="agent_id",
)

⚙️ Parameters

agent_id: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.agents.modify(...)

📝 Description

Update an existing agent

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.agents.modify(
    agent_id="agent_id",
)

⚙️ Parameters

agent_id: str

name: typing.Optional[str] — The name of the agent.

tool_ids: typing.Optional[typing.Sequence[str]] — The ids of the tools used by the agent.

source_ids: typing.Optional[typing.Sequence[str]] — The ids of the sources used by the agent.

block_ids: typing.Optional[typing.Sequence[str]] — The ids of the blocks used by the agent.

tags: typing.Optional[typing.Sequence[str]] — The tags associated with the agent.

system: typing.Optional[str] — The system prompt used by the agent.

tool_rules: typing.Optional[typing.Sequence[UpdateAgentToolRulesItem]] — The tool rules governing the agent.

llm_config: typing.Optional[LlmConfig] — The LLM configuration used by the agent.

embedding_config: typing.Optional[EmbeddingConfig] — The embedding configuration used by the agent.

message_ids: typing.Optional[typing.Sequence[str]] — The ids of the messages in the agent's in-context memory.

description: typing.Optional[str] — The description of the agent.

metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] — The metadata of the agent.

tool_exec_environment_variables: typing.Optional[typing.Dict[str, typing.Optional[str]]] — The environment variables for tool execution specific to this agent.

project_id: typing.Optional[str] — The id of the project the agent belongs to.

template_id: typing.Optional[str] — The id of the template the agent belongs to.

base_template_id: typing.Optional[str] — The base template id of the agent.

identity_ids: typing.Optional[typing.Sequence[str]] — The ids of the identities associated with this agent.

message_buffer_autoclear: typing.Optional[bool] — If set to True, the agent will not remember previous messages (though the agent will still retain state via core memory blocks and archival/recall memory). Not recommended unless you have an advanced use case.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.agents.modify_passage(...)

📝 Description

Modify a memory in the agent's archival memory store.

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.agents.modify_passage(
    agent_id="agent_id",
    memory_id="memory_id",
    id="id",
)

⚙️ Parameters

agent_id: str

memory_id: str

id: str — The unique identifier of the passage.

created_by_id: typing.Optional[str] — The id of the user that made this object.

last_updated_by_id: typing.Optional[str] — The id of the user that made this object.

created_at: typing.Optional[dt.datetime] — The timestamp when the object was created.

updated_at: typing.Optional[dt.datetime] — The timestamp when the object was last updated.

is_deleted: typing.Optional[bool] — Whether this passage is deleted or not.

passage_update_agent_id: typing.Optional[str] — The unique identifier of the agent associated with the passage.

source_id: typing.Optional[str] — The data source of the passage.

file_id: typing.Optional[str] — The unique identifier of the file associated with the passage.

metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] — The metadata of the passage.

text: typing.Optional[str] — The text of the passage.

embedding: typing.Optional[typing.Sequence[float]] — The embedding of the passage.

embedding_config: typing.Optional[EmbeddingConfig] — The embedding configuration used by the passage.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.agents.reset_messages(...)

📝 Description

Resets the messages for an agent

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.agents.reset_messages(
    agent_id="agent_id",
)

⚙️ Parameters

agent_id: str

add_default_initial_messages: typing.Optional[bool] — If true, adds the default initial messages after resetting.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.agents.search(...)

📝 Description

This endpoint is only available on Letta Cloud.

Search deployed agents.

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.agents.search()

⚙️ Parameters

search: typing.Optional[typing.Sequence[AgentsSearchRequestSearchItem]]

project_id: typing.Optional[str]

combinator: typing.Optional[typing.Literal["AND"]]

limit: typing.Optional[float]

after: typing.Optional[str]

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Identities

client.identities.list(...)

📝 Description

Get a list of all identities in the database

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.identities.list()

⚙️ Parameters

name: typing.Optional[str]

project_id: typing.Optional[str]

identifier_key: typing.Optional[str]

identity_type: typing.Optional[IdentityType]

before: typing.Optional[str]

after: typing.Optional[str]

limit: typing.Optional[int]

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.identities.create(...)

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.identities.create(
    identifier_key="identifier_key",
    name="name",
    identity_type="org",
)

⚙️ Parameters

identifier_key: str — External, user-generated identifier key of the identity.

name: str — The name of the identity.

identity_type: IdentityType — The type of the identity.

project: typing.Optional[str]

project_id: typing.Optional[str] — The project id of the identity, if applicable.

agent_ids: typing.Optional[typing.Sequence[str]] — The agent ids that are associated with the identity.

properties: typing.Optional[typing.Sequence[IdentityProperty]] — List of properties associated with the identity.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.identities.upsert(...)

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.identities.upsert(
    identifier_key="identifier_key",
    name="name",
    identity_type="org",
)

⚙️ Parameters

identifier_key: str — External, user-generated identifier key of the identity.

name: str — The name of the identity.

identity_type: IdentityType — The type of the identity.

project: typing.Optional[str]

project_id: typing.Optional[str] — The project id of the identity, if applicable.

agent_ids: typing.Optional[typing.Sequence[str]] — The agent ids that are associated with the identity.

properties: typing.Optional[typing.Sequence[IdentityProperty]] — List of properties associated with the identity.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.identities.retrieve(...)

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.identities.retrieve(
    identity_id="identity_id",
)

⚙️ Parameters

identity_id: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.identities.delete(...)

📝 Description

Delete an identity by its identifier key

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.identities.delete(
    identity_id="identity_id",
)

⚙️ Parameters

identity_id: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.identities.modify(...)

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.identities.modify(
    identity_id="identity_id",
)

⚙️ Parameters

identity_id: str

identifier_key: typing.Optional[str] — External, user-generated identifier key of the identity.

name: typing.Optional[str] — The name of the identity.

identity_type: typing.Optional[IdentityType] — The type of the identity.

agent_ids: typing.Optional[typing.Sequence[str]] — The agent ids that are associated with the identity.

properties: typing.Optional[typing.Sequence[IdentityProperty]] — List of properties associated with the identity.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Models

client.models.list_llms()

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.models.list_llms()

⚙️ Parameters

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.models.list_embedding_models()

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.models.list_embedding_models()

⚙️ Parameters

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Blocks

client.blocks.list(...)

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.blocks.list()

⚙️ Parameters

label: typing.Optional[str] — Labels to include (e.g. human, persona)

templates_only: typing.Optional[bool] — Whether to include only templates

name: typing.Optional[str] — Name of the block

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.blocks.create(...)

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.blocks.create(
    value="value",
    label="label",
)

⚙️ Parameters

value: str — Value of the block.

label: str — Label of the block.

limit: typing.Optional[int] — Character limit of the block.

name: typing.Optional[str] — Name of the block if it is a template.

is_template: typing.Optional[bool]

description: typing.Optional[str] — Description of the block.

metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] — Metadata of the block.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.blocks.retrieve(...)

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.blocks.retrieve(
    block_id="block_id",
)

⚙️ Parameters

block_id: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.blocks.delete(...)

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.blocks.delete(
    block_id="block_id",
)

⚙️ Parameters

block_id: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.blocks.modify(...)

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.blocks.modify(
    block_id="block_id",
)

⚙️ Parameters

block_id: str

value: typing.Optional[str] — Value of the block.

limit: typing.Optional[int] — Character limit of the block.

name: typing.Optional[str] — Name of the block if it is a template.

is_template: typing.Optional[bool] — Whether the block is a template (e.g. saved human/persona options).

label: typing.Optional[str] — Label of the block (e.g. 'human', 'persona') in the context window.

description: typing.Optional[str] — Description of the block.

metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] — Metadata of the block.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.blocks.list_agents_for_block(...)

📝 Description

Retrieves all agents associated with the specified block. Raises a 404 if the block does not exist.

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.blocks.list_agents_for_block(
    block_id="block_id",
)

⚙️ Parameters

block_id: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Jobs

client.jobs.list(...)

📝 Description

List all jobs.

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.jobs.list()

⚙️ Parameters

source_id: typing.Optional[str] — Only list jobs associated with the source.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.jobs.list_active()

📝 Description

List all active jobs.

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.jobs.list_active()

⚙️ Parameters

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.jobs.retrieve(...)

📝 Description

Get the status of a job.

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.jobs.retrieve(
    job_id="job_id",
)

⚙️ Parameters

job_id: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.jobs.delete(...)

📝 Description

Delete a job by its job_id.

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.jobs.delete(
    job_id="job_id",
)

⚙️ Parameters

job_id: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Health

client.health.check()

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.health.check()

⚙️ Parameters

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Providers

client.providers.list_providers(...)

📝 Description

Get a list of all custom providers in the database

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.providers.list_providers()

⚙️ Parameters

after: typing.Optional[str]

limit: typing.Optional[int]

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.providers.create_provider(...)

📝 Description

Create a new custom provider

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.providers.create_provider(
    name="name",
    api_key="api_key",
)

⚙️ Parameters

name: str — The name of the provider.

api_key: str — API key used for requests to the provider.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.providers.delete_provider(...)

📝 Description

Delete an existing custom provider

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.providers.delete_provider(
    provider_id="provider_id",
)

⚙️ Parameters

provider_id: str — The provider_id key to be deleted.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.providers.modify_provider(...)

📝 Description

Update an existing custom provider

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.providers.modify_provider(
    id="id",
    api_key="api_key",
)

⚙️ Parameters

id: str — The id of the provider to update.

api_key: str — API key used for requests to the provider.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Runs

client.runs.list_runs()

📝 Description

List all runs.

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.runs.list_runs()

⚙️ Parameters

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.runs.list_active_runs()

📝 Description

List all active runs.

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.runs.list_active_runs()

⚙️ Parameters

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.runs.retrieve_run(...)

📝 Description

Get the status of a run.

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.runs.retrieve_run(
    run_id="run_id",
)

⚙️ Parameters

run_id: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.runs.delete_run(...)

📝 Description

Delete a run by its run_id.

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.runs.delete_run(
    run_id="run_id",
)

⚙️ Parameters

run_id: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.runs.list_run_messages(...)

📝 Description

Get messages associated with a run with filtering options.

Args: run_id: ID of the run before: A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. after: A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. limit: Maximum number of messages to return order: Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order. role: Filter by role (user/assistant/system/tool) return_message_object: Whether to return Message objects or LettaMessage objects user_id: ID of the user making the request

Returns: A list of messages associated with the run. Default is List[LettaMessage].

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.runs.list_run_messages(
    run_id="run_id",
)

⚙️ Parameters

run_id: str

before: typing.Optional[str] — Cursor for pagination

after: typing.Optional[str] — Cursor for pagination

limit: typing.Optional[int] — Maximum number of messages to return

order: typing.Optional[str] — Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.

role: typing.Optional[MessageRole] — Filter by role

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.runs.retrieve_run_usage(...)

📝 Description

Get usage statistics for a run.

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.runs.retrieve_run_usage(
    run_id="run_id",
)

⚙️ Parameters

run_id: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.runs.list_run_steps(...)

📝 Description

Get messages associated with a run with filtering options.

Args: run_id: ID of the run before: A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. after: A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. limit: Maximum number of steps to return order: Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.

Returns: A list of steps associated with the run.

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.runs.list_run_steps(
    run_id="run_id",
)

⚙️ Parameters

run_id: str

before: typing.Optional[str] — Cursor for pagination

after: typing.Optional[str] — Cursor for pagination

limit: typing.Optional[int] — Maximum number of messages to return

order: typing.Optional[str] — Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Steps

client.steps.list_steps(...)

📝 Description

List steps with optional pagination and date filters. Dates should be provided in ISO 8601 format (e.g. 2025-01-29T15:01:19-08:00)

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.steps.list_steps()

⚙️ Parameters

before: typing.Optional[str] — Return steps before this step ID

after: typing.Optional[str] — Return steps after this step ID

limit: typing.Optional[int] — Maximum number of steps to return

order: typing.Optional[str] — Sort order (asc or desc)

start_date: typing.Optional[str] — Return steps after this ISO datetime (e.g. "2025-01-29T15:01:19-08:00")

end_date: typing.Optional[str] — Return steps before this ISO datetime (e.g. "2025-01-29T15:01:19-08:00")

model: typing.Optional[str] — Filter by the name of the model used for the step

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.steps.retrieve_step(...)

📝 Description

Get a step by ID.

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.steps.retrieve_step(
    step_id="step_id",
)

⚙️ Parameters

step_id: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Tag

client.tag.list_tags(...)

📝 Description

Get a list of all tags in the database

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.tag.list_tags()

⚙️ Parameters

after: typing.Optional[str]

limit: typing.Optional[int]

query_text: typing.Optional[str]

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Voice

client.voice.create_voice_chat_completions(...)

🔌 Usage

from letta_client import (
    ChatCompletionDeveloperMessageParam,
    CompletionCreateParamsNonStreaming,
    Letta,
)

client = Letta(
    token="YOUR_TOKEN",
)
client.voice.create_voice_chat_completions(
    request=CompletionCreateParamsNonStreaming(
        messages=[
            ChatCompletionDeveloperMessageParam(
                content="content",
            )
        ],
        model="model",
    ),
)

⚙️ Parameters

request: CreateVoiceChatCompletionsRequest

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Templates

client.templates.create_agents(...)

📝 Description

Creates an Agent or multiple Agents from a template

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.templates.create_agents(
    project="project",
    template_version="template_version",
)

⚙️ Parameters

project: str — The project slug

template_version: str — The template version, formatted as {template-name}:{version-number} or {template-name}:latest

tags: typing.Optional[typing.Sequence[str]] — The tags to assign to the agent

agent_name: typing.Optional[str] — The name of the agent, optional otherwise a random one will be assigned

memory_variables: typing.Optional[typing.Dict[str, str]] — The memory variables to assign to the agent

tool_variables: typing.Optional[typing.Dict[str, str]] — The tool variables to assign to the agent

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Agents Context

client.agents.context.retrieve(...)

📝 Description

Retrieve the context window of a specific agent.

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.agents.context.retrieve(
    agent_id="agent_id",
)

⚙️ Parameters

agent_id: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Agents Tools

client.agents.tools.list(...)

📝 Description

Get tools from an existing agent

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.agents.tools.list(
    agent_id="agent_id",
)

⚙️ Parameters

agent_id: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.agents.tools.attach(...)

📝 Description

Attach a tool to an agent.

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.agents.tools.attach(
    agent_id="agent_id",
    tool_id="tool_id",
)

⚙️ Parameters

agent_id: str

tool_id: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.agents.tools.detach(...)

📝 Description

Detach a tool from an agent.

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.agents.tools.detach(
    agent_id="agent_id",
    tool_id="tool_id",
)

⚙️ Parameters

agent_id: str

tool_id: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Agents Sources

client.agents.sources.attach(...)

📝 Description

Attach a source to an agent.

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.agents.sources.attach(
    agent_id="agent_id",
    source_id="source_id",
)

⚙️ Parameters

agent_id: str

source_id: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.agents.sources.detach(...)

📝 Description

Detach a source from an agent.

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.agents.sources.detach(
    agent_id="agent_id",
    source_id="source_id",
)

⚙️ Parameters

agent_id: str

source_id: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.agents.sources.list(...)

📝 Description

Get the sources associated with an agent.

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.agents.sources.list(
    agent_id="agent_id",
)

⚙️ Parameters

agent_id: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Agents CoreMemory

client.agents.core_memory.retrieve(...)

📝 Description

Retrieve the memory state of a specific agent. This endpoint fetches the current memory state of the agent identified by the user ID and agent ID.

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.agents.core_memory.retrieve(
    agent_id="agent_id",
)

⚙️ Parameters

agent_id: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Agents Blocks

client.agents.blocks.retrieve(...)

📝 Description

Retrieve a core memory block from an agent.

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.agents.blocks.retrieve(
    agent_id="agent_id",
    block_label="block_label",
)

⚙️ Parameters

agent_id: str

block_label: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.agents.blocks.modify(...)

📝 Description

Updates a core memory block of an agent.

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.agents.blocks.modify(
    agent_id="agent_id",
    block_label="block_label",
)

⚙️ Parameters

agent_id: str

block_label: str

value: typing.Optional[str] — Value of the block.

limit: typing.Optional[int] — Character limit of the block.

name: typing.Optional[str] — Name of the block if it is a template.

is_template: typing.Optional[bool] — Whether the block is a template (e.g. saved human/persona options).

label: typing.Optional[str] — Label of the block (e.g. 'human', 'persona') in the context window.

description: typing.Optional[str] — Description of the block.

metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] — Metadata of the block.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.agents.blocks.list(...)

📝 Description

Retrieve the core memory blocks of a specific agent.

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.agents.blocks.list(
    agent_id="agent_id",
)

⚙️ Parameters

agent_id: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.agents.blocks.attach(...)

📝 Description

Attach a core memoryblock to an agent.

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.agents.blocks.attach(
    agent_id="agent_id",
    block_id="block_id",
)

⚙️ Parameters

agent_id: str

block_id: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.agents.blocks.detach(...)

📝 Description

Detach a core memory block from an agent.

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.agents.blocks.detach(
    agent_id="agent_id",
    block_id="block_id",
)

⚙️ Parameters

agent_id: str

block_id: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Agents Passages

client.agents.passages.list(...)

📝 Description

Retrieve the memories in an agent's archival memory store (paginated query).

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.agents.passages.list(
    agent_id="agent_id",
)

⚙️ Parameters

agent_id: str

after: typing.Optional[int] — Unique ID of the memory to start the query range at.

before: typing.Optional[int] — Unique ID of the memory to end the query range at.

limit: typing.Optional[int] — How many results to include in the response.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.agents.passages.create(...)

📝 Description

Insert a memory into an agent's archival memory store.

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.agents.passages.create(
    agent_id="agent_id",
    text="text",
)

⚙️ Parameters

agent_id: str

text: str — Text to write to archival memory.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.agents.passages.delete(...)

📝 Description

Delete a memory from an agent's archival memory store.

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.agents.passages.delete(
    agent_id="agent_id",
    memory_id="memory_id",
)

⚙️ Parameters

agent_id: str

memory_id: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Agents Messages

client.agents.messages.list(...)

📝 Description

Retrieve message history for an agent.

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.agents.messages.list(
    agent_id="agent_id",
)

⚙️ Parameters

agent_id: str

after: typing.Optional[str] — Message after which to retrieve the returned messages.

before: typing.Optional[str] — Message before which to retrieve the returned messages.

limit: typing.Optional[int] — Maximum number of messages to retrieve.

use_assistant_message: typing.Optional[bool] — Whether to use assistant messages

assistant_message_tool_name: typing.Optional[str] — The name of the designated message tool.

assistant_message_tool_kwarg: typing.Optional[str] — The name of the message argument.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.agents.messages.create(...)

📝 Description

Process a user message and return the agent's response. This endpoint accepts a message from a user and processes it through the agent.

🔌 Usage

from letta_client import Letta, MessageCreate

client = Letta(
    token="YOUR_TOKEN",
)
client.agents.messages.create(
    agent_id="agent_id",
    messages=[
        MessageCreate(
            role="user",
            content="content",
        )
    ],
)

⚙️ Parameters

agent_id: str

messages: typing.Sequence[MessageCreate] — The messages to be sent to the agent.

use_assistant_message: typing.Optional[bool] — Whether the server should parse specific tool call arguments (default send_message) as AssistantMessage objects.

assistant_message_tool_name: typing.Optional[str] — The name of the designated message tool.

assistant_message_tool_kwarg: typing.Optional[str] — The name of the message argument in the designated message tool.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.agents.messages.modify(...)

📝 Description

Update the details of a message associated with an agent.

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.agents.messages.modify(
    agent_id="agent_id",
    message_id="message_id",
)

⚙️ Parameters

agent_id: str

message_id: str

role: typing.Optional[MessageRole] — The role of the participant.

content: typing.Optional[MessageUpdateContent] — The content of the message.

name: typing.Optional[str] — The name of the participant.

tool_calls: typing.Optional[typing.Sequence[ChatCompletionMessageToolCallInput]] — The list of tool calls requested.

tool_call_id: typing.Optional[str] — The id of the tool call.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.agents.messages.create_stream(...)

📝 Description

Process a user message and return the agent's response. This endpoint accepts a message from a user and processes it through the agent. It will stream the steps of the response always, and stream the tokens if 'stream_tokens' is set to True.

🔌 Usage

from letta_client import Letta, MessageCreate

client = Letta(
    token="YOUR_TOKEN",
)
response = client.agents.messages.create_stream(
    agent_id="agent_id",
    messages=[
        MessageCreate(
            role="user",
            content="content",
        )
    ],
)
for chunk in response:
    yield chunk

⚙️ Parameters

agent_id: str

messages: typing.Sequence[MessageCreate] — The messages to be sent to the agent.

use_assistant_message: typing.Optional[bool] — Whether the server should parse specific tool call arguments (default send_message) as AssistantMessage objects.

assistant_message_tool_name: typing.Optional[str] — The name of the designated message tool.

assistant_message_tool_kwarg: typing.Optional[str] — The name of the message argument in the designated message tool.

stream_tokens: typing.Optional[bool] — Flag to determine if individual tokens should be streamed. Set to True for token streaming (requires stream_steps = True).

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.agents.messages.create_async(...)

📝 Description

Asynchronously process a user message and return a run object. The actual processing happens in the background, and the status can be checked using the run ID.

🔌 Usage

from letta_client import Letta, MessageCreate

client = Letta(
    token="YOUR_TOKEN",
)
client.agents.messages.create_async(
    agent_id="agent_id",
    messages=[
        MessageCreate(
            role="user",
            content="content",
        )
    ],
)

⚙️ Parameters

agent_id: str

messages: typing.Sequence[MessageCreate] — The messages to be sent to the agent.

use_assistant_message: typing.Optional[bool] — Whether the server should parse specific tool call arguments (default send_message) as AssistantMessage objects.

assistant_message_tool_name: typing.Optional[str] — The name of the designated message tool.

assistant_message_tool_kwarg: typing.Optional[str] — The name of the message argument in the designated message tool.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Agents Templates

client.agents.templates.create_version(...)

📝 Description

This endpoint is only available on Letta Cloud.

Creates a new version of the template version of the agent.

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.agents.templates.create_version(
    agent_id="agent_id",
)

⚙️ Parameters

agent_id: str — The agent ID of the agent to migrate, if this agent is not a template, it will create a agent template from the agent provided as well

return_agent_state: typing.Optional[bool]

migrate_deployed_agents: typing.Optional[bool]

message: typing.Optional[str]

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.agents.templates.migrate(...)

📝 Description

This endpoint is only available on Letta Cloud.

Migrate an agent to a new versioned agent template.

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.agents.templates.migrate(
    agent_id="agent_id",
    to_template="to_template",
    preserve_core_memories=True,
)

⚙️ Parameters

agent_id: str

to_template: str

preserve_core_memories: bool

variables: typing.Optional[typing.Dict[str, str]] — If you chose to not preserve core memories, you should provide the new variables for the core memories

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.agents.templates.create(...)

📝 Description

This endpoint is only available on Letta Cloud.

Creates a template from an agent.

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.agents.templates.create(
    agent_id="agent_id",
)

⚙️ Parameters

agent_id: str

project: typing.Optional[str]

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Agents MemoryVariables

client.agents.memory_variables.list(...)

📝 Description

This endpoint is only available on Letta Cloud.

Returns the memory variables associated with an agent.

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.agents.memory_variables.list(
    agent_id="agent_id",
)

⚙️ Parameters

agent_id: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Sources Files

client.sources.files.upload(...)

📝 Description

Upload a file to a data source.

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.sources.files.upload(
    source_id="source_id",
)

⚙️ Parameters

source_id: str

file: `from future import annotations

core.File` — See core.File for more documentation

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.sources.files.list(...)

📝 Description

List paginated files associated with a data source.

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.sources.files.list(
    source_id="source_id",
)

⚙️ Parameters

source_id: str

limit: typing.Optional[int] — Number of files to return

after: typing.Optional[str] — Pagination cursor to fetch the next set of results

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.sources.files.delete(...)

📝 Description

Delete a data source.

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.sources.files.delete(
    source_id="source_id",
    file_id="file_id",
)

⚙️ Parameters

source_id: str

file_id: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Sources Passages

client.sources.passages.list(...)

📝 Description

List all passages associated with a data source.

🔌 Usage

from letta_client import Letta

client = Letta(
    token="YOUR_TOKEN",
)
client.sources.passages.list(
    source_id="source_id",
)

⚙️ Parameters

source_id: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.