@letta-ai/letta-client 1.0.0-alpha.7 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +248 -0
- package/README.md +282 -319
- package/client.d.mts +61 -36
- package/client.d.mts.map +1 -1
- package/client.d.ts +61 -36
- package/client.d.ts.map +1 -1
- package/client.js +53 -23
- package/client.js.map +1 -1
- package/client.mjs +53 -23
- package/client.mjs.map +1 -1
- package/core/pagination.d.mts +96 -0
- package/core/pagination.d.mts.map +1 -0
- package/core/pagination.d.ts +96 -0
- package/core/pagination.d.ts.map +1 -0
- package/core/pagination.js +199 -0
- package/core/pagination.js.map +1 -0
- package/core/pagination.mjs +191 -0
- package/core/pagination.mjs.map +1 -0
- package/core/streaming.d.mts +33 -0
- package/core/streaming.d.mts.map +1 -0
- package/core/streaming.d.ts +33 -0
- package/core/streaming.d.ts.map +1 -0
- package/core/streaming.js +276 -0
- package/core/streaming.js.map +1 -0
- package/core/streaming.mjs +271 -0
- package/core/streaming.mjs.map +1 -0
- package/index.d.mts +1 -0
- package/index.d.mts.map +1 -1
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +3 -1
- package/index.js.map +1 -1
- package/index.mjs +1 -0
- package/index.mjs.map +1 -1
- package/internal/decoders/line.d.mts +17 -0
- package/internal/decoders/line.d.mts.map +1 -0
- package/internal/decoders/line.d.ts +17 -0
- package/internal/decoders/line.d.ts.map +1 -0
- package/internal/decoders/line.js +113 -0
- package/internal/decoders/line.js.map +1 -0
- package/internal/decoders/line.mjs +108 -0
- package/internal/decoders/line.mjs.map +1 -0
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.js +10 -0
- package/internal/parse.js.map +1 -1
- package/internal/parse.mjs +10 -0
- package/internal/parse.mjs.map +1 -1
- package/internal/request-options.d.mts +2 -0
- package/internal/request-options.d.mts.map +1 -1
- package/internal/request-options.d.ts +2 -0
- package/internal/request-options.d.ts.map +1 -1
- package/internal/request-options.js.map +1 -1
- package/internal/request-options.mjs.map +1 -1
- package/internal/tslib.js +17 -17
- package/package.json +21 -1
- package/pagination.d.mts +2 -0
- package/pagination.d.mts.map +1 -0
- package/pagination.d.ts +2 -0
- package/pagination.d.ts.map +1 -0
- package/pagination.js +6 -0
- package/pagination.js.map +1 -0
- package/pagination.mjs +2 -0
- package/pagination.mjs.map +1 -0
- package/resources/access-tokens.d.mts +105 -0
- package/resources/access-tokens.d.mts.map +1 -0
- package/resources/access-tokens.d.ts +105 -0
- package/resources/access-tokens.d.ts.map +1 -0
- package/resources/access-tokens.js +30 -0
- package/resources/access-tokens.js.map +1 -0
- package/resources/access-tokens.mjs +26 -0
- package/resources/access-tokens.mjs.map +1 -0
- package/resources/agents/agents.d.mts +517 -160
- package/resources/agents/agents.d.mts.map +1 -1
- package/resources/agents/agents.d.ts +517 -160
- package/resources/agents/agents.d.ts.map +1 -1
- package/resources/agents/agents.js +16 -21
- package/resources/agents/agents.js.map +1 -1
- package/resources/agents/agents.mjs +17 -22
- package/resources/agents/agents.mjs.map +1 -1
- package/resources/agents/archives.d.mts +31 -0
- package/resources/agents/archives.d.mts.map +1 -0
- package/resources/agents/archives.d.ts +31 -0
- package/resources/agents/archives.d.ts.map +1 -0
- package/resources/agents/archives.js +24 -0
- package/resources/agents/archives.js.map +1 -0
- package/resources/agents/archives.mjs +20 -0
- package/resources/agents/archives.mjs.map +1 -0
- package/resources/agents/blocks.d.mts +33 -55
- package/resources/agents/blocks.d.mts.map +1 -1
- package/resources/agents/blocks.d.ts +33 -55
- package/resources/agents/blocks.d.ts.map +1 -1
- package/resources/agents/blocks.js +2 -1
- package/resources/agents/blocks.js.map +1 -1
- package/resources/agents/blocks.mjs +2 -1
- package/resources/agents/blocks.mjs.map +1 -1
- package/resources/agents/files.d.mts +39 -79
- package/resources/agents/files.d.mts.map +1 -1
- package/resources/agents/files.d.ts +39 -79
- package/resources/agents/files.d.ts.map +1 -1
- package/resources/agents/files.js +5 -1
- package/resources/agents/files.js.map +1 -1
- package/resources/agents/files.mjs +5 -1
- package/resources/agents/files.mjs.map +1 -1
- package/resources/agents/folders.d.mts +50 -79
- package/resources/agents/folders.d.mts.map +1 -1
- package/resources/agents/folders.d.ts +50 -79
- package/resources/agents/folders.d.ts.map +1 -1
- package/resources/agents/folders.js +5 -1
- package/resources/agents/folders.js.map +1 -1
- package/resources/agents/folders.mjs +5 -1
- package/resources/agents/folders.mjs.map +1 -1
- package/resources/agents/groups.d.mts +6 -28
- package/resources/agents/groups.d.mts.map +1 -1
- package/resources/agents/groups.d.ts +6 -28
- package/resources/agents/groups.d.ts.map +1 -1
- package/resources/agents/groups.js +5 -1
- package/resources/agents/groups.js.map +1 -1
- package/resources/agents/groups.mjs +5 -1
- package/resources/agents/groups.mjs.map +1 -1
- package/resources/agents/identities.d.mts +31 -0
- package/resources/agents/identities.d.mts.map +1 -0
- package/resources/agents/identities.d.ts +31 -0
- package/resources/agents/identities.d.ts.map +1 -0
- package/resources/agents/identities.js +24 -0
- package/resources/agents/identities.js.map +1 -0
- package/resources/agents/identities.mjs +20 -0
- package/resources/agents/identities.mjs.map +1 -0
- package/resources/agents/index.d.mts +9 -7
- package/resources/agents/index.d.mts.map +1 -1
- package/resources/agents/index.d.ts +9 -7
- package/resources/agents/index.d.ts.map +1 -1
- package/resources/agents/index.js +5 -1
- package/resources/agents/index.js.map +1 -1
- package/resources/agents/index.mjs +2 -0
- package/resources/agents/index.mjs.map +1 -1
- package/resources/agents/messages.d.mts +668 -422
- package/resources/agents/messages.d.mts.map +1 -1
- package/resources/agents/messages.d.ts +668 -422
- package/resources/agents/messages.d.ts.map +1 -1
- package/resources/agents/messages.js +27 -26
- package/resources/agents/messages.js.map +1 -1
- package/resources/agents/messages.mjs +27 -26
- package/resources/agents/messages.mjs.map +1 -1
- package/resources/agents/tools.d.mts +9 -30
- package/resources/agents/tools.d.mts.map +1 -1
- package/resources/agents/tools.d.ts +9 -30
- package/resources/agents/tools.d.ts.map +1 -1
- package/resources/agents/tools.js +5 -1
- package/resources/agents/tools.js.map +1 -1
- package/resources/agents/tools.mjs +5 -1
- package/resources/agents/tools.mjs.map +1 -1
- package/resources/archives/archives.d.mts +115 -0
- package/resources/archives/archives.d.mts.map +1 -0
- package/resources/archives/archives.d.ts +115 -0
- package/resources/archives/archives.d.ts.map +1 -0
- package/resources/archives/archives.js +50 -0
- package/resources/archives/archives.js.map +1 -0
- package/resources/archives/archives.mjs +45 -0
- package/resources/archives/archives.mjs.map +1 -0
- package/resources/archives/index.d.mts +3 -0
- package/resources/archives/index.d.mts.map +1 -0
- package/resources/archives/index.d.ts +3 -0
- package/resources/archives/index.d.ts.map +1 -0
- package/resources/archives/index.js +9 -0
- package/resources/archives/index.js.map +1 -0
- package/resources/archives/index.mjs +4 -0
- package/resources/archives/index.mjs.map +1 -0
- package/resources/archives/passages.d.mts +113 -0
- package/resources/archives/passages.d.mts.map +1 -0
- package/resources/archives/passages.d.ts +113 -0
- package/resources/archives/passages.d.ts.map +1 -0
- package/resources/archives/passages.js +32 -0
- package/resources/archives/passages.js.map +1 -0
- package/resources/archives/passages.mjs +28 -0
- package/resources/archives/passages.mjs.map +1 -0
- package/resources/archives.d.mts +1 -130
- package/resources/archives.d.mts.map +1 -1
- package/resources/archives.d.ts +1 -130
- package/resources/archives.d.ts.map +1 -1
- package/resources/archives.js +2 -37
- package/resources/archives.js.map +1 -1
- package/resources/archives.mjs +1 -35
- package/resources/archives.mjs.map +1 -1
- package/resources/batches/batches.d.mts +52 -34
- package/resources/batches/batches.d.mts.map +1 -1
- package/resources/batches/batches.d.ts +52 -34
- package/resources/batches/batches.d.ts.map +1 -1
- package/resources/batches/batches.js +2 -1
- package/resources/batches/batches.js.map +1 -1
- package/resources/batches/batches.mjs +2 -1
- package/resources/batches/batches.mjs.map +1 -1
- package/resources/batches/index.d.mts +2 -2
- package/resources/batches/index.d.mts.map +1 -1
- package/resources/batches/index.d.ts +2 -2
- package/resources/batches/index.d.ts.map +1 -1
- package/resources/batches/index.js.map +1 -1
- package/resources/batches/index.mjs.map +1 -1
- package/resources/batches/messages.d.mts +6 -30
- package/resources/batches/messages.d.mts.map +1 -1
- package/resources/batches/messages.d.ts +6 -30
- package/resources/batches/messages.d.ts.map +1 -1
- package/resources/batches/messages.js +2 -1
- package/resources/batches/messages.js.map +1 -1
- package/resources/batches/messages.mjs +2 -1
- package/resources/batches/messages.mjs.map +1 -1
- package/resources/blocks/agents.d.mts +6 -28
- package/resources/blocks/agents.d.mts.map +1 -1
- package/resources/blocks/agents.d.ts +6 -28
- package/resources/blocks/agents.d.ts.map +1 -1
- package/resources/blocks/agents.js +5 -1
- package/resources/blocks/agents.js.map +1 -1
- package/resources/blocks/agents.mjs +5 -1
- package/resources/blocks/agents.mjs.map +1 -1
- package/resources/blocks/blocks.d.mts +108 -48
- package/resources/blocks/blocks.d.mts.map +1 -1
- package/resources/blocks/blocks.d.ts +108 -48
- package/resources/blocks/blocks.d.ts.map +1 -1
- package/resources/blocks/blocks.js +3 -8
- package/resources/blocks/blocks.js.map +1 -1
- package/resources/blocks/blocks.mjs +3 -8
- package/resources/blocks/blocks.mjs.map +1 -1
- package/resources/blocks/index.d.mts +2 -2
- package/resources/blocks/index.d.mts.map +1 -1
- package/resources/blocks/index.d.ts +2 -2
- package/resources/blocks/index.d.ts.map +1 -1
- package/resources/blocks/index.js.map +1 -1
- package/resources/blocks/index.mjs.map +1 -1
- package/resources/folders/files.d.mts +75 -97
- package/resources/folders/files.d.mts.map +1 -1
- package/resources/folders/files.d.ts +75 -97
- package/resources/folders/files.d.ts.map +1 -1
- package/resources/folders/files.js +5 -1
- package/resources/folders/files.js.map +1 -1
- package/resources/folders/files.mjs +5 -1
- package/resources/folders/files.mjs.map +1 -1
- package/resources/folders/folders.d.mts +11 -44
- package/resources/folders/folders.d.mts.map +1 -1
- package/resources/folders/folders.d.ts +11 -44
- package/resources/folders/folders.d.ts.map +1 -1
- package/resources/folders/folders.js +2 -7
- package/resources/folders/folders.js.map +1 -1
- package/resources/folders/folders.mjs +2 -7
- package/resources/folders/folders.mjs.map +1 -1
- package/resources/folders/index.d.mts +2 -2
- package/resources/folders/index.d.mts.map +1 -1
- package/resources/folders/index.d.ts +2 -2
- package/resources/folders/index.d.ts.map +1 -1
- package/resources/folders/index.js.map +1 -1
- package/resources/folders/index.mjs.map +1 -1
- package/resources/groups/groups.d.mts +17 -67
- package/resources/groups/groups.d.mts.map +1 -1
- package/resources/groups/groups.d.ts +17 -67
- package/resources/groups/groups.d.ts.map +1 -1
- package/resources/groups/groups.js +6 -28
- package/resources/groups/groups.js.map +1 -1
- package/resources/groups/groups.mjs +6 -28
- package/resources/groups/groups.mjs.map +1 -1
- package/resources/groups/index.d.mts +2 -2
- package/resources/groups/index.d.mts.map +1 -1
- package/resources/groups/index.d.ts +2 -2
- package/resources/groups/index.d.ts.map +1 -1
- package/resources/groups/index.js.map +1 -1
- package/resources/groups/index.mjs.map +1 -1
- package/resources/groups/messages.d.mts +145 -79
- package/resources/groups/messages.d.mts.map +1 -1
- package/resources/groups/messages.d.ts +145 -79
- package/resources/groups/messages.d.ts.map +1 -1
- package/resources/groups/messages.js +18 -10
- package/resources/groups/messages.js.map +1 -1
- package/resources/groups/messages.mjs +18 -10
- package/resources/groups/messages.mjs.map +1 -1
- package/resources/identities/agents.d.mts +6 -28
- package/resources/identities/agents.d.mts.map +1 -1
- package/resources/identities/agents.d.ts +6 -28
- package/resources/identities/agents.d.ts.map +1 -1
- package/resources/identities/agents.js +2 -1
- package/resources/identities/agents.js.map +1 -1
- package/resources/identities/agents.mjs +2 -1
- package/resources/identities/agents.mjs.map +1 -1
- package/resources/identities/blocks.d.mts +7 -29
- package/resources/identities/blocks.d.mts.map +1 -1
- package/resources/identities/blocks.d.ts +7 -29
- package/resources/identities/blocks.d.ts.map +1 -1
- package/resources/identities/blocks.js +2 -1
- package/resources/identities/blocks.js.map +1 -1
- package/resources/identities/blocks.mjs +2 -1
- package/resources/identities/blocks.mjs.map +1 -1
- package/resources/identities/identities.d.mts +30 -65
- package/resources/identities/identities.d.mts.map +1 -1
- package/resources/identities/identities.d.ts +30 -65
- package/resources/identities/identities.d.ts.map +1 -1
- package/resources/identities/identities.js +7 -29
- package/resources/identities/identities.js.map +1 -1
- package/resources/identities/identities.mjs +7 -29
- package/resources/identities/identities.mjs.map +1 -1
- package/resources/identities/index.d.mts +3 -3
- package/resources/identities/index.d.mts.map +1 -1
- package/resources/identities/index.d.ts +3 -3
- package/resources/identities/index.d.ts.map +1 -1
- package/resources/identities/index.js.map +1 -1
- package/resources/identities/index.mjs.map +1 -1
- package/resources/identities/properties.d.mts +1 -1
- package/resources/identities/properties.d.ts +1 -1
- package/resources/identities/properties.js +1 -1
- package/resources/identities/properties.mjs +1 -1
- package/resources/index.d.mts +13 -11
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +13 -11
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +6 -2
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +3 -1
- package/resources/index.mjs.map +1 -1
- package/resources/mcp-servers/index.d.mts +3 -0
- package/resources/mcp-servers/index.d.mts.map +1 -0
- package/resources/mcp-servers/index.d.ts +3 -0
- package/resources/mcp-servers/index.d.ts.map +1 -0
- package/resources/mcp-servers/index.js +9 -0
- package/resources/mcp-servers/index.js.map +1 -0
- package/resources/mcp-servers/index.mjs +4 -0
- package/resources/mcp-servers/index.mjs.map +1 -0
- package/resources/mcp-servers/mcp-servers.d.mts +349 -0
- package/resources/mcp-servers/mcp-servers.d.mts.map +1 -0
- package/resources/mcp-servers/mcp-servers.d.ts +349 -0
- package/resources/mcp-servers/mcp-servers.d.ts.map +1 -0
- package/resources/mcp-servers/mcp-servers.js +69 -0
- package/resources/mcp-servers/mcp-servers.js.map +1 -0
- package/resources/mcp-servers/mcp-servers.mjs +64 -0
- package/resources/mcp-servers/mcp-servers.mjs.map +1 -0
- package/resources/mcp-servers/tools.d.mts +42 -0
- package/resources/mcp-servers/tools.d.mts.map +1 -0
- package/resources/mcp-servers/tools.d.ts +42 -0
- package/resources/mcp-servers/tools.d.ts.map +1 -0
- package/resources/mcp-servers/tools.js +36 -0
- package/resources/mcp-servers/tools.js.map +1 -0
- package/resources/mcp-servers/tools.mjs +32 -0
- package/resources/mcp-servers/tools.mjs.map +1 -0
- package/resources/mcp-servers.d.mts +2 -0
- package/resources/mcp-servers.d.mts.map +1 -0
- package/resources/mcp-servers.d.ts +2 -0
- package/resources/mcp-servers.d.ts.map +1 -0
- package/resources/mcp-servers.js +6 -0
- package/resources/mcp-servers.js.map +1 -0
- package/resources/mcp-servers.mjs +3 -0
- package/resources/mcp-servers.mjs.map +1 -0
- package/resources/models/embeddings.d.mts +6 -2
- package/resources/models/embeddings.d.mts.map +1 -1
- package/resources/models/embeddings.d.ts +6 -2
- package/resources/models/embeddings.d.ts.map +1 -1
- package/resources/models/embeddings.js +5 -1
- package/resources/models/embeddings.js.map +1 -1
- package/resources/models/embeddings.mjs +5 -1
- package/resources/models/embeddings.mjs.map +1 -1
- package/resources/models/index.d.mts +1 -1
- package/resources/models/index.d.mts.map +1 -1
- package/resources/models/index.d.ts +1 -1
- package/resources/models/index.d.ts.map +1 -1
- package/resources/models/index.js.map +1 -1
- package/resources/models/index.mjs.map +1 -1
- package/resources/models/models.d.mts +180 -4
- package/resources/models/models.d.mts.map +1 -1
- package/resources/models/models.d.ts +180 -4
- package/resources/models/models.d.ts.map +1 -1
- package/resources/models/models.js +5 -1
- package/resources/models/models.js.map +1 -1
- package/resources/models/models.mjs +5 -1
- package/resources/models/models.mjs.map +1 -1
- package/resources/runs/index.d.mts +3 -3
- package/resources/runs/index.d.mts.map +1 -1
- package/resources/runs/index.d.ts +3 -3
- package/resources/runs/index.d.ts.map +1 -1
- package/resources/runs/index.js.map +1 -1
- package/resources/runs/index.mjs.map +1 -1
- package/resources/runs/messages.d.mts +8 -28
- package/resources/runs/messages.d.mts.map +1 -1
- package/resources/runs/messages.d.ts +8 -28
- package/resources/runs/messages.d.ts.map +1 -1
- package/resources/runs/messages.js +10 -2
- package/resources/runs/messages.js.map +1 -1
- package/resources/runs/messages.mjs +10 -2
- package/resources/runs/messages.mjs.map +1 -1
- package/resources/runs/runs.d.mts +10 -36
- package/resources/runs/runs.d.mts.map +1 -1
- package/resources/runs/runs.d.ts +10 -36
- package/resources/runs/runs.d.ts.map +1 -1
- package/resources/runs/runs.js +2 -1
- package/resources/runs/runs.js.map +1 -1
- package/resources/runs/runs.mjs +3 -2
- package/resources/runs/runs.mjs.map +1 -1
- package/resources/runs/steps.d.mts +6 -26
- package/resources/runs/steps.d.mts.map +1 -1
- package/resources/runs/steps.d.ts +6 -26
- package/resources/runs/steps.d.ts.map +1 -1
- package/resources/runs/steps.js +5 -1
- package/resources/runs/steps.js.map +1 -1
- package/resources/runs/steps.mjs +5 -1
- package/resources/runs/steps.mjs.map +1 -1
- package/resources/steps/index.d.mts +2 -2
- package/resources/steps/index.d.mts.map +1 -1
- package/resources/steps/index.d.ts +2 -2
- package/resources/steps/index.d.ts.map +1 -1
- package/resources/steps/index.js.map +1 -1
- package/resources/steps/index.mjs +1 -1
- package/resources/steps/index.mjs.map +1 -1
- package/resources/steps/messages.d.mts +14 -28
- package/resources/steps/messages.d.mts.map +1 -1
- package/resources/steps/messages.d.ts +14 -28
- package/resources/steps/messages.d.ts.map +1 -1
- package/resources/steps/messages.js +5 -1
- package/resources/steps/messages.js.map +1 -1
- package/resources/steps/messages.mjs +5 -1
- package/resources/steps/messages.mjs.map +1 -1
- package/resources/steps/steps.d.mts +17 -44
- package/resources/steps/steps.d.mts.map +1 -1
- package/resources/steps/steps.d.ts +17 -44
- package/resources/steps/steps.d.ts.map +1 -1
- package/resources/steps/steps.js +3 -11
- package/resources/steps/steps.js.map +1 -1
- package/resources/steps/steps.mjs +3 -11
- package/resources/steps/steps.mjs.map +1 -1
- package/resources/templates/agents.d.mts +9 -14
- package/resources/templates/agents.d.mts.map +1 -1
- package/resources/templates/agents.d.ts +9 -14
- package/resources/templates/agents.d.ts.map +1 -1
- package/resources/templates/agents.js +2 -3
- package/resources/templates/agents.js.map +1 -1
- package/resources/templates/agents.mjs +2 -3
- package/resources/templates/agents.mjs.map +1 -1
- package/resources/tools.d.mts +6 -68
- package/resources/tools.d.mts.map +1 -1
- package/resources/tools.d.ts +6 -68
- package/resources/tools.d.ts.map +1 -1
- package/resources/tools.js +2 -7
- package/resources/tools.js.map +1 -1
- package/resources/tools.mjs +2 -7
- package/resources/tools.mjs.map +1 -1
- package/src/client.ts +274 -127
- package/src/core/pagination.ts +334 -0
- package/src/core/streaming.ts +331 -0
- package/src/index.ts +1 -0
- package/src/internal/decoders/line.ts +135 -0
- package/src/internal/parse.ts +14 -0
- package/src/internal/request-options.ts +2 -0
- package/src/pagination.ts +2 -0
- package/src/resources/access-tokens.ts +163 -0
- package/src/resources/agents/agents.ts +722 -242
- package/src/resources/agents/archives.ts +51 -0
- package/src/resources/agents/blocks.ts +50 -63
- package/src/resources/agents/files.ts +47 -90
- package/src/resources/agents/folders.ts +58 -88
- package/src/resources/agents/groups.ts +11 -35
- package/src/resources/agents/identities.ts +51 -0
- package/src/resources/agents/index.ts +40 -12
- package/src/resources/agents/messages.ts +941 -550
- package/src/resources/agents/tools.ts +13 -37
- package/src/resources/archives/archives.ts +170 -0
- package/src/resources/archives/index.ts +17 -0
- package/src/resources/archives/passages.ts +150 -0
- package/src/resources/archives.ts +1 -178
- package/src/resources/batches/batches.ts +74 -46
- package/src/resources/batches/index.ts +2 -2
- package/src/resources/batches/messages.ts +12 -37
- package/src/resources/blocks/agents.ts +11 -35
- package/src/resources/blocks/blocks.ts +130 -64
- package/src/resources/blocks/index.ts +3 -3
- package/src/resources/folders/files.ts +90 -113
- package/src/resources/folders/folders.ts +14 -55
- package/src/resources/folders/index.ts +2 -2
- package/src/resources/groups/groups.ts +21 -102
- package/src/resources/groups/index.ts +2 -4
- package/src/resources/groups/messages.ts +215 -103
- package/src/resources/identities/agents.ts +12 -35
- package/src/resources/identities/blocks.ts +13 -36
- package/src/resources/identities/identities.ts +35 -107
- package/src/resources/identities/index.ts +3 -4
- package/src/resources/identities/properties.ts +1 -1
- package/src/resources/index.ts +55 -18
- package/src/resources/mcp-servers/index.ts +25 -0
- package/src/resources/mcp-servers/mcp-servers.ts +460 -0
- package/src/resources/mcp-servers/tools.ts +69 -0
- package/src/resources/mcp-servers.ts +3 -0
- package/src/resources/models/embeddings.ts +6 -2
- package/src/resources/models/index.ts +2 -0
- package/src/resources/models/models.ts +260 -3
- package/src/resources/runs/index.ts +2 -3
- package/src/resources/runs/messages.ts +18 -37
- package/src/resources/runs/runs.ts +14 -54
- package/src/resources/runs/steps.ts +11 -33
- package/src/resources/steps/index.ts +7 -2
- package/src/resources/steps/messages.ts +25 -35
- package/src/resources/steps/steps.ts +20 -61
- package/src/resources/templates/agents.ts +14 -17
- package/src/resources/tools.ts +8 -92
- package/src/streaming.ts +2 -0
- package/src/version.ts +1 -1
- package/streaming.d.mts +2 -0
- package/streaming.d.mts.map +1 -0
- package/streaming.d.ts +2 -0
- package/streaming.d.ts.map +1 -0
- package/streaming.js +6 -0
- package/streaming.js.map +1 -0
- package/streaming.mjs +2 -0
- package/streaming.mjs.map +1 -0
- package/version.d.mts +1 -1
- package/version.d.mts.map +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
|
@@ -6,21 +6,54 @@ import * as ToolsAPI from '../tools';
|
|
|
6
6
|
import * as AgentsAPI from './agents';
|
|
7
7
|
import * as RunsAPI from '../runs/runs';
|
|
8
8
|
import { APIPromise } from '../../core/api-promise';
|
|
9
|
+
import { ArrayPage, type ArrayPageParams, ObjectPage, PagePromise } from '../../core/pagination';
|
|
10
|
+
import { Stream } from '../../core/streaming';
|
|
9
11
|
import { buildHeaders } from '../../internal/headers';
|
|
10
12
|
import { RequestOptions } from '../../internal/request-options';
|
|
11
13
|
import { path } from '../../internal/utils/path';
|
|
12
14
|
|
|
13
15
|
export class Messages extends APIResource {
|
|
14
16
|
/**
|
|
15
|
-
*
|
|
17
|
+
* Process a user message and return the agent's response. This endpoint accepts a
|
|
18
|
+
* message from a user and processes it through the agent.
|
|
19
|
+
*
|
|
20
|
+
* The response format is controlled by the `streaming` field in the request body:
|
|
21
|
+
*
|
|
22
|
+
* - If `streaming=false` (default): Returns a complete LettaResponse with all
|
|
23
|
+
* messages
|
|
24
|
+
* - If `streaming=true`: Returns a Server-Sent Events (SSE) stream
|
|
25
|
+
*
|
|
26
|
+
* Additional streaming options (only used when streaming=true):
|
|
27
|
+
*
|
|
28
|
+
* - `stream_tokens`: Stream individual tokens instead of complete steps
|
|
29
|
+
* - `include_pings`: Include keepalive pings to prevent connection timeouts
|
|
30
|
+
* - `background`: Process the request in the background
|
|
16
31
|
*/
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
32
|
+
create(
|
|
33
|
+
agentID: string,
|
|
34
|
+
body: MessageCreateParamsNonStreaming,
|
|
35
|
+
options?: RequestOptions,
|
|
36
|
+
): APIPromise<LettaResponse>;
|
|
37
|
+
create(
|
|
38
|
+
agentID: string,
|
|
39
|
+
body: MessageCreateParamsStreaming,
|
|
40
|
+
options?: RequestOptions,
|
|
41
|
+
): APIPromise<Stream<LettaStreamingResponse>>;
|
|
42
|
+
create(
|
|
43
|
+
agentID: string,
|
|
44
|
+
body: MessageCreateParamsBase,
|
|
45
|
+
options?: RequestOptions,
|
|
46
|
+
): APIPromise<Stream<LettaStreamingResponse> | LettaResponse>;
|
|
47
|
+
create(
|
|
48
|
+
agentID: string,
|
|
49
|
+
body: MessageCreateParams,
|
|
20
50
|
options?: RequestOptions,
|
|
21
|
-
): APIPromise<
|
|
22
|
-
|
|
23
|
-
|
|
51
|
+
): APIPromise<LettaResponse> | APIPromise<Stream<LettaStreamingResponse>> {
|
|
52
|
+
return this._client.post(path`/v1/agents/${agentID}/messages`, {
|
|
53
|
+
body,
|
|
54
|
+
...options,
|
|
55
|
+
stream: body.streaming ?? false,
|
|
56
|
+
}) as APIPromise<LettaResponse> | APIPromise<Stream<LettaStreamingResponse>>;
|
|
24
57
|
}
|
|
25
58
|
|
|
26
59
|
/**
|
|
@@ -30,8 +63,11 @@ export class Messages extends APIResource {
|
|
|
30
63
|
agentID: string,
|
|
31
64
|
query: MessageListParams | null | undefined = {},
|
|
32
65
|
options?: RequestOptions,
|
|
33
|
-
):
|
|
34
|
-
return this._client.
|
|
66
|
+
): PagePromise<MessagesArrayPage, Message> {
|
|
67
|
+
return this._client.getAPIList(path`/v1/agents/${agentID}/messages`, ArrayPage<Message>, {
|
|
68
|
+
query,
|
|
69
|
+
...options,
|
|
70
|
+
});
|
|
35
71
|
}
|
|
36
72
|
|
|
37
73
|
/**
|
|
@@ -49,22 +85,13 @@ export class Messages extends APIResource {
|
|
|
49
85
|
}
|
|
50
86
|
|
|
51
87
|
/**
|
|
52
|
-
*
|
|
53
|
-
*/
|
|
54
|
-
reset(
|
|
55
|
-
agentID: string,
|
|
56
|
-
body: MessageResetParams,
|
|
57
|
-
options?: RequestOptions,
|
|
58
|
-
): APIPromise<AgentsAPI.AgentState> {
|
|
59
|
-
return this._client.patch(path`/v1/agents/${agentID}/reset-messages`, { body, ...options });
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Process a user message and return the agent's response. This endpoint accepts a
|
|
64
|
-
* message from a user and processes it through the agent.
|
|
88
|
+
* Summarize an agent's conversation history.
|
|
65
89
|
*/
|
|
66
|
-
|
|
67
|
-
return this._client.post(path`/v1/agents/${agentID}/
|
|
90
|
+
compact(agentID: string, options?: RequestOptions): APIPromise<void> {
|
|
91
|
+
return this._client.post(path`/v1/agents/${agentID}/summarize`, {
|
|
92
|
+
...options,
|
|
93
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
94
|
+
});
|
|
68
95
|
}
|
|
69
96
|
|
|
70
97
|
/**
|
|
@@ -75,30 +102,45 @@ export class Messages extends APIResource {
|
|
|
75
102
|
* This is "asynchronous" in the sense that it's a background run and explicitly
|
|
76
103
|
* must be fetched by the run ID.
|
|
77
104
|
*/
|
|
78
|
-
|
|
105
|
+
createAsync(agentID: string, body: MessageCreateAsyncParams, options?: RequestOptions): APIPromise<Run> {
|
|
79
106
|
return this._client.post(path`/v1/agents/${agentID}/messages/async`, { body, ...options });
|
|
80
107
|
}
|
|
81
108
|
|
|
82
109
|
/**
|
|
83
|
-
*
|
|
84
|
-
* message from a user and processes it through the agent. It will stream the steps
|
|
85
|
-
* of the response always, and stream the tokens if 'stream_tokens' is set to True.
|
|
110
|
+
* Resets the messages for an agent
|
|
86
111
|
*/
|
|
87
|
-
|
|
88
|
-
|
|
112
|
+
reset(
|
|
113
|
+
agentID: string,
|
|
114
|
+
body: MessageResetParams,
|
|
115
|
+
options?: RequestOptions,
|
|
116
|
+
): APIPromise<AgentsAPI.AgentState | null> {
|
|
117
|
+
return this._client.patch(path`/v1/agents/${agentID}/reset-messages`, { body, ...options });
|
|
89
118
|
}
|
|
90
119
|
|
|
91
120
|
/**
|
|
92
|
-
*
|
|
121
|
+
* Process a user message and return the agent's response. This endpoint accepts a
|
|
122
|
+
* message from a user and processes it through the agent. It will stream the steps
|
|
123
|
+
* of the response always, and stream the tokens if 'stream_tokens' is set to True.
|
|
93
124
|
*/
|
|
94
|
-
|
|
95
|
-
|
|
125
|
+
stream(
|
|
126
|
+
agentID: string,
|
|
127
|
+
body: MessageStreamParams,
|
|
128
|
+
options?: RequestOptions,
|
|
129
|
+
): APIPromise<Stream<LettaStreamingResponse>> {
|
|
130
|
+
return this._client.post(path`/v1/agents/${agentID}/messages/stream`, {
|
|
131
|
+
body,
|
|
96
132
|
...options,
|
|
97
|
-
|
|
98
|
-
})
|
|
133
|
+
stream: true,
|
|
134
|
+
}) as APIPromise<Stream<LettaStreamingResponse>>;
|
|
99
135
|
}
|
|
100
136
|
}
|
|
101
137
|
|
|
138
|
+
export type MessagesArrayPage = ArrayPage<Message>;
|
|
139
|
+
|
|
140
|
+
export type RunsArrayPage = ArrayPage<Run>;
|
|
141
|
+
|
|
142
|
+
export type InternalMessagesObjectPage = ObjectPage<InternalMessage>;
|
|
143
|
+
|
|
102
144
|
/**
|
|
103
145
|
* Input to approve or deny a tool call request
|
|
104
146
|
*/
|
|
@@ -111,13 +153,18 @@ export interface ApprovalCreate {
|
|
|
111
153
|
/**
|
|
112
154
|
* The list of approval responses
|
|
113
155
|
*/
|
|
114
|
-
approvals?: Array<
|
|
156
|
+
approvals?: Array<ApprovalReturn | ToolReturn> | null;
|
|
115
157
|
|
|
116
158
|
/**
|
|
117
159
|
* @deprecated Whether the tool has been approved
|
|
118
160
|
*/
|
|
119
161
|
approve?: boolean | null;
|
|
120
162
|
|
|
163
|
+
/**
|
|
164
|
+
* The multi-agent group that the message was sent in
|
|
165
|
+
*/
|
|
166
|
+
group_id?: string | null;
|
|
167
|
+
|
|
121
168
|
/**
|
|
122
169
|
* @deprecated An optional explanation for the provided approval status
|
|
123
170
|
*/
|
|
@@ -129,30 +176,6 @@ export interface ApprovalCreate {
|
|
|
129
176
|
type?: 'approval';
|
|
130
177
|
}
|
|
131
178
|
|
|
132
|
-
export namespace ApprovalCreate {
|
|
133
|
-
export interface ApprovalReturn {
|
|
134
|
-
/**
|
|
135
|
-
* Whether the tool has been approved
|
|
136
|
-
*/
|
|
137
|
-
approve: boolean;
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
* The ID of the tool call that corresponds to this approval
|
|
141
|
-
*/
|
|
142
|
-
tool_call_id: string;
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* An optional explanation for the provided approval status
|
|
146
|
-
*/
|
|
147
|
-
reason?: string | null;
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* The message type to be created.
|
|
151
|
-
*/
|
|
152
|
-
type?: 'approval';
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
|
|
156
179
|
/**
|
|
157
180
|
* A message representing a request for approval to call a tool (generated by the
|
|
158
181
|
* LLM to trigger tool execution).
|
|
@@ -220,7 +243,7 @@ export interface ApprovalResponseMessage {
|
|
|
220
243
|
/**
|
|
221
244
|
* The list of approval responses
|
|
222
245
|
*/
|
|
223
|
-
approvals?: Array<
|
|
246
|
+
approvals?: Array<ApprovalReturn | ToolReturn> | null;
|
|
224
247
|
|
|
225
248
|
/**
|
|
226
249
|
* @deprecated Whether the tool has been approved
|
|
@@ -252,28 +275,26 @@ export interface ApprovalResponseMessage {
|
|
|
252
275
|
step_id?: string | null;
|
|
253
276
|
}
|
|
254
277
|
|
|
255
|
-
export
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
approve: boolean;
|
|
278
|
+
export interface ApprovalReturn {
|
|
279
|
+
/**
|
|
280
|
+
* Whether the tool has been approved
|
|
281
|
+
*/
|
|
282
|
+
approve: boolean;
|
|
261
283
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
284
|
+
/**
|
|
285
|
+
* The ID of the tool call that corresponds to this approval
|
|
286
|
+
*/
|
|
287
|
+
tool_call_id: string;
|
|
266
288
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
289
|
+
/**
|
|
290
|
+
* An optional explanation for the provided approval status
|
|
291
|
+
*/
|
|
292
|
+
reason?: string | null;
|
|
271
293
|
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
}
|
|
294
|
+
/**
|
|
295
|
+
* The message type to be created.
|
|
296
|
+
*/
|
|
297
|
+
type?: 'approval';
|
|
277
298
|
}
|
|
278
299
|
|
|
279
300
|
/**
|
|
@@ -315,6 +336,36 @@ export interface AssistantMessage {
|
|
|
315
336
|
step_id?: string | null;
|
|
316
337
|
}
|
|
317
338
|
|
|
339
|
+
/**
|
|
340
|
+
* A message for notifying the developer that an event that has occured (e.g. a
|
|
341
|
+
* compaction). Events are NOT part of the context window.
|
|
342
|
+
*/
|
|
343
|
+
export interface EventMessage {
|
|
344
|
+
id: string;
|
|
345
|
+
|
|
346
|
+
date: string;
|
|
347
|
+
|
|
348
|
+
event_data: { [key: string]: unknown };
|
|
349
|
+
|
|
350
|
+
event_type: 'compaction';
|
|
351
|
+
|
|
352
|
+
is_err?: boolean | null;
|
|
353
|
+
|
|
354
|
+
message_type?: 'event';
|
|
355
|
+
|
|
356
|
+
name?: string | null;
|
|
357
|
+
|
|
358
|
+
otid?: string | null;
|
|
359
|
+
|
|
360
|
+
run_id?: string | null;
|
|
361
|
+
|
|
362
|
+
sender_id?: string | null;
|
|
363
|
+
|
|
364
|
+
seq_id?: number | null;
|
|
365
|
+
|
|
366
|
+
step_id?: string | null;
|
|
367
|
+
}
|
|
368
|
+
|
|
318
369
|
/**
|
|
319
370
|
* Representation of an agent's internal reasoning where reasoning content has been
|
|
320
371
|
* hidden from the response.
|
|
@@ -432,173 +483,300 @@ export namespace ImageContent {
|
|
|
432
483
|
}
|
|
433
484
|
|
|
434
485
|
/**
|
|
435
|
-
*
|
|
486
|
+
* Letta's internal representation of a message. Includes methods to convert to/from LLM provider formats.
|
|
487
|
+
*
|
|
488
|
+
* Attributes:
|
|
489
|
+
* id (str): The unique identifier of the message.
|
|
490
|
+
* role (MessageRole): The role of the participant.
|
|
491
|
+
* text (str): The text of the message.
|
|
492
|
+
* user_id (str): The unique identifier of the user.
|
|
493
|
+
* agent_id (str): The unique identifier of the agent.
|
|
494
|
+
* model (str): The model used to make the function call.
|
|
495
|
+
* name (str): The name of the participant.
|
|
496
|
+
* created_at (datetime): The time the message was created.
|
|
497
|
+
* tool_calls (List[OpenAIToolCall,]): The list of tool calls requested.
|
|
498
|
+
* tool_call_id (str): The id of the tool call.
|
|
499
|
+
* step_id (str): The id of the step that this message was created in.
|
|
500
|
+
* otid (str): The offline threading id associated with this message.
|
|
501
|
+
* tool_returns (List[ToolReturn]): The list of tool returns requested.
|
|
502
|
+
* group_id (str): The multi-agent group that the message was sent in.
|
|
503
|
+
* sender_id (str): The id of the sender of the message, can be an identity id or agent id.
|
|
504
|
+
*
|
|
505
|
+
* t
|
|
436
506
|
*/
|
|
437
|
-
export
|
|
438
|
-
|
|
439
|
-
|
|
507
|
+
export interface InternalMessage {
|
|
508
|
+
/**
|
|
509
|
+
* The human-friendly ID of the Message
|
|
510
|
+
*/
|
|
511
|
+
id: string;
|
|
440
512
|
|
|
441
|
-
export interface LettaAssistantMessageContentUnion {
|
|
442
513
|
/**
|
|
443
|
-
* The
|
|
514
|
+
* The role of the participant.
|
|
444
515
|
*/
|
|
445
|
-
|
|
516
|
+
role: MessageRole;
|
|
446
517
|
|
|
447
518
|
/**
|
|
448
|
-
*
|
|
519
|
+
* The unique identifier of the agent.
|
|
449
520
|
*/
|
|
450
|
-
|
|
521
|
+
agent_id?: string | null;
|
|
451
522
|
|
|
452
523
|
/**
|
|
453
|
-
* The
|
|
524
|
+
* The id of the approval request if this message is associated with a tool call
|
|
525
|
+
* request.
|
|
454
526
|
*/
|
|
455
|
-
|
|
456
|
-
}
|
|
527
|
+
approval_request_id?: string | null;
|
|
457
528
|
|
|
458
|
-
/**
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
* Args: id (str): The ID of the message date (datetime): The date the message was
|
|
463
|
-
* created in ISO format name (Optional[str]): The name of the sender of the
|
|
464
|
-
* message content (str): The message content sent by the system
|
|
465
|
-
*/
|
|
466
|
-
export type LettaMessageUnion =
|
|
467
|
-
| SystemMessage
|
|
468
|
-
| UserMessage
|
|
469
|
-
| ReasoningMessage
|
|
470
|
-
| HiddenReasoningMessage
|
|
471
|
-
| ToolCallMessage
|
|
472
|
-
| ToolsAPI.ToolReturnMessage
|
|
473
|
-
| AssistantMessage
|
|
474
|
-
| ApprovalRequestMessage
|
|
475
|
-
| ApprovalResponseMessage;
|
|
529
|
+
/**
|
|
530
|
+
* The list of approvals for this message.
|
|
531
|
+
*/
|
|
532
|
+
approvals?: Array<ApprovalReturn | InternalMessage.LettaSchemasMessageToolReturn> | null;
|
|
476
533
|
|
|
477
|
-
export interface LettaRequest {
|
|
478
534
|
/**
|
|
479
|
-
*
|
|
535
|
+
* Whether tool call is approved.
|
|
480
536
|
*/
|
|
481
|
-
|
|
537
|
+
approve?: boolean | null;
|
|
482
538
|
|
|
483
539
|
/**
|
|
484
|
-
*
|
|
485
|
-
* Still supported for legacy agent types, but deprecated for letta_v1_agent
|
|
486
|
-
* onward.
|
|
540
|
+
* The id of the LLMBatchItem that this message is associated with
|
|
487
541
|
*/
|
|
488
|
-
|
|
542
|
+
batch_item_id?: string | null;
|
|
489
543
|
|
|
490
544
|
/**
|
|
491
|
-
*
|
|
492
|
-
* agent types, but deprecated for letta_v1_agent onward.
|
|
545
|
+
* The content of the message.
|
|
493
546
|
*/
|
|
494
|
-
|
|
547
|
+
content?: Array<
|
|
548
|
+
| TextContent
|
|
549
|
+
| ImageContent
|
|
550
|
+
| ToolCallContent
|
|
551
|
+
| ToolReturnContent
|
|
552
|
+
| ReasoningContent
|
|
553
|
+
| RedactedReasoningContent
|
|
554
|
+
| OmittedReasoningContent
|
|
555
|
+
| InternalMessage.SummarizedReasoningContent
|
|
556
|
+
> | null;
|
|
495
557
|
|
|
496
558
|
/**
|
|
497
|
-
*
|
|
498
|
-
* from the agent.
|
|
559
|
+
* The timestamp when the object was created.
|
|
499
560
|
*/
|
|
500
|
-
|
|
561
|
+
created_at?: string;
|
|
501
562
|
|
|
502
563
|
/**
|
|
503
|
-
*
|
|
504
|
-
* all messages.
|
|
564
|
+
* The id of the user that made this object.
|
|
505
565
|
*/
|
|
506
|
-
|
|
566
|
+
created_by_id?: string | null;
|
|
507
567
|
|
|
508
568
|
/**
|
|
509
|
-
*
|
|
569
|
+
* The reason the tool call request was denied.
|
|
510
570
|
*/
|
|
511
|
-
|
|
571
|
+
denial_reason?: string | null;
|
|
512
572
|
|
|
513
573
|
/**
|
|
514
|
-
*
|
|
515
|
-
* (default `send_message`) as `AssistantMessage` objects. Still supported for
|
|
516
|
-
* legacy agent types, but deprecated for letta_v1_agent onward.
|
|
574
|
+
* The multi-agent group that the message was sent in
|
|
517
575
|
*/
|
|
518
|
-
|
|
519
|
-
}
|
|
576
|
+
group_id?: string | null;
|
|
520
577
|
|
|
521
|
-
/**
|
|
522
|
-
* Response object from an agent interaction, consisting of the new messages
|
|
523
|
-
* generated by the agent and usage statistics. The type of the returned messages
|
|
524
|
-
* can be either `Message` or `LettaMessage`, depending on what was specified in
|
|
525
|
-
* the request.
|
|
526
|
-
*
|
|
527
|
-
* Attributes: messages (List[Union[Message, LettaMessage]]): The messages returned
|
|
528
|
-
* by the agent. usage (LettaUsageStatistics): The usage statistics
|
|
529
|
-
*/
|
|
530
|
-
export interface LettaResponse {
|
|
531
578
|
/**
|
|
532
|
-
*
|
|
579
|
+
* Whether this message is part of an error step. Used only for debugging purposes.
|
|
533
580
|
*/
|
|
534
|
-
|
|
581
|
+
is_err?: boolean | null;
|
|
535
582
|
|
|
536
583
|
/**
|
|
537
|
-
* The
|
|
584
|
+
* The id of the user that made this object.
|
|
538
585
|
*/
|
|
539
|
-
|
|
586
|
+
last_updated_by_id?: string | null;
|
|
540
587
|
|
|
541
588
|
/**
|
|
542
|
-
* The
|
|
589
|
+
* The model used to make the function call.
|
|
543
590
|
*/
|
|
544
|
-
|
|
545
|
-
}
|
|
591
|
+
model?: string | null;
|
|
546
592
|
|
|
547
|
-
export namespace LettaResponse {
|
|
548
593
|
/**
|
|
549
|
-
*
|
|
594
|
+
* For role user/assistant: the (optional) name of the participant. For role
|
|
595
|
+
* tool/function: the name of the function called.
|
|
550
596
|
*/
|
|
551
|
-
|
|
552
|
-
/**
|
|
553
|
-
* The reason why execution stopped.
|
|
554
|
-
*/
|
|
555
|
-
stop_reason: RunsAPI.StopReasonType;
|
|
597
|
+
name?: string | null;
|
|
556
598
|
|
|
599
|
+
/**
|
|
600
|
+
* The offline threading id associated with this message
|
|
601
|
+
*/
|
|
602
|
+
otid?: string | null;
|
|
603
|
+
|
|
604
|
+
/**
|
|
605
|
+
* The id of the run that this message was created in.
|
|
606
|
+
*/
|
|
607
|
+
run_id?: string | null;
|
|
608
|
+
|
|
609
|
+
/**
|
|
610
|
+
* The id of the sender of the message, can be an identity id or agent id
|
|
611
|
+
*/
|
|
612
|
+
sender_id?: string | null;
|
|
613
|
+
|
|
614
|
+
/**
|
|
615
|
+
* The id of the step that this message was created in.
|
|
616
|
+
*/
|
|
617
|
+
step_id?: string | null;
|
|
618
|
+
|
|
619
|
+
/**
|
|
620
|
+
* The ID of the tool call. Only applicable for role tool.
|
|
621
|
+
*/
|
|
622
|
+
tool_call_id?: string | null;
|
|
623
|
+
|
|
624
|
+
/**
|
|
625
|
+
* The list of tool calls requested. Only applicable for role assistant.
|
|
626
|
+
*/
|
|
627
|
+
tool_calls?: Array<InternalMessage.ToolCall> | null;
|
|
628
|
+
|
|
629
|
+
/**
|
|
630
|
+
* Tool execution return information for prior tool calls
|
|
631
|
+
*/
|
|
632
|
+
tool_returns?: Array<InternalMessage.ToolReturn> | null;
|
|
633
|
+
|
|
634
|
+
/**
|
|
635
|
+
* The timestamp when the object was last updated.
|
|
636
|
+
*/
|
|
637
|
+
updated_at?: string | null;
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
export namespace InternalMessage {
|
|
641
|
+
export interface LettaSchemasMessageToolReturn {
|
|
557
642
|
/**
|
|
558
|
-
* The
|
|
643
|
+
* The status of the tool call
|
|
559
644
|
*/
|
|
560
|
-
|
|
645
|
+
status: 'success' | 'error';
|
|
646
|
+
|
|
647
|
+
/**
|
|
648
|
+
* The function response string
|
|
649
|
+
*/
|
|
650
|
+
func_response?: string | null;
|
|
651
|
+
|
|
652
|
+
/**
|
|
653
|
+
* Captured stderr from the tool invocation
|
|
654
|
+
*/
|
|
655
|
+
stderr?: Array<string> | null;
|
|
656
|
+
|
|
657
|
+
/**
|
|
658
|
+
* Captured stdout (e.g. prints, logs) from the tool invocation
|
|
659
|
+
*/
|
|
660
|
+
stdout?: Array<string> | null;
|
|
661
|
+
|
|
662
|
+
/**
|
|
663
|
+
* The ID for the tool call
|
|
664
|
+
*/
|
|
665
|
+
tool_call_id?: unknown;
|
|
561
666
|
}
|
|
562
667
|
|
|
563
668
|
/**
|
|
564
|
-
* The
|
|
669
|
+
* The style of reasoning content returned by the OpenAI Responses API
|
|
565
670
|
*/
|
|
566
|
-
export interface
|
|
671
|
+
export interface SummarizedReasoningContent {
|
|
567
672
|
/**
|
|
568
|
-
* The
|
|
673
|
+
* The unique identifier for this reasoning step.
|
|
569
674
|
*/
|
|
570
|
-
|
|
675
|
+
id: string;
|
|
571
676
|
|
|
572
|
-
|
|
677
|
+
/**
|
|
678
|
+
* Summaries of the reasoning content.
|
|
679
|
+
*/
|
|
680
|
+
summary: Array<SummarizedReasoningContent.Summary>;
|
|
573
681
|
|
|
574
682
|
/**
|
|
575
|
-
* The
|
|
683
|
+
* The encrypted reasoning content.
|
|
576
684
|
*/
|
|
577
|
-
|
|
685
|
+
encrypted_content?: string;
|
|
578
686
|
|
|
579
687
|
/**
|
|
580
|
-
*
|
|
688
|
+
* Indicates this is a summarized reasoning step.
|
|
581
689
|
*/
|
|
582
|
-
|
|
690
|
+
type?: 'summarized_reasoning';
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
export namespace SummarizedReasoningContent {
|
|
694
|
+
export interface Summary {
|
|
695
|
+
/**
|
|
696
|
+
* The index of the summary part.
|
|
697
|
+
*/
|
|
698
|
+
index: number;
|
|
699
|
+
|
|
700
|
+
/**
|
|
701
|
+
* The text of the summary part.
|
|
702
|
+
*/
|
|
703
|
+
text: string;
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
export interface ToolCall {
|
|
708
|
+
id: string;
|
|
709
|
+
|
|
710
|
+
function: ToolCall.Function;
|
|
711
|
+
|
|
712
|
+
type: 'function';
|
|
713
|
+
|
|
714
|
+
[k: string]: unknown;
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
export namespace ToolCall {
|
|
718
|
+
export interface Function {
|
|
719
|
+
arguments: string;
|
|
720
|
+
|
|
721
|
+
name: string;
|
|
722
|
+
|
|
723
|
+
[k: string]: unknown;
|
|
724
|
+
}
|
|
725
|
+
}
|
|
583
726
|
|
|
727
|
+
export interface ToolReturn {
|
|
584
728
|
/**
|
|
585
|
-
* The
|
|
729
|
+
* The status of the tool call
|
|
586
730
|
*/
|
|
587
|
-
|
|
731
|
+
status: 'success' | 'error';
|
|
588
732
|
|
|
589
733
|
/**
|
|
590
|
-
* The
|
|
734
|
+
* The function response string
|
|
591
735
|
*/
|
|
592
|
-
|
|
736
|
+
func_response?: string | null;
|
|
737
|
+
|
|
738
|
+
/**
|
|
739
|
+
* Captured stderr from the tool invocation
|
|
740
|
+
*/
|
|
741
|
+
stderr?: Array<string> | null;
|
|
742
|
+
|
|
743
|
+
/**
|
|
744
|
+
* Captured stdout (e.g. prints, logs) from the tool invocation
|
|
745
|
+
*/
|
|
746
|
+
stdout?: Array<string> | null;
|
|
747
|
+
|
|
748
|
+
/**
|
|
749
|
+
* The ID for the tool call
|
|
750
|
+
*/
|
|
751
|
+
tool_call_id?: unknown;
|
|
593
752
|
}
|
|
594
753
|
}
|
|
595
754
|
|
|
596
|
-
|
|
755
|
+
/**
|
|
756
|
+
* Status of the job.
|
|
757
|
+
*/
|
|
758
|
+
export type JobStatus = 'created' | 'running' | 'completed' | 'failed' | 'pending' | 'cancelled' | 'expired';
|
|
759
|
+
|
|
760
|
+
export type JobType = 'job' | 'run' | 'batch';
|
|
761
|
+
|
|
762
|
+
export interface LettaAssistantMessageContentUnion {
|
|
597
763
|
/**
|
|
598
|
-
* The
|
|
764
|
+
* The text content of the message.
|
|
599
765
|
*/
|
|
600
|
-
|
|
766
|
+
text: string;
|
|
601
767
|
|
|
768
|
+
/**
|
|
769
|
+
* Stores a unique identifier for any reasoning associated with this text content.
|
|
770
|
+
*/
|
|
771
|
+
signature?: string | null;
|
|
772
|
+
|
|
773
|
+
/**
|
|
774
|
+
* The type of the message.
|
|
775
|
+
*/
|
|
776
|
+
type?: 'text';
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
export interface LettaRequest {
|
|
602
780
|
/**
|
|
603
781
|
* @deprecated The name of the message argument in the designated message tool.
|
|
604
782
|
* Still supported for legacy agent types, but deprecated for letta_v1_agent
|
|
@@ -612,39 +790,45 @@ export interface LettaStreamingRequest {
|
|
|
612
790
|
*/
|
|
613
791
|
assistant_message_tool_name?: string;
|
|
614
792
|
|
|
615
|
-
/**
|
|
616
|
-
* Whether to process the request in the background.
|
|
617
|
-
*/
|
|
618
|
-
background?: boolean;
|
|
619
|
-
|
|
620
793
|
/**
|
|
621
794
|
* @deprecated If set to True, enables reasoning before responses or tool calls
|
|
622
795
|
* from the agent.
|
|
623
796
|
*/
|
|
624
797
|
enable_thinking?: string;
|
|
625
798
|
|
|
626
|
-
/**
|
|
627
|
-
* Whether to include periodic keepalive ping messages in the stream to prevent
|
|
628
|
-
* connection timeouts.
|
|
629
|
-
*/
|
|
630
|
-
include_pings?: boolean;
|
|
631
|
-
|
|
632
799
|
/**
|
|
633
800
|
* Only return specified message types in the response. If `None` (default) returns
|
|
634
801
|
* all messages.
|
|
635
802
|
*/
|
|
636
803
|
include_return_message_types?: Array<MessageType> | null;
|
|
637
804
|
|
|
805
|
+
/**
|
|
806
|
+
* Syntactic sugar for a single user message. Equivalent to messages=[{'role':
|
|
807
|
+
* 'user', 'content': input}].
|
|
808
|
+
*/
|
|
809
|
+
input?:
|
|
810
|
+
| string
|
|
811
|
+
| Array<
|
|
812
|
+
| TextContent
|
|
813
|
+
| ImageContent
|
|
814
|
+
| ToolCallContent
|
|
815
|
+
| ToolReturnContent
|
|
816
|
+
| ReasoningContent
|
|
817
|
+
| RedactedReasoningContent
|
|
818
|
+
| OmittedReasoningContent
|
|
819
|
+
| LettaRequest.SummarizedReasoningContent
|
|
820
|
+
>
|
|
821
|
+
| null;
|
|
822
|
+
|
|
638
823
|
/**
|
|
639
824
|
* Maximum number of steps the agent should take to process the request.
|
|
640
825
|
*/
|
|
641
826
|
max_steps?: number;
|
|
642
827
|
|
|
643
828
|
/**
|
|
644
|
-
*
|
|
645
|
-
* per step.
|
|
829
|
+
* The messages to be sent to the agent.
|
|
646
830
|
*/
|
|
647
|
-
|
|
831
|
+
messages?: Array<AgentsAPI.MessageCreate | ApprovalCreate> | null;
|
|
648
832
|
|
|
649
833
|
/**
|
|
650
834
|
* @deprecated Whether the server should parse specific tool call arguments
|
|
@@ -654,213 +838,209 @@ export interface LettaStreamingRequest {
|
|
|
654
838
|
use_assistant_message?: boolean;
|
|
655
839
|
}
|
|
656
840
|
|
|
657
|
-
export
|
|
841
|
+
export namespace LettaRequest {
|
|
842
|
+
/**
|
|
843
|
+
* The style of reasoning content returned by the OpenAI Responses API
|
|
844
|
+
*/
|
|
845
|
+
export interface SummarizedReasoningContent {
|
|
846
|
+
/**
|
|
847
|
+
* The unique identifier for this reasoning step.
|
|
848
|
+
*/
|
|
849
|
+
id: string;
|
|
850
|
+
|
|
851
|
+
/**
|
|
852
|
+
* Summaries of the reasoning content.
|
|
853
|
+
*/
|
|
854
|
+
summary: Array<SummarizedReasoningContent.Summary>;
|
|
855
|
+
|
|
856
|
+
/**
|
|
857
|
+
* The encrypted reasoning content.
|
|
858
|
+
*/
|
|
859
|
+
encrypted_content?: string;
|
|
860
|
+
|
|
861
|
+
/**
|
|
862
|
+
* Indicates this is a summarized reasoning step.
|
|
863
|
+
*/
|
|
864
|
+
type?: 'summarized_reasoning';
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
export namespace SummarizedReasoningContent {
|
|
868
|
+
export interface Summary {
|
|
869
|
+
/**
|
|
870
|
+
* The index of the summary part.
|
|
871
|
+
*/
|
|
872
|
+
index: number;
|
|
873
|
+
|
|
874
|
+
/**
|
|
875
|
+
* The text of the summary part.
|
|
876
|
+
*/
|
|
877
|
+
text: string;
|
|
878
|
+
}
|
|
879
|
+
}
|
|
880
|
+
}
|
|
658
881
|
|
|
659
882
|
/**
|
|
660
|
-
*
|
|
661
|
-
*
|
|
662
|
-
*
|
|
663
|
-
*
|
|
664
|
-
* role (MessageRole): The role of the participant.
|
|
665
|
-
* text (str): The text of the message.
|
|
666
|
-
* user_id (str): The unique identifier of the user.
|
|
667
|
-
* agent_id (str): The unique identifier of the agent.
|
|
668
|
-
* model (str): The model used to make the function call.
|
|
669
|
-
* name (str): The name of the participant.
|
|
670
|
-
* created_at (datetime): The time the message was created.
|
|
671
|
-
* tool_calls (List[OpenAIToolCall,]): The list of tool calls requested.
|
|
672
|
-
* tool_call_id (str): The id of the tool call.
|
|
673
|
-
* step_id (str): The id of the step that this message was created in.
|
|
674
|
-
* otid (str): The offline threading id associated with this message.
|
|
675
|
-
* tool_returns (List[ToolReturn]): The list of tool returns requested.
|
|
676
|
-
* group_id (str): The multi-agent group that the message was sent in.
|
|
677
|
-
* sender_id (str): The id of the sender of the message, can be an identity id or agent id.
|
|
883
|
+
* Response object from an agent interaction, consisting of the new messages
|
|
884
|
+
* generated by the agent and usage statistics. The type of the returned messages
|
|
885
|
+
* can be either `Message` or `LettaMessage`, depending on what was specified in
|
|
886
|
+
* the request.
|
|
678
887
|
*
|
|
679
|
-
*
|
|
888
|
+
* Attributes: messages (List[Union[Message, LettaMessage]]): The messages returned
|
|
889
|
+
* by the agent. usage (LettaUsageStatistics): The usage statistics
|
|
680
890
|
*/
|
|
681
|
-
export interface
|
|
682
|
-
/**
|
|
683
|
-
* The role of the participant.
|
|
684
|
-
*/
|
|
685
|
-
role: MessageRole;
|
|
686
|
-
|
|
891
|
+
export interface LettaResponse {
|
|
687
892
|
/**
|
|
688
|
-
* The
|
|
893
|
+
* The messages returned by the agent.
|
|
689
894
|
*/
|
|
690
|
-
|
|
895
|
+
messages: Array<Message>;
|
|
691
896
|
|
|
692
897
|
/**
|
|
693
|
-
* The
|
|
898
|
+
* The stop reason from Letta indicating why agent loop stopped execution.
|
|
694
899
|
*/
|
|
695
|
-
|
|
900
|
+
stop_reason: LettaResponse.StopReason;
|
|
696
901
|
|
|
697
902
|
/**
|
|
698
|
-
* The
|
|
699
|
-
* request.
|
|
903
|
+
* The usage statistics of the agent.
|
|
700
904
|
*/
|
|
701
|
-
|
|
905
|
+
usage: LettaResponse.Usage;
|
|
906
|
+
}
|
|
702
907
|
|
|
908
|
+
export namespace LettaResponse {
|
|
703
909
|
/**
|
|
704
|
-
* The
|
|
910
|
+
* The stop reason from Letta indicating why agent loop stopped execution.
|
|
705
911
|
*/
|
|
706
|
-
|
|
912
|
+
export interface StopReason {
|
|
913
|
+
/**
|
|
914
|
+
* The reason why execution stopped.
|
|
915
|
+
*/
|
|
916
|
+
stop_reason: RunsAPI.StopReasonType;
|
|
707
917
|
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
918
|
+
/**
|
|
919
|
+
* The type of the message.
|
|
920
|
+
*/
|
|
921
|
+
message_type?: 'stop_reason';
|
|
922
|
+
}
|
|
712
923
|
|
|
713
924
|
/**
|
|
714
|
-
* The
|
|
925
|
+
* The usage statistics of the agent.
|
|
715
926
|
*/
|
|
716
|
-
|
|
927
|
+
export interface Usage {
|
|
928
|
+
/**
|
|
929
|
+
* The number of tokens generated by the agent.
|
|
930
|
+
*/
|
|
931
|
+
completion_tokens?: number;
|
|
717
932
|
|
|
718
|
-
|
|
719
|
-
* The content of the message.
|
|
720
|
-
*/
|
|
721
|
-
content?: Array<
|
|
722
|
-
| TextContent
|
|
723
|
-
| ImageContent
|
|
724
|
-
| ToolCallContent
|
|
725
|
-
| ToolReturnContent
|
|
726
|
-
| ReasoningContent
|
|
727
|
-
| RedactedReasoningContent
|
|
728
|
-
| OmittedReasoningContent
|
|
729
|
-
| Message.SummarizedReasoningContent
|
|
730
|
-
> | null;
|
|
933
|
+
message_type?: 'usage_statistics';
|
|
731
934
|
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
935
|
+
/**
|
|
936
|
+
* The number of tokens in the prompt.
|
|
937
|
+
*/
|
|
938
|
+
prompt_tokens?: number;
|
|
736
939
|
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
940
|
+
/**
|
|
941
|
+
* The background task run IDs associated with the agent interaction
|
|
942
|
+
*/
|
|
943
|
+
run_ids?: Array<string> | null;
|
|
741
944
|
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
945
|
+
/**
|
|
946
|
+
* The number of steps taken by the agent.
|
|
947
|
+
*/
|
|
948
|
+
step_count?: number;
|
|
746
949
|
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
950
|
+
/**
|
|
951
|
+
* The total number of tokens processed by the agent.
|
|
952
|
+
*/
|
|
953
|
+
total_tokens?: number;
|
|
954
|
+
}
|
|
955
|
+
}
|
|
751
956
|
|
|
957
|
+
export interface LettaStreamingRequest {
|
|
752
958
|
/**
|
|
753
|
-
*
|
|
959
|
+
* @deprecated The name of the message argument in the designated message tool.
|
|
960
|
+
* Still supported for legacy agent types, but deprecated for letta_v1_agent
|
|
961
|
+
* onward.
|
|
754
962
|
*/
|
|
755
|
-
|
|
963
|
+
assistant_message_tool_kwarg?: string;
|
|
756
964
|
|
|
757
965
|
/**
|
|
758
|
-
* The
|
|
966
|
+
* @deprecated The name of the designated message tool. Still supported for legacy
|
|
967
|
+
* agent types, but deprecated for letta_v1_agent onward.
|
|
759
968
|
*/
|
|
760
|
-
|
|
969
|
+
assistant_message_tool_name?: string;
|
|
761
970
|
|
|
762
971
|
/**
|
|
763
|
-
*
|
|
972
|
+
* Whether to process the request in the background (only used when
|
|
973
|
+
* streaming=true).
|
|
764
974
|
*/
|
|
765
|
-
|
|
975
|
+
background?: boolean;
|
|
766
976
|
|
|
767
977
|
/**
|
|
768
|
-
*
|
|
769
|
-
*
|
|
978
|
+
* @deprecated If set to True, enables reasoning before responses or tool calls
|
|
979
|
+
* from the agent.
|
|
770
980
|
*/
|
|
771
|
-
|
|
981
|
+
enable_thinking?: string;
|
|
772
982
|
|
|
773
983
|
/**
|
|
774
|
-
*
|
|
984
|
+
* Whether to include periodic keepalive ping messages in the stream to prevent
|
|
985
|
+
* connection timeouts (only used when streaming=true).
|
|
775
986
|
*/
|
|
776
|
-
|
|
987
|
+
include_pings?: boolean;
|
|
777
988
|
|
|
778
989
|
/**
|
|
779
|
-
*
|
|
990
|
+
* Only return specified message types in the response. If `None` (default) returns
|
|
991
|
+
* all messages.
|
|
780
992
|
*/
|
|
781
|
-
|
|
993
|
+
include_return_message_types?: Array<MessageType> | null;
|
|
782
994
|
|
|
783
995
|
/**
|
|
784
|
-
*
|
|
996
|
+
* Syntactic sugar for a single user message. Equivalent to messages=[{'role':
|
|
997
|
+
* 'user', 'content': input}].
|
|
785
998
|
*/
|
|
786
|
-
|
|
999
|
+
input?:
|
|
1000
|
+
| string
|
|
1001
|
+
| Array<
|
|
1002
|
+
| TextContent
|
|
1003
|
+
| ImageContent
|
|
1004
|
+
| ToolCallContent
|
|
1005
|
+
| ToolReturnContent
|
|
1006
|
+
| ReasoningContent
|
|
1007
|
+
| RedactedReasoningContent
|
|
1008
|
+
| OmittedReasoningContent
|
|
1009
|
+
| LettaStreamingRequest.SummarizedReasoningContent
|
|
1010
|
+
>
|
|
1011
|
+
| null;
|
|
787
1012
|
|
|
788
1013
|
/**
|
|
789
|
-
*
|
|
1014
|
+
* Maximum number of steps the agent should take to process the request.
|
|
790
1015
|
*/
|
|
791
|
-
|
|
1016
|
+
max_steps?: number;
|
|
792
1017
|
|
|
793
1018
|
/**
|
|
794
|
-
* The
|
|
1019
|
+
* The messages to be sent to the agent.
|
|
795
1020
|
*/
|
|
796
|
-
|
|
1021
|
+
messages?: Array<AgentsAPI.MessageCreate | ApprovalCreate> | null;
|
|
797
1022
|
|
|
798
1023
|
/**
|
|
799
|
-
*
|
|
1024
|
+
* Flag to determine if individual tokens should be streamed, rather than streaming
|
|
1025
|
+
* per step (only used when streaming=true).
|
|
800
1026
|
*/
|
|
801
|
-
|
|
1027
|
+
stream_tokens?: boolean;
|
|
802
1028
|
|
|
803
1029
|
/**
|
|
804
|
-
*
|
|
1030
|
+
* If True, returns a streaming response (Server-Sent Events). If False (default),
|
|
1031
|
+
* returns a complete response.
|
|
805
1032
|
*/
|
|
806
|
-
|
|
1033
|
+
streaming?: boolean;
|
|
807
1034
|
|
|
808
1035
|
/**
|
|
809
|
-
*
|
|
1036
|
+
* @deprecated Whether the server should parse specific tool call arguments
|
|
1037
|
+
* (default `send_message`) as `AssistantMessage` objects. Still supported for
|
|
1038
|
+
* legacy agent types, but deprecated for letta_v1_agent onward.
|
|
810
1039
|
*/
|
|
811
|
-
|
|
1040
|
+
use_assistant_message?: boolean;
|
|
812
1041
|
}
|
|
813
1042
|
|
|
814
|
-
export namespace
|
|
815
|
-
export interface ApprovalReturn {
|
|
816
|
-
/**
|
|
817
|
-
* Whether the tool has been approved
|
|
818
|
-
*/
|
|
819
|
-
approve: boolean;
|
|
820
|
-
|
|
821
|
-
/**
|
|
822
|
-
* The ID of the tool call that corresponds to this approval
|
|
823
|
-
*/
|
|
824
|
-
tool_call_id: string;
|
|
825
|
-
|
|
826
|
-
/**
|
|
827
|
-
* An optional explanation for the provided approval status
|
|
828
|
-
*/
|
|
829
|
-
reason?: string | null;
|
|
830
|
-
|
|
831
|
-
/**
|
|
832
|
-
* The message type to be created.
|
|
833
|
-
*/
|
|
834
|
-
type?: 'approval';
|
|
835
|
-
}
|
|
836
|
-
|
|
837
|
-
export interface LettaSchemasMessageToolReturn {
|
|
838
|
-
/**
|
|
839
|
-
* The status of the tool call
|
|
840
|
-
*/
|
|
841
|
-
status: 'success' | 'error';
|
|
842
|
-
|
|
843
|
-
/**
|
|
844
|
-
* The function response string
|
|
845
|
-
*/
|
|
846
|
-
func_response?: string | null;
|
|
847
|
-
|
|
848
|
-
/**
|
|
849
|
-
* Captured stderr from the tool invocation
|
|
850
|
-
*/
|
|
851
|
-
stderr?: Array<string> | null;
|
|
852
|
-
|
|
853
|
-
/**
|
|
854
|
-
* Captured stdout (e.g. prints, logs) from the tool invocation
|
|
855
|
-
*/
|
|
856
|
-
stdout?: Array<string> | null;
|
|
857
|
-
|
|
858
|
-
/**
|
|
859
|
-
* The ID for the tool call
|
|
860
|
-
*/
|
|
861
|
-
tool_call_id?: unknown;
|
|
862
|
-
}
|
|
863
|
-
|
|
1043
|
+
export namespace LettaStreamingRequest {
|
|
864
1044
|
/**
|
|
865
1045
|
* The style of reasoning content returned by the OpenAI Responses API
|
|
866
1046
|
*/
|
|
@@ -899,55 +1079,146 @@ export namespace Message {
|
|
|
899
1079
|
text: string;
|
|
900
1080
|
}
|
|
901
1081
|
}
|
|
1082
|
+
}
|
|
902
1083
|
|
|
903
|
-
|
|
904
|
-
|
|
1084
|
+
/**
|
|
1085
|
+
* Streaming response type for Server-Sent Events (SSE) endpoints. Each event in
|
|
1086
|
+
* the stream will be one of these types.
|
|
1087
|
+
*/
|
|
1088
|
+
export type LettaStreamingResponse =
|
|
1089
|
+
| SystemMessage
|
|
1090
|
+
| UserMessage
|
|
1091
|
+
| ReasoningMessage
|
|
1092
|
+
| HiddenReasoningMessage
|
|
1093
|
+
| ToolCallMessage
|
|
1094
|
+
| ToolsAPI.ToolReturnMessage
|
|
1095
|
+
| AssistantMessage
|
|
1096
|
+
| ApprovalRequestMessage
|
|
1097
|
+
| ApprovalResponseMessage
|
|
1098
|
+
| LettaStreamingResponse.LettaPing
|
|
1099
|
+
| LettaStreamingResponse.LettaErrorMessage
|
|
1100
|
+
| LettaStreamingResponse.LettaStopReason
|
|
1101
|
+
| LettaStreamingResponse.LettaUsageStatistics;
|
|
905
1102
|
|
|
906
|
-
|
|
1103
|
+
export namespace LettaStreamingResponse {
|
|
1104
|
+
/**
|
|
1105
|
+
* Ping messages are a keep-alive to prevent SSE streams from timing out during
|
|
1106
|
+
* long running requests.
|
|
1107
|
+
*/
|
|
1108
|
+
export interface LettaPing {
|
|
1109
|
+
/**
|
|
1110
|
+
* The type of the message.
|
|
1111
|
+
*/
|
|
1112
|
+
message_type: 'ping';
|
|
1113
|
+
}
|
|
907
1114
|
|
|
908
|
-
|
|
1115
|
+
/**
|
|
1116
|
+
* Error messages are used to notify the client of an error that occurred during
|
|
1117
|
+
* the agent's execution.
|
|
1118
|
+
*/
|
|
1119
|
+
export interface LettaErrorMessage {
|
|
1120
|
+
/**
|
|
1121
|
+
* The type of error.
|
|
1122
|
+
*/
|
|
1123
|
+
error_type: string;
|
|
909
1124
|
|
|
910
|
-
|
|
911
|
-
|
|
1125
|
+
/**
|
|
1126
|
+
* The error message.
|
|
1127
|
+
*/
|
|
1128
|
+
message: string;
|
|
912
1129
|
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
1130
|
+
/**
|
|
1131
|
+
* The type of the message.
|
|
1132
|
+
*/
|
|
1133
|
+
message_type: 'error_message';
|
|
916
1134
|
|
|
917
|
-
|
|
1135
|
+
/**
|
|
1136
|
+
* The ID of the run.
|
|
1137
|
+
*/
|
|
1138
|
+
run_id: string;
|
|
918
1139
|
|
|
919
|
-
|
|
920
|
-
|
|
1140
|
+
/**
|
|
1141
|
+
* An optional error detail.
|
|
1142
|
+
*/
|
|
1143
|
+
detail?: string;
|
|
921
1144
|
}
|
|
922
1145
|
|
|
923
|
-
|
|
1146
|
+
/**
|
|
1147
|
+
* The stop reason from Letta indicating why agent loop stopped execution.
|
|
1148
|
+
*/
|
|
1149
|
+
export interface LettaStopReason {
|
|
924
1150
|
/**
|
|
925
|
-
* The
|
|
1151
|
+
* The reason why execution stopped.
|
|
926
1152
|
*/
|
|
927
|
-
|
|
1153
|
+
stop_reason: RunsAPI.StopReasonType;
|
|
928
1154
|
|
|
929
1155
|
/**
|
|
930
|
-
* The
|
|
1156
|
+
* The type of the message.
|
|
931
1157
|
*/
|
|
932
|
-
|
|
1158
|
+
message_type?: 'stop_reason';
|
|
1159
|
+
}
|
|
933
1160
|
|
|
1161
|
+
/**
|
|
1162
|
+
* Usage statistics for the agent interaction.
|
|
1163
|
+
*
|
|
1164
|
+
* Attributes: completion_tokens (int): The number of tokens generated by the
|
|
1165
|
+
* agent. prompt_tokens (int): The number of tokens in the prompt. total_tokens
|
|
1166
|
+
* (int): The total number of tokens processed by the agent. step_count (int): The
|
|
1167
|
+
* number of steps taken by the agent.
|
|
1168
|
+
*/
|
|
1169
|
+
export interface LettaUsageStatistics {
|
|
934
1170
|
/**
|
|
935
|
-
*
|
|
1171
|
+
* The number of tokens generated by the agent.
|
|
936
1172
|
*/
|
|
937
|
-
|
|
1173
|
+
completion_tokens?: number;
|
|
1174
|
+
|
|
1175
|
+
message_type?: 'usage_statistics';
|
|
938
1176
|
|
|
939
1177
|
/**
|
|
940
|
-
*
|
|
1178
|
+
* The number of tokens in the prompt.
|
|
941
1179
|
*/
|
|
942
|
-
|
|
1180
|
+
prompt_tokens?: number;
|
|
943
1181
|
|
|
944
1182
|
/**
|
|
945
|
-
* The
|
|
1183
|
+
* The background task run IDs associated with the agent interaction
|
|
946
1184
|
*/
|
|
947
|
-
|
|
1185
|
+
run_ids?: Array<string> | null;
|
|
1186
|
+
|
|
1187
|
+
/**
|
|
1188
|
+
* The number of steps taken by the agent.
|
|
1189
|
+
*/
|
|
1190
|
+
step_count?: number;
|
|
1191
|
+
|
|
1192
|
+
/**
|
|
1193
|
+
* The total number of tokens processed by the agent.
|
|
1194
|
+
*/
|
|
1195
|
+
total_tokens?: number;
|
|
948
1196
|
}
|
|
949
1197
|
}
|
|
950
1198
|
|
|
1199
|
+
export type LettaUserMessageContentUnion = TextContent | ImageContent;
|
|
1200
|
+
|
|
1201
|
+
/**
|
|
1202
|
+
* A message generated by the system. Never streamed back on a response, only used
|
|
1203
|
+
* for cursor pagination.
|
|
1204
|
+
*
|
|
1205
|
+
* Args: id (str): The ID of the message date (datetime): The date the message was
|
|
1206
|
+
* created in ISO format name (Optional[str]): The name of the sender of the
|
|
1207
|
+
* message content (str): The message content sent by the system
|
|
1208
|
+
*/
|
|
1209
|
+
export type Message =
|
|
1210
|
+
| SystemMessage
|
|
1211
|
+
| UserMessage
|
|
1212
|
+
| ReasoningMessage
|
|
1213
|
+
| HiddenReasoningMessage
|
|
1214
|
+
| ToolCallMessage
|
|
1215
|
+
| ToolsAPI.ToolReturnMessage
|
|
1216
|
+
| AssistantMessage
|
|
1217
|
+
| ApprovalRequestMessage
|
|
1218
|
+
| ApprovalResponseMessage
|
|
1219
|
+
| SummaryMessage
|
|
1220
|
+
| EventMessage;
|
|
1221
|
+
|
|
951
1222
|
export type MessageRole = 'assistant' | 'user' | 'tool' | 'function' | 'system' | 'approval';
|
|
952
1223
|
|
|
953
1224
|
export type MessageType =
|
|
@@ -1063,27 +1334,17 @@ export interface RedactedReasoningContent {
|
|
|
1063
1334
|
* Representation of a run - a conversation or processing session for an agent.
|
|
1064
1335
|
* Runs track when agents process messages and maintain the relationship between
|
|
1065
1336
|
* agents, steps, and messages.
|
|
1066
|
-
*
|
|
1067
|
-
* Parameters: id (str): The unique identifier of the run (prefixed with 'run-').
|
|
1068
|
-
* status (JobStatus): The current status of the run. created_at (datetime): The
|
|
1069
|
-
* timestamp when the run was created. completed_at (datetime): The timestamp when
|
|
1070
|
-
* the run was completed. agent_id (str): The unique identifier of the agent
|
|
1071
|
-
* associated with the run. base_template_id (str): The base template ID that the
|
|
1072
|
-
* run belongs to. stop_reason (StopReasonType): The reason why the run was
|
|
1073
|
-
* stopped. background (bool): Whether the run was created in background mode.
|
|
1074
|
-
* metadata (dict): Additional metadata for the run. request_config
|
|
1075
|
-
* (LettaRequestConfig): The request configuration for the run.
|
|
1076
1337
|
*/
|
|
1077
1338
|
export interface Run {
|
|
1078
1339
|
/**
|
|
1079
|
-
* The
|
|
1340
|
+
* The human-friendly ID of the Run
|
|
1080
1341
|
*/
|
|
1081
|
-
|
|
1342
|
+
id: string;
|
|
1082
1343
|
|
|
1083
1344
|
/**
|
|
1084
|
-
* The
|
|
1345
|
+
* The unique identifier of the agent associated with the run.
|
|
1085
1346
|
*/
|
|
1086
|
-
|
|
1347
|
+
agent_id: string;
|
|
1087
1348
|
|
|
1088
1349
|
/**
|
|
1089
1350
|
* Whether the run was created in background mode.
|
|
@@ -1185,6 +1446,34 @@ export namespace Run {
|
|
|
1185
1446
|
}
|
|
1186
1447
|
}
|
|
1187
1448
|
|
|
1449
|
+
/**
|
|
1450
|
+
* A message representing a summary of the conversation. Sent to the LLM as a user
|
|
1451
|
+
* or system message depending on the provider.
|
|
1452
|
+
*/
|
|
1453
|
+
export interface SummaryMessage {
|
|
1454
|
+
id: string;
|
|
1455
|
+
|
|
1456
|
+
date: string;
|
|
1457
|
+
|
|
1458
|
+
summary: string;
|
|
1459
|
+
|
|
1460
|
+
is_err?: boolean | null;
|
|
1461
|
+
|
|
1462
|
+
message_type?: 'summary';
|
|
1463
|
+
|
|
1464
|
+
name?: string | null;
|
|
1465
|
+
|
|
1466
|
+
otid?: string | null;
|
|
1467
|
+
|
|
1468
|
+
run_id?: string | null;
|
|
1469
|
+
|
|
1470
|
+
sender_id?: string | null;
|
|
1471
|
+
|
|
1472
|
+
seq_id?: number | null;
|
|
1473
|
+
|
|
1474
|
+
step_id?: string | null;
|
|
1475
|
+
}
|
|
1476
|
+
|
|
1188
1477
|
/**
|
|
1189
1478
|
* A message generated by the system. Never streamed back on a response, only used
|
|
1190
1479
|
* for cursor pagination.
|
|
@@ -1422,248 +1711,210 @@ export interface UserMessage {
|
|
|
1422
1711
|
|
|
1423
1712
|
is_err?: boolean | null;
|
|
1424
1713
|
|
|
1425
|
-
/**
|
|
1426
|
-
* The type of the message.
|
|
1427
|
-
*/
|
|
1428
|
-
message_type?: 'user_message';
|
|
1429
|
-
|
|
1430
|
-
name?: string | null;
|
|
1431
|
-
|
|
1432
|
-
otid?: string | null;
|
|
1433
|
-
|
|
1434
|
-
run_id?: string | null;
|
|
1435
|
-
|
|
1436
|
-
sender_id?: string | null;
|
|
1437
|
-
|
|
1438
|
-
seq_id?: number | null;
|
|
1439
|
-
|
|
1440
|
-
step_id?: string | null;
|
|
1441
|
-
}
|
|
1442
|
-
|
|
1443
|
-
/**
|
|
1444
|
-
* A message generated by the system. Never streamed back on a response, only used
|
|
1445
|
-
* for cursor pagination.
|
|
1446
|
-
*
|
|
1447
|
-
* Args: id (str): The ID of the message date (datetime): The date the message was
|
|
1448
|
-
* created in ISO format name (Optional[str]): The name of the sender of the
|
|
1449
|
-
* message content (str): The message content sent by the system
|
|
1450
|
-
*/
|
|
1451
|
-
export type MessageUpdateResponse =
|
|
1452
|
-
| SystemMessage
|
|
1453
|
-
| UserMessage
|
|
1454
|
-
| ReasoningMessage
|
|
1455
|
-
| HiddenReasoningMessage
|
|
1456
|
-
| ToolCallMessage
|
|
1457
|
-
| ToolsAPI.ToolReturnMessage
|
|
1458
|
-
| AssistantMessage
|
|
1459
|
-
| ApprovalRequestMessage
|
|
1460
|
-
| ApprovalResponseMessage;
|
|
1461
|
-
|
|
1462
|
-
export type MessageListResponse = Array<LettaMessageUnion>;
|
|
1463
|
-
|
|
1464
|
-
export type MessageCancelResponse = { [key: string]: unknown };
|
|
1465
|
-
|
|
1466
|
-
export type MessageStreamResponse = unknown;
|
|
1467
|
-
|
|
1468
|
-
export type MessageUpdateParams =
|
|
1469
|
-
| MessageUpdateParams.UpdateSystemMessage
|
|
1470
|
-
| MessageUpdateParams.UpdateUserMessage
|
|
1471
|
-
| MessageUpdateParams.UpdateReasoningMessage
|
|
1472
|
-
| MessageUpdateParams.UpdateAssistantMessage;
|
|
1473
|
-
|
|
1474
|
-
export declare namespace MessageUpdateParams {
|
|
1475
|
-
export interface UpdateSystemMessage {
|
|
1476
|
-
/**
|
|
1477
|
-
* Path param: The ID of the agent in the format 'agent-<uuid4>'
|
|
1478
|
-
*/
|
|
1479
|
-
agent_id: string;
|
|
1480
|
-
|
|
1481
|
-
/**
|
|
1482
|
-
* Body param: The message content sent by the system (can be a string or an array
|
|
1483
|
-
* of multi-modal content parts)
|
|
1484
|
-
*/
|
|
1485
|
-
content: string;
|
|
1714
|
+
/**
|
|
1715
|
+
* The type of the message.
|
|
1716
|
+
*/
|
|
1717
|
+
message_type?: 'user_message';
|
|
1486
1718
|
|
|
1487
|
-
|
|
1488
|
-
* Body param:
|
|
1489
|
-
*/
|
|
1490
|
-
message_type?: 'system_message';
|
|
1491
|
-
}
|
|
1719
|
+
name?: string | null;
|
|
1492
1720
|
|
|
1493
|
-
|
|
1494
|
-
/**
|
|
1495
|
-
* Path param: The ID of the agent in the format 'agent-<uuid4>'
|
|
1496
|
-
*/
|
|
1497
|
-
agent_id: string;
|
|
1721
|
+
otid?: string | null;
|
|
1498
1722
|
|
|
1499
|
-
|
|
1500
|
-
* Body param: The message content sent by the user (can be a string or an array of
|
|
1501
|
-
* multi-modal content parts)
|
|
1502
|
-
*/
|
|
1503
|
-
content: Array<LettaUserMessageContentUnion> | string;
|
|
1723
|
+
run_id?: string | null;
|
|
1504
1724
|
|
|
1505
|
-
|
|
1506
|
-
* Body param:
|
|
1507
|
-
*/
|
|
1508
|
-
message_type?: 'user_message';
|
|
1509
|
-
}
|
|
1725
|
+
sender_id?: string | null;
|
|
1510
1726
|
|
|
1511
|
-
|
|
1512
|
-
/**
|
|
1513
|
-
* Path param: The ID of the agent in the format 'agent-<uuid4>'
|
|
1514
|
-
*/
|
|
1515
|
-
agent_id: string;
|
|
1727
|
+
seq_id?: number | null;
|
|
1516
1728
|
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
*/
|
|
1520
|
-
reasoning: string;
|
|
1729
|
+
step_id?: string | null;
|
|
1730
|
+
}
|
|
1521
1731
|
|
|
1522
|
-
|
|
1523
|
-
* Body param:
|
|
1524
|
-
*/
|
|
1525
|
-
message_type?: 'reasoning_message';
|
|
1526
|
-
}
|
|
1732
|
+
export type MessageCancelResponse = { [key: string]: unknown };
|
|
1527
1733
|
|
|
1528
|
-
|
|
1529
|
-
/**
|
|
1530
|
-
* Path param: The ID of the agent in the format 'agent-<uuid4>'
|
|
1531
|
-
*/
|
|
1532
|
-
agent_id: string;
|
|
1734
|
+
export type MessageCreateParams = MessageCreateParamsNonStreaming | MessageCreateParamsStreaming;
|
|
1533
1735
|
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1736
|
+
export interface MessageCreateParamsBase {
|
|
1737
|
+
/**
|
|
1738
|
+
* @deprecated The name of the message argument in the designated message tool.
|
|
1739
|
+
* Still supported for legacy agent types, but deprecated for letta_v1_agent
|
|
1740
|
+
* onward.
|
|
1741
|
+
*/
|
|
1742
|
+
assistant_message_tool_kwarg?: string;
|
|
1539
1743
|
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
}
|
|
1744
|
+
/**
|
|
1745
|
+
* @deprecated The name of the designated message tool. Still supported for legacy
|
|
1746
|
+
* agent types, but deprecated for letta_v1_agent onward.
|
|
1747
|
+
*/
|
|
1748
|
+
assistant_message_tool_name?: string;
|
|
1546
1749
|
|
|
1547
|
-
export interface MessageListParams {
|
|
1548
1750
|
/**
|
|
1549
|
-
*
|
|
1550
|
-
*
|
|
1751
|
+
* Whether to process the request in the background (only used when
|
|
1752
|
+
* streaming=true).
|
|
1551
1753
|
*/
|
|
1552
|
-
|
|
1754
|
+
background?: boolean;
|
|
1553
1755
|
|
|
1554
1756
|
/**
|
|
1555
|
-
* @deprecated
|
|
1757
|
+
* @deprecated If set to True, enables reasoning before responses or tool calls
|
|
1758
|
+
* from the agent.
|
|
1556
1759
|
*/
|
|
1557
|
-
|
|
1760
|
+
enable_thinking?: string;
|
|
1558
1761
|
|
|
1559
1762
|
/**
|
|
1560
|
-
*
|
|
1763
|
+
* Whether to include periodic keepalive ping messages in the stream to prevent
|
|
1764
|
+
* connection timeouts (only used when streaming=true).
|
|
1561
1765
|
*/
|
|
1562
|
-
|
|
1766
|
+
include_pings?: boolean;
|
|
1563
1767
|
|
|
1564
1768
|
/**
|
|
1565
|
-
*
|
|
1566
|
-
*
|
|
1769
|
+
* Only return specified message types in the response. If `None` (default) returns
|
|
1770
|
+
* all messages.
|
|
1567
1771
|
*/
|
|
1568
|
-
|
|
1772
|
+
include_return_message_types?: Array<MessageType> | null;
|
|
1569
1773
|
|
|
1570
1774
|
/**
|
|
1571
|
-
*
|
|
1775
|
+
* Syntactic sugar for a single user message. Equivalent to messages=[{'role':
|
|
1776
|
+
* 'user', 'content': input}].
|
|
1572
1777
|
*/
|
|
1573
|
-
|
|
1778
|
+
input?:
|
|
1779
|
+
| string
|
|
1780
|
+
| Array<
|
|
1781
|
+
| TextContent
|
|
1782
|
+
| ImageContent
|
|
1783
|
+
| ToolCallContent
|
|
1784
|
+
| ToolReturnContent
|
|
1785
|
+
| ReasoningContent
|
|
1786
|
+
| RedactedReasoningContent
|
|
1787
|
+
| OmittedReasoningContent
|
|
1788
|
+
| MessageCreateParams.SummarizedReasoningContent
|
|
1789
|
+
>
|
|
1790
|
+
| null;
|
|
1574
1791
|
|
|
1575
1792
|
/**
|
|
1576
|
-
*
|
|
1577
|
-
* only.
|
|
1793
|
+
* Maximum number of steps the agent should take to process the request.
|
|
1578
1794
|
*/
|
|
1579
|
-
|
|
1795
|
+
max_steps?: number;
|
|
1580
1796
|
|
|
1581
1797
|
/**
|
|
1582
|
-
*
|
|
1798
|
+
* The messages to be sent to the agent.
|
|
1583
1799
|
*/
|
|
1584
|
-
|
|
1800
|
+
messages?: Array<AgentsAPI.MessageCreate | ApprovalCreate> | null;
|
|
1585
1801
|
|
|
1586
1802
|
/**
|
|
1587
|
-
*
|
|
1588
|
-
*
|
|
1803
|
+
* Flag to determine if individual tokens should be streamed, rather than streaming
|
|
1804
|
+
* per step (only used when streaming=true).
|
|
1589
1805
|
*/
|
|
1590
|
-
|
|
1806
|
+
stream_tokens?: boolean;
|
|
1591
1807
|
|
|
1592
1808
|
/**
|
|
1593
|
-
*
|
|
1809
|
+
* If True, returns a streaming response (Server-Sent Events). If False (default),
|
|
1810
|
+
* returns a complete response.
|
|
1594
1811
|
*/
|
|
1595
|
-
|
|
1812
|
+
streaming?: boolean;
|
|
1596
1813
|
|
|
1597
1814
|
/**
|
|
1598
|
-
* @deprecated Whether
|
|
1815
|
+
* @deprecated Whether the server should parse specific tool call arguments
|
|
1816
|
+
* (default `send_message`) as `AssistantMessage` objects. Still supported for
|
|
1817
|
+
* legacy agent types, but deprecated for letta_v1_agent onward.
|
|
1599
1818
|
*/
|
|
1600
1819
|
use_assistant_message?: boolean;
|
|
1601
1820
|
}
|
|
1602
1821
|
|
|
1603
|
-
export
|
|
1822
|
+
export namespace MessageCreateParams {
|
|
1604
1823
|
/**
|
|
1605
|
-
*
|
|
1824
|
+
* The style of reasoning content returned by the OpenAI Responses API
|
|
1606
1825
|
*/
|
|
1607
|
-
|
|
1826
|
+
export interface SummarizedReasoningContent {
|
|
1827
|
+
/**
|
|
1828
|
+
* The unique identifier for this reasoning step.
|
|
1829
|
+
*/
|
|
1830
|
+
id: string;
|
|
1831
|
+
|
|
1832
|
+
/**
|
|
1833
|
+
* Summaries of the reasoning content.
|
|
1834
|
+
*/
|
|
1835
|
+
summary: Array<SummarizedReasoningContent.Summary>;
|
|
1836
|
+
|
|
1837
|
+
/**
|
|
1838
|
+
* The encrypted reasoning content.
|
|
1839
|
+
*/
|
|
1840
|
+
encrypted_content?: string;
|
|
1841
|
+
|
|
1842
|
+
/**
|
|
1843
|
+
* Indicates this is a summarized reasoning step.
|
|
1844
|
+
*/
|
|
1845
|
+
type?: 'summarized_reasoning';
|
|
1846
|
+
}
|
|
1847
|
+
|
|
1848
|
+
export namespace SummarizedReasoningContent {
|
|
1849
|
+
export interface Summary {
|
|
1850
|
+
/**
|
|
1851
|
+
* The index of the summary part.
|
|
1852
|
+
*/
|
|
1853
|
+
index: number;
|
|
1854
|
+
|
|
1855
|
+
/**
|
|
1856
|
+
* The text of the summary part.
|
|
1857
|
+
*/
|
|
1858
|
+
text: string;
|
|
1859
|
+
}
|
|
1860
|
+
}
|
|
1861
|
+
|
|
1862
|
+
export type MessageCreateParamsNonStreaming = MessagesAPI.MessageCreateParamsNonStreaming;
|
|
1863
|
+
export type MessageCreateParamsStreaming = MessagesAPI.MessageCreateParamsStreaming;
|
|
1608
1864
|
}
|
|
1609
1865
|
|
|
1610
|
-
export interface
|
|
1866
|
+
export interface MessageCreateParamsNonStreaming extends MessageCreateParamsBase {
|
|
1611
1867
|
/**
|
|
1612
|
-
* If
|
|
1868
|
+
* If True, returns a streaming response (Server-Sent Events). If False (default),
|
|
1869
|
+
* returns a complete response.
|
|
1613
1870
|
*/
|
|
1614
|
-
|
|
1871
|
+
streaming?: false;
|
|
1615
1872
|
}
|
|
1616
1873
|
|
|
1617
|
-
export interface
|
|
1874
|
+
export interface MessageCreateParamsStreaming extends MessageCreateParamsBase {
|
|
1618
1875
|
/**
|
|
1619
|
-
*
|
|
1876
|
+
* If True, returns a streaming response (Server-Sent Events). If False (default),
|
|
1877
|
+
* returns a complete response.
|
|
1620
1878
|
*/
|
|
1621
|
-
|
|
1879
|
+
streaming: true;
|
|
1880
|
+
}
|
|
1622
1881
|
|
|
1882
|
+
export interface MessageListParams extends ArrayPageParams {
|
|
1623
1883
|
/**
|
|
1624
|
-
* @deprecated The name of the message argument
|
|
1625
|
-
* Still supported for legacy agent types, but deprecated for letta_v1_agent
|
|
1626
|
-
* onward.
|
|
1884
|
+
* @deprecated The name of the message argument.
|
|
1627
1885
|
*/
|
|
1628
1886
|
assistant_message_tool_kwarg?: string;
|
|
1629
1887
|
|
|
1630
1888
|
/**
|
|
1631
|
-
* @deprecated The name of the designated message tool.
|
|
1632
|
-
* agent types, but deprecated for letta_v1_agent onward.
|
|
1889
|
+
* @deprecated The name of the designated message tool.
|
|
1633
1890
|
*/
|
|
1634
1891
|
assistant_message_tool_name?: string;
|
|
1635
1892
|
|
|
1636
1893
|
/**
|
|
1637
|
-
*
|
|
1638
|
-
* from the agent.
|
|
1639
|
-
*/
|
|
1640
|
-
enable_thinking?: string;
|
|
1641
|
-
|
|
1642
|
-
/**
|
|
1643
|
-
* Only return specified message types in the response. If `None` (default) returns
|
|
1644
|
-
* all messages.
|
|
1894
|
+
* Group ID to filter messages by.
|
|
1645
1895
|
*/
|
|
1646
|
-
|
|
1896
|
+
group_id?: string | null;
|
|
1647
1897
|
|
|
1648
1898
|
/**
|
|
1649
|
-
*
|
|
1899
|
+
* Whether to include error messages and error statuses. For debugging purposes
|
|
1900
|
+
* only.
|
|
1650
1901
|
*/
|
|
1651
|
-
|
|
1902
|
+
include_err?: boolean | null;
|
|
1652
1903
|
|
|
1653
1904
|
/**
|
|
1654
|
-
* @deprecated Whether
|
|
1655
|
-
* (default `send_message`) as `AssistantMessage` objects. Still supported for
|
|
1656
|
-
* legacy agent types, but deprecated for letta_v1_agent onward.
|
|
1905
|
+
* @deprecated Whether to use assistant messages
|
|
1657
1906
|
*/
|
|
1658
1907
|
use_assistant_message?: boolean;
|
|
1659
1908
|
}
|
|
1660
1909
|
|
|
1661
|
-
export interface
|
|
1910
|
+
export interface MessageCancelParams {
|
|
1662
1911
|
/**
|
|
1663
|
-
*
|
|
1912
|
+
* Optional list of run IDs to cancel
|
|
1664
1913
|
*/
|
|
1665
|
-
|
|
1914
|
+
run_ids?: Array<string> | null;
|
|
1915
|
+
}
|
|
1666
1916
|
|
|
1917
|
+
export interface MessageCreateAsyncParams {
|
|
1667
1918
|
/**
|
|
1668
1919
|
* @deprecated The name of the message argument in the designated message tool.
|
|
1669
1920
|
* Still supported for legacy agent types, but deprecated for letta_v1_agent
|
|
@@ -1694,11 +1945,34 @@ export interface MessageSendAsyncParams {
|
|
|
1694
1945
|
*/
|
|
1695
1946
|
include_return_message_types?: Array<MessageType> | null;
|
|
1696
1947
|
|
|
1948
|
+
/**
|
|
1949
|
+
* Syntactic sugar for a single user message. Equivalent to messages=[{'role':
|
|
1950
|
+
* 'user', 'content': input}].
|
|
1951
|
+
*/
|
|
1952
|
+
input?:
|
|
1953
|
+
| string
|
|
1954
|
+
| Array<
|
|
1955
|
+
| TextContent
|
|
1956
|
+
| ImageContent
|
|
1957
|
+
| ToolCallContent
|
|
1958
|
+
| ToolReturnContent
|
|
1959
|
+
| ReasoningContent
|
|
1960
|
+
| RedactedReasoningContent
|
|
1961
|
+
| OmittedReasoningContent
|
|
1962
|
+
| MessageCreateAsyncParams.SummarizedReasoningContent
|
|
1963
|
+
>
|
|
1964
|
+
| null;
|
|
1965
|
+
|
|
1697
1966
|
/**
|
|
1698
1967
|
* Maximum number of steps the agent should take to process the request.
|
|
1699
1968
|
*/
|
|
1700
1969
|
max_steps?: number;
|
|
1701
1970
|
|
|
1971
|
+
/**
|
|
1972
|
+
* The messages to be sent to the agent.
|
|
1973
|
+
*/
|
|
1974
|
+
messages?: Array<AgentsAPI.MessageCreate | ApprovalCreate> | null;
|
|
1975
|
+
|
|
1702
1976
|
/**
|
|
1703
1977
|
* @deprecated Whether the server should parse specific tool call arguments
|
|
1704
1978
|
* (default `send_message`) as `AssistantMessage` objects. Still supported for
|
|
@@ -1707,12 +1981,55 @@ export interface MessageSendAsyncParams {
|
|
|
1707
1981
|
use_assistant_message?: boolean;
|
|
1708
1982
|
}
|
|
1709
1983
|
|
|
1710
|
-
export
|
|
1984
|
+
export namespace MessageCreateAsyncParams {
|
|
1711
1985
|
/**
|
|
1712
|
-
* The
|
|
1986
|
+
* The style of reasoning content returned by the OpenAI Responses API
|
|
1987
|
+
*/
|
|
1988
|
+
export interface SummarizedReasoningContent {
|
|
1989
|
+
/**
|
|
1990
|
+
* The unique identifier for this reasoning step.
|
|
1991
|
+
*/
|
|
1992
|
+
id: string;
|
|
1993
|
+
|
|
1994
|
+
/**
|
|
1995
|
+
* Summaries of the reasoning content.
|
|
1996
|
+
*/
|
|
1997
|
+
summary: Array<SummarizedReasoningContent.Summary>;
|
|
1998
|
+
|
|
1999
|
+
/**
|
|
2000
|
+
* The encrypted reasoning content.
|
|
2001
|
+
*/
|
|
2002
|
+
encrypted_content?: string;
|
|
2003
|
+
|
|
2004
|
+
/**
|
|
2005
|
+
* Indicates this is a summarized reasoning step.
|
|
2006
|
+
*/
|
|
2007
|
+
type?: 'summarized_reasoning';
|
|
2008
|
+
}
|
|
2009
|
+
|
|
2010
|
+
export namespace SummarizedReasoningContent {
|
|
2011
|
+
export interface Summary {
|
|
2012
|
+
/**
|
|
2013
|
+
* The index of the summary part.
|
|
2014
|
+
*/
|
|
2015
|
+
index: number;
|
|
2016
|
+
|
|
2017
|
+
/**
|
|
2018
|
+
* The text of the summary part.
|
|
2019
|
+
*/
|
|
2020
|
+
text: string;
|
|
2021
|
+
}
|
|
2022
|
+
}
|
|
2023
|
+
}
|
|
2024
|
+
|
|
2025
|
+
export interface MessageResetParams {
|
|
2026
|
+
/**
|
|
2027
|
+
* If true, adds the default initial messages after resetting.
|
|
1713
2028
|
*/
|
|
1714
|
-
|
|
2029
|
+
add_default_initial_messages?: boolean;
|
|
2030
|
+
}
|
|
1715
2031
|
|
|
2032
|
+
export interface MessageStreamParams {
|
|
1716
2033
|
/**
|
|
1717
2034
|
* @deprecated The name of the message argument in the designated message tool.
|
|
1718
2035
|
* Still supported for legacy agent types, but deprecated for letta_v1_agent
|
|
@@ -1727,7 +2044,8 @@ export interface MessageStreamParams {
|
|
|
1727
2044
|
assistant_message_tool_name?: string;
|
|
1728
2045
|
|
|
1729
2046
|
/**
|
|
1730
|
-
* Whether to process the request in the background
|
|
2047
|
+
* Whether to process the request in the background (only used when
|
|
2048
|
+
* streaming=true).
|
|
1731
2049
|
*/
|
|
1732
2050
|
background?: boolean;
|
|
1733
2051
|
|
|
@@ -1739,7 +2057,7 @@ export interface MessageStreamParams {
|
|
|
1739
2057
|
|
|
1740
2058
|
/**
|
|
1741
2059
|
* Whether to include periodic keepalive ping messages in the stream to prevent
|
|
1742
|
-
* connection timeouts.
|
|
2060
|
+
* connection timeouts (only used when streaming=true).
|
|
1743
2061
|
*/
|
|
1744
2062
|
include_pings?: boolean;
|
|
1745
2063
|
|
|
@@ -1749,17 +2067,46 @@ export interface MessageStreamParams {
|
|
|
1749
2067
|
*/
|
|
1750
2068
|
include_return_message_types?: Array<MessageType> | null;
|
|
1751
2069
|
|
|
2070
|
+
/**
|
|
2071
|
+
* Syntactic sugar for a single user message. Equivalent to messages=[{'role':
|
|
2072
|
+
* 'user', 'content': input}].
|
|
2073
|
+
*/
|
|
2074
|
+
input?:
|
|
2075
|
+
| string
|
|
2076
|
+
| Array<
|
|
2077
|
+
| TextContent
|
|
2078
|
+
| ImageContent
|
|
2079
|
+
| ToolCallContent
|
|
2080
|
+
| ToolReturnContent
|
|
2081
|
+
| ReasoningContent
|
|
2082
|
+
| RedactedReasoningContent
|
|
2083
|
+
| OmittedReasoningContent
|
|
2084
|
+
| MessageStreamParams.SummarizedReasoningContent
|
|
2085
|
+
>
|
|
2086
|
+
| null;
|
|
2087
|
+
|
|
1752
2088
|
/**
|
|
1753
2089
|
* Maximum number of steps the agent should take to process the request.
|
|
1754
2090
|
*/
|
|
1755
2091
|
max_steps?: number;
|
|
1756
2092
|
|
|
2093
|
+
/**
|
|
2094
|
+
* The messages to be sent to the agent.
|
|
2095
|
+
*/
|
|
2096
|
+
messages?: Array<AgentsAPI.MessageCreate | ApprovalCreate> | null;
|
|
2097
|
+
|
|
1757
2098
|
/**
|
|
1758
2099
|
* Flag to determine if individual tokens should be streamed, rather than streaming
|
|
1759
|
-
* per step.
|
|
2100
|
+
* per step (only used when streaming=true).
|
|
1760
2101
|
*/
|
|
1761
2102
|
stream_tokens?: boolean;
|
|
1762
2103
|
|
|
2104
|
+
/**
|
|
2105
|
+
* If True, returns a streaming response (Server-Sent Events). If False (default),
|
|
2106
|
+
* returns a complete response.
|
|
2107
|
+
*/
|
|
2108
|
+
streaming?: boolean;
|
|
2109
|
+
|
|
1763
2110
|
/**
|
|
1764
2111
|
* @deprecated Whether the server should parse specific tool call arguments
|
|
1765
2112
|
* (default `send_message`) as `AssistantMessage` objects. Still supported for
|
|
@@ -1768,21 +2115,65 @@ export interface MessageStreamParams {
|
|
|
1768
2115
|
use_assistant_message?: boolean;
|
|
1769
2116
|
}
|
|
1770
2117
|
|
|
2118
|
+
export namespace MessageStreamParams {
|
|
2119
|
+
/**
|
|
2120
|
+
* The style of reasoning content returned by the OpenAI Responses API
|
|
2121
|
+
*/
|
|
2122
|
+
export interface SummarizedReasoningContent {
|
|
2123
|
+
/**
|
|
2124
|
+
* The unique identifier for this reasoning step.
|
|
2125
|
+
*/
|
|
2126
|
+
id: string;
|
|
2127
|
+
|
|
2128
|
+
/**
|
|
2129
|
+
* Summaries of the reasoning content.
|
|
2130
|
+
*/
|
|
2131
|
+
summary: Array<SummarizedReasoningContent.Summary>;
|
|
2132
|
+
|
|
2133
|
+
/**
|
|
2134
|
+
* The encrypted reasoning content.
|
|
2135
|
+
*/
|
|
2136
|
+
encrypted_content?: string;
|
|
2137
|
+
|
|
2138
|
+
/**
|
|
2139
|
+
* Indicates this is a summarized reasoning step.
|
|
2140
|
+
*/
|
|
2141
|
+
type?: 'summarized_reasoning';
|
|
2142
|
+
}
|
|
2143
|
+
|
|
2144
|
+
export namespace SummarizedReasoningContent {
|
|
2145
|
+
export interface Summary {
|
|
2146
|
+
/**
|
|
2147
|
+
* The index of the summary part.
|
|
2148
|
+
*/
|
|
2149
|
+
index: number;
|
|
2150
|
+
|
|
2151
|
+
/**
|
|
2152
|
+
* The text of the summary part.
|
|
2153
|
+
*/
|
|
2154
|
+
text: string;
|
|
2155
|
+
}
|
|
2156
|
+
}
|
|
2157
|
+
}
|
|
2158
|
+
|
|
1771
2159
|
export declare namespace Messages {
|
|
1772
2160
|
export {
|
|
1773
2161
|
type ApprovalCreate as ApprovalCreate,
|
|
1774
2162
|
type ApprovalRequestMessage as ApprovalRequestMessage,
|
|
1775
2163
|
type ApprovalResponseMessage as ApprovalResponseMessage,
|
|
2164
|
+
type ApprovalReturn as ApprovalReturn,
|
|
1776
2165
|
type AssistantMessage as AssistantMessage,
|
|
2166
|
+
type EventMessage as EventMessage,
|
|
1777
2167
|
type HiddenReasoningMessage as HiddenReasoningMessage,
|
|
1778
2168
|
type ImageContent as ImageContent,
|
|
2169
|
+
type InternalMessage as InternalMessage,
|
|
1779
2170
|
type JobStatus as JobStatus,
|
|
1780
2171
|
type JobType as JobType,
|
|
1781
2172
|
type LettaAssistantMessageContentUnion as LettaAssistantMessageContentUnion,
|
|
1782
|
-
type LettaMessageUnion as LettaMessageUnion,
|
|
1783
2173
|
type LettaRequest as LettaRequest,
|
|
1784
2174
|
type LettaResponse as LettaResponse,
|
|
1785
2175
|
type LettaStreamingRequest as LettaStreamingRequest,
|
|
2176
|
+
type LettaStreamingResponse as LettaStreamingResponse,
|
|
1786
2177
|
type LettaUserMessageContentUnion as LettaUserMessageContentUnion,
|
|
1787
2178
|
type Message as Message,
|
|
1788
2179
|
type MessageRole as MessageRole,
|
|
@@ -1792,6 +2183,7 @@ export declare namespace Messages {
|
|
|
1792
2183
|
type ReasoningMessage as ReasoningMessage,
|
|
1793
2184
|
type RedactedReasoningContent as RedactedReasoningContent,
|
|
1794
2185
|
type Run as Run,
|
|
2186
|
+
type SummaryMessage as SummaryMessage,
|
|
1795
2187
|
type SystemMessage as SystemMessage,
|
|
1796
2188
|
type TextContent as TextContent,
|
|
1797
2189
|
type ToolCall as ToolCall,
|
|
@@ -1805,16 +2197,15 @@ export declare namespace Messages {
|
|
|
1805
2197
|
type UpdateSystemMessage as UpdateSystemMessage,
|
|
1806
2198
|
type UpdateUserMessage as UpdateUserMessage,
|
|
1807
2199
|
type UserMessage as UserMessage,
|
|
1808
|
-
type MessageUpdateResponse as MessageUpdateResponse,
|
|
1809
|
-
type MessageListResponse as MessageListResponse,
|
|
1810
2200
|
type MessageCancelResponse as MessageCancelResponse,
|
|
1811
|
-
type
|
|
1812
|
-
type
|
|
2201
|
+
type MessagesArrayPage as MessagesArrayPage,
|
|
2202
|
+
type MessageCreateParams as MessageCreateParams,
|
|
2203
|
+
type MessageCreateParamsNonStreaming as MessageCreateParamsNonStreaming,
|
|
2204
|
+
type MessageCreateParamsStreaming as MessageCreateParamsStreaming,
|
|
1813
2205
|
type MessageListParams as MessageListParams,
|
|
1814
2206
|
type MessageCancelParams as MessageCancelParams,
|
|
2207
|
+
type MessageCreateAsyncParams as MessageCreateAsyncParams,
|
|
1815
2208
|
type MessageResetParams as MessageResetParams,
|
|
1816
|
-
type MessageSendParams as MessageSendParams,
|
|
1817
|
-
type MessageSendAsyncParams as MessageSendAsyncParams,
|
|
1818
2209
|
type MessageStreamParams as MessageStreamParams,
|
|
1819
2210
|
};
|
|
1820
2211
|
}
|