@letta-ai/letta-client 0.1.146 → 0.1.148

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.
Files changed (154) hide show
  1. package/api/resources/agents/client/Client.d.ts +30 -0
  2. package/api/resources/agents/client/Client.js +155 -10
  3. package/api/resources/agents/resources/blocks/client/Client.js +5 -5
  4. package/api/resources/agents/resources/context/client/Client.js +1 -1
  5. package/api/resources/agents/resources/coreMemory/client/Client.js +1 -1
  6. package/api/resources/agents/resources/groups/client/Client.js +1 -1
  7. package/api/resources/agents/resources/memoryVariables/client/Client.js +1 -1
  8. package/api/resources/agents/resources/messages/client/Client.d.ts +3 -0
  9. package/api/resources/agents/resources/messages/client/Client.js +9 -6
  10. package/api/resources/agents/resources/passages/client/Client.js +4 -4
  11. package/api/resources/agents/resources/sources/client/Client.js +3 -3
  12. package/api/resources/agents/resources/templates/client/Client.js +3 -3
  13. package/api/resources/agents/resources/tools/client/Client.js +3 -3
  14. package/api/resources/batches/client/Client.js +4 -4
  15. package/api/resources/blocks/client/Client.js +6 -6
  16. package/api/resources/blocks/resources/agents/client/Client.js +1 -1
  17. package/api/resources/clientSideAccessTokens/client/Client.js +2 -2
  18. package/api/resources/embeddingModels/client/Client.js +1 -1
  19. package/api/resources/groups/client/Client.js +6 -6
  20. package/api/resources/groups/resources/messages/client/Client.js +5 -5
  21. package/api/resources/health/client/Client.js +1 -1
  22. package/api/resources/identities/client/Client.js +7 -7
  23. package/api/resources/identities/resources/properties/client/Client.js +1 -1
  24. package/api/resources/jobs/client/Client.d.ts +16 -0
  25. package/api/resources/jobs/client/Client.js +101 -6
  26. package/api/resources/jobs/client/requests/JobsListActiveRequest.d.ts +16 -0
  27. package/api/resources/jobs/client/requests/JobsListRequest.d.ts +16 -0
  28. package/api/resources/messages/client/Client.js +1 -1
  29. package/api/resources/models/client/Client.js +1 -1
  30. package/api/resources/projects/client/Client.js +1 -1
  31. package/api/resources/providers/client/Client.js +5 -5
  32. package/api/resources/runs/client/Client.js +4 -4
  33. package/api/resources/runs/resources/messages/client/Client.js +1 -1
  34. package/api/resources/runs/resources/steps/client/Client.js +1 -1
  35. package/api/resources/runs/resources/usage/client/Client.js +1 -1
  36. package/api/resources/sources/client/Client.js +8 -8
  37. package/api/resources/sources/resources/files/client/Client.js +3 -3
  38. package/api/resources/sources/resources/passages/client/Client.js +1 -1
  39. package/api/resources/steps/client/Client.js +6 -3
  40. package/api/resources/steps/client/requests/StepsListRequest.d.ts +4 -0
  41. package/api/resources/steps/resources/feedback/client/Client.js +1 -1
  42. package/api/resources/tags/client/Client.js +1 -1
  43. package/api/resources/telemetry/client/Client.js +1 -1
  44. package/api/resources/templates/client/Client.js +1 -1
  45. package/api/resources/templates/resources/agents/client/Client.js +1 -1
  46. package/api/resources/tools/client/Client.js +19 -19
  47. package/api/resources/voice/client/Client.js +1 -1
  48. package/api/types/CodeInput.d.ts +7 -0
  49. package/api/types/CodeInput.js +5 -0
  50. package/api/types/Step.d.ts +2 -0
  51. package/api/types/StopReasonType.d.ts +2 -1
  52. package/api/types/StopReasonType.js +1 -0
  53. package/api/types/UpdateSsemcpServer.d.ts +2 -0
  54. package/api/types/UpdateStreamableHttpmcpServer.d.ts +2 -0
  55. package/api/types/index.d.ts +1 -0
  56. package/api/types/index.js +1 -0
  57. package/dist/api/resources/agents/client/Client.d.ts +30 -0
  58. package/dist/api/resources/agents/client/Client.js +155 -10
  59. package/dist/api/resources/agents/resources/blocks/client/Client.js +5 -5
  60. package/dist/api/resources/agents/resources/context/client/Client.js +1 -1
  61. package/dist/api/resources/agents/resources/coreMemory/client/Client.js +1 -1
  62. package/dist/api/resources/agents/resources/groups/client/Client.js +1 -1
  63. package/dist/api/resources/agents/resources/memoryVariables/client/Client.js +1 -1
  64. package/dist/api/resources/agents/resources/messages/client/Client.d.ts +3 -0
  65. package/dist/api/resources/agents/resources/messages/client/Client.js +9 -6
  66. package/dist/api/resources/agents/resources/passages/client/Client.js +4 -4
  67. package/dist/api/resources/agents/resources/sources/client/Client.js +3 -3
  68. package/dist/api/resources/agents/resources/templates/client/Client.js +3 -3
  69. package/dist/api/resources/agents/resources/tools/client/Client.js +3 -3
  70. package/dist/api/resources/batches/client/Client.js +4 -4
  71. package/dist/api/resources/blocks/client/Client.js +6 -6
  72. package/dist/api/resources/blocks/resources/agents/client/Client.js +1 -1
  73. package/dist/api/resources/clientSideAccessTokens/client/Client.js +2 -2
  74. package/dist/api/resources/embeddingModels/client/Client.js +1 -1
  75. package/dist/api/resources/groups/client/Client.js +6 -6
  76. package/dist/api/resources/groups/resources/messages/client/Client.js +5 -5
  77. package/dist/api/resources/health/client/Client.js +1 -1
  78. package/dist/api/resources/identities/client/Client.js +7 -7
  79. package/dist/api/resources/identities/resources/properties/client/Client.js +1 -1
  80. package/dist/api/resources/jobs/client/Client.d.ts +16 -0
  81. package/dist/api/resources/jobs/client/Client.js +101 -6
  82. package/dist/api/resources/jobs/client/requests/JobsListActiveRequest.d.ts +16 -0
  83. package/dist/api/resources/jobs/client/requests/JobsListRequest.d.ts +16 -0
  84. package/dist/api/resources/messages/client/Client.js +1 -1
  85. package/dist/api/resources/models/client/Client.js +1 -1
  86. package/dist/api/resources/projects/client/Client.js +1 -1
  87. package/dist/api/resources/providers/client/Client.js +5 -5
  88. package/dist/api/resources/runs/client/Client.js +4 -4
  89. package/dist/api/resources/runs/resources/messages/client/Client.js +1 -1
  90. package/dist/api/resources/runs/resources/steps/client/Client.js +1 -1
  91. package/dist/api/resources/runs/resources/usage/client/Client.js +1 -1
  92. package/dist/api/resources/sources/client/Client.js +8 -8
  93. package/dist/api/resources/sources/resources/files/client/Client.js +3 -3
  94. package/dist/api/resources/sources/resources/passages/client/Client.js +1 -1
  95. package/dist/api/resources/steps/client/Client.js +6 -3
  96. package/dist/api/resources/steps/client/requests/StepsListRequest.d.ts +4 -0
  97. package/dist/api/resources/steps/resources/feedback/client/Client.js +1 -1
  98. package/dist/api/resources/tags/client/Client.js +1 -1
  99. package/dist/api/resources/telemetry/client/Client.js +1 -1
  100. package/dist/api/resources/templates/client/Client.js +1 -1
  101. package/dist/api/resources/templates/resources/agents/client/Client.js +1 -1
  102. package/dist/api/resources/tools/client/Client.js +19 -19
  103. package/dist/api/resources/voice/client/Client.js +1 -1
  104. package/dist/api/types/CodeInput.d.ts +7 -0
  105. package/dist/api/types/CodeInput.js +5 -0
  106. package/dist/api/types/Step.d.ts +2 -0
  107. package/dist/api/types/StopReasonType.d.ts +2 -1
  108. package/dist/api/types/StopReasonType.js +1 -0
  109. package/dist/api/types/UpdateSsemcpServer.d.ts +2 -0
  110. package/dist/api/types/UpdateStreamableHttpmcpServer.d.ts +2 -0
  111. package/dist/api/types/index.d.ts +1 -0
  112. package/dist/api/types/index.js +1 -0
  113. package/dist/serialization/resources/agents/client/cancelAgentRun.d.ts +13 -0
  114. package/dist/serialization/resources/agents/client/cancelAgentRun.js +42 -0
  115. package/dist/serialization/resources/agents/client/closeAllOpenFiles.d.ts +9 -0
  116. package/dist/serialization/resources/agents/client/closeAllOpenFiles.js +41 -0
  117. package/dist/serialization/resources/agents/client/index.d.ts +2 -0
  118. package/dist/serialization/resources/agents/client/index.js +3 -1
  119. package/dist/serialization/types/CodeInput.d.ts +12 -0
  120. package/dist/serialization/types/CodeInput.js +43 -0
  121. package/dist/serialization/types/Step.d.ts +1 -0
  122. package/dist/serialization/types/Step.js +1 -0
  123. package/dist/serialization/types/StopReasonType.d.ts +1 -1
  124. package/dist/serialization/types/StopReasonType.js +9 -1
  125. package/dist/serialization/types/UpdateSsemcpServer.d.ts +1 -0
  126. package/dist/serialization/types/UpdateSsemcpServer.js +1 -0
  127. package/dist/serialization/types/UpdateStreamableHttpmcpServer.d.ts +1 -0
  128. package/dist/serialization/types/UpdateStreamableHttpmcpServer.js +1 -0
  129. package/dist/serialization/types/index.d.ts +1 -0
  130. package/dist/serialization/types/index.js +1 -0
  131. package/dist/version.d.ts +1 -1
  132. package/dist/version.js +1 -1
  133. package/package.json +1 -1
  134. package/reference.md +209 -0
  135. package/serialization/resources/agents/client/cancelAgentRun.d.ts +13 -0
  136. package/serialization/resources/agents/client/cancelAgentRun.js +42 -0
  137. package/serialization/resources/agents/client/closeAllOpenFiles.d.ts +9 -0
  138. package/serialization/resources/agents/client/closeAllOpenFiles.js +41 -0
  139. package/serialization/resources/agents/client/index.d.ts +2 -0
  140. package/serialization/resources/agents/client/index.js +3 -1
  141. package/serialization/types/CodeInput.d.ts +12 -0
  142. package/serialization/types/CodeInput.js +43 -0
  143. package/serialization/types/Step.d.ts +1 -0
  144. package/serialization/types/Step.js +1 -0
  145. package/serialization/types/StopReasonType.d.ts +1 -1
  146. package/serialization/types/StopReasonType.js +9 -1
  147. package/serialization/types/UpdateSsemcpServer.d.ts +1 -0
  148. package/serialization/types/UpdateSsemcpServer.js +1 -0
  149. package/serialization/types/UpdateStreamableHttpmcpServer.d.ts +1 -0
  150. package/serialization/types/UpdateStreamableHttpmcpServer.js +1 -0
  151. package/serialization/types/index.d.ts +1 -0
  152. package/serialization/types/index.js +1 -0
  153. package/version.d.ts +1 -1
  154. package/version.js +1 -1
@@ -163,6 +163,36 @@ export declare class Agents {
163
163
  * await client.agents.modify("agent_id")
164
164
  */
165
165
  modify(agentId: string, request?: Letta.UpdateAgent, requestOptions?: Agents.RequestOptions): Promise<Letta.AgentState>;
166
+ /**
167
+ * Closes all currently open files for a given agent.
168
+ *
169
+ * This endpoint updates the file state for the agent so that no files are marked as open.
170
+ * Typically used to reset the working memory view for the agent.
171
+ *
172
+ * @param {string} agentId
173
+ * @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
174
+ *
175
+ * @throws {@link Letta.UnprocessableEntityError}
176
+ *
177
+ * @example
178
+ * await client.agents.closeAllOpenFiles("agent_id")
179
+ */
180
+ closeAllOpenFiles(agentId: string, requestOptions?: Agents.RequestOptions): Promise<string[]>;
181
+ /**
182
+ * Cancel runs associated with an agent. If run_ids are passed in, cancel those in particular.
183
+ *
184
+ * Note to cancel active runs associated with an agent, redis is required.
185
+ *
186
+ * @param {string} agentId
187
+ * @param {string[]} request
188
+ * @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
189
+ *
190
+ * @throws {@link Letta.UnprocessableEntityError}
191
+ *
192
+ * @example
193
+ * await client.agents.cancelAgentRun("agent_id", undefined)
194
+ */
195
+ cancelAgentRun(agentId: string, request?: string[], requestOptions?: Agents.RequestOptions): Promise<Record<string, unknown>>;
166
196
  /**
167
197
  * Summarize an agent's conversation history to a target message length.
168
198
  *
@@ -193,7 +193,7 @@ class Agents {
193
193
  method: "GET",
194
194
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
195
195
  ? yield core.Supplier.get(this._options.project)
196
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.146", "User-Agent": "@letta-ai/letta-client/0.1.146", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
196
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
197
197
  contentType: "application/json",
198
198
  queryParameters: _queryParams,
199
199
  requestType: "json",
@@ -261,7 +261,7 @@ class Agents {
261
261
  method: "POST",
262
262
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
263
263
  ? yield core.Supplier.get(this._options.project)
264
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.146", "User-Agent": "@letta-ai/letta-client/0.1.146", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
264
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
265
265
  contentType: "application/json",
266
266
  requestType: "json",
267
267
  body: serializers.CreateAgentRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -328,7 +328,7 @@ class Agents {
328
328
  method: "GET",
329
329
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
330
330
  ? yield core.Supplier.get(this._options.project)
331
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.146", "User-Agent": "@letta-ai/letta-client/0.1.146", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
331
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
332
332
  contentType: "application/json",
333
333
  requestType: "json",
334
334
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -395,7 +395,7 @@ class Agents {
395
395
  method: "GET",
396
396
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
397
397
  ? yield core.Supplier.get(this._options.project)
398
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.146", "User-Agent": "@letta-ai/letta-client/0.1.146", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
398
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
399
399
  contentType: "application/json",
400
400
  requestType: "json",
401
401
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -479,7 +479,7 @@ class Agents {
479
479
  method: "POST",
480
480
  headers: Object.assign(Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
481
481
  ? yield core.Supplier.get(this._options.project)
482
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.146", "User-Agent": "@letta-ai/letta-client/0.1.146", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), _maybeEncodedRequest.headers), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
482
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), _maybeEncodedRequest.headers), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
483
483
  queryParameters: _queryParams,
484
484
  requestType: "file",
485
485
  duplex: _maybeEncodedRequest.duplex,
@@ -559,7 +559,7 @@ class Agents {
559
559
  method: "GET",
560
560
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
561
561
  ? yield core.Supplier.get(this._options.project)
562
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.146", "User-Agent": "@letta-ai/letta-client/0.1.146", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
562
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
563
563
  contentType: "application/json",
564
564
  queryParameters: _queryParams,
565
565
  requestType: "json",
@@ -627,7 +627,7 @@ class Agents {
627
627
  method: "DELETE",
628
628
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
629
629
  ? yield core.Supplier.get(this._options.project)
630
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.146", "User-Agent": "@letta-ai/letta-client/0.1.146", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
630
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
631
631
  contentType: "application/json",
632
632
  requestType: "json",
633
633
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -689,7 +689,7 @@ class Agents {
689
689
  method: "PATCH",
690
690
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
691
691
  ? yield core.Supplier.get(this._options.project)
692
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.146", "User-Agent": "@letta-ai/letta-client/0.1.146", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
692
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
693
693
  contentType: "application/json",
694
694
  requestType: "json",
695
695
  body: serializers.UpdateAgent.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -738,6 +738,151 @@ class Agents {
738
738
  }
739
739
  });
740
740
  }
741
+ /**
742
+ * Closes all currently open files for a given agent.
743
+ *
744
+ * This endpoint updates the file state for the agent so that no files are marked as open.
745
+ * Typically used to reset the working memory view for the agent.
746
+ *
747
+ * @param {string} agentId
748
+ * @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
749
+ *
750
+ * @throws {@link Letta.UnprocessableEntityError}
751
+ *
752
+ * @example
753
+ * await client.agents.closeAllOpenFiles("agent_id")
754
+ */
755
+ closeAllOpenFiles(agentId, requestOptions) {
756
+ return __awaiter(this, void 0, void 0, function* () {
757
+ var _a, _b, _c;
758
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
759
+ url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/files/close-all`),
760
+ method: "PATCH",
761
+ headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
762
+ ? yield core.Supplier.get(this._options.project)
763
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
764
+ contentType: "application/json",
765
+ requestType: "json",
766
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
767
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
768
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
769
+ });
770
+ if (_response.ok) {
771
+ return serializers.agents.closeAllOpenFiles.Response.parseOrThrow(_response.body, {
772
+ unrecognizedObjectKeys: "passthrough",
773
+ allowUnrecognizedUnionMembers: true,
774
+ allowUnrecognizedEnumValues: true,
775
+ skipValidation: true,
776
+ breadcrumbsPrefix: ["response"],
777
+ });
778
+ }
779
+ if (_response.error.reason === "status-code") {
780
+ switch (_response.error.statusCode) {
781
+ case 422:
782
+ throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
783
+ unrecognizedObjectKeys: "passthrough",
784
+ allowUnrecognizedUnionMembers: true,
785
+ allowUnrecognizedEnumValues: true,
786
+ skipValidation: true,
787
+ breadcrumbsPrefix: ["response"],
788
+ }));
789
+ default:
790
+ throw new errors.LettaError({
791
+ statusCode: _response.error.statusCode,
792
+ body: _response.error.body,
793
+ });
794
+ }
795
+ }
796
+ switch (_response.error.reason) {
797
+ case "non-json":
798
+ throw new errors.LettaError({
799
+ statusCode: _response.error.statusCode,
800
+ body: _response.error.rawBody,
801
+ });
802
+ case "timeout":
803
+ throw new errors.LettaTimeoutError("Timeout exceeded when calling PATCH /v1/agents/{agent_id}/files/close-all.");
804
+ case "unknown":
805
+ throw new errors.LettaError({
806
+ message: _response.error.errorMessage,
807
+ });
808
+ }
809
+ });
810
+ }
811
+ /**
812
+ * Cancel runs associated with an agent. If run_ids are passed in, cancel those in particular.
813
+ *
814
+ * Note to cancel active runs associated with an agent, redis is required.
815
+ *
816
+ * @param {string} agentId
817
+ * @param {string[]} request
818
+ * @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
819
+ *
820
+ * @throws {@link Letta.UnprocessableEntityError}
821
+ *
822
+ * @example
823
+ * await client.agents.cancelAgentRun("agent_id", undefined)
824
+ */
825
+ cancelAgentRun(agentId, request, requestOptions) {
826
+ return __awaiter(this, void 0, void 0, function* () {
827
+ var _a, _b, _c;
828
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
829
+ url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/messages/cancel`),
830
+ method: "POST",
831
+ headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
832
+ ? yield core.Supplier.get(this._options.project)
833
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
834
+ contentType: "application/json",
835
+ requestType: "json",
836
+ body: request != null
837
+ ? serializers.agents.cancelAgentRun.Request.jsonOrThrow(request, {
838
+ unrecognizedObjectKeys: "strip",
839
+ })
840
+ : undefined,
841
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
842
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
843
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
844
+ });
845
+ if (_response.ok) {
846
+ return serializers.agents.cancelAgentRun.Response.parseOrThrow(_response.body, {
847
+ unrecognizedObjectKeys: "passthrough",
848
+ allowUnrecognizedUnionMembers: true,
849
+ allowUnrecognizedEnumValues: true,
850
+ skipValidation: true,
851
+ breadcrumbsPrefix: ["response"],
852
+ });
853
+ }
854
+ if (_response.error.reason === "status-code") {
855
+ switch (_response.error.statusCode) {
856
+ case 422:
857
+ throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
858
+ unrecognizedObjectKeys: "passthrough",
859
+ allowUnrecognizedUnionMembers: true,
860
+ allowUnrecognizedEnumValues: true,
861
+ skipValidation: true,
862
+ breadcrumbsPrefix: ["response"],
863
+ }));
864
+ default:
865
+ throw new errors.LettaError({
866
+ statusCode: _response.error.statusCode,
867
+ body: _response.error.body,
868
+ });
869
+ }
870
+ }
871
+ switch (_response.error.reason) {
872
+ case "non-json":
873
+ throw new errors.LettaError({
874
+ statusCode: _response.error.statusCode,
875
+ body: _response.error.rawBody,
876
+ });
877
+ case "timeout":
878
+ throw new errors.LettaTimeoutError("Timeout exceeded when calling POST /v1/agents/{agent_id}/messages/cancel.");
879
+ case "unknown":
880
+ throw new errors.LettaError({
881
+ message: _response.error.errorMessage,
882
+ });
883
+ }
884
+ });
885
+ }
741
886
  /**
742
887
  * Summarize an agent's conversation history to a target message length.
743
888
  *
@@ -766,7 +911,7 @@ class Agents {
766
911
  method: "POST",
767
912
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
768
913
  ? yield core.Supplier.get(this._options.project)
769
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.146", "User-Agent": "@letta-ai/letta-client/0.1.146", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
914
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
770
915
  contentType: "application/json",
771
916
  queryParameters: _queryParams,
772
917
  requestType: "json",
@@ -834,7 +979,7 @@ class Agents {
834
979
  method: "POST",
835
980
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
836
981
  ? yield core.Supplier.get(this._options.project)
837
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.146", "User-Agent": "@letta-ai/letta-client/0.1.146", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
982
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
838
983
  contentType: "application/json",
839
984
  requestType: "json",
840
985
  body: serializers.AgentsSearchRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -79,7 +79,7 @@ class Blocks {
79
79
  method: "GET",
80
80
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
81
81
  ? yield core.Supplier.get(this._options.project)
82
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.146", "User-Agent": "@letta-ai/letta-client/0.1.146", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
82
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
83
83
  contentType: "application/json",
84
84
  requestType: "json",
85
85
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -148,7 +148,7 @@ class Blocks {
148
148
  method: "PATCH",
149
149
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
150
150
  ? yield core.Supplier.get(this._options.project)
151
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.146", "User-Agent": "@letta-ai/letta-client/0.1.146", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
151
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
152
152
  contentType: "application/json",
153
153
  requestType: "json",
154
154
  body: serializers.BlockUpdate.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -216,7 +216,7 @@ class Blocks {
216
216
  method: "GET",
217
217
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
218
218
  ? yield core.Supplier.get(this._options.project)
219
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.146", "User-Agent": "@letta-ai/letta-client/0.1.146", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
219
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
220
220
  contentType: "application/json",
221
221
  requestType: "json",
222
222
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -284,7 +284,7 @@ class Blocks {
284
284
  method: "PATCH",
285
285
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
286
286
  ? yield core.Supplier.get(this._options.project)
287
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.146", "User-Agent": "@letta-ai/letta-client/0.1.146", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
287
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
288
288
  contentType: "application/json",
289
289
  requestType: "json",
290
290
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -352,7 +352,7 @@ class Blocks {
352
352
  method: "PATCH",
353
353
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
354
354
  ? yield core.Supplier.get(this._options.project)
355
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.146", "User-Agent": "@letta-ai/letta-client/0.1.146", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
355
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
356
356
  contentType: "application/json",
357
357
  requestType: "json",
358
358
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -78,7 +78,7 @@ class Context {
78
78
  method: "GET",
79
79
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
80
80
  ? yield core.Supplier.get(this._options.project)
81
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.146", "User-Agent": "@letta-ai/letta-client/0.1.146", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
81
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
82
82
  contentType: "application/json",
83
83
  requestType: "json",
84
84
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -79,7 +79,7 @@ class CoreMemory {
79
79
  method: "GET",
80
80
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
81
81
  ? yield core.Supplier.get(this._options.project)
82
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.146", "User-Agent": "@letta-ai/letta-client/0.1.146", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
82
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
83
83
  contentType: "application/json",
84
84
  requestType: "json",
85
85
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -84,7 +84,7 @@ class Groups {
84
84
  method: "GET",
85
85
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
86
86
  ? yield core.Supplier.get(this._options.project)
87
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.146", "User-Agent": "@letta-ai/letta-client/0.1.146", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
87
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
88
88
  contentType: "application/json",
89
89
  queryParameters: _queryParams,
90
90
  requestType: "json",
@@ -80,7 +80,7 @@ class MemoryVariables {
80
80
  method: "GET",
81
81
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
82
82
  ? yield core.Supplier.get(this._options.project)
83
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.146", "User-Agent": "@letta-ai/letta-client/0.1.146", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
83
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
84
84
  contentType: "application/json",
85
85
  requestType: "json",
86
86
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -91,6 +91,9 @@ export declare class Messages {
91
91
  * Asynchronously process a user message and return a run object.
92
92
  * The actual processing happens in the background, and the status can be checked using the run ID.
93
93
  *
94
+ * This is "asynchronous" in the sense that it's a background job and explicitly must be fetched by the run ID.
95
+ * This is more like `send_message_job`
96
+ *
94
97
  * @param {string} agentId
95
98
  * @param {Letta.agents.LettaAsyncRequest} request
96
99
  * @param {Messages.RequestOptions} requestOptions - Request-specific configuration.
@@ -102,7 +102,7 @@ class Messages {
102
102
  method: "GET",
103
103
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
104
104
  ? yield core.Supplier.get(this._options.project)
105
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.146", "User-Agent": "@letta-ai/letta-client/0.1.146", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
105
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
106
106
  contentType: "application/json",
107
107
  queryParameters: _queryParams,
108
108
  requestType: "json",
@@ -180,7 +180,7 @@ class Messages {
180
180
  method: "POST",
181
181
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
182
182
  ? yield core.Supplier.get(this._options.project)
183
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.146", "User-Agent": "@letta-ai/letta-client/0.1.146", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
183
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
184
184
  contentType: "application/json",
185
185
  requestType: "json",
186
186
  body: serializers.LettaRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -252,7 +252,7 @@ class Messages {
252
252
  method: "PATCH",
253
253
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
254
254
  ? yield core.Supplier.get(this._options.project)
255
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.146", "User-Agent": "@letta-ai/letta-client/0.1.146", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
255
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
256
256
  contentType: "application/json",
257
257
  requestType: "json",
258
258
  body: serializers.agents.MessagesModifyRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -314,7 +314,7 @@ class Messages {
314
314
  method: "POST",
315
315
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
316
316
  ? yield core.Supplier.get(this._options.project)
317
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.146", "User-Agent": "@letta-ai/letta-client/0.1.146", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
317
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
318
318
  contentType: "application/json",
319
319
  requestType: "json",
320
320
  body: serializers.LettaStreamingRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -378,6 +378,9 @@ class Messages {
378
378
  * Asynchronously process a user message and return a run object.
379
379
  * The actual processing happens in the background, and the status can be checked using the run ID.
380
380
  *
381
+ * This is "asynchronous" in the sense that it's a background job and explicitly must be fetched by the run ID.
382
+ * This is more like `send_message_job`
383
+ *
381
384
  * @param {string} agentId
382
385
  * @param {Letta.agents.LettaAsyncRequest} request
383
386
  * @param {Messages.RequestOptions} requestOptions - Request-specific configuration.
@@ -403,7 +406,7 @@ class Messages {
403
406
  method: "POST",
404
407
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
405
408
  ? yield core.Supplier.get(this._options.project)
406
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.146", "User-Agent": "@letta-ai/letta-client/0.1.146", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
409
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
407
410
  contentType: "application/json",
408
411
  requestType: "json",
409
412
  body: serializers.agents.LettaAsyncRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -477,7 +480,7 @@ class Messages {
477
480
  method: "PATCH",
478
481
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
479
482
  ? yield core.Supplier.get(this._options.project)
480
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.146", "User-Agent": "@letta-ai/letta-client/0.1.146", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
483
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
481
484
  contentType: "application/json",
482
485
  queryParameters: _queryParams,
483
486
  requestType: "json",
@@ -96,7 +96,7 @@ class Passages {
96
96
  method: "GET",
97
97
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
98
98
  ? yield core.Supplier.get(this._options.project)
99
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.146", "User-Agent": "@letta-ai/letta-client/0.1.146", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
99
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
100
100
  contentType: "application/json",
101
101
  queryParameters: _queryParams,
102
102
  requestType: "json",
@@ -167,7 +167,7 @@ class Passages {
167
167
  method: "POST",
168
168
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
169
169
  ? yield core.Supplier.get(this._options.project)
170
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.146", "User-Agent": "@letta-ai/letta-client/0.1.146", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
170
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
171
171
  contentType: "application/json",
172
172
  requestType: "json",
173
173
  body: serializers.agents.CreateArchivalMemory.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -236,7 +236,7 @@ class Passages {
236
236
  method: "DELETE",
237
237
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
238
238
  ? yield core.Supplier.get(this._options.project)
239
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.146", "User-Agent": "@letta-ai/letta-client/0.1.146", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
239
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
240
240
  contentType: "application/json",
241
241
  requestType: "json",
242
242
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -301,7 +301,7 @@ class Passages {
301
301
  method: "PATCH",
302
302
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
303
303
  ? yield core.Supplier.get(this._options.project)
304
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.146", "User-Agent": "@letta-ai/letta-client/0.1.146", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
304
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
305
305
  contentType: "application/json",
306
306
  requestType: "json",
307
307
  body: serializers.agents.PassageUpdate.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -79,7 +79,7 @@ class Sources {
79
79
  method: "PATCH",
80
80
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
81
81
  ? yield core.Supplier.get(this._options.project)
82
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.146", "User-Agent": "@letta-ai/letta-client/0.1.146", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
82
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
83
83
  contentType: "application/json",
84
84
  requestType: "json",
85
85
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -147,7 +147,7 @@ class Sources {
147
147
  method: "PATCH",
148
148
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
149
149
  ? yield core.Supplier.get(this._options.project)
150
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.146", "User-Agent": "@letta-ai/letta-client/0.1.146", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
150
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
151
151
  contentType: "application/json",
152
152
  requestType: "json",
153
153
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -214,7 +214,7 @@ class Sources {
214
214
  method: "GET",
215
215
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
216
216
  ? yield core.Supplier.get(this._options.project)
217
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.146", "User-Agent": "@letta-ai/letta-client/0.1.146", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
217
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
218
218
  contentType: "application/json",
219
219
  requestType: "json",
220
220
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -98,7 +98,7 @@ class Templates {
98
98
  method: "POST",
99
99
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
100
100
  ? yield core.Supplier.get(this._options.project)
101
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.146", "User-Agent": "@letta-ai/letta-client/0.1.146", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
101
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
102
102
  contentType: "application/json",
103
103
  queryParameters: _queryParams,
104
104
  requestType: "json",
@@ -167,7 +167,7 @@ class Templates {
167
167
  method: "POST",
168
168
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
169
169
  ? yield core.Supplier.get(this._options.project)
170
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.146", "User-Agent": "@letta-ai/letta-client/0.1.146", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
170
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
171
171
  contentType: "application/json",
172
172
  requestType: "json",
173
173
  body: serializers.agents.TemplatesMigrateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -242,7 +242,7 @@ class Templates {
242
242
  method: "POST",
243
243
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
244
244
  ? yield core.Supplier.get(this._options.project)
245
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.146", "User-Agent": "@letta-ai/letta-client/0.1.146", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
245
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
246
246
  contentType: "application/json",
247
247
  requestType: "json",
248
248
  body: serializers.agents.TemplatesCreateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),