@letta-ai/letta-client 0.1.143 → 0.1.145

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 (213) hide show
  1. package/Client.d.ts +4 -0
  2. package/README.md +1 -1
  3. package/api/resources/agents/client/Client.d.ts +4 -0
  4. package/api/resources/agents/client/Client.js +31 -23
  5. package/api/resources/agents/client/requests/CreateAgentRequest.d.ts +1 -2
  6. package/api/resources/agents/resources/blocks/client/Client.d.ts +4 -0
  7. package/api/resources/agents/resources/blocks/client/Client.js +15 -5
  8. package/api/resources/agents/resources/context/client/Client.d.ts +4 -0
  9. package/api/resources/agents/resources/context/client/Client.js +3 -1
  10. package/api/resources/agents/resources/coreMemory/client/Client.d.ts +4 -0
  11. package/api/resources/agents/resources/coreMemory/client/Client.js +3 -1
  12. package/api/resources/agents/resources/groups/client/Client.d.ts +4 -0
  13. package/api/resources/agents/resources/groups/client/Client.js +3 -1
  14. package/api/resources/agents/resources/memoryVariables/client/Client.d.ts +4 -0
  15. package/api/resources/agents/resources/memoryVariables/client/Client.js +3 -1
  16. package/api/resources/agents/resources/messages/client/Client.d.ts +4 -0
  17. package/api/resources/agents/resources/messages/client/Client.js +18 -6
  18. package/api/resources/agents/resources/passages/client/Client.d.ts +4 -0
  19. package/api/resources/agents/resources/passages/client/Client.js +12 -4
  20. package/api/resources/agents/resources/sources/client/Client.d.ts +4 -0
  21. package/api/resources/agents/resources/sources/client/Client.js +9 -3
  22. package/api/resources/agents/resources/templates/client/Client.d.ts +4 -0
  23. package/api/resources/agents/resources/templates/client/Client.js +9 -3
  24. package/api/resources/agents/resources/tools/client/Client.d.ts +4 -0
  25. package/api/resources/agents/resources/tools/client/Client.js +9 -3
  26. package/api/resources/batches/client/Client.d.ts +4 -0
  27. package/api/resources/batches/client/Client.js +12 -4
  28. package/api/resources/blocks/client/Client.d.ts +4 -0
  29. package/api/resources/blocks/client/Client.js +18 -6
  30. package/api/resources/blocks/resources/agents/client/Client.d.ts +4 -0
  31. package/api/resources/blocks/resources/agents/client/Client.js +3 -1
  32. package/api/resources/clientSideAccessTokens/client/Client.d.ts +4 -0
  33. package/api/resources/clientSideAccessTokens/client/Client.js +6 -2
  34. package/api/resources/embeddingModels/client/Client.d.ts +4 -0
  35. package/api/resources/embeddingModels/client/Client.js +3 -1
  36. package/api/resources/groups/client/Client.d.ts +4 -0
  37. package/api/resources/groups/client/Client.js +20 -21
  38. package/api/resources/groups/client/requests/GroupCreate.d.ts +0 -1
  39. package/api/resources/groups/client/requests/GroupUpdate.d.ts +0 -1
  40. package/api/resources/groups/resources/messages/client/Client.d.ts +4 -0
  41. package/api/resources/groups/resources/messages/client/Client.js +15 -5
  42. package/api/resources/health/client/Client.d.ts +4 -0
  43. package/api/resources/health/client/Client.js +3 -1
  44. package/api/resources/identities/client/Client.d.ts +4 -0
  45. package/api/resources/identities/client/Client.js +23 -22
  46. package/api/resources/identities/client/requests/IdentityCreate.d.ts +0 -1
  47. package/api/resources/identities/client/requests/IdentityUpsert.d.ts +0 -1
  48. package/api/resources/identities/resources/properties/client/Client.d.ts +4 -0
  49. package/api/resources/identities/resources/properties/client/Client.js +3 -1
  50. package/api/resources/jobs/client/Client.d.ts +4 -0
  51. package/api/resources/jobs/client/Client.js +12 -4
  52. package/api/resources/messages/client/Client.d.ts +4 -0
  53. package/api/resources/messages/client/Client.js +3 -1
  54. package/api/resources/models/client/Client.d.ts +4 -0
  55. package/api/resources/models/client/Client.js +3 -1
  56. package/api/resources/projects/client/Client.d.ts +4 -0
  57. package/api/resources/projects/client/Client.js +3 -1
  58. package/api/resources/providers/client/Client.d.ts +4 -0
  59. package/api/resources/providers/client/Client.js +15 -5
  60. package/api/resources/runs/client/Client.d.ts +4 -0
  61. package/api/resources/runs/client/Client.js +12 -4
  62. package/api/resources/runs/resources/messages/client/Client.d.ts +4 -0
  63. package/api/resources/runs/resources/messages/client/Client.js +3 -1
  64. package/api/resources/runs/resources/steps/client/Client.d.ts +4 -0
  65. package/api/resources/runs/resources/steps/client/Client.js +3 -1
  66. package/api/resources/runs/resources/usage/client/Client.d.ts +4 -0
  67. package/api/resources/runs/resources/usage/client/Client.js +3 -1
  68. package/api/resources/sources/client/Client.d.ts +4 -0
  69. package/api/resources/sources/client/Client.js +24 -8
  70. package/api/resources/sources/resources/files/client/Client.d.ts +4 -0
  71. package/api/resources/sources/resources/files/client/Client.js +9 -3
  72. package/api/resources/sources/resources/passages/client/Client.d.ts +4 -0
  73. package/api/resources/sources/resources/passages/client/Client.js +3 -1
  74. package/api/resources/steps/client/Client.d.ts +4 -13
  75. package/api/resources/steps/client/Client.js +6 -74
  76. package/api/resources/steps/client/requests/index.d.ts +0 -1
  77. package/api/resources/steps/resources/feedback/client/Client.d.ts +12 -2
  78. package/api/resources/steps/resources/feedback/client/Client.js +43 -11
  79. package/api/resources/steps/resources/feedback/client/index.d.ts +1 -1
  80. package/api/resources/steps/resources/feedback/client/index.js +15 -0
  81. package/api/resources/steps/{client/requests/AddFeedbackRequest.d.ts → resources/feedback/client/requests/FeedbackCreateRequest.d.ts} +2 -2
  82. package/api/resources/steps/resources/feedback/client/requests/index.d.ts +1 -0
  83. package/api/resources/steps/resources/feedback/client/requests/index.js +2 -0
  84. package/api/resources/steps/resources/index.d.ts +1 -0
  85. package/api/resources/steps/resources/index.js +4 -0
  86. package/api/resources/tags/client/Client.d.ts +4 -0
  87. package/api/resources/tags/client/Client.js +3 -1
  88. package/api/resources/telemetry/client/Client.d.ts +4 -0
  89. package/api/resources/telemetry/client/Client.js +3 -1
  90. package/api/resources/templates/client/Client.d.ts +4 -0
  91. package/api/resources/templates/client/Client.js +3 -1
  92. package/api/resources/templates/resources/agents/client/Client.d.ts +4 -0
  93. package/api/resources/templates/resources/agents/client/Client.js +3 -1
  94. package/api/resources/tools/client/Client.d.ts +4 -0
  95. package/api/resources/tools/client/Client.js +57 -19
  96. package/api/resources/voice/client/Client.d.ts +4 -0
  97. package/api/resources/voice/client/Client.js +3 -1
  98. package/dist/Client.d.ts +4 -0
  99. package/dist/api/resources/agents/client/Client.d.ts +4 -0
  100. package/dist/api/resources/agents/client/Client.js +31 -23
  101. package/dist/api/resources/agents/client/requests/CreateAgentRequest.d.ts +1 -2
  102. package/dist/api/resources/agents/resources/blocks/client/Client.d.ts +4 -0
  103. package/dist/api/resources/agents/resources/blocks/client/Client.js +15 -5
  104. package/dist/api/resources/agents/resources/context/client/Client.d.ts +4 -0
  105. package/dist/api/resources/agents/resources/context/client/Client.js +3 -1
  106. package/dist/api/resources/agents/resources/coreMemory/client/Client.d.ts +4 -0
  107. package/dist/api/resources/agents/resources/coreMemory/client/Client.js +3 -1
  108. package/dist/api/resources/agents/resources/groups/client/Client.d.ts +4 -0
  109. package/dist/api/resources/agents/resources/groups/client/Client.js +3 -1
  110. package/dist/api/resources/agents/resources/memoryVariables/client/Client.d.ts +4 -0
  111. package/dist/api/resources/agents/resources/memoryVariables/client/Client.js +3 -1
  112. package/dist/api/resources/agents/resources/messages/client/Client.d.ts +4 -0
  113. package/dist/api/resources/agents/resources/messages/client/Client.js +18 -6
  114. package/dist/api/resources/agents/resources/passages/client/Client.d.ts +4 -0
  115. package/dist/api/resources/agents/resources/passages/client/Client.js +12 -4
  116. package/dist/api/resources/agents/resources/sources/client/Client.d.ts +4 -0
  117. package/dist/api/resources/agents/resources/sources/client/Client.js +9 -3
  118. package/dist/api/resources/agents/resources/templates/client/Client.d.ts +4 -0
  119. package/dist/api/resources/agents/resources/templates/client/Client.js +9 -3
  120. package/dist/api/resources/agents/resources/tools/client/Client.d.ts +4 -0
  121. package/dist/api/resources/agents/resources/tools/client/Client.js +9 -3
  122. package/dist/api/resources/batches/client/Client.d.ts +4 -0
  123. package/dist/api/resources/batches/client/Client.js +12 -4
  124. package/dist/api/resources/blocks/client/Client.d.ts +4 -0
  125. package/dist/api/resources/blocks/client/Client.js +18 -6
  126. package/dist/api/resources/blocks/resources/agents/client/Client.d.ts +4 -0
  127. package/dist/api/resources/blocks/resources/agents/client/Client.js +3 -1
  128. package/dist/api/resources/clientSideAccessTokens/client/Client.d.ts +4 -0
  129. package/dist/api/resources/clientSideAccessTokens/client/Client.js +6 -2
  130. package/dist/api/resources/embeddingModels/client/Client.d.ts +4 -0
  131. package/dist/api/resources/embeddingModels/client/Client.js +3 -1
  132. package/dist/api/resources/groups/client/Client.d.ts +4 -0
  133. package/dist/api/resources/groups/client/Client.js +20 -21
  134. package/dist/api/resources/groups/client/requests/GroupCreate.d.ts +0 -1
  135. package/dist/api/resources/groups/client/requests/GroupUpdate.d.ts +0 -1
  136. package/dist/api/resources/groups/resources/messages/client/Client.d.ts +4 -0
  137. package/dist/api/resources/groups/resources/messages/client/Client.js +15 -5
  138. package/dist/api/resources/health/client/Client.d.ts +4 -0
  139. package/dist/api/resources/health/client/Client.js +3 -1
  140. package/dist/api/resources/identities/client/Client.d.ts +4 -0
  141. package/dist/api/resources/identities/client/Client.js +23 -22
  142. package/dist/api/resources/identities/client/requests/IdentityCreate.d.ts +0 -1
  143. package/dist/api/resources/identities/client/requests/IdentityUpsert.d.ts +0 -1
  144. package/dist/api/resources/identities/resources/properties/client/Client.d.ts +4 -0
  145. package/dist/api/resources/identities/resources/properties/client/Client.js +3 -1
  146. package/dist/api/resources/jobs/client/Client.d.ts +4 -0
  147. package/dist/api/resources/jobs/client/Client.js +12 -4
  148. package/dist/api/resources/messages/client/Client.d.ts +4 -0
  149. package/dist/api/resources/messages/client/Client.js +3 -1
  150. package/dist/api/resources/models/client/Client.d.ts +4 -0
  151. package/dist/api/resources/models/client/Client.js +3 -1
  152. package/dist/api/resources/projects/client/Client.d.ts +4 -0
  153. package/dist/api/resources/projects/client/Client.js +3 -1
  154. package/dist/api/resources/providers/client/Client.d.ts +4 -0
  155. package/dist/api/resources/providers/client/Client.js +15 -5
  156. package/dist/api/resources/runs/client/Client.d.ts +4 -0
  157. package/dist/api/resources/runs/client/Client.js +12 -4
  158. package/dist/api/resources/runs/resources/messages/client/Client.d.ts +4 -0
  159. package/dist/api/resources/runs/resources/messages/client/Client.js +3 -1
  160. package/dist/api/resources/runs/resources/steps/client/Client.d.ts +4 -0
  161. package/dist/api/resources/runs/resources/steps/client/Client.js +3 -1
  162. package/dist/api/resources/runs/resources/usage/client/Client.d.ts +4 -0
  163. package/dist/api/resources/runs/resources/usage/client/Client.js +3 -1
  164. package/dist/api/resources/sources/client/Client.d.ts +4 -0
  165. package/dist/api/resources/sources/client/Client.js +24 -8
  166. package/dist/api/resources/sources/resources/files/client/Client.d.ts +4 -0
  167. package/dist/api/resources/sources/resources/files/client/Client.js +9 -3
  168. package/dist/api/resources/sources/resources/passages/client/Client.d.ts +4 -0
  169. package/dist/api/resources/sources/resources/passages/client/Client.js +3 -1
  170. package/dist/api/resources/steps/client/Client.d.ts +4 -13
  171. package/dist/api/resources/steps/client/Client.js +6 -74
  172. package/dist/api/resources/steps/client/requests/index.d.ts +0 -1
  173. package/dist/api/resources/steps/resources/feedback/client/Client.d.ts +12 -2
  174. package/dist/api/resources/steps/resources/feedback/client/Client.js +43 -11
  175. package/dist/api/resources/steps/resources/feedback/client/index.d.ts +1 -1
  176. package/dist/api/resources/steps/resources/feedback/client/index.js +15 -0
  177. package/dist/api/resources/steps/{client/requests/AddFeedbackRequest.d.ts → resources/feedback/client/requests/FeedbackCreateRequest.d.ts} +2 -2
  178. package/dist/api/resources/steps/resources/feedback/client/requests/index.d.ts +1 -0
  179. package/dist/api/resources/steps/resources/feedback/client/requests/index.js +2 -0
  180. package/dist/api/resources/steps/resources/index.d.ts +1 -0
  181. package/dist/api/resources/steps/resources/index.js +4 -0
  182. package/dist/api/resources/tags/client/Client.d.ts +4 -0
  183. package/dist/api/resources/tags/client/Client.js +3 -1
  184. package/dist/api/resources/telemetry/client/Client.d.ts +4 -0
  185. package/dist/api/resources/telemetry/client/Client.js +3 -1
  186. package/dist/api/resources/templates/client/Client.d.ts +4 -0
  187. package/dist/api/resources/templates/client/Client.js +3 -1
  188. package/dist/api/resources/templates/resources/agents/client/Client.d.ts +4 -0
  189. package/dist/api/resources/templates/resources/agents/client/Client.js +3 -1
  190. package/dist/api/resources/tools/client/Client.d.ts +4 -0
  191. package/dist/api/resources/tools/client/Client.js +57 -19
  192. package/dist/api/resources/voice/client/Client.d.ts +4 -0
  193. package/dist/api/resources/voice/client/Client.js +3 -1
  194. package/dist/serialization/resources/agents/client/requests/CreateAgentRequest.d.ts +1 -1
  195. package/dist/serialization/resources/agents/client/requests/CreateAgentRequest.js +1 -1
  196. package/dist/serialization/resources/groups/client/requests/GroupCreate.d.ts +1 -1
  197. package/dist/serialization/resources/groups/client/requests/GroupUpdate.d.ts +1 -1
  198. package/dist/serialization/resources/identities/client/requests/IdentityCreate.d.ts +1 -1
  199. package/dist/serialization/resources/identities/client/requests/IdentityUpsert.d.ts +1 -1
  200. package/dist/version.d.ts +1 -1
  201. package/dist/version.js +1 -1
  202. package/package.json +1 -1
  203. package/reference.md +25 -73
  204. package/serialization/resources/agents/client/requests/CreateAgentRequest.d.ts +1 -1
  205. package/serialization/resources/agents/client/requests/CreateAgentRequest.js +1 -1
  206. package/serialization/resources/groups/client/requests/GroupCreate.d.ts +1 -1
  207. package/serialization/resources/groups/client/requests/GroupUpdate.d.ts +1 -1
  208. package/serialization/resources/identities/client/requests/IdentityCreate.d.ts +1 -1
  209. package/serialization/resources/identities/client/requests/IdentityUpsert.d.ts +1 -1
  210. package/version.d.ts +1 -1
  211. package/version.js +1 -1
  212. /package/api/resources/steps/{client/requests/AddFeedbackRequest.js → resources/feedback/client/requests/FeedbackCreateRequest.js} +0 -0
  213. /package/dist/api/resources/steps/{client/requests/AddFeedbackRequest.js → resources/feedback/client/requests/FeedbackCreateRequest.js} +0 -0
@@ -130,7 +130,9 @@ class Steps {
130
130
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
131
131
  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/steps/"),
132
132
  method: "GET",
133
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.143", "User-Agent": "@letta-ai/letta-client/0.1.143", "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),
133
+ headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
134
+ ? yield core.Supplier.get(this._options.project)
135
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.145", "User-Agent": "@letta-ai/letta-client/0.1.145", "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),
134
136
  contentType: "application/json",
135
137
  queryParameters: _queryParams,
136
138
  requestType: "json",
@@ -196,7 +198,9 @@ class Steps {
196
198
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
197
199
  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/steps/${encodeURIComponent(stepId)}`),
198
200
  method: "GET",
199
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.143", "User-Agent": "@letta-ai/letta-client/0.1.143", "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),
201
+ headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
202
+ ? yield core.Supplier.get(this._options.project)
203
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.145", "User-Agent": "@letta-ai/letta-client/0.1.145", "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),
200
204
  contentType: "application/json",
201
205
  requestType: "json",
202
206
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -244,78 +248,6 @@ class Steps {
244
248
  }
245
249
  });
246
250
  }
247
- /**
248
- * Add feedback to a step.
249
- *
250
- * @param {string} stepId
251
- * @param {Letta.AddFeedbackRequest} request
252
- * @param {Steps.RequestOptions} requestOptions - Request-specific configuration.
253
- *
254
- * @throws {@link Letta.UnprocessableEntityError}
255
- *
256
- * @example
257
- * await client.steps.addFeedback("step_id")
258
- */
259
- addFeedback(stepId_1) {
260
- return __awaiter(this, arguments, void 0, function* (stepId, request = {}, requestOptions) {
261
- var _a, _b, _c;
262
- const { feedback } = request;
263
- const _queryParams = {};
264
- if (feedback != null) {
265
- _queryParams["feedback"] = feedback;
266
- }
267
- const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
268
- 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/steps/${encodeURIComponent(stepId)}/feedback`),
269
- method: "PATCH",
270
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.143", "User-Agent": "@letta-ai/letta-client/0.1.143", "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),
271
- contentType: "application/json",
272
- queryParameters: _queryParams,
273
- requestType: "json",
274
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
275
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
276
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
277
- });
278
- if (_response.ok) {
279
- return serializers.Step.parseOrThrow(_response.body, {
280
- unrecognizedObjectKeys: "passthrough",
281
- allowUnrecognizedUnionMembers: true,
282
- allowUnrecognizedEnumValues: true,
283
- skipValidation: true,
284
- breadcrumbsPrefix: ["response"],
285
- });
286
- }
287
- if (_response.error.reason === "status-code") {
288
- switch (_response.error.statusCode) {
289
- case 422:
290
- throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
291
- unrecognizedObjectKeys: "passthrough",
292
- allowUnrecognizedUnionMembers: true,
293
- allowUnrecognizedEnumValues: true,
294
- skipValidation: true,
295
- breadcrumbsPrefix: ["response"],
296
- }));
297
- default:
298
- throw new errors.LettaError({
299
- statusCode: _response.error.statusCode,
300
- body: _response.error.body,
301
- });
302
- }
303
- }
304
- switch (_response.error.reason) {
305
- case "non-json":
306
- throw new errors.LettaError({
307
- statusCode: _response.error.statusCode,
308
- body: _response.error.rawBody,
309
- });
310
- case "timeout":
311
- throw new errors.LettaTimeoutError("Timeout exceeded when calling PATCH /v1/steps/{step_id}/feedback.");
312
- case "unknown":
313
- throw new errors.LettaError({
314
- message: _response.error.errorMessage,
315
- });
316
- }
317
- });
318
- }
319
251
  _getCustomAuthorizationHeaders() {
320
252
  return __awaiter(this, void 0, void 0, function* () {
321
253
  const tokenValue = yield core.Supplier.get(this._options.token);
@@ -1,2 +1 @@
1
1
  export { type StepsListRequest } from "./StepsListRequest";
2
- export { type AddFeedbackRequest } from "./AddFeedbackRequest";
@@ -3,12 +3,15 @@
3
3
  */
4
4
  import * as environments from "../../../../../../environments";
5
5
  import * as core from "../../../../../../core";
6
+ import * as Letta from "../../../../../index";
6
7
  export declare namespace Feedback {
7
8
  interface Options {
8
9
  environment?: core.Supplier<environments.LettaEnvironment | string>;
9
10
  /** Specify a custom URL to connect the client to. */
10
11
  baseUrl?: core.Supplier<string>;
11
12
  token?: core.Supplier<string | undefined>;
13
+ /** Override the X-Project header */
14
+ project?: core.Supplier<string | undefined>;
12
15
  fetcher?: core.FetchFunction;
13
16
  }
14
17
  interface RequestOptions {
@@ -18,6 +21,8 @@ export declare namespace Feedback {
18
21
  maxRetries?: number;
19
22
  /** A hook to abort the request. */
20
23
  abortSignal?: AbortSignal;
24
+ /** Override the X-Project header */
25
+ project?: string | undefined;
21
26
  /** Additional headers to include in the request. */
22
27
  headers?: Record<string, string>;
23
28
  }
@@ -26,13 +31,18 @@ export declare class Feedback {
26
31
  protected readonly _options: Feedback.Options;
27
32
  constructor(_options?: Feedback.Options);
28
33
  /**
34
+ * Add feedback to a step.
35
+ *
29
36
  * @param {string} stepId
37
+ * @param {Letta.steps.FeedbackCreateRequest} request
30
38
  * @param {Feedback.RequestOptions} requestOptions - Request-specific configuration.
31
39
  *
40
+ * @throws {@link Letta.UnprocessableEntityError}
41
+ *
32
42
  * @example
33
- * await client.steps.feedback.add("step_id")
43
+ * await client.steps.feedback.create("step_id")
34
44
  */
35
- add(stepId: string, requestOptions?: Feedback.RequestOptions): Promise<void>;
45
+ create(stepId: string, request?: Letta.steps.FeedbackCreateRequest, requestOptions?: Feedback.RequestOptions): Promise<Letta.Step>;
36
46
  protected _getCustomAuthorizationHeaders(): Promise<{
37
47
  Authorization: string;
38
48
  }>;
@@ -51,40 +51,72 @@ Object.defineProperty(exports, "__esModule", { value: true });
51
51
  exports.Feedback = void 0;
52
52
  const environments = __importStar(require("../../../../../../environments"));
53
53
  const core = __importStar(require("../../../../../../core"));
54
+ const Letta = __importStar(require("../../../../../index"));
54
55
  const url_join_1 = __importDefault(require("url-join"));
56
+ const serializers = __importStar(require("../../../../../../serialization/index"));
55
57
  const errors = __importStar(require("../../../../../../errors/index"));
56
58
  class Feedback {
57
59
  constructor(_options = {}) {
58
60
  this._options = _options;
59
61
  }
60
62
  /**
63
+ * Add feedback to a step.
64
+ *
61
65
  * @param {string} stepId
66
+ * @param {Letta.steps.FeedbackCreateRequest} request
62
67
  * @param {Feedback.RequestOptions} requestOptions - Request-specific configuration.
63
68
  *
69
+ * @throws {@link Letta.UnprocessableEntityError}
70
+ *
64
71
  * @example
65
- * await client.steps.feedback.add("step_id")
72
+ * await client.steps.feedback.create("step_id")
66
73
  */
67
- add(stepId, requestOptions) {
68
- return __awaiter(this, void 0, void 0, function* () {
74
+ create(stepId_1) {
75
+ return __awaiter(this, arguments, void 0, function* (stepId, request = {}, requestOptions) {
69
76
  var _a, _b, _c;
77
+ const { feedback } = request;
78
+ const _queryParams = {};
79
+ if (feedback != null) {
80
+ _queryParams["feedback"] = feedback;
81
+ }
70
82
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
71
83
  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/steps/${encodeURIComponent(stepId)}/feedback`),
72
- method: "POST",
73
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.143", "User-Agent": "@letta-ai/letta-client/0.1.143", "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
+ method: "PATCH",
85
+ headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
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.145", "User-Agent": "@letta-ai/letta-client/0.1.145", "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),
74
88
  contentType: "application/json",
89
+ queryParameters: _queryParams,
75
90
  requestType: "json",
76
91
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
77
92
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
78
93
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
79
94
  });
80
95
  if (_response.ok) {
81
- return;
96
+ return serializers.Step.parseOrThrow(_response.body, {
97
+ unrecognizedObjectKeys: "passthrough",
98
+ allowUnrecognizedUnionMembers: true,
99
+ allowUnrecognizedEnumValues: true,
100
+ skipValidation: true,
101
+ breadcrumbsPrefix: ["response"],
102
+ });
82
103
  }
83
104
  if (_response.error.reason === "status-code") {
84
- throw new errors.LettaError({
85
- statusCode: _response.error.statusCode,
86
- body: _response.error.body,
87
- });
105
+ switch (_response.error.statusCode) {
106
+ case 422:
107
+ throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
108
+ unrecognizedObjectKeys: "passthrough",
109
+ allowUnrecognizedUnionMembers: true,
110
+ allowUnrecognizedEnumValues: true,
111
+ skipValidation: true,
112
+ breadcrumbsPrefix: ["response"],
113
+ }));
114
+ default:
115
+ throw new errors.LettaError({
116
+ statusCode: _response.error.statusCode,
117
+ body: _response.error.body,
118
+ });
119
+ }
88
120
  }
89
121
  switch (_response.error.reason) {
90
122
  case "non-json":
@@ -93,7 +125,7 @@ class Feedback {
93
125
  body: _response.error.rawBody,
94
126
  });
95
127
  case "timeout":
96
- throw new errors.LettaTimeoutError("Timeout exceeded when calling POST /v1/steps/{step_id}/feedback.");
128
+ throw new errors.LettaTimeoutError("Timeout exceeded when calling PATCH /v1/steps/{step_id}/feedback.");
97
129
  case "unknown":
98
130
  throw new errors.LettaError({
99
131
  message: _response.error.errorMessage,
@@ -1 +1 @@
1
- export {};
1
+ export * from "./requests";
@@ -1,2 +1,17 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
2
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./requests"), exports);
@@ -1,11 +1,11 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- import * as Letta from "../../../../index";
4
+ import * as Letta from "../../../../../../index";
5
5
  /**
6
6
  * @example
7
7
  * {}
8
8
  */
9
- export interface AddFeedbackRequest {
9
+ export interface FeedbackCreateRequest {
10
10
  feedback?: Letta.FeedbackType;
11
11
  }
@@ -0,0 +1 @@
1
+ export { type FeedbackCreateRequest } from "./FeedbackCreateRequest";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1 +1,2 @@
1
1
  export * as feedback from "./feedback";
2
+ export * from "./feedback/client/requests";
@@ -32,6 +32,10 @@ var __importStar = (this && this.__importStar) || (function () {
32
32
  return result;
33
33
  };
34
34
  })();
35
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
36
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
37
+ };
35
38
  Object.defineProperty(exports, "__esModule", { value: true });
36
39
  exports.feedback = void 0;
37
40
  exports.feedback = __importStar(require("./feedback"));
41
+ __exportStar(require("./feedback/client/requests"), exports);
@@ -10,6 +10,8 @@ export declare namespace Tags {
10
10
  /** Specify a custom URL to connect the client to. */
11
11
  baseUrl?: core.Supplier<string>;
12
12
  token?: core.Supplier<string | undefined>;
13
+ /** Override the X-Project header */
14
+ project?: core.Supplier<string | undefined>;
13
15
  fetcher?: core.FetchFunction;
14
16
  }
15
17
  interface RequestOptions {
@@ -19,6 +21,8 @@ export declare namespace Tags {
19
21
  maxRetries?: number;
20
22
  /** A hook to abort the request. */
21
23
  abortSignal?: AbortSignal;
24
+ /** Override the X-Project header */
25
+ project?: string | undefined;
22
26
  /** Additional headers to include in the request. */
23
27
  headers?: Record<string, string>;
24
28
  }
@@ -87,7 +87,9 @@ class Tags {
87
87
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
88
88
  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/tags/"),
89
89
  method: "GET",
90
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.143", "User-Agent": "@letta-ai/letta-client/0.1.143", "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),
90
+ headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
91
+ ? yield core.Supplier.get(this._options.project)
92
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.145", "User-Agent": "@letta-ai/letta-client/0.1.145", "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),
91
93
  contentType: "application/json",
92
94
  queryParameters: _queryParams,
93
95
  requestType: "json",
@@ -10,6 +10,8 @@ export declare namespace Telemetry {
10
10
  /** Specify a custom URL to connect the client to. */
11
11
  baseUrl?: core.Supplier<string>;
12
12
  token?: core.Supplier<string | undefined>;
13
+ /** Override the X-Project header */
14
+ project?: core.Supplier<string | undefined>;
13
15
  fetcher?: core.FetchFunction;
14
16
  }
15
17
  interface RequestOptions {
@@ -19,6 +21,8 @@ export declare namespace Telemetry {
19
21
  maxRetries?: number;
20
22
  /** A hook to abort the request. */
21
23
  abortSignal?: AbortSignal;
24
+ /** Override the X-Project header */
25
+ project?: string | undefined;
22
26
  /** Additional headers to include in the request. */
23
27
  headers?: Record<string, string>;
24
28
  }
@@ -74,7 +74,9 @@ class Telemetry {
74
74
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
75
75
  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/telemetry/${encodeURIComponent(stepId)}`),
76
76
  method: "GET",
77
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.143", "User-Agent": "@letta-ai/letta-client/0.1.143", "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),
77
+ headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
78
+ ? yield core.Supplier.get(this._options.project)
79
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.145", "User-Agent": "@letta-ai/letta-client/0.1.145", "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),
78
80
  contentType: "application/json",
79
81
  requestType: "json",
80
82
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -11,6 +11,8 @@ export declare namespace Templates {
11
11
  /** Specify a custom URL to connect the client to. */
12
12
  baseUrl?: core.Supplier<string>;
13
13
  token?: core.Supplier<string | undefined>;
14
+ /** Override the X-Project header */
15
+ project?: core.Supplier<string | undefined>;
14
16
  fetcher?: core.FetchFunction;
15
17
  }
16
18
  interface RequestOptions {
@@ -20,6 +22,8 @@ export declare namespace Templates {
20
22
  maxRetries?: number;
21
23
  /** A hook to abort the request. */
22
24
  abortSignal?: AbortSignal;
25
+ /** Override the X-Project header */
26
+ project?: string | undefined;
23
27
  /** Additional headers to include in the request. */
24
28
  headers?: Record<string, string>;
25
29
  }
@@ -92,7 +92,9 @@ class Templates {
92
92
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
93
93
  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/templates"),
94
94
  method: "GET",
95
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.143", "User-Agent": "@letta-ai/letta-client/0.1.143", "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),
95
+ headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
96
+ ? yield core.Supplier.get(this._options.project)
97
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.145", "User-Agent": "@letta-ai/letta-client/0.1.145", "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),
96
98
  contentType: "application/json",
97
99
  queryParameters: _queryParams,
98
100
  requestType: "json",
@@ -10,6 +10,8 @@ export declare namespace Agents {
10
10
  /** Specify a custom URL to connect the client to. */
11
11
  baseUrl?: core.Supplier<string>;
12
12
  token?: core.Supplier<string | undefined>;
13
+ /** Override the X-Project header */
14
+ project?: core.Supplier<string | undefined>;
13
15
  fetcher?: core.FetchFunction;
14
16
  }
15
17
  interface RequestOptions {
@@ -19,6 +21,8 @@ export declare namespace Agents {
19
21
  maxRetries?: number;
20
22
  /** A hook to abort the request. */
21
23
  abortSignal?: AbortSignal;
24
+ /** Override the X-Project header */
25
+ project?: string | undefined;
22
26
  /** Additional headers to include in the request. */
23
27
  headers?: Record<string, string>;
24
28
  }
@@ -78,7 +78,9 @@ class Agents {
78
78
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
79
79
  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/templates/${encodeURIComponent(project)}/${encodeURIComponent(templateVersion)}/agents`),
80
80
  method: "POST",
81
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.143", "User-Agent": "@letta-ai/letta-client/0.1.143", "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
+ headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
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.145", "User-Agent": "@letta-ai/letta-client/0.1.145", "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
84
  contentType: "application/json",
83
85
  requestType: "json",
84
86
  body: serializers.templates.AgentsCreateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -10,6 +10,8 @@ export declare namespace Tools {
10
10
  /** Specify a custom URL to connect the client to. */
11
11
  baseUrl?: core.Supplier<string>;
12
12
  token?: core.Supplier<string | undefined>;
13
+ /** Override the X-Project header */
14
+ project?: core.Supplier<string | undefined>;
13
15
  fetcher?: core.FetchFunction;
14
16
  }
15
17
  interface RequestOptions {
@@ -19,6 +21,8 @@ export declare namespace Tools {
19
21
  maxRetries?: number;
20
22
  /** A hook to abort the request. */
21
23
  abortSignal?: AbortSignal;
24
+ /** Override the X-Project header */
25
+ project?: string | undefined;
22
26
  /** Additional headers to include in the request. */
23
27
  headers?: Record<string, string>;
24
28
  }