Skip to content

Latest commit

Β 

History

History
5363 lines (3666 loc) Β· 52.1 KB

reference.md

File metadata and controls

5363 lines (3666 loc) Β· 52.1 KB

Reference

Tools

client.tools.get(toolId) -> Letta.LettaSchemasToolTool

πŸ“ Description

Get a tool by ID

πŸ”Œ Usage

await client.tools.get("tool_id");

βš™οΈ Parameters

toolId: string

requestOptions: Tools.RequestOptions

client.tools.delete(toolId) -> unknown

πŸ“ Description

Delete a tool by name

πŸ”Œ Usage

await client.tools.delete("tool_id");

βš™οΈ Parameters

toolId: string

requestOptions: Tools.RequestOptions

client.tools.update(toolId, { ...params }) -> Letta.LettaSchemasToolTool

πŸ“ Description

Update an existing tool

πŸ”Œ Usage

await client.tools.update("tool_id");

βš™οΈ Parameters

toolId: string

request: Letta.ToolUpdate

requestOptions: Tools.RequestOptions

client.tools.getByName(toolName) -> string

πŸ“ Description

Get a tool ID by name

πŸ”Œ Usage

await client.tools.getByName("tool_name");

βš™οΈ Parameters

toolName: string

requestOptions: Tools.RequestOptions

client.tools.list({ ...params }) -> Letta.LettaSchemasToolTool[]

πŸ“ Description

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

πŸ”Œ Usage

await client.tools.list();

βš™οΈ Parameters

request: Letta.ToolsListRequest

requestOptions: Tools.RequestOptions

client.tools.create({ ...params }) -> Letta.LettaSchemasToolTool

πŸ“ Description

Create a new tool

πŸ”Œ Usage

await client.tools.create({
    sourceCode: "source_code",
});

βš™οΈ Parameters

request: Letta.ToolCreate

requestOptions: Tools.RequestOptions

client.tools.upsert({ ...params }) -> Letta.LettaSchemasToolTool

πŸ“ Description

Create or update a tool

πŸ”Œ Usage

await client.tools.upsert({
    sourceCode: "source_code",
});

βš™οΈ Parameters

request: Letta.ToolCreate

requestOptions: Tools.RequestOptions

client.tools.addBaseTool() -> Letta.LettaSchemasToolTool[]

πŸ“ Description

Upsert base tools

πŸ”Œ Usage

await client.tools.addBaseTool();

βš™οΈ Parameters

requestOptions: Tools.RequestOptions

client.tools.runToolFromSource({ ...params }) -> Letta.ToolReturnMessage

πŸ“ Description

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

πŸ”Œ Usage

await client.tools.runToolFromSource({
    sourceCode: "source_code",
    args: {
        key: "value",
    },
});

βš™οΈ Parameters

request: Letta.ToolRunFromSource

requestOptions: Tools.RequestOptions

client.tools.listComposioApps() -> Letta.AppModel[]

πŸ“ Description

Get a list of all Composio apps

πŸ”Œ Usage

await client.tools.listComposioApps();

βš™οΈ Parameters

requestOptions: Tools.RequestOptions

client.tools.listComposioActionsByApp(composioAppName) -> Letta.ActionModel[]

πŸ“ Description

Get a list of all Composio actions for a specific app

πŸ”Œ Usage

await client.tools.listComposioActionsByApp("composio_app_name");

βš™οΈ Parameters

composioAppName: string

requestOptions: Tools.RequestOptions

client.tools.addComposioTool(composioActionName) -> Letta.LettaSchemasToolTool

πŸ“ Description

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

πŸ”Œ Usage

await client.tools.addComposioTool("composio_action_name");

βš™οΈ Parameters

composioActionName: string

requestOptions: Tools.RequestOptions

Sources

client.sources.get(sourceId) -> Letta.Source

πŸ“ Description

Get all sources

πŸ”Œ Usage

await client.sources.get("source_id");

βš™οΈ Parameters

sourceId: string

requestOptions: Sources.RequestOptions

client.sources.delete(sourceId) -> unknown

πŸ“ Description

Delete a data source.

πŸ”Œ Usage

await client.sources.delete("source_id");

βš™οΈ Parameters

sourceId: string

requestOptions: Sources.RequestOptions

client.sources.update(sourceId, { ...params }) -> Letta.Source

πŸ“ Description

Update the name or documentation of an existing data source.

πŸ”Œ Usage

await client.sources.update("source_id");

βš™οΈ Parameters

sourceId: string

request: Letta.SourceUpdate

requestOptions: Sources.RequestOptions

client.sources.getByName(sourceName) -> string

πŸ“ Description

Get a source by name

πŸ”Œ Usage

await client.sources.getByName("source_name");

βš™οΈ Parameters

sourceName: string

requestOptions: Sources.RequestOptions

client.sources.list() -> Letta.Source[]

πŸ“ Description

List all data sources created by a user.

πŸ”Œ Usage

await client.sources.list();

βš™οΈ Parameters

requestOptions: Sources.RequestOptions

client.sources.create({ ...params }) -> Letta.Source

πŸ“ Description

Create a new data source.

πŸ”Œ Usage

await client.sources.create({
    name: "name",
});

βš™οΈ Parameters

request: Letta.SourceCreate

requestOptions: Sources.RequestOptions

client.sources.attach(sourceId, { ...params }) -> Letta.Source

πŸ“ Description

Attach a data source to an existing agent.

πŸ”Œ Usage

await client.sources.attach("source_id", {
    agentId: "agent_id",
});

βš™οΈ Parameters

sourceId: string

request: Letta.SourcesAttachRequest

requestOptions: Sources.RequestOptions

client.sources.detach(sourceId, { ...params }) -> Letta.Source

πŸ“ Description

Detach a data source from an existing agent.

πŸ”Œ Usage

await client.sources.detach("source_id", {
    agentId: "agent_id",
});

βš™οΈ Parameters

sourceId: string

request: Letta.SourcesDetachRequest

requestOptions: Sources.RequestOptions

Agents

client.agents.list({ ...params }) -> Letta.AgentState[]

πŸ“ 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

await client.agents.list();

βš™οΈ Parameters

request: Letta.AgentsListRequest

requestOptions: Agents.RequestOptions

client.agents.create({ ...params }) -> Letta.AgentState

πŸ“ Description

Create a new agent with the specified configuration.

πŸ”Œ Usage

await client.agents.create();

βš™οΈ Parameters

request: Letta.CreateAgentRequest

requestOptions: Agents.RequestOptions

client.agents.get(agentId) -> Letta.AgentState

πŸ“ Description

Get the state of the agent.

πŸ”Œ Usage

await client.agents.get("agent_id");

βš™οΈ Parameters

agentId: string

requestOptions: Agents.RequestOptions

client.agents.delete(agentId) -> unknown

πŸ“ Description

Delete an agent.

πŸ”Œ Usage

await client.agents.delete("agent_id");

βš™οΈ Parameters

agentId: string

requestOptions: Agents.RequestOptions

client.agents.update(agentId, { ...params }) -> Letta.AgentState

πŸ“ Description

Update an exsiting agent

πŸ”Œ Usage

await client.agents.update("agent_id");

βš™οΈ Parameters

agentId: string

request: Letta.UpdateAgent

requestOptions: Agents.RequestOptions

client.agents.resetMessages(agentId, { ...params }) -> Letta.AgentState

πŸ“ Description

Resets the messages for an agent

πŸ”Œ Usage

await client.agents.resetMessages("agent_id");

βš™οΈ Parameters

agentId: string

request: Letta.ResetMessagesRequest

requestOptions: Agents.RequestOptions

client.agents.search({ ...params }) -> void

πŸ“ Description

This endpoint is only available on Letta Cloud.

Search deployed agents.

πŸ”Œ Usage

await client.agents.search();

βš™οΈ Parameters

request: Letta.AgentsSearchRequest

requestOptions: Agents.RequestOptions

Models

client.models.listLlms() -> Letta.LlmConfig[]

πŸ”Œ Usage

await client.models.listLlms();

βš™οΈ Parameters

requestOptions: Models.RequestOptions

client.models.listEmbeddingModels() -> Letta.EmbeddingConfig[]

πŸ”Œ Usage

await client.models.listEmbeddingModels();

βš™οΈ Parameters

requestOptions: Models.RequestOptions

Blocks

client.blocks.list({ ...params }) -> Letta.Block[]

πŸ”Œ Usage

await client.blocks.list();

βš™οΈ Parameters

request: Letta.BlocksListRequest

requestOptions: Blocks.RequestOptions

client.blocks.create({ ...params }) -> Letta.Block

πŸ”Œ Usage

await client.blocks.create({
    value: "value",
    label: "label",
});

βš™οΈ Parameters

request: Letta.CreateBlock

requestOptions: Blocks.RequestOptions

client.blocks.get(blockId) -> Letta.Block

πŸ”Œ Usage

await client.blocks.get("block_id");

βš™οΈ Parameters

blockId: string

requestOptions: Blocks.RequestOptions

client.blocks.delete(blockId) -> Letta.Block

πŸ”Œ Usage

await client.blocks.delete("block_id");

βš™οΈ Parameters

blockId: string

requestOptions: Blocks.RequestOptions

client.blocks.update(blockId, { ...params }) -> Letta.Block

πŸ”Œ Usage

await client.blocks.update("block_id", {});

βš™οΈ Parameters

blockId: string

request: Letta.BlockUpdate

requestOptions: Blocks.RequestOptions

client.blocks.linkAgentMemoryBlock(blockId, { ...params }) -> void

πŸ“ Description

Link a memory block to an agent.

πŸ”Œ Usage

await client.blocks.linkAgentMemoryBlock("block_id", {
    agentId: "agent_id",
});

βš™οΈ Parameters

blockId: string

request: Letta.LinkAgentMemoryBlockRequest

requestOptions: Blocks.RequestOptions

client.blocks.unlinkAgentMemoryBlock(blockId, { ...params }) -> void

πŸ“ Description

Unlink a memory block from an agent

πŸ”Œ Usage

await client.blocks.unlinkAgentMemoryBlock("block_id", {
    agentId: "agent_id",
});

βš™οΈ Parameters

blockId: string

request: Letta.UnlinkAgentMemoryBlockRequest

requestOptions: Blocks.RequestOptions

Jobs

client.jobs.list({ ...params }) -> Letta.Job[]

πŸ“ Description

List all jobs.

πŸ”Œ Usage

await client.jobs.list();

βš™οΈ Parameters

request: Letta.JobsListRequest

requestOptions: Jobs.RequestOptions

client.jobs.listActive() -> Letta.Job[]

πŸ“ Description

List all active jobs.

πŸ”Œ Usage

await client.jobs.listActive();

βš™οΈ Parameters

requestOptions: Jobs.RequestOptions

client.jobs.get(jobId) -> Letta.Job

πŸ“ Description

Get the status of a job.

πŸ”Œ Usage

await client.jobs.get("job_id");

βš™οΈ Parameters

jobId: string

requestOptions: Jobs.RequestOptions

client.jobs.delete(jobId) -> Letta.Job

πŸ“ Description

Delete a job by its job_id.

πŸ”Œ Usage

await client.jobs.delete("job_id");

βš™οΈ Parameters

jobId: string

requestOptions: Jobs.RequestOptions

Health

client.health.check() -> Letta.Health

πŸ”Œ Usage

await client.health.check();

βš™οΈ Parameters

requestOptions: Health.RequestOptions

Providers

client.providers.listProviders({ ...params }) -> Letta.Provider[]

πŸ“ Description

Get a list of all custom providers in the database

πŸ”Œ Usage

await client.providers.listProviders();

βš™οΈ Parameters

request: Letta.ListProvidersRequest

requestOptions: Providers.RequestOptions

client.providers.createProvider({ ...params }) -> Letta.Provider

πŸ“ Description

Create a new custom provider

πŸ”Œ Usage

await client.providers.createProvider({
    name: "name",
    apiKey: "api_key",
});

βš™οΈ Parameters

request: Letta.ProviderCreate

requestOptions: Providers.RequestOptions

client.providers.updateProvider({ ...params }) -> Letta.Provider

πŸ“ Description

Update an existing custom provider

πŸ”Œ Usage

await client.providers.updateProvider({
    id: "id",
    apiKey: "api_key",
});

βš™οΈ Parameters

request: Letta.ProviderUpdate

requestOptions: Providers.RequestOptions

client.providers.deleteProvider({ ...params }) -> unknown

πŸ“ Description

Delete an existing custom provider

πŸ”Œ Usage

await client.providers.deleteProvider({
    providerId: "provider_id",
});

βš™οΈ Parameters

request: Letta.DeleteProviderRequest

requestOptions: Providers.RequestOptions

Runs

client.runs.listRuns() -> Letta.Run[]

πŸ“ Description

List all runs.

πŸ”Œ Usage

await client.runs.listRuns();

βš™οΈ Parameters

requestOptions: Runs.RequestOptions

client.runs.listActiveRuns() -> Letta.Run[]

πŸ“ Description

List all active runs.

πŸ”Œ Usage

await client.runs.listActiveRuns();

βš™οΈ Parameters

requestOptions: Runs.RequestOptions

client.runs.getRun(runId) -> Letta.Run

πŸ“ Description

Get the status of a run.

πŸ”Œ Usage

await client.runs.getRun("run_id");

βš™οΈ Parameters

runId: string

requestOptions: Runs.RequestOptions

client.runs.deleteRun(runId) -> Letta.Run

πŸ“ Description

Delete a run by its run_id.

πŸ”Œ Usage

await client.runs.deleteRun("run_id");

βš™οΈ Parameters

runId: string

requestOptions: Runs.RequestOptions

client.runs.getRunMessages(runId, { ...params }) -> Letta.LettaMessageUnion[]

πŸ“ Description

Get messages associated with a run with filtering options.

Args: run_id: ID of the run cursor: Cursor for pagination limit: Maximum number of messages to return ascending: Sort order by creation time 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

await client.runs.getRunMessages("run_id");

βš™οΈ Parameters

runId: string

request: Letta.GetRunMessagesRequest

requestOptions: Runs.RequestOptions

client.runs.getRunUsage(runId) -> Letta.UsageStatistics

πŸ“ Description

Get usage statistics for a run.

πŸ”Œ Usage

await client.runs.getRunUsage("run_id");

βš™οΈ Parameters

runId: string

requestOptions: Runs.RequestOptions

Tag

client.tag.listTags({ ...params }) -> string[]

πŸ“ Description

Get a list of all tags in the database

πŸ”Œ Usage

await client.tag.listTags();

βš™οΈ Parameters

request: Letta.ListTagsRequest

requestOptions: Tag.RequestOptions

Agents Context

client.agents.context.get(agentId) -> Letta.ContextWindowOverview

πŸ“ Description

Retrieve the context window of a specific agent.

πŸ”Œ Usage

await client.agents.context.get("agent_id");

βš™οΈ Parameters

agentId: string

requestOptions: Context.RequestOptions

Agents Tools

client.agents.tools.list(agentId) -> Letta.LettaSchemasToolTool[]

πŸ“ Description

Get tools from an existing agent

πŸ”Œ Usage

await client.agents.tools.list("agent_id");

βš™οΈ Parameters

agentId: string

requestOptions: Tools.RequestOptions

client.agents.tools.add(agentId, toolId) -> Letta.AgentState

πŸ“ Description

Add tools to an existing agent

πŸ”Œ Usage

await client.agents.tools.add("agent_id", "tool_id");

βš™οΈ Parameters

agentId: string

toolId: string

requestOptions: Tools.RequestOptions

client.agents.tools.remove(agentId, toolId) -> Letta.AgentState

πŸ“ Description

Add tools to an existing agent

πŸ”Œ Usage

await client.agents.tools.remove("agent_id", "tool_id");

βš™οΈ Parameters

agentId: string

toolId: string

requestOptions: Tools.RequestOptions

Agents Sources

client.agents.sources.get(agentId) -> Letta.Source[]

πŸ“ Description

Get the sources associated with an agent.

πŸ”Œ Usage

await client.agents.sources.get("agent_id");

βš™οΈ Parameters

agentId: string

requestOptions: Sources.RequestOptions

Agents CoreMemory

client.agents.coreMemory.listInContext(agentId) -> Letta.LettaSchemasMessageMessage[]

πŸ“ Description

Retrieve the messages in the context of a specific agent.

πŸ”Œ Usage

await client.agents.coreMemory.listInContext("agent_id");

βš™οΈ Parameters

agentId: string

requestOptions: CoreMemory.RequestOptions

client.agents.coreMemory.get(agentId) -> Letta.Memory

πŸ“ 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

await client.agents.coreMemory.get("agent_id");

βš™οΈ Parameters

agentId: string

requestOptions: CoreMemory.RequestOptions

client.agents.coreMemory.getBlock(agentId, blockLabel) -> Letta.Block

πŸ“ Description

Retrieve a memory block from an agent.

πŸ”Œ Usage

await client.agents.coreMemory.getBlock("agent_id", "block_label");

βš™οΈ Parameters

agentId: string

blockLabel: string

requestOptions: CoreMemory.RequestOptions

client.agents.coreMemory.removeBlock(agentId, blockLabel) -> Letta.Memory

πŸ“ Description

Removes a memory block from an agent by unlnking it. If the block is not linked to any other agent, it is deleted.

πŸ”Œ Usage

await client.agents.coreMemory.removeBlock("agent_id", "block_label");

βš™οΈ Parameters

agentId: string

blockLabel: string

requestOptions: CoreMemory.RequestOptions

client.agents.coreMemory.updateBlock(agentId, blockLabel, { ...params }) -> Letta.Block

πŸ“ Description

Removes a memory block from an agent by unlnking it. If the block is not linked to any other agent, it is deleted.

πŸ”Œ Usage

await client.agents.coreMemory.updateBlock("agent_id", "block_label", {});

βš™οΈ Parameters

agentId: string

blockLabel: string

request: Letta.BlockUpdate

requestOptions: CoreMemory.RequestOptions

client.agents.coreMemory.getBlocks(agentId) -> Letta.Block[]

πŸ“ Description

Retrieve the memory blocks of a specific agent.

πŸ”Œ Usage

await client.agents.coreMemory.getBlocks("agent_id");

βš™οΈ Parameters

agentId: string

requestOptions: CoreMemory.RequestOptions

client.agents.coreMemory.addBlock(agentId, { ...params }) -> Letta.Memory

πŸ“ Description

Creates a memory block and links it to the agent.

πŸ”Œ Usage

await client.agents.coreMemory.addBlock("agent_id", {
    value: "value",
    label: "label",
});

βš™οΈ Parameters

agentId: string

request: Letta.CreateBlock

requestOptions: CoreMemory.RequestOptions

Agents RecallMemory

client.agents.recallMemory.getSummary(agentId) -> Letta.RecallMemorySummary

πŸ“ Description

Retrieve the summary of the recall memory of a specific agent.

πŸ”Œ Usage

await client.agents.recallMemory.getSummary("agent_id");

βš™οΈ Parameters

agentId: string

requestOptions: RecallMemory.RequestOptions

Agents ArchivalMemory

client.agents.archivalMemory.getSummary(agentId) -> Letta.ArchivalMemorySummary

πŸ“ Description

Retrieve the summary of the archival memory of a specific agent.

πŸ”Œ Usage

await client.agents.archivalMemory.getSummary("agent_id");

βš™οΈ Parameters

agentId: string

requestOptions: ArchivalMemory.RequestOptions

client.agents.archivalMemory.list(agentId, { ...params }) -> Letta.Passage[]

πŸ“ Description

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

πŸ”Œ Usage

await client.agents.archivalMemory.list("agent_id");

βš™οΈ Parameters

agentId: string

request: Letta.agents.ArchivalMemoryListRequest

requestOptions: ArchivalMemory.RequestOptions

client.agents.archivalMemory.create(agentId, { ...params }) -> Letta.Passage[]

πŸ“ Description

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

πŸ”Œ Usage

await client.agents.archivalMemory.create("agent_id", {
    text: "text",
});

βš™οΈ Parameters

agentId: string

request: Letta.agents.CreateArchivalMemory

requestOptions: ArchivalMemory.RequestOptions

client.agents.archivalMemory.delete(agentId, memoryId) -> unknown

πŸ“ Description

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

πŸ”Œ Usage

await client.agents.archivalMemory.delete("agent_id", "memory_id");

βš™οΈ Parameters

agentId: string

memoryId: string

requestOptions: ArchivalMemory.RequestOptions

Agents Messages

client.agents.messages.list(agentId, { ...params }) -> Letta.MessagesListResponse

πŸ“ Description

Retrieve message history for an agent.

πŸ”Œ Usage

await client.agents.messages.list("agent_id");

βš™οΈ Parameters

agentId: string

request: Letta.agents.MessagesListRequest

requestOptions: Messages.RequestOptions

client.agents.messages.send(agentId, { ...params }) -> Letta.LettaResponse

πŸ“ 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

await client.agents.messages.send("agent_id", {
    messages: [
        {
            role: "user",
            text: "text",
        },
    ],
});

βš™οΈ Parameters

agentId: string

request: Letta.LettaRequest

requestOptions: Messages.RequestOptions

client.agents.messages.update(agentId, messageId, { ...params }) -> Letta.LettaSchemasMessageMessage

πŸ“ Description

Update the details of a message associated with an agent.

πŸ”Œ Usage

await client.agents.messages.update("agent_id", "message_id");

βš™οΈ Parameters

agentId: string

messageId: string

request: Letta.agents.MessageUpdate

requestOptions: Messages.RequestOptions

client.agents.messages.stream(agentId, { ...params }) -> core.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

const response = await client.agents.messages.stream("agent_id", {
    messages: [
        {
            role: "user",
            text: "text",
        },
    ],
});
for await (const item of response) {
    console.log(item);
}

βš™οΈ Parameters

agentId: string

request: Letta.agents.LettaStreamingRequest

requestOptions: Messages.RequestOptions

client.agents.messages.sendAsync(agentId, { ...params }) -> Letta.Run

πŸ“ 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

await client.agents.messages.sendAsync("agent_id", {
    messages: [
        {
            role: "user",
            text: "text",
        },
    ],
});

βš™οΈ Parameters

agentId: string

request: Letta.LettaRequest

requestOptions: Messages.RequestOptions

Agents Templates

client.agents.templates.createVersion(agentId, { ...params }) -> void

πŸ“ Description

This endpoint is only available on Letta Cloud.

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

πŸ”Œ Usage

await client.agents.templates.createVersion("agent_id");

βš™οΈ Parameters

agentId: string β€” 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

request: Letta.agents.TemplatesCreateVersionRequest

requestOptions: Templates.RequestOptions

client.agents.templates.migrate(agentId, { ...params }) -> Letta.TemplatesMigrateResponse

πŸ“ Description

This endpoint is only available on Letta Cloud.

Migrate an agent to a new versioned agent template.

πŸ”Œ Usage

await client.agents.templates.migrate("agent_id", {
    toTemplate: "to_template",
    preserveCoreMemories: true,
});

βš™οΈ Parameters

agentId: string

request: Letta.agents.TemplatesMigrateRequest

requestOptions: Templates.RequestOptions

client.agents.templates.create(agentId, { ...params }) -> void

πŸ“ Description

This endpoint is only available on Letta Cloud.

Creates a template from an agent.

πŸ”Œ Usage

await client.agents.templates.create("agent_id");

βš™οΈ Parameters

agentId: string

request: Letta.agents.TemplatesCreateRequest

requestOptions: Templates.RequestOptions

Agents MemoryVariables

client.agents.memoryVariables.get(agentId) -> Letta.MemoryVariablesGetResponse

πŸ“ Description

This endpoint is only available on Letta Cloud.

Returns the memory variables associated with an agent.

πŸ”Œ Usage

await client.agents.memoryVariables.get("agent_id");

βš™οΈ Parameters

agentId: string

requestOptions: MemoryVariables.RequestOptions

Sources Files

client.sources.files.upload(file, sourceId) -> Letta.Job

πŸ“ Description

Upload a file to a data source.

πŸ”Œ Usage

await client.sources.files.upload(fs.createReadStream("/path/to/your/file"), "source_id");

βš™οΈ Parameters

file: File | fs.ReadStream | Blob

sourceId: string

requestOptions: Files.RequestOptions

client.sources.files.list(sourceId, { ...params }) -> Letta.FileMetadata[]

πŸ“ Description

List paginated files associated with a data source.

πŸ”Œ Usage

await client.sources.files.list("source_id");

βš™οΈ Parameters

sourceId: string

request: Letta.sources.FilesListRequest

requestOptions: Files.RequestOptions

client.sources.files.delete(sourceId, fileId) -> void

πŸ“ Description

Delete a data source.

πŸ”Œ Usage

await client.sources.files.delete("source_id", "file_id");

βš™οΈ Parameters

sourceId: string

fileId: string

requestOptions: Files.RequestOptions

Sources Passages

client.sources.passages.list(sourceId) -> Letta.Passage[]

πŸ“ Description

List all passages associated with a data source.

πŸ”Œ Usage

await client.sources.passages.list("source_id");

βš™οΈ Parameters

sourceId: string

requestOptions: Passages.RequestOptions