Letta · Schema

LettaResponse

Response object from an agent interaction, consisting of the new messages generated by the agent and usage statistics. The type of the returned messages can be either `Message` or `LettaMessage`, depending on what was specified in the request. Attributes: messages (List[Union[Message, LettaMessage]]): The messages returned by the agent. usage (LettaUsageStatistics): The usage statistics

AIAgentsStateful AgentsMemoryMemGPTContinual LearningMCPMulti-AgentRAGOpen Source

Properties

Name Type Description
messages array The messages returned by the agent.
stop_reason object
usage object The usage statistics of the agent.
logprobs object Log probabilities of the output tokens from the last LLM call. Only present if return_logprobs was enabled.
turns object Token data for all LLM generations in multi-turn agent interaction. Includes token IDs and logprobs for each assistant turn, plus tool result content. Only present if return_token_ids was enabled. Use
View JSON Schema on GitHub

JSON Schema

letta-lettaresponse-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/LettaResponse",
  "title": "LettaResponse",
  "properties": {
    "messages": {
      "items": {
        "$ref": "#/components/schemas/LettaMessageUnion"
      },
      "type": "array",
      "title": "Messages",
      "description": "The messages returned by the agent."
    },
    "stop_reason": {
      "$ref": "#/components/schemas/LettaStopReason"
    },
    "usage": {
      "$ref": "#/components/schemas/LettaUsageStatistics",
      "description": "The usage statistics of the agent."
    },
    "logprobs": {
      "anyOf": [
        {
          "$ref": "#/components/schemas/letta__schemas__openai__chat_completion_response__ChoiceLogprobs"
        },
        {
          "type": "null"
        }
      ],
      "description": "Log probabilities of the output tokens from the last LLM call. Only present if return_logprobs was enabled."
    },
    "turns": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/components/schemas/TurnTokenData"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Turns",
      "description": "Token data for all LLM generations in multi-turn agent interaction. Includes token IDs and logprobs for each assistant turn, plus tool result content. Only present if return_token_ids was enabled. Used for RL training with loss masking."
    }
  },
  "type": "object",
  "required": [
    "messages",
    "stop_reason",
    "usage"
  ],
  "description": "Response object from an agent interaction, consisting of the new messages generated by the agent and usage statistics.\nThe type of the returned messages can be either `Message` or `LettaMessage`, depending on what was specified in the request.\n\nAttributes:\n    messages (List[Union[Message, LettaMessage]]): The messages returned by the agent.\n    usage (LettaUsageStatistics): The usage statistics"
}