@letta-ai/letta-client 0.1.38 → 0.1.40

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 (140) hide show
  1. package/api/resources/agents/client/Client.d.ts +6 -3
  2. package/api/resources/agents/client/Client.js +25 -17
  3. package/api/resources/agents/client/requests/AgentsListRequest.d.ts +4 -0
  4. package/api/resources/agents/resources/blocks/client/Client.d.ts +97 -0
  5. package/api/resources/agents/resources/blocks/client/Client.js +400 -0
  6. package/api/resources/agents/resources/blocks/client/index.d.ts +1 -0
  7. package/api/resources/agents/resources/context/client/Client.js +1 -1
  8. package/api/resources/agents/resources/coreMemory/client/Client.d.ts +0 -65
  9. package/api/resources/agents/resources/coreMemory/client/Client.js +1 -332
  10. package/api/resources/agents/resources/index.d.ts +3 -2
  11. package/api/resources/agents/resources/index.js +4 -3
  12. package/api/resources/agents/resources/memoryVariables/client/Client.js +1 -1
  13. package/api/resources/agents/resources/messages/client/Client.js +5 -5
  14. package/api/resources/agents/resources/{archivalMemory → passages}/client/Client.d.ts +14 -14
  15. package/{dist/api/resources/agents/resources/archivalMemory → api/resources/agents/resources/passages}/client/Client.js +15 -15
  16. package/api/resources/agents/resources/{archivalMemory/client/requests/ArchivalMemoryListRequest.d.ts → passages/client/requests/PassagesListRequest.d.ts} +1 -1
  17. package/api/resources/agents/resources/passages/client/requests/index.d.ts +2 -0
  18. package/api/resources/agents/resources/sources/client/Client.js +3 -3
  19. package/api/resources/agents/resources/templates/client/Client.js +3 -3
  20. package/api/resources/agents/resources/tools/client/Client.js +3 -3
  21. package/api/resources/blocks/client/Client.js +6 -6
  22. package/api/resources/health/client/Client.js +1 -1
  23. package/api/resources/identities/client/Client.js +6 -6
  24. package/api/resources/jobs/client/Client.js +4 -4
  25. package/api/resources/models/client/Client.js +2 -2
  26. package/api/resources/providers/client/Client.js +4 -4
  27. package/api/resources/runs/client/Client.js +6 -6
  28. package/api/resources/sources/client/Client.js +6 -6
  29. package/api/resources/sources/resources/files/client/Client.js +3 -3
  30. package/api/resources/sources/resources/passages/client/Client.js +1 -1
  31. package/api/resources/steps/client/Client.js +2 -2
  32. package/api/resources/tag/client/Client.js +1 -1
  33. package/api/resources/templates/client/Client.js +1 -1
  34. package/api/resources/tools/client/Client.js +11 -11
  35. package/dist/api/resources/agents/client/Client.d.ts +6 -3
  36. package/dist/api/resources/agents/client/Client.js +25 -17
  37. package/dist/api/resources/agents/client/requests/AgentsListRequest.d.ts +4 -0
  38. package/dist/api/resources/agents/resources/blocks/client/Client.d.ts +97 -0
  39. package/dist/api/resources/agents/resources/blocks/client/Client.js +400 -0
  40. package/dist/api/resources/agents/resources/blocks/client/index.d.ts +1 -0
  41. package/dist/api/resources/agents/resources/blocks/client/index.js +2 -0
  42. package/dist/api/resources/agents/resources/context/client/Client.js +1 -1
  43. package/dist/api/resources/agents/resources/coreMemory/client/Client.d.ts +0 -65
  44. package/dist/api/resources/agents/resources/coreMemory/client/Client.js +1 -332
  45. package/dist/api/resources/agents/resources/index.d.ts +3 -2
  46. package/dist/api/resources/agents/resources/index.js +4 -3
  47. package/dist/api/resources/agents/resources/memoryVariables/client/Client.js +1 -1
  48. package/dist/api/resources/agents/resources/messages/client/Client.js +5 -5
  49. package/dist/api/resources/agents/resources/{archivalMemory → passages}/client/Client.d.ts +14 -14
  50. package/{api/resources/agents/resources/archivalMemory → dist/api/resources/agents/resources/passages}/client/Client.js +15 -15
  51. package/dist/api/resources/agents/resources/{archivalMemory/client/requests/ArchivalMemoryListRequest.d.ts → passages/client/requests/PassagesListRequest.d.ts} +1 -1
  52. package/dist/api/resources/agents/resources/passages/client/requests/index.d.ts +2 -0
  53. package/dist/api/resources/agents/resources/passages/client/requests/index.js +2 -0
  54. package/dist/api/resources/agents/resources/sources/client/Client.js +3 -3
  55. package/dist/api/resources/agents/resources/templates/client/Client.js +3 -3
  56. package/dist/api/resources/agents/resources/tools/client/Client.js +3 -3
  57. package/dist/api/resources/blocks/client/Client.js +6 -6
  58. package/dist/api/resources/health/client/Client.js +1 -1
  59. package/dist/api/resources/identities/client/Client.js +6 -6
  60. package/dist/api/resources/jobs/client/Client.js +4 -4
  61. package/dist/api/resources/models/client/Client.js +2 -2
  62. package/dist/api/resources/providers/client/Client.js +4 -4
  63. package/dist/api/resources/runs/client/Client.js +6 -6
  64. package/dist/api/resources/sources/client/Client.js +6 -6
  65. package/dist/api/resources/sources/resources/files/client/Client.js +3 -3
  66. package/dist/api/resources/sources/resources/passages/client/Client.js +1 -1
  67. package/dist/api/resources/steps/client/Client.js +2 -2
  68. package/dist/api/resources/tag/client/Client.js +1 -1
  69. package/dist/api/resources/templates/client/Client.js +1 -1
  70. package/dist/api/resources/tools/client/Client.js +11 -11
  71. package/dist/serialization/resources/agents/resources/blocks/client/index.d.ts +1 -0
  72. package/dist/serialization/resources/agents/resources/{coreMemory → blocks}/client/index.js +2 -2
  73. package/dist/serialization/resources/agents/resources/{coreMemory/client/listBlocks.d.ts → blocks/client/list.d.ts} +1 -1
  74. package/dist/serialization/resources/agents/resources/index.d.ts +3 -3
  75. package/dist/serialization/resources/agents/resources/index.js +4 -4
  76. package/dist/serialization/resources/agents/resources/{archivalMemory → passages}/client/create.d.ts +1 -1
  77. package/dist/serialization/resources/agents/resources/{archivalMemory → passages}/client/list.d.ts +1 -1
  78. package/dist/version.d.ts +1 -1
  79. package/dist/version.js +1 -1
  80. package/package.json +1 -1
  81. package/reference.md +28 -26
  82. package/serialization/resources/agents/resources/blocks/client/index.d.ts +1 -0
  83. package/serialization/resources/agents/resources/{coreMemory → blocks}/client/index.js +2 -2
  84. package/serialization/resources/agents/resources/{coreMemory/client/listBlocks.d.ts → blocks/client/list.d.ts} +1 -1
  85. package/serialization/resources/agents/resources/blocks/index.d.ts +1 -0
  86. package/serialization/resources/agents/resources/blocks/index.js +17 -0
  87. package/serialization/resources/agents/resources/index.d.ts +3 -3
  88. package/serialization/resources/agents/resources/index.js +4 -4
  89. package/serialization/resources/agents/resources/{archivalMemory → passages}/client/create.d.ts +1 -1
  90. package/serialization/resources/agents/resources/{archivalMemory → passages}/client/list.d.ts +1 -1
  91. package/serialization/resources/agents/resources/passages/index.d.ts +1 -0
  92. package/serialization/resources/agents/resources/passages/index.js +17 -0
  93. package/version.d.ts +1 -1
  94. package/version.js +1 -1
  95. package/api/resources/agents/resources/archivalMemory/client/requests/index.d.ts +0 -2
  96. package/dist/api/resources/agents/resources/archivalMemory/client/requests/index.d.ts +0 -2
  97. package/dist/serialization/resources/agents/resources/coreMemory/client/index.d.ts +0 -1
  98. package/serialization/resources/agents/resources/coreMemory/client/index.d.ts +0 -1
  99. /package/api/resources/agents/resources/{archivalMemory/client/requests → blocks/client}/index.js +0 -0
  100. /package/api/resources/agents/resources/{archivalMemory → blocks}/index.d.ts +0 -0
  101. /package/api/resources/agents/resources/{archivalMemory → blocks}/index.js +0 -0
  102. /package/api/resources/agents/resources/{archivalMemory → passages}/client/index.d.ts +0 -0
  103. /package/api/resources/agents/resources/{archivalMemory → passages}/client/index.js +0 -0
  104. /package/api/resources/agents/resources/{archivalMemory → passages}/client/requests/CreateArchivalMemory.d.ts +0 -0
  105. /package/api/resources/agents/resources/{archivalMemory → passages}/client/requests/CreateArchivalMemory.js +0 -0
  106. /package/api/resources/agents/resources/{archivalMemory/client/requests/ArchivalMemoryListRequest.js → passages/client/requests/PassagesListRequest.js} +0 -0
  107. /package/{dist/api/resources/agents/resources/archivalMemory → api/resources/agents/resources/passages}/client/requests/index.js +0 -0
  108. /package/{dist/api/resources/agents/resources/archivalMemory → api/resources/agents/resources/passages}/index.d.ts +0 -0
  109. /package/{dist/api/resources/agents/resources/archivalMemory → api/resources/agents/resources/passages}/index.js +0 -0
  110. /package/dist/{serialization/resources/agents/resources/archivalMemory → api/resources/agents/resources/blocks}/index.d.ts +0 -0
  111. /package/dist/{serialization/resources/agents/resources/archivalMemory → api/resources/agents/resources/blocks}/index.js +0 -0
  112. /package/dist/api/resources/agents/resources/{archivalMemory → passages}/client/index.d.ts +0 -0
  113. /package/dist/api/resources/agents/resources/{archivalMemory → passages}/client/index.js +0 -0
  114. /package/dist/api/resources/agents/resources/{archivalMemory → passages}/client/requests/CreateArchivalMemory.d.ts +0 -0
  115. /package/dist/api/resources/agents/resources/{archivalMemory → passages}/client/requests/CreateArchivalMemory.js +0 -0
  116. /package/dist/api/resources/agents/resources/{archivalMemory/client/requests/ArchivalMemoryListRequest.js → passages/client/requests/PassagesListRequest.js} +0 -0
  117. /package/dist/{serialization/resources/agents/resources/coreMemory → api/resources/agents/resources/passages}/index.d.ts +0 -0
  118. /package/dist/{serialization/resources/agents/resources/coreMemory → api/resources/agents/resources/passages}/index.js +0 -0
  119. /package/dist/serialization/resources/agents/resources/{coreMemory/client/listBlocks.js → blocks/client/list.js} +0 -0
  120. /package/{serialization/resources/agents/resources/archivalMemory → dist/serialization/resources/agents/resources/blocks}/index.d.ts +0 -0
  121. /package/{serialization/resources/agents/resources/archivalMemory → dist/serialization/resources/agents/resources/blocks}/index.js +0 -0
  122. /package/dist/serialization/resources/agents/resources/{archivalMemory → passages}/client/create.js +0 -0
  123. /package/dist/serialization/resources/agents/resources/{archivalMemory → passages}/client/index.d.ts +0 -0
  124. /package/dist/serialization/resources/agents/resources/{archivalMemory → passages}/client/index.js +0 -0
  125. /package/dist/serialization/resources/agents/resources/{archivalMemory → passages}/client/list.js +0 -0
  126. /package/dist/serialization/resources/agents/resources/{archivalMemory → passages}/client/requests/CreateArchivalMemory.d.ts +0 -0
  127. /package/dist/serialization/resources/agents/resources/{archivalMemory → passages}/client/requests/CreateArchivalMemory.js +0 -0
  128. /package/dist/serialization/resources/agents/resources/{archivalMemory → passages}/client/requests/index.d.ts +0 -0
  129. /package/dist/serialization/resources/agents/resources/{archivalMemory → passages}/client/requests/index.js +0 -0
  130. /package/{serialization/resources/agents/resources/coreMemory → dist/serialization/resources/agents/resources/passages}/index.d.ts +0 -0
  131. /package/{serialization/resources/agents/resources/coreMemory → dist/serialization/resources/agents/resources/passages}/index.js +0 -0
  132. /package/serialization/resources/agents/resources/{coreMemory/client/listBlocks.js → blocks/client/list.js} +0 -0
  133. /package/serialization/resources/agents/resources/{archivalMemory → passages}/client/create.js +0 -0
  134. /package/serialization/resources/agents/resources/{archivalMemory → passages}/client/index.d.ts +0 -0
  135. /package/serialization/resources/agents/resources/{archivalMemory → passages}/client/index.js +0 -0
  136. /package/serialization/resources/agents/resources/{archivalMemory → passages}/client/list.js +0 -0
  137. /package/serialization/resources/agents/resources/{archivalMemory → passages}/client/requests/CreateArchivalMemory.d.ts +0 -0
  138. /package/serialization/resources/agents/resources/{archivalMemory → passages}/client/requests/CreateArchivalMemory.js +0 -0
  139. /package/serialization/resources/agents/resources/{archivalMemory → passages}/client/requests/index.d.ts +0 -0
  140. /package/serialization/resources/agents/resources/{archivalMemory → passages}/client/requests/index.js +0 -0
@@ -8,7 +8,8 @@ import { Context } from "../resources/context/client/Client";
8
8
  import { Tools } from "../resources/tools/client/Client";
9
9
  import { Sources } from "../resources/sources/client/Client";
10
10
  import { CoreMemory } from "../resources/coreMemory/client/Client";
11
- import { ArchivalMemory } from "../resources/archivalMemory/client/Client";
11
+ import { Blocks } from "../resources/blocks/client/Client";
12
+ import { Passages } from "../resources/passages/client/Client";
12
13
  import { Messages } from "../resources/messages/client/Client";
13
14
  import { Templates } from "../resources/templates/client/Client";
14
15
  import { MemoryVariables } from "../resources/memoryVariables/client/Client";
@@ -37,7 +38,8 @@ export declare class Agents {
37
38
  protected _tools: Tools | undefined;
38
39
  protected _sources: Sources | undefined;
39
40
  protected _coreMemory: CoreMemory | undefined;
40
- protected _archivalMemory: ArchivalMemory | undefined;
41
+ protected _blocks: Blocks | undefined;
42
+ protected _passages: Passages | undefined;
41
43
  protected _messages: Messages | undefined;
42
44
  protected _templates: Templates | undefined;
43
45
  protected _memoryVariables: MemoryVariables | undefined;
@@ -46,7 +48,8 @@ export declare class Agents {
46
48
  get tools(): Tools;
47
49
  get sources(): Sources;
48
50
  get coreMemory(): CoreMemory;
49
- get archivalMemory(): ArchivalMemory;
51
+ get blocks(): Blocks;
52
+ get passages(): Passages;
50
53
  get messages(): Messages;
51
54
  get templates(): Templates;
52
55
  get memoryVariables(): MemoryVariables;
@@ -70,10 +70,11 @@ const Client_1 = require("../resources/context/client/Client");
70
70
  const Client_2 = require("../resources/tools/client/Client");
71
71
  const Client_3 = require("../resources/sources/client/Client");
72
72
  const Client_4 = require("../resources/coreMemory/client/Client");
73
- const Client_5 = require("../resources/archivalMemory/client/Client");
74
- const Client_6 = require("../resources/messages/client/Client");
75
- const Client_7 = require("../resources/templates/client/Client");
76
- const Client_8 = require("../resources/memoryVariables/client/Client");
73
+ const Client_5 = require("../resources/blocks/client/Client");
74
+ const Client_6 = require("../resources/passages/client/Client");
75
+ const Client_7 = require("../resources/messages/client/Client");
76
+ const Client_8 = require("../resources/templates/client/Client");
77
+ const Client_9 = require("../resources/memoryVariables/client/Client");
77
78
  class Agents {
78
79
  constructor(_options = {}) {
79
80
  this._options = _options;
@@ -94,21 +95,25 @@ class Agents {
94
95
  var _a;
95
96
  return ((_a = this._coreMemory) !== null && _a !== void 0 ? _a : (this._coreMemory = new Client_4.CoreMemory(this._options)));
96
97
  }
97
- get archivalMemory() {
98
+ get blocks() {
98
99
  var _a;
99
- return ((_a = this._archivalMemory) !== null && _a !== void 0 ? _a : (this._archivalMemory = new Client_5.ArchivalMemory(this._options)));
100
+ return ((_a = this._blocks) !== null && _a !== void 0 ? _a : (this._blocks = new Client_5.Blocks(this._options)));
101
+ }
102
+ get passages() {
103
+ var _a;
104
+ return ((_a = this._passages) !== null && _a !== void 0 ? _a : (this._passages = new Client_6.Passages(this._options)));
100
105
  }
101
106
  get messages() {
102
107
  var _a;
103
- return ((_a = this._messages) !== null && _a !== void 0 ? _a : (this._messages = new Client_6.Messages(this._options)));
108
+ return ((_a = this._messages) !== null && _a !== void 0 ? _a : (this._messages = new Client_7.Messages(this._options)));
104
109
  }
105
110
  get templates() {
106
111
  var _a;
107
- return ((_a = this._templates) !== null && _a !== void 0 ? _a : (this._templates = new Client_7.Templates(this._options)));
112
+ return ((_a = this._templates) !== null && _a !== void 0 ? _a : (this._templates = new Client_8.Templates(this._options)));
108
113
  }
109
114
  get memoryVariables() {
110
115
  var _a;
111
- return ((_a = this._memoryVariables) !== null && _a !== void 0 ? _a : (this._memoryVariables = new Client_8.MemoryVariables(this._options)));
116
+ return ((_a = this._memoryVariables) !== null && _a !== void 0 ? _a : (this._memoryVariables = new Client_9.MemoryVariables(this._options)));
112
117
  }
113
118
  /**
114
119
  * List all agents associated with a given user.
@@ -125,7 +130,7 @@ class Agents {
125
130
  list() {
126
131
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
127
132
  var _a, _b, _c;
128
- const { name, tags, matchAllTags, before, after, limit, queryText, projectId, templateId, baseTemplateId, identifierKeys, } = request;
133
+ const { name, tags, matchAllTags, before, after, limit, queryText, projectId, templateId, baseTemplateId, identifierId, identifierKeys, } = request;
129
134
  const _queryParams = {};
130
135
  if (name != null) {
131
136
  _queryParams["name"] = name;
@@ -162,6 +167,9 @@ class Agents {
162
167
  if (baseTemplateId != null) {
163
168
  _queryParams["base_template_id"] = baseTemplateId;
164
169
  }
170
+ if (identifierId != null) {
171
+ _queryParams["identifier_id"] = identifierId;
172
+ }
165
173
  if (identifierKeys != null) {
166
174
  if (Array.isArray(identifierKeys)) {
167
175
  _queryParams["identifier_keys"] = identifierKeys.map((item) => item);
@@ -173,7 +181,7 @@ class Agents {
173
181
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
174
182
  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/"),
175
183
  method: "GET",
176
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.38", "User-Agent": "@letta-ai/letta-client/0.1.38", "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
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.40", "User-Agent": "@letta-ai/letta-client/0.1.40", "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),
177
185
  contentType: "application/json",
178
186
  queryParameters: _queryParams,
179
187
  requestType: "json",
@@ -240,7 +248,7 @@ class Agents {
240
248
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
241
249
  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/"),
242
250
  method: "POST",
243
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.38", "User-Agent": "@letta-ai/letta-client/0.1.38", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, "X-Project": project != null ? project : undefined }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
251
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.40", "User-Agent": "@letta-ai/letta-client/0.1.40", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, "X-Project": project != null ? project : undefined }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
244
252
  contentType: "application/json",
245
253
  requestType: "json",
246
254
  body: serializers.CreateAgentRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }),
@@ -306,7 +314,7 @@ class Agents {
306
314
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
307
315
  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)}`),
308
316
  method: "GET",
309
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.38", "User-Agent": "@letta-ai/letta-client/0.1.38", "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
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.40", "User-Agent": "@letta-ai/letta-client/0.1.40", "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),
310
318
  contentType: "application/json",
311
319
  requestType: "json",
312
320
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -371,7 +379,7 @@ class Agents {
371
379
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
372
380
  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)}`),
373
381
  method: "DELETE",
374
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.38", "User-Agent": "@letta-ai/letta-client/0.1.38", "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),
382
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.40", "User-Agent": "@letta-ai/letta-client/0.1.40", "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),
375
383
  contentType: "application/json",
376
384
  requestType: "json",
377
385
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -431,7 +439,7 @@ class Agents {
431
439
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
432
440
  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)}`),
433
441
  method: "PATCH",
434
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.38", "User-Agent": "@letta-ai/letta-client/0.1.38", "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),
442
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.40", "User-Agent": "@letta-ai/letta-client/0.1.40", "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),
435
443
  contentType: "application/json",
436
444
  requestType: "json",
437
445
  body: serializers.UpdateAgent.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -503,7 +511,7 @@ class Agents {
503
511
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
504
512
  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)}/reset-messages`),
505
513
  method: "PATCH",
506
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.38", "User-Agent": "@letta-ai/letta-client/0.1.38", "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),
514
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.40", "User-Agent": "@letta-ai/letta-client/0.1.40", "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),
507
515
  contentType: "application/json",
508
516
  queryParameters: _queryParams,
509
517
  requestType: "json",
@@ -569,7 +577,7 @@ class Agents {
569
577
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
570
578
  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/search"),
571
579
  method: "POST",
572
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.38", "User-Agent": "@letta-ai/letta-client/0.1.38", "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),
580
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.40", "User-Agent": "@letta-ai/letta-client/0.1.40", "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),
573
581
  contentType: "application/json",
574
582
  requestType: "json",
575
583
  body: serializers.AgentsSearchRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -46,6 +46,10 @@ export interface AgentsListRequest {
46
46
  * Search agents by base template id
47
47
  */
48
48
  baseTemplateId?: string;
49
+ /**
50
+ * Search agents by identifier id
51
+ */
52
+ identifierId?: string;
49
53
  /**
50
54
  * Search agents by identifier keys
51
55
  */
@@ -0,0 +1,97 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as environments from "../../../../../../environments";
5
+ import * as core from "../../../../../../core";
6
+ import * as Letta from "../../../../../index";
7
+ export declare namespace Blocks {
8
+ interface Options {
9
+ environment?: core.Supplier<environments.LettaEnvironment | string>;
10
+ /** Specify a custom URL to connect the client to. */
11
+ baseUrl?: core.Supplier<string>;
12
+ token?: core.Supplier<string | undefined>;
13
+ fetcher?: core.FetchFunction;
14
+ }
15
+ interface RequestOptions {
16
+ /** The maximum time to wait for a response in seconds. */
17
+ timeoutInSeconds?: number;
18
+ /** The number of times to retry the request. Defaults to 2. */
19
+ maxRetries?: number;
20
+ /** A hook to abort the request. */
21
+ abortSignal?: AbortSignal;
22
+ /** Additional headers to include in the request. */
23
+ headers?: Record<string, string>;
24
+ }
25
+ }
26
+ export declare class Blocks {
27
+ protected readonly _options: Blocks.Options;
28
+ constructor(_options?: Blocks.Options);
29
+ /**
30
+ * Retrieve a memory block from an agent.
31
+ *
32
+ * @param {string} agentId
33
+ * @param {string} blockLabel
34
+ * @param {Blocks.RequestOptions} requestOptions - Request-specific configuration.
35
+ *
36
+ * @throws {@link Letta.UnprocessableEntityError}
37
+ *
38
+ * @example
39
+ * await client.agents.blocks.retrieve("agent_id", "block_label")
40
+ */
41
+ retrieve(agentId: string, blockLabel: string, requestOptions?: Blocks.RequestOptions): Promise<Letta.Block>;
42
+ /**
43
+ * Updates a memory block of an agent.
44
+ *
45
+ * @param {string} agentId
46
+ * @param {string} blockLabel
47
+ * @param {Letta.BlockUpdate} request
48
+ * @param {Blocks.RequestOptions} requestOptions - Request-specific configuration.
49
+ *
50
+ * @throws {@link Letta.UnprocessableEntityError}
51
+ *
52
+ * @example
53
+ * await client.agents.blocks.modify("agent_id", "block_label", {})
54
+ */
55
+ modify(agentId: string, blockLabel: string, request: Letta.BlockUpdate, requestOptions?: Blocks.RequestOptions): Promise<Letta.Block>;
56
+ /**
57
+ * Retrieve the memory blocks of a specific agent.
58
+ *
59
+ * @param {string} agentId
60
+ * @param {Blocks.RequestOptions} requestOptions - Request-specific configuration.
61
+ *
62
+ * @throws {@link Letta.UnprocessableEntityError}
63
+ *
64
+ * @example
65
+ * await client.agents.blocks.list("agent_id")
66
+ */
67
+ list(agentId: string, requestOptions?: Blocks.RequestOptions): Promise<Letta.Block[]>;
68
+ /**
69
+ * Attach a block to an agent.
70
+ *
71
+ * @param {string} agentId
72
+ * @param {string} blockId
73
+ * @param {Blocks.RequestOptions} requestOptions - Request-specific configuration.
74
+ *
75
+ * @throws {@link Letta.UnprocessableEntityError}
76
+ *
77
+ * @example
78
+ * await client.agents.blocks.attach("agent_id", "block_id")
79
+ */
80
+ attach(agentId: string, blockId: string, requestOptions?: Blocks.RequestOptions): Promise<Letta.AgentState>;
81
+ /**
82
+ * Detach a block from an agent.
83
+ *
84
+ * @param {string} agentId
85
+ * @param {string} blockId
86
+ * @param {Blocks.RequestOptions} requestOptions - Request-specific configuration.
87
+ *
88
+ * @throws {@link Letta.UnprocessableEntityError}
89
+ *
90
+ * @example
91
+ * await client.agents.blocks.detach("agent_id", "block_id")
92
+ */
93
+ detach(agentId: string, blockId: string, requestOptions?: Blocks.RequestOptions): Promise<Letta.AgentState>;
94
+ protected _getCustomAuthorizationHeaders(): Promise<{
95
+ Authorization: string;
96
+ }>;
97
+ }