@letta-ai/letta-client 0.1.181 → 0.1.183
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/resources/agents/client/Client.d.ts +14 -0
- package/api/resources/agents/client/Client.js +99 -10
- package/api/resources/agents/client/requests/ListAgentFilesRequest.d.ts +21 -0
- package/api/resources/agents/client/requests/index.d.ts +1 -0
- package/api/resources/agents/resources/blocks/client/Client.js +5 -5
- package/api/resources/agents/resources/context/client/Client.js +1 -1
- package/api/resources/agents/resources/coreMemory/client/Client.js +1 -1
- package/api/resources/agents/resources/files/client/Client.d.ts +9 -0
- package/api/resources/agents/resources/files/client/Client.js +55 -3
- package/api/resources/agents/resources/folders/client/Client.js +3 -3
- package/api/resources/agents/resources/groups/client/Client.js +1 -1
- package/api/resources/agents/resources/memoryVariables/client/Client.js +1 -1
- package/api/resources/agents/resources/messages/client/Client.js +8 -8
- package/api/resources/agents/resources/passages/client/Client.js +4 -4
- package/api/resources/agents/resources/sources/client/Client.js +3 -3
- package/api/resources/agents/resources/templates/client/Client.js +3 -3
- package/api/resources/agents/resources/tools/client/Client.js +3 -3
- package/api/resources/batches/client/Client.js +4 -4
- package/api/resources/blocks/client/Client.js +6 -6
- package/api/resources/blocks/resources/agents/client/Client.js +1 -1
- package/api/resources/clientSideAccessTokens/client/Client.js +3 -3
- package/api/resources/embeddingModels/client/Client.js +1 -1
- package/api/resources/folders/client/Client.js +9 -9
- package/api/resources/folders/resources/files/client/Client.js +6 -3
- package/api/resources/folders/resources/files/client/requests/BodyUploadFileToFolder.d.ts +4 -0
- package/api/resources/folders/resources/passages/client/Client.js +1 -1
- package/api/resources/groups/client/Client.js +6 -6
- package/api/resources/groups/resources/messages/client/Client.js +5 -5
- package/api/resources/health/client/Client.js +1 -1
- package/api/resources/identities/client/Client.js +7 -7
- package/api/resources/identities/resources/properties/client/Client.js +1 -1
- package/api/resources/jobs/client/Client.js +5 -5
- package/api/resources/messages/client/Client.js +1 -1
- package/api/resources/models/client/Client.js +1 -1
- package/api/resources/projects/client/Client.js +1 -1
- package/api/resources/providers/client/Client.js +6 -6
- package/api/resources/runs/client/Client.js +4 -4
- package/api/resources/runs/resources/messages/client/Client.js +1 -1
- package/api/resources/runs/resources/steps/client/Client.js +1 -1
- package/api/resources/runs/resources/usage/client/Client.js +1 -1
- package/api/resources/sources/client/Client.js +10 -10
- package/api/resources/sources/resources/files/client/Client.js +6 -3
- package/api/resources/sources/resources/files/client/requests/BodyUploadFileToSource.d.ts +4 -0
- package/api/resources/sources/resources/passages/client/Client.js +1 -1
- package/api/resources/steps/client/Client.js +3 -3
- package/api/resources/steps/resources/feedback/client/Client.js +1 -1
- package/api/resources/tags/client/Client.js +1 -1
- package/api/resources/telemetry/client/Client.js +1 -1
- package/api/resources/templates/client/Client.js +8 -8
- package/api/resources/templates/resources/agents/client/Client.js +1 -1
- package/api/resources/templates/types/TemplatesGetTemplateSnapshotResponseAgentsItemProperties.d.ts +2 -0
- package/api/resources/tools/client/Client.js +20 -20
- package/api/resources/voice/client/Client.js +1 -1
- package/api/types/AgentFileAttachment.d.ts +28 -0
- package/api/types/ChatCompletionMessageFunctionToolCallInput.d.ts +11 -0
- package/api/types/ChatCompletionMessageFunctionToolCallInput.js +5 -0
- package/api/types/{ChatCompletionMessageFunctionToolCall.d.ts → ChatCompletionMessageFunctionToolCallOutput.d.ts} +1 -1
- package/api/types/ChatCompletionMessageFunctionToolCallOutput.js +5 -0
- package/api/types/DuplicateFileHandling.d.ts +2 -1
- package/api/types/DuplicateFileHandling.js +1 -0
- package/api/types/LettaSchemasAgentFileMessageSchema.d.ts +8 -0
- package/api/types/Message.d.ts +1 -1
- package/api/types/OpenaiTypesChatChatCompletionMessageFunctionToolCallFunction.d.ts +9 -0
- package/api/types/OpenaiTypesChatChatCompletionMessageFunctionToolCallFunction.js +5 -0
- package/api/types/PaginatedAgentFiles.d.ts +15 -0
- package/api/types/PaginatedAgentFiles.js +5 -0
- package/api/types/index.d.ts +5 -1
- package/api/types/index.js +5 -1
- package/dist/api/resources/agents/client/Client.d.ts +14 -0
- package/dist/api/resources/agents/client/Client.js +99 -10
- package/dist/api/resources/agents/client/requests/ListAgentFilesRequest.d.ts +21 -0
- package/dist/api/resources/agents/client/requests/ListAgentFilesRequest.js +5 -0
- package/dist/api/resources/agents/client/requests/index.d.ts +1 -0
- package/dist/api/resources/agents/resources/blocks/client/Client.js +5 -5
- package/dist/api/resources/agents/resources/context/client/Client.js +1 -1
- package/dist/api/resources/agents/resources/coreMemory/client/Client.js +1 -1
- package/dist/api/resources/agents/resources/files/client/Client.d.ts +9 -0
- package/dist/api/resources/agents/resources/files/client/Client.js +55 -3
- package/dist/api/resources/agents/resources/folders/client/Client.js +3 -3
- package/dist/api/resources/agents/resources/groups/client/Client.js +1 -1
- package/dist/api/resources/agents/resources/memoryVariables/client/Client.js +1 -1
- package/dist/api/resources/agents/resources/messages/client/Client.js +8 -8
- package/dist/api/resources/agents/resources/passages/client/Client.js +4 -4
- package/dist/api/resources/agents/resources/sources/client/Client.js +3 -3
- package/dist/api/resources/agents/resources/templates/client/Client.js +3 -3
- package/dist/api/resources/agents/resources/tools/client/Client.js +3 -3
- package/dist/api/resources/batches/client/Client.js +4 -4
- package/dist/api/resources/blocks/client/Client.js +6 -6
- package/dist/api/resources/blocks/resources/agents/client/Client.js +1 -1
- package/dist/api/resources/clientSideAccessTokens/client/Client.js +3 -3
- package/dist/api/resources/embeddingModels/client/Client.js +1 -1
- package/dist/api/resources/folders/client/Client.js +9 -9
- package/dist/api/resources/folders/resources/files/client/Client.js +6 -3
- package/dist/api/resources/folders/resources/files/client/requests/BodyUploadFileToFolder.d.ts +4 -0
- package/dist/api/resources/folders/resources/passages/client/Client.js +1 -1
- package/dist/api/resources/groups/client/Client.js +6 -6
- package/dist/api/resources/groups/resources/messages/client/Client.js +5 -5
- package/dist/api/resources/health/client/Client.js +1 -1
- package/dist/api/resources/identities/client/Client.js +7 -7
- package/dist/api/resources/identities/resources/properties/client/Client.js +1 -1
- package/dist/api/resources/jobs/client/Client.js +5 -5
- package/dist/api/resources/messages/client/Client.js +1 -1
- package/dist/api/resources/models/client/Client.js +1 -1
- package/dist/api/resources/projects/client/Client.js +1 -1
- package/dist/api/resources/providers/client/Client.js +6 -6
- package/dist/api/resources/runs/client/Client.js +4 -4
- package/dist/api/resources/runs/resources/messages/client/Client.js +1 -1
- package/dist/api/resources/runs/resources/steps/client/Client.js +1 -1
- package/dist/api/resources/runs/resources/usage/client/Client.js +1 -1
- package/dist/api/resources/sources/client/Client.js +10 -10
- package/dist/api/resources/sources/resources/files/client/Client.js +6 -3
- package/dist/api/resources/sources/resources/files/client/requests/BodyUploadFileToSource.d.ts +4 -0
- package/dist/api/resources/sources/resources/passages/client/Client.js +1 -1
- package/dist/api/resources/steps/client/Client.js +3 -3
- package/dist/api/resources/steps/resources/feedback/client/Client.js +1 -1
- package/dist/api/resources/tags/client/Client.js +1 -1
- package/dist/api/resources/telemetry/client/Client.js +1 -1
- package/dist/api/resources/templates/client/Client.js +8 -8
- package/dist/api/resources/templates/resources/agents/client/Client.js +1 -1
- package/dist/api/resources/templates/types/TemplatesGetTemplateSnapshotResponseAgentsItemProperties.d.ts +2 -0
- package/dist/api/resources/tools/client/Client.js +20 -20
- package/dist/api/resources/voice/client/Client.js +1 -1
- package/dist/api/types/AgentFileAttachment.d.ts +28 -0
- package/dist/api/types/AgentFileAttachment.js +5 -0
- package/dist/api/types/ChatCompletionMessageFunctionToolCallInput.d.ts +11 -0
- package/dist/api/types/ChatCompletionMessageFunctionToolCallInput.js +5 -0
- package/dist/api/types/{ChatCompletionMessageFunctionToolCall.d.ts → ChatCompletionMessageFunctionToolCallOutput.d.ts} +1 -1
- package/dist/api/types/ChatCompletionMessageFunctionToolCallOutput.js +5 -0
- package/dist/api/types/DuplicateFileHandling.d.ts +2 -1
- package/dist/api/types/DuplicateFileHandling.js +1 -0
- package/dist/api/types/LettaSchemasAgentFileMessageSchema.d.ts +8 -0
- package/dist/api/types/Message.d.ts +1 -1
- package/dist/api/types/OpenaiTypesChatChatCompletionMessageFunctionToolCallFunction.d.ts +9 -0
- package/dist/api/types/OpenaiTypesChatChatCompletionMessageFunctionToolCallFunction.js +5 -0
- package/dist/api/types/PaginatedAgentFiles.d.ts +15 -0
- package/dist/api/types/PaginatedAgentFiles.js +5 -0
- package/dist/api/types/index.d.ts +5 -1
- package/dist/api/types/index.js +5 -1
- package/dist/serialization/resources/templates/types/TemplatesGetTemplateSnapshotResponseAgentsItemProperties.d.ts +2 -0
- package/dist/serialization/resources/templates/types/TemplatesGetTemplateSnapshotResponseAgentsItemProperties.js +2 -0
- package/dist/serialization/types/AgentFileAttachment.d.ts +21 -0
- package/dist/serialization/types/AgentFileAttachment.js +52 -0
- package/dist/serialization/types/ChatCompletionMessageFunctionToolCallInput.d.ts +16 -0
- package/dist/serialization/types/ChatCompletionMessageFunctionToolCallInput.js +48 -0
- package/dist/serialization/types/{ChatCompletionMessageFunctionToolCall.d.ts → ChatCompletionMessageFunctionToolCallOutput.d.ts} +2 -2
- package/dist/serialization/types/{ChatCompletionMessageFunctionToolCall.js → ChatCompletionMessageFunctionToolCallOutput.js} +2 -2
- package/dist/serialization/types/DuplicateFileHandling.d.ts +1 -1
- package/dist/serialization/types/DuplicateFileHandling.js +1 -1
- package/dist/serialization/types/LettaSchemasAgentFileMessageSchema.d.ts +6 -0
- package/dist/serialization/types/LettaSchemasAgentFileMessageSchema.js +6 -0
- package/dist/serialization/types/Message.d.ts +2 -2
- package/dist/serialization/types/Message.js +2 -2
- package/dist/serialization/types/OpenaiTypesChatChatCompletionMessageFunctionToolCallFunction.d.ts +14 -0
- package/dist/serialization/types/OpenaiTypesChatChatCompletionMessageFunctionToolCallFunction.js +46 -0
- package/dist/serialization/types/PaginatedAgentFiles.d.ts +15 -0
- package/dist/serialization/types/PaginatedAgentFiles.js +46 -0
- package/dist/serialization/types/index.d.ts +5 -1
- package/dist/serialization/types/index.js +5 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/reference.md +119 -0
- package/serialization/resources/templates/types/TemplatesGetTemplateSnapshotResponseAgentsItemProperties.d.ts +2 -0
- package/serialization/resources/templates/types/TemplatesGetTemplateSnapshotResponseAgentsItemProperties.js +2 -0
- package/serialization/types/AgentFileAttachment.d.ts +21 -0
- package/serialization/types/AgentFileAttachment.js +52 -0
- package/serialization/types/ChatCompletionMessageFunctionToolCallInput.d.ts +16 -0
- package/serialization/types/ChatCompletionMessageFunctionToolCallInput.js +48 -0
- package/serialization/types/{ChatCompletionMessageFunctionToolCall.d.ts → ChatCompletionMessageFunctionToolCallOutput.d.ts} +2 -2
- package/serialization/types/{ChatCompletionMessageFunctionToolCall.js → ChatCompletionMessageFunctionToolCallOutput.js} +2 -2
- package/serialization/types/DuplicateFileHandling.d.ts +1 -1
- package/serialization/types/DuplicateFileHandling.js +1 -1
- package/serialization/types/LettaSchemasAgentFileMessageSchema.d.ts +6 -0
- package/serialization/types/LettaSchemasAgentFileMessageSchema.js +6 -0
- package/serialization/types/Message.d.ts +2 -2
- package/serialization/types/Message.js +2 -2
- package/serialization/types/OpenaiTypesChatChatCompletionMessageFunctionToolCallFunction.d.ts +14 -0
- package/serialization/types/OpenaiTypesChatChatCompletionMessageFunctionToolCallFunction.js +46 -0
- package/serialization/types/PaginatedAgentFiles.d.ts +15 -0
- package/serialization/types/PaginatedAgentFiles.js +46 -0
- package/serialization/types/index.d.ts +5 -1
- package/serialization/types/index.js +5 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- /package/api/{types/ChatCompletionMessageFunctionToolCall.js → resources/agents/client/requests/ListAgentFilesRequest.js} +0 -0
- /package/{dist/api/types/ChatCompletionMessageFunctionToolCall.js → api/types/AgentFileAttachment.js} +0 -0
|
@@ -183,6 +183,20 @@ export declare class Agents {
|
|
|
183
183
|
*/
|
|
184
184
|
modify(agentId: string, request?: Letta.UpdateAgent, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<Letta.AgentState>;
|
|
185
185
|
private __modify;
|
|
186
|
+
/**
|
|
187
|
+
* Get the files attached to an agent with their open/closed status (paginated).
|
|
188
|
+
*
|
|
189
|
+
* @param {string} agentId
|
|
190
|
+
* @param {Letta.ListAgentFilesRequest} request
|
|
191
|
+
* @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
|
|
192
|
+
*
|
|
193
|
+
* @throws {@link Letta.UnprocessableEntityError}
|
|
194
|
+
*
|
|
195
|
+
* @example
|
|
196
|
+
* await client.agents.listAgentFiles("agent_id")
|
|
197
|
+
*/
|
|
198
|
+
listAgentFiles(agentId: string, request?: Letta.ListAgentFilesRequest, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<Letta.PaginatedAgentFiles>;
|
|
199
|
+
private __listAgentFiles;
|
|
186
200
|
/**
|
|
187
201
|
* Summarize an agent's conversation history to a target message length.
|
|
188
202
|
*
|
|
@@ -207,7 +207,7 @@ class Agents {
|
|
|
207
207
|
method: "GET",
|
|
208
208
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
209
209
|
? yield core.Supplier.get(this._options.project)
|
|
210
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
210
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.183", "User-Agent": "@letta-ai/letta-client/0.1.183", "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),
|
|
211
211
|
contentType: "application/json",
|
|
212
212
|
queryParameters: _queryParams,
|
|
213
213
|
requestType: "json",
|
|
@@ -284,7 +284,7 @@ class Agents {
|
|
|
284
284
|
method: "POST",
|
|
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.
|
|
287
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.183", "User-Agent": "@letta-ai/letta-client/0.1.183", "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
|
body: serializers.CreateAgentRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -360,7 +360,7 @@ class Agents {
|
|
|
360
360
|
method: "GET",
|
|
361
361
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
362
362
|
? yield core.Supplier.get(this._options.project)
|
|
363
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
363
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.183", "User-Agent": "@letta-ai/letta-client/0.1.183", "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),
|
|
364
364
|
contentType: "application/json",
|
|
365
365
|
requestType: "json",
|
|
366
366
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -449,7 +449,7 @@ class Agents {
|
|
|
449
449
|
method: "GET",
|
|
450
450
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
451
451
|
? yield core.Supplier.get(this._options.project)
|
|
452
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
452
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.183", "User-Agent": "@letta-ai/letta-client/0.1.183", "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),
|
|
453
453
|
contentType: "application/json",
|
|
454
454
|
queryParameters: _queryParams,
|
|
455
455
|
requestType: "json",
|
|
@@ -546,7 +546,7 @@ class Agents {
|
|
|
546
546
|
method: "POST",
|
|
547
547
|
headers: Object.assign(Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
548
548
|
? yield core.Supplier.get(this._options.project)
|
|
549
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
549
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.183", "User-Agent": "@letta-ai/letta-client/0.1.183", "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),
|
|
550
550
|
requestType: "file",
|
|
551
551
|
duplex: _maybeEncodedRequest.duplex,
|
|
552
552
|
body: _maybeEncodedRequest.body,
|
|
@@ -634,7 +634,7 @@ class Agents {
|
|
|
634
634
|
method: "GET",
|
|
635
635
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
636
636
|
? yield core.Supplier.get(this._options.project)
|
|
637
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
637
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.183", "User-Agent": "@letta-ai/letta-client/0.1.183", "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),
|
|
638
638
|
contentType: "application/json",
|
|
639
639
|
queryParameters: _queryParams,
|
|
640
640
|
requestType: "json",
|
|
@@ -711,7 +711,7 @@ class Agents {
|
|
|
711
711
|
method: "DELETE",
|
|
712
712
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
713
713
|
? yield core.Supplier.get(this._options.project)
|
|
714
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
714
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.183", "User-Agent": "@letta-ai/letta-client/0.1.183", "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),
|
|
715
715
|
contentType: "application/json",
|
|
716
716
|
requestType: "json",
|
|
717
717
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -779,7 +779,7 @@ class Agents {
|
|
|
779
779
|
method: "PATCH",
|
|
780
780
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
781
781
|
? yield core.Supplier.get(this._options.project)
|
|
782
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
782
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.183", "User-Agent": "@letta-ai/letta-client/0.1.183", "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),
|
|
783
783
|
contentType: "application/json",
|
|
784
784
|
requestType: "json",
|
|
785
785
|
body: serializers.UpdateAgent.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -834,6 +834,95 @@ class Agents {
|
|
|
834
834
|
}
|
|
835
835
|
});
|
|
836
836
|
}
|
|
837
|
+
/**
|
|
838
|
+
* Get the files attached to an agent with their open/closed status (paginated).
|
|
839
|
+
*
|
|
840
|
+
* @param {string} agentId
|
|
841
|
+
* @param {Letta.ListAgentFilesRequest} request
|
|
842
|
+
* @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
|
|
843
|
+
*
|
|
844
|
+
* @throws {@link Letta.UnprocessableEntityError}
|
|
845
|
+
*
|
|
846
|
+
* @example
|
|
847
|
+
* await client.agents.listAgentFiles("agent_id")
|
|
848
|
+
*/
|
|
849
|
+
listAgentFiles(agentId, request = {}, requestOptions) {
|
|
850
|
+
return core.HttpResponsePromise.fromPromise(this.__listAgentFiles(agentId, request, requestOptions));
|
|
851
|
+
}
|
|
852
|
+
__listAgentFiles(agentId_1) {
|
|
853
|
+
return __awaiter(this, arguments, void 0, function* (agentId, request = {}, requestOptions) {
|
|
854
|
+
var _a, _b, _c;
|
|
855
|
+
const { cursor, limit, isOpen } = request;
|
|
856
|
+
const _queryParams = {};
|
|
857
|
+
if (cursor != null) {
|
|
858
|
+
_queryParams["cursor"] = cursor;
|
|
859
|
+
}
|
|
860
|
+
if (limit != null) {
|
|
861
|
+
_queryParams["limit"] = limit.toString();
|
|
862
|
+
}
|
|
863
|
+
if (isOpen != null) {
|
|
864
|
+
_queryParams["is_open"] = isOpen.toString();
|
|
865
|
+
}
|
|
866
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
867
|
+
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`),
|
|
868
|
+
method: "GET",
|
|
869
|
+
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
870
|
+
? yield core.Supplier.get(this._options.project)
|
|
871
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.183", "User-Agent": "@letta-ai/letta-client/0.1.183", "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),
|
|
872
|
+
contentType: "application/json",
|
|
873
|
+
queryParameters: _queryParams,
|
|
874
|
+
requestType: "json",
|
|
875
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
876
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
877
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
878
|
+
});
|
|
879
|
+
if (_response.ok) {
|
|
880
|
+
return {
|
|
881
|
+
data: serializers.PaginatedAgentFiles.parseOrThrow(_response.body, {
|
|
882
|
+
unrecognizedObjectKeys: "passthrough",
|
|
883
|
+
allowUnrecognizedUnionMembers: true,
|
|
884
|
+
allowUnrecognizedEnumValues: true,
|
|
885
|
+
skipValidation: true,
|
|
886
|
+
breadcrumbsPrefix: ["response"],
|
|
887
|
+
}),
|
|
888
|
+
rawResponse: _response.rawResponse,
|
|
889
|
+
};
|
|
890
|
+
}
|
|
891
|
+
if (_response.error.reason === "status-code") {
|
|
892
|
+
switch (_response.error.statusCode) {
|
|
893
|
+
case 422:
|
|
894
|
+
throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
895
|
+
unrecognizedObjectKeys: "passthrough",
|
|
896
|
+
allowUnrecognizedUnionMembers: true,
|
|
897
|
+
allowUnrecognizedEnumValues: true,
|
|
898
|
+
skipValidation: true,
|
|
899
|
+
breadcrumbsPrefix: ["response"],
|
|
900
|
+
}), _response.rawResponse);
|
|
901
|
+
default:
|
|
902
|
+
throw new errors.LettaError({
|
|
903
|
+
statusCode: _response.error.statusCode,
|
|
904
|
+
body: _response.error.body,
|
|
905
|
+
rawResponse: _response.rawResponse,
|
|
906
|
+
});
|
|
907
|
+
}
|
|
908
|
+
}
|
|
909
|
+
switch (_response.error.reason) {
|
|
910
|
+
case "non-json":
|
|
911
|
+
throw new errors.LettaError({
|
|
912
|
+
statusCode: _response.error.statusCode,
|
|
913
|
+
body: _response.error.rawBody,
|
|
914
|
+
rawResponse: _response.rawResponse,
|
|
915
|
+
});
|
|
916
|
+
case "timeout":
|
|
917
|
+
throw new errors.LettaTimeoutError("Timeout exceeded when calling GET /v1/agents/{agent_id}/files.");
|
|
918
|
+
case "unknown":
|
|
919
|
+
throw new errors.LettaError({
|
|
920
|
+
message: _response.error.errorMessage,
|
|
921
|
+
rawResponse: _response.rawResponse,
|
|
922
|
+
});
|
|
923
|
+
}
|
|
924
|
+
});
|
|
925
|
+
}
|
|
837
926
|
/**
|
|
838
927
|
* Summarize an agent's conversation history to a target message length.
|
|
839
928
|
*
|
|
@@ -865,7 +954,7 @@ class Agents {
|
|
|
865
954
|
method: "POST",
|
|
866
955
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
867
956
|
? yield core.Supplier.get(this._options.project)
|
|
868
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
957
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.183", "User-Agent": "@letta-ai/letta-client/0.1.183", "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),
|
|
869
958
|
contentType: "application/json",
|
|
870
959
|
queryParameters: _queryParams,
|
|
871
960
|
requestType: "json",
|
|
@@ -933,7 +1022,7 @@ class Agents {
|
|
|
933
1022
|
method: "POST",
|
|
934
1023
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
935
1024
|
? yield core.Supplier.get(this._options.project)
|
|
936
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
1025
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.183", "User-Agent": "@letta-ai/letta-client/0.1.183", "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),
|
|
937
1026
|
contentType: "application/json",
|
|
938
1027
|
requestType: "json",
|
|
939
1028
|
body: serializers.AgentsSearchRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @example
|
|
6
|
+
* {}
|
|
7
|
+
*/
|
|
8
|
+
export interface ListAgentFilesRequest {
|
|
9
|
+
/**
|
|
10
|
+
* Pagination cursor from previous response
|
|
11
|
+
*/
|
|
12
|
+
cursor?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Number of items to return (1-100)
|
|
15
|
+
*/
|
|
16
|
+
limit?: number;
|
|
17
|
+
/**
|
|
18
|
+
* Filter by open status (true for open files, false for closed files)
|
|
19
|
+
*/
|
|
20
|
+
isOpen?: boolean;
|
|
21
|
+
}
|
|
@@ -4,5 +4,6 @@ export { type AgentsExportFileRequest } from "./AgentsExportFileRequest";
|
|
|
4
4
|
export { type BodyImportAgentSerialized } from "./BodyImportAgentSerialized";
|
|
5
5
|
export { type AgentsRetrieveRequest } from "./AgentsRetrieveRequest";
|
|
6
6
|
export { type UpdateAgent } from "./UpdateAgent";
|
|
7
|
+
export { type ListAgentFilesRequest } from "./ListAgentFilesRequest";
|
|
7
8
|
export { type SummarizeAgentConversationRequest } from "./SummarizeAgentConversationRequest";
|
|
8
9
|
export { type AgentsSearchRequest } from "./AgentsSearchRequest";
|
|
@@ -82,7 +82,7 @@ class Blocks {
|
|
|
82
82
|
method: "GET",
|
|
83
83
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
84
84
|
? yield core.Supplier.get(this._options.project)
|
|
85
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
85
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.183", "User-Agent": "@letta-ai/letta-client/0.1.183", "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),
|
|
86
86
|
contentType: "application/json",
|
|
87
87
|
requestType: "json",
|
|
88
88
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -160,7 +160,7 @@ class Blocks {
|
|
|
160
160
|
method: "PATCH",
|
|
161
161
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
162
162
|
? yield core.Supplier.get(this._options.project)
|
|
163
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
163
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.183", "User-Agent": "@letta-ai/letta-client/0.1.183", "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),
|
|
164
164
|
contentType: "application/json",
|
|
165
165
|
requestType: "json",
|
|
166
166
|
body: serializers.BlockUpdate.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -237,7 +237,7 @@ class Blocks {
|
|
|
237
237
|
method: "GET",
|
|
238
238
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
239
239
|
? yield core.Supplier.get(this._options.project)
|
|
240
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
240
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.183", "User-Agent": "@letta-ai/letta-client/0.1.183", "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),
|
|
241
241
|
contentType: "application/json",
|
|
242
242
|
requestType: "json",
|
|
243
243
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -314,7 +314,7 @@ class Blocks {
|
|
|
314
314
|
method: "PATCH",
|
|
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.
|
|
317
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.183", "User-Agent": "@letta-ai/letta-client/0.1.183", "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
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -391,7 +391,7 @@ class Blocks {
|
|
|
391
391
|
method: "PATCH",
|
|
392
392
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
393
393
|
? yield core.Supplier.get(this._options.project)
|
|
394
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
394
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.183", "User-Agent": "@letta-ai/letta-client/0.1.183", "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),
|
|
395
395
|
contentType: "application/json",
|
|
396
396
|
requestType: "json",
|
|
397
397
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -81,7 +81,7 @@ class Context {
|
|
|
81
81
|
method: "GET",
|
|
82
82
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
83
83
|
? yield core.Supplier.get(this._options.project)
|
|
84
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
84
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.183", "User-Agent": "@letta-ai/letta-client/0.1.183", "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),
|
|
85
85
|
contentType: "application/json",
|
|
86
86
|
requestType: "json",
|
|
87
87
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -82,7 +82,7 @@ class CoreMemory {
|
|
|
82
82
|
method: "GET",
|
|
83
83
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
84
84
|
? yield core.Supplier.get(this._options.project)
|
|
85
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
85
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.183", "User-Agent": "@letta-ai/letta-client/0.1.183", "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),
|
|
86
86
|
contentType: "application/json",
|
|
87
87
|
requestType: "json",
|
|
88
88
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -80,6 +80,15 @@ export declare class Files {
|
|
|
80
80
|
*/
|
|
81
81
|
close(agentId: string, fileId: string, requestOptions?: Files.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
82
82
|
private __close;
|
|
83
|
+
/**
|
|
84
|
+
* @param {string} agentId
|
|
85
|
+
* @param {Files.RequestOptions} requestOptions - Request-specific configuration.
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* await client.agents.files.list("agent_id")
|
|
89
|
+
*/
|
|
90
|
+
list(agentId: string, requestOptions?: Files.RequestOptions): core.HttpResponsePromise<void>;
|
|
91
|
+
private __list;
|
|
83
92
|
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
84
93
|
Authorization: string;
|
|
85
94
|
}>;
|
|
@@ -84,7 +84,7 @@ class Files {
|
|
|
84
84
|
method: "PATCH",
|
|
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.
|
|
87
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.183", "User-Agent": "@letta-ai/letta-client/0.1.183", "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
|
requestType: "json",
|
|
90
90
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -165,7 +165,7 @@ class Files {
|
|
|
165
165
|
method: "PATCH",
|
|
166
166
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
167
167
|
? yield core.Supplier.get(this._options.project)
|
|
168
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
168
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.183", "User-Agent": "@letta-ai/letta-client/0.1.183", "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),
|
|
169
169
|
contentType: "application/json",
|
|
170
170
|
requestType: "json",
|
|
171
171
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -245,7 +245,7 @@ class Files {
|
|
|
245
245
|
method: "PATCH",
|
|
246
246
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
247
247
|
? yield core.Supplier.get(this._options.project)
|
|
248
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
248
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.183", "User-Agent": "@letta-ai/letta-client/0.1.183", "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),
|
|
249
249
|
contentType: "application/json",
|
|
250
250
|
requestType: "json",
|
|
251
251
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -290,6 +290,58 @@ class Files {
|
|
|
290
290
|
}
|
|
291
291
|
});
|
|
292
292
|
}
|
|
293
|
+
/**
|
|
294
|
+
* @param {string} agentId
|
|
295
|
+
* @param {Files.RequestOptions} requestOptions - Request-specific configuration.
|
|
296
|
+
*
|
|
297
|
+
* @example
|
|
298
|
+
* await client.agents.files.list("agent_id")
|
|
299
|
+
*/
|
|
300
|
+
list(agentId, requestOptions) {
|
|
301
|
+
return core.HttpResponsePromise.fromPromise(this.__list(agentId, requestOptions));
|
|
302
|
+
}
|
|
303
|
+
__list(agentId, requestOptions) {
|
|
304
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
305
|
+
var _a, _b, _c;
|
|
306
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
307
|
+
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`),
|
|
308
|
+
method: "PATCH",
|
|
309
|
+
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
310
|
+
? yield core.Supplier.get(this._options.project)
|
|
311
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.183", "User-Agent": "@letta-ai/letta-client/0.1.183", "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),
|
|
312
|
+
contentType: "application/json",
|
|
313
|
+
requestType: "json",
|
|
314
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
315
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
316
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
317
|
+
});
|
|
318
|
+
if (_response.ok) {
|
|
319
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
320
|
+
}
|
|
321
|
+
if (_response.error.reason === "status-code") {
|
|
322
|
+
throw new errors.LettaError({
|
|
323
|
+
statusCode: _response.error.statusCode,
|
|
324
|
+
body: _response.error.body,
|
|
325
|
+
rawResponse: _response.rawResponse,
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
switch (_response.error.reason) {
|
|
329
|
+
case "non-json":
|
|
330
|
+
throw new errors.LettaError({
|
|
331
|
+
statusCode: _response.error.statusCode,
|
|
332
|
+
body: _response.error.rawBody,
|
|
333
|
+
rawResponse: _response.rawResponse,
|
|
334
|
+
});
|
|
335
|
+
case "timeout":
|
|
336
|
+
throw new errors.LettaTimeoutError("Timeout exceeded when calling PATCH /v1/agents/{agent_id}/files.");
|
|
337
|
+
case "unknown":
|
|
338
|
+
throw new errors.LettaError({
|
|
339
|
+
message: _response.error.errorMessage,
|
|
340
|
+
rawResponse: _response.rawResponse,
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
});
|
|
344
|
+
}
|
|
293
345
|
_getCustomAuthorizationHeaders() {
|
|
294
346
|
return __awaiter(this, void 0, void 0, function* () {
|
|
295
347
|
const tokenValue = yield core.Supplier.get(this._options.token);
|
|
@@ -82,7 +82,7 @@ class Folders {
|
|
|
82
82
|
method: "PATCH",
|
|
83
83
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
84
84
|
? yield core.Supplier.get(this._options.project)
|
|
85
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
85
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.183", "User-Agent": "@letta-ai/letta-client/0.1.183", "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),
|
|
86
86
|
contentType: "application/json",
|
|
87
87
|
requestType: "json",
|
|
88
88
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -159,7 +159,7 @@ class Folders {
|
|
|
159
159
|
method: "PATCH",
|
|
160
160
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
161
161
|
? yield core.Supplier.get(this._options.project)
|
|
162
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
162
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.183", "User-Agent": "@letta-ai/letta-client/0.1.183", "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),
|
|
163
163
|
contentType: "application/json",
|
|
164
164
|
requestType: "json",
|
|
165
165
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -235,7 +235,7 @@ class Folders {
|
|
|
235
235
|
method: "GET",
|
|
236
236
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
237
237
|
? yield core.Supplier.get(this._options.project)
|
|
238
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
238
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.183", "User-Agent": "@letta-ai/letta-client/0.1.183", "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
239
|
contentType: "application/json",
|
|
240
240
|
requestType: "json",
|
|
241
241
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -87,7 +87,7 @@ class Groups {
|
|
|
87
87
|
method: "GET",
|
|
88
88
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
89
89
|
? yield core.Supplier.get(this._options.project)
|
|
90
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
90
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.183", "User-Agent": "@letta-ai/letta-client/0.1.183", "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
91
|
contentType: "application/json",
|
|
92
92
|
queryParameters: _queryParams,
|
|
93
93
|
requestType: "json",
|
|
@@ -83,7 +83,7 @@ class MemoryVariables {
|
|
|
83
83
|
method: "GET",
|
|
84
84
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
85
85
|
? yield core.Supplier.get(this._options.project)
|
|
86
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
86
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.183", "User-Agent": "@letta-ai/letta-client/0.1.183", "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
87
|
contentType: "application/json",
|
|
88
88
|
requestType: "json",
|
|
89
89
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -108,7 +108,7 @@ class Messages {
|
|
|
108
108
|
method: "GET",
|
|
109
109
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
110
110
|
? yield core.Supplier.get(this._options.project)
|
|
111
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
111
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.183", "User-Agent": "@letta-ai/letta-client/0.1.183", "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),
|
|
112
112
|
contentType: "application/json",
|
|
113
113
|
queryParameters: _queryParams,
|
|
114
114
|
requestType: "json",
|
|
@@ -195,7 +195,7 @@ class Messages {
|
|
|
195
195
|
method: "POST",
|
|
196
196
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
197
197
|
? yield core.Supplier.get(this._options.project)
|
|
198
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
198
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.183", "User-Agent": "@letta-ai/letta-client/0.1.183", "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),
|
|
199
199
|
contentType: "application/json",
|
|
200
200
|
requestType: "json",
|
|
201
201
|
body: serializers.LettaRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -276,7 +276,7 @@ class Messages {
|
|
|
276
276
|
method: "PATCH",
|
|
277
277
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
278
278
|
? yield core.Supplier.get(this._options.project)
|
|
279
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
279
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.183", "User-Agent": "@letta-ai/letta-client/0.1.183", "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),
|
|
280
280
|
contentType: "application/json",
|
|
281
281
|
requestType: "json",
|
|
282
282
|
body: serializers.agents.MessagesModifyRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -347,7 +347,7 @@ class Messages {
|
|
|
347
347
|
method: "POST",
|
|
348
348
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
349
349
|
? yield core.Supplier.get(this._options.project)
|
|
350
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
350
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.183", "User-Agent": "@letta-ai/letta-client/0.1.183", "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),
|
|
351
351
|
contentType: "application/json",
|
|
352
352
|
requestType: "json",
|
|
353
353
|
body: serializers.LettaStreamingRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -438,7 +438,7 @@ class Messages {
|
|
|
438
438
|
method: "POST",
|
|
439
439
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
440
440
|
? yield core.Supplier.get(this._options.project)
|
|
441
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
441
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.183", "User-Agent": "@letta-ai/letta-client/0.1.183", "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
442
|
contentType: "application/json",
|
|
443
443
|
requestType: "json",
|
|
444
444
|
body: serializers.agents.CancelAgentRunRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -528,7 +528,7 @@ class Messages {
|
|
|
528
528
|
method: "POST",
|
|
529
529
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
530
530
|
? yield core.Supplier.get(this._options.project)
|
|
531
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
531
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.183", "User-Agent": "@letta-ai/letta-client/0.1.183", "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),
|
|
532
532
|
contentType: "application/json",
|
|
533
533
|
requestType: "json",
|
|
534
534
|
body: serializers.agents.LettaAsyncRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -611,7 +611,7 @@ class Messages {
|
|
|
611
611
|
method: "PATCH",
|
|
612
612
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
613
613
|
? yield core.Supplier.get(this._options.project)
|
|
614
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
614
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.183", "User-Agent": "@letta-ai/letta-client/0.1.183", "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),
|
|
615
615
|
contentType: "application/json",
|
|
616
616
|
queryParameters: _queryParams,
|
|
617
617
|
requestType: "json",
|
|
@@ -701,7 +701,7 @@ class Messages {
|
|
|
701
701
|
method: "POST",
|
|
702
702
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
703
703
|
? yield core.Supplier.get(this._options.project)
|
|
704
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
704
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.183", "User-Agent": "@letta-ai/letta-client/0.1.183", "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),
|
|
705
705
|
contentType: "application/json",
|
|
706
706
|
requestType: "json",
|
|
707
707
|
body: serializers.agents.MessagesPreviewRawPayloadRequest.jsonOrThrow(request, {
|