LettaAPI.Api.Messages (letta_api v1.0.0)

API calls for all endpoints tagged Messages.

Summary

Functions

Cancel Batch Run Cancel a batch run.

Create Messages Batch Submit a batch of agent messages for asynchronous processing. Creates a job that will fan out messages to all listed agents and process them in parallel.

List Batch Messages Get messages for a specific batch job. Returns messages associated with the batch in chronological order. Pagination: - For the first page, omit the cursor parameter - For subsequent pages, use the ID of the last message from the previous response as the cursor - Results will include messages before/after the cursor based on sort_descending

List Batch Runs List all batch runs.

Retrieve Batch Run Get the status of a batch run.

Functions

cancel_batch_run(connection, batch_id, opts \\ [])

@spec cancel_batch_run(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, any()}
  | {:ok, LettaAPI.Model.HttpValidationError.t()}
  | {:error, Tesla.Env.t()}

Cancel Batch Run Cancel a batch run.

Parameters

  • connection (LettaAPI.Connection): Connection to server
  • batch_id (String.t):
  • opts (keyword): Optional parameters
    • :user_id (String.t):

Returns

  • {:ok, any()} on success
  • {:error, Tesla.Env.t} on failure

create_messages_batch(connection, create_batch, opts \\ [])

@spec create_messages_batch(
  Tesla.Env.client(),
  LettaAPI.Model.CreateBatch.t(),
  keyword()
) ::
  {:ok, LettaAPI.Model.BatchJob.t()}
  | {:ok, LettaAPI.Model.HttpValidationError.t()}
  | {:error, Tesla.Env.t()}

Create Messages Batch Submit a batch of agent messages for asynchronous processing. Creates a job that will fan out messages to all listed agents and process them in parallel.

Parameters

  • connection (LettaAPI.Connection): Connection to server
  • create_batch (CreateBatch):
  • opts (keyword): Optional parameters
    • :user_id (String.t):

Returns

  • {:ok, LettaAPI.Model.BatchJob.t} on success
  • {:error, Tesla.Env.t} on failure

list_batch_messages(connection, batch_id, opts \\ [])

@spec list_batch_messages(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, LettaAPI.Model.LettaBatchMessages.t()}
  | {:ok, LettaAPI.Model.HttpValidationError.t()}
  | {:error, Tesla.Env.t()}

List Batch Messages Get messages for a specific batch job. Returns messages associated with the batch in chronological order. Pagination: - For the first page, omit the cursor parameter - For subsequent pages, use the ID of the last message from the previous response as the cursor - Results will include messages before/after the cursor based on sort_descending

Parameters

  • connection (LettaAPI.Connection): Connection to server
  • batch_id (String.t):
  • opts (keyword): Optional parameters
    • :limit (integer()): Maximum number of messages to return
    • :cursor (String.t): Message ID to use as pagination cursor (get messages before/after this ID) depending on sort_descending.
    • :agent_id (String.t): Filter messages by agent ID
    • :sort_descending (boolean()): Sort messages by creation time (true=newest first)
    • :user_id (String.t):

Returns

  • {:ok, LettaAPI.Model.LettaBatchMessages.t} on success
  • {:error, Tesla.Env.t} on failure

list_batch_runs(connection, opts \\ [])

@spec list_batch_runs(
  Tesla.Env.client(),
  keyword()
) ::
  {:ok, [LettaAPI.Model.BatchJob.t()]}
  | {:ok, LettaAPI.Model.HttpValidationError.t()}
  | {:error, Tesla.Env.t()}

List Batch Runs List all batch runs.

Parameters

  • connection (LettaAPI.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :user_id (String.t):

Returns

  • {:ok, [%BatchJob{}, ...]} on success
  • {:error, Tesla.Env.t} on failure

retrieve_batch_run(connection, batch_id, opts \\ [])

@spec retrieve_batch_run(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, LettaAPI.Model.BatchJob.t()}
  | {:ok, LettaAPI.Model.HttpValidationError.t()}
  | {:error, Tesla.Env.t()}

Retrieve Batch Run Get the status of a batch run.

Parameters

  • connection (LettaAPI.Connection): Connection to server
  • batch_id (String.t):
  • opts (keyword): Optional parameters
    • :user_id (String.t):

Returns

  • {:ok, LettaAPI.Model.BatchJob.t} on success
  • {:error, Tesla.Env.t} on failure