@letta-ai/letta-client 0.1.161 → 0.1.163
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 +6 -48
- package/api/resources/agents/client/Client.js +34 -231
- 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 +83 -0
- package/api/resources/agents/resources/files/client/Client.js +276 -0
- package/api/resources/agents/resources/files/client/index.d.ts +1 -0
- package/api/resources/agents/resources/files/client/index.js +2 -0
- package/api/resources/agents/resources/files/index.d.ts +1 -0
- package/api/resources/agents/resources/files/index.js +17 -0
- package/api/resources/agents/resources/folders/client/Client.d.ts +74 -0
- package/api/resources/agents/resources/folders/client/Client.js +272 -0
- package/api/resources/agents/resources/folders/client/index.d.ts +1 -0
- package/api/resources/agents/resources/folders/client/index.js +2 -0
- package/api/resources/agents/resources/folders/index.d.ts +1 -0
- package/api/resources/agents/resources/folders/index.js +17 -0
- package/api/resources/agents/resources/groups/client/Client.js +1 -1
- package/api/resources/agents/resources/index.d.ts +2 -0
- package/api/resources/agents/resources/index.js +3 -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.d.ts +20 -69
- package/api/resources/folders/client/Client.js +36 -326
- package/api/resources/folders/client/requests/index.d.ts +0 -3
- package/api/resources/folders/index.d.ts +1 -0
- package/api/resources/folders/index.js +1 -0
- package/api/resources/folders/resources/files/client/Client.d.ts +78 -0
- package/api/resources/folders/resources/files/client/Client.js +289 -0
- package/api/resources/folders/resources/files/client/index.d.ts +1 -0
- package/api/resources/folders/resources/files/client/index.js +17 -0
- package/api/resources/folders/{client → resources/files/client}/requests/BodyUploadFileToFolder.d.ts +1 -1
- package/{dist/api/resources/folders/client/requests/ListFolderFilesRequest.d.ts → api/resources/folders/resources/files/client/requests/FilesListRequest.d.ts} +1 -1
- package/api/resources/folders/resources/files/client/requests/index.d.ts +2 -0
- package/api/resources/folders/resources/files/client/requests/index.js +2 -0
- package/api/resources/folders/resources/files/index.d.ts +1 -0
- package/api/resources/folders/resources/files/index.js +17 -0
- package/api/resources/folders/resources/index.d.ts +4 -0
- package/api/resources/folders/resources/index.js +43 -0
- package/api/resources/folders/resources/passages/client/Client.d.ts +49 -0
- package/api/resources/folders/resources/passages/client/Client.js +149 -0
- package/api/resources/folders/resources/passages/client/index.d.ts +1 -0
- package/api/resources/folders/resources/passages/client/index.js +17 -0
- package/api/resources/folders/{client/requests/ListFolderPassagesRequest.d.ts → resources/passages/client/requests/PassagesListRequest.d.ts} +1 -1
- package/api/resources/folders/resources/passages/client/requests/index.d.ts +1 -0
- package/api/resources/folders/resources/passages/client/requests/index.js +2 -0
- package/api/resources/folders/resources/passages/index.d.ts +1 -0
- package/api/resources/folders/resources/passages/index.js +17 -0
- 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 +5 -5
- 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 +3 -3
- package/api/resources/sources/resources/passages/client/Client.js +1 -1
- package/api/resources/steps/client/Client.js +2 -2
- 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 +1 -1
- package/api/resources/templates/resources/agents/client/Client.js +1 -1
- package/api/resources/tools/client/Client.js +19 -19
- package/api/resources/voice/client/Client.js +1 -1
- package/dist/api/resources/agents/client/Client.d.ts +6 -48
- package/dist/api/resources/agents/client/Client.js +34 -231
- 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 +83 -0
- package/dist/api/resources/agents/resources/files/client/Client.js +276 -0
- package/dist/api/resources/agents/resources/files/client/index.d.ts +1 -0
- package/dist/api/resources/agents/resources/files/client/index.js +2 -0
- package/dist/api/resources/agents/resources/files/index.d.ts +1 -0
- package/dist/api/resources/agents/resources/files/index.js +17 -0
- package/dist/api/resources/agents/resources/folders/client/Client.d.ts +74 -0
- package/dist/api/resources/agents/resources/folders/client/Client.js +272 -0
- package/dist/api/resources/agents/resources/folders/client/index.d.ts +1 -0
- package/dist/api/resources/agents/resources/folders/client/index.js +2 -0
- package/dist/api/resources/agents/resources/folders/index.d.ts +1 -0
- package/dist/api/resources/agents/resources/folders/index.js +17 -0
- package/dist/api/resources/agents/resources/groups/client/Client.js +1 -1
- package/dist/api/resources/agents/resources/index.d.ts +2 -0
- package/dist/api/resources/agents/resources/index.js +3 -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.d.ts +20 -69
- package/dist/api/resources/folders/client/Client.js +36 -326
- package/dist/api/resources/folders/client/requests/index.d.ts +0 -3
- package/dist/api/resources/folders/index.d.ts +1 -0
- package/dist/api/resources/folders/index.js +1 -0
- package/dist/api/resources/folders/resources/files/client/Client.d.ts +78 -0
- package/dist/api/resources/folders/resources/files/client/Client.js +289 -0
- package/dist/api/resources/folders/resources/files/client/index.d.ts +1 -0
- package/dist/api/resources/folders/resources/files/client/index.js +17 -0
- package/dist/api/resources/folders/{client → resources/files/client}/requests/BodyUploadFileToFolder.d.ts +1 -1
- package/{api/resources/folders/client/requests/ListFolderFilesRequest.d.ts → dist/api/resources/folders/resources/files/client/requests/FilesListRequest.d.ts} +1 -1
- package/dist/api/resources/folders/resources/files/client/requests/index.d.ts +2 -0
- package/dist/api/resources/folders/resources/files/client/requests/index.js +2 -0
- package/dist/api/resources/folders/resources/files/index.d.ts +1 -0
- package/dist/api/resources/folders/resources/files/index.js +17 -0
- package/dist/api/resources/folders/resources/index.d.ts +4 -0
- package/dist/api/resources/folders/resources/index.js +43 -0
- package/dist/api/resources/folders/resources/passages/client/Client.d.ts +49 -0
- package/dist/api/resources/folders/resources/passages/client/Client.js +149 -0
- package/dist/api/resources/folders/resources/passages/client/index.d.ts +1 -0
- package/dist/api/resources/folders/resources/passages/client/index.js +17 -0
- package/dist/api/resources/folders/{client/requests/ListFolderPassagesRequest.d.ts → resources/passages/client/requests/PassagesListRequest.d.ts} +1 -1
- package/dist/api/resources/folders/resources/passages/client/requests/index.d.ts +1 -0
- package/dist/api/resources/folders/resources/passages/client/requests/index.js +2 -0
- package/dist/api/resources/folders/resources/passages/index.d.ts +1 -0
- package/dist/api/resources/folders/resources/passages/index.js +17 -0
- 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 +5 -5
- 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 +3 -3
- package/dist/api/resources/sources/resources/passages/client/Client.js +1 -1
- package/dist/api/resources/steps/client/Client.js +2 -2
- 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 +1 -1
- package/dist/api/resources/templates/resources/agents/client/Client.js +1 -1
- package/dist/api/resources/tools/client/Client.js +19 -19
- package/dist/api/resources/voice/client/Client.js +1 -1
- package/dist/serialization/resources/agents/client/index.d.ts +0 -2
- package/dist/serialization/resources/agents/client/index.js +1 -3
- package/dist/serialization/resources/agents/{client/openFile.d.ts → resources/files/client/closeAll.d.ts} +3 -3
- package/dist/serialization/resources/agents/{client/closeAllOpenFiles.js → resources/files/client/closeAll.js} +1 -1
- package/dist/serialization/resources/agents/resources/files/client/index.d.ts +2 -0
- package/dist/serialization/resources/agents/resources/files/client/index.js +38 -0
- package/{serialization/resources/agents/client/closeAllOpenFiles.d.ts → dist/serialization/resources/agents/resources/files/client/open.d.ts} +3 -3
- package/dist/serialization/resources/agents/{client/openFile.js → resources/files/client/open.js} +1 -1
- package/dist/serialization/resources/agents/resources/files/index.d.ts +1 -0
- package/dist/serialization/resources/agents/resources/files/index.js +17 -0
- package/dist/serialization/resources/agents/resources/folders/client/index.d.ts +1 -0
- package/dist/serialization/resources/agents/resources/folders/client/index.js +37 -0
- package/dist/serialization/resources/agents/resources/folders/client/list.d.ts +11 -0
- package/dist/serialization/resources/agents/resources/folders/client/list.js +42 -0
- package/dist/serialization/resources/agents/resources/folders/index.d.ts +1 -0
- package/dist/serialization/resources/agents/resources/folders/index.js +17 -0
- package/dist/serialization/resources/agents/resources/index.d.ts +2 -0
- package/dist/serialization/resources/agents/resources/index.js +3 -1
- package/dist/serialization/resources/folders/client/{countFolders.d.ts → count.d.ts} +1 -1
- package/dist/serialization/resources/folders/client/index.d.ts +3 -5
- package/dist/serialization/resources/folders/client/index.js +4 -6
- package/dist/serialization/resources/folders/client/{listFolders.d.ts → list.d.ts} +1 -1
- package/{serialization/resources/folders/client/getFolderIdByName.d.ts → dist/serialization/resources/folders/client/retrieveByName.d.ts} +1 -1
- package/dist/serialization/resources/folders/index.d.ts +1 -0
- package/dist/serialization/resources/folders/index.js +1 -0
- package/dist/serialization/resources/folders/resources/files/client/index.d.ts +1 -0
- package/dist/serialization/resources/folders/resources/files/client/index.js +37 -0
- package/dist/serialization/resources/folders/resources/files/client/list.d.ts +11 -0
- package/dist/serialization/resources/folders/{client/listFolderFiles.js → resources/files/client/list.js} +2 -2
- package/dist/serialization/resources/folders/resources/files/index.d.ts +1 -0
- package/dist/serialization/resources/folders/resources/files/index.js +17 -0
- package/dist/serialization/resources/folders/resources/index.d.ts +2 -0
- package/dist/serialization/resources/folders/resources/index.js +38 -0
- package/dist/serialization/resources/folders/resources/passages/client/index.d.ts +1 -0
- package/dist/serialization/resources/folders/resources/passages/client/index.js +37 -0
- package/dist/serialization/resources/folders/resources/passages/client/list.d.ts +11 -0
- package/dist/serialization/resources/folders/{client/listFolderPassages.js → resources/passages/client/list.js} +2 -2
- package/dist/serialization/resources/folders/resources/passages/index.d.ts +1 -0
- package/dist/serialization/resources/folders/resources/passages/index.js +17 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/reference.md +1144 -931
- package/serialization/resources/agents/client/index.d.ts +0 -2
- package/serialization/resources/agents/client/index.js +1 -3
- package/serialization/resources/agents/{client/openFile.d.ts → resources/files/client/closeAll.d.ts} +3 -3
- package/serialization/resources/agents/{client/closeAllOpenFiles.js → resources/files/client/closeAll.js} +1 -1
- package/serialization/resources/agents/resources/files/client/index.d.ts +2 -0
- package/serialization/resources/agents/resources/files/client/index.js +38 -0
- package/{dist/serialization/resources/agents/client/closeAllOpenFiles.d.ts → serialization/resources/agents/resources/files/client/open.d.ts} +3 -3
- package/serialization/resources/agents/{client/openFile.js → resources/files/client/open.js} +1 -1
- package/serialization/resources/agents/resources/files/index.d.ts +1 -0
- package/serialization/resources/agents/resources/files/index.js +17 -0
- package/serialization/resources/agents/resources/folders/client/index.d.ts +1 -0
- package/serialization/resources/agents/resources/folders/client/index.js +37 -0
- package/serialization/resources/agents/resources/folders/client/list.d.ts +11 -0
- package/serialization/resources/agents/resources/folders/client/list.js +42 -0
- package/serialization/resources/agents/resources/folders/index.d.ts +1 -0
- package/serialization/resources/agents/resources/folders/index.js +17 -0
- package/serialization/resources/agents/resources/index.d.ts +2 -0
- package/serialization/resources/agents/resources/index.js +3 -1
- package/serialization/resources/folders/client/{countFolders.d.ts → count.d.ts} +1 -1
- package/serialization/resources/folders/client/index.d.ts +3 -5
- package/serialization/resources/folders/client/index.js +4 -6
- package/serialization/resources/folders/client/{listFolders.d.ts → list.d.ts} +1 -1
- package/{dist/serialization/resources/folders/client/getFolderIdByName.d.ts → serialization/resources/folders/client/retrieveByName.d.ts} +1 -1
- package/serialization/resources/folders/index.d.ts +1 -0
- package/serialization/resources/folders/index.js +1 -0
- package/serialization/resources/folders/resources/files/client/index.d.ts +1 -0
- package/serialization/resources/folders/resources/files/client/index.js +37 -0
- package/serialization/resources/folders/resources/files/client/list.d.ts +11 -0
- package/serialization/resources/folders/{client/listFolderFiles.js → resources/files/client/list.js} +2 -2
- package/serialization/resources/folders/resources/files/index.d.ts +1 -0
- package/serialization/resources/folders/resources/files/index.js +17 -0
- package/serialization/resources/folders/resources/index.d.ts +2 -0
- package/serialization/resources/folders/resources/index.js +38 -0
- package/serialization/resources/folders/resources/passages/client/index.d.ts +1 -0
- package/serialization/resources/folders/resources/passages/client/index.js +37 -0
- package/serialization/resources/folders/resources/passages/client/list.d.ts +11 -0
- package/serialization/resources/folders/{client/listFolderPassages.js → resources/passages/client/list.js} +2 -2
- package/serialization/resources/folders/resources/passages/index.d.ts +1 -0
- package/serialization/resources/folders/resources/passages/index.js +17 -0
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/dist/serialization/resources/folders/client/listFolderFiles.d.ts +0 -11
- package/dist/serialization/resources/folders/client/listFolderPassages.d.ts +0 -11
- package/serialization/resources/folders/client/listFolderFiles.d.ts +0 -11
- package/serialization/resources/folders/client/listFolderPassages.d.ts +0 -11
- /package/api/resources/folders/{client → resources/files/client}/requests/BodyUploadFileToFolder.js +0 -0
- /package/api/resources/folders/{client/requests/ListFolderFilesRequest.js → resources/files/client/requests/FilesListRequest.js} +0 -0
- /package/api/resources/folders/{client/requests/ListFolderPassagesRequest.js → resources/passages/client/requests/PassagesListRequest.js} +0 -0
- /package/dist/api/resources/folders/{client → resources/files/client}/requests/BodyUploadFileToFolder.js +0 -0
- /package/dist/api/resources/folders/{client/requests/ListFolderFilesRequest.js → resources/files/client/requests/FilesListRequest.js} +0 -0
- /package/dist/api/resources/folders/{client/requests/ListFolderPassagesRequest.js → resources/passages/client/requests/PassagesListRequest.js} +0 -0
- /package/dist/serialization/resources/folders/client/{countFolders.js → count.js} +0 -0
- /package/dist/serialization/resources/folders/client/{listFolders.js → list.js} +0 -0
- /package/dist/serialization/resources/folders/client/{getFolderIdByName.js → retrieveByName.js} +0 -0
- /package/serialization/resources/folders/client/{countFolders.js → count.js} +0 -0
- /package/serialization/resources/folders/client/{listFolders.js → list.js} +0 -0
- /package/serialization/resources/folders/client/{getFolderIdByName.js → retrieveByName.js} +0 -0
|
@@ -9,6 +9,8 @@ import { Blob } from "buffer";
|
|
|
9
9
|
import { Context } from "../resources/context/client/Client";
|
|
10
10
|
import { Tools } from "../resources/tools/client/Client";
|
|
11
11
|
import { Sources } from "../resources/sources/client/Client";
|
|
12
|
+
import { Folders } from "../resources/folders/client/Client";
|
|
13
|
+
import { Files } from "../resources/files/client/Client";
|
|
12
14
|
import { CoreMemory } from "../resources/coreMemory/client/Client";
|
|
13
15
|
import { Blocks } from "../resources/blocks/client/Client";
|
|
14
16
|
import { Passages } from "../resources/passages/client/Client";
|
|
@@ -44,6 +46,8 @@ export declare class Agents {
|
|
|
44
46
|
protected _context: Context | undefined;
|
|
45
47
|
protected _tools: Tools | undefined;
|
|
46
48
|
protected _sources: Sources | undefined;
|
|
49
|
+
protected _folders: Folders | undefined;
|
|
50
|
+
protected _files: Files | undefined;
|
|
47
51
|
protected _coreMemory: CoreMemory | undefined;
|
|
48
52
|
protected _blocks: Blocks | undefined;
|
|
49
53
|
protected _passages: Passages | undefined;
|
|
@@ -55,6 +59,8 @@ export declare class Agents {
|
|
|
55
59
|
get context(): Context;
|
|
56
60
|
get tools(): Tools;
|
|
57
61
|
get sources(): Sources;
|
|
62
|
+
get folders(): Folders;
|
|
63
|
+
get files(): Files;
|
|
58
64
|
get coreMemory(): CoreMemory;
|
|
59
65
|
get blocks(): Blocks;
|
|
60
66
|
get passages(): Passages;
|
|
@@ -163,54 +169,6 @@ export declare class Agents {
|
|
|
163
169
|
* await client.agents.modify("agent_id")
|
|
164
170
|
*/
|
|
165
171
|
modify(agentId: string, request?: Letta.UpdateAgent, requestOptions?: Agents.RequestOptions): Promise<Letta.AgentState>;
|
|
166
|
-
/**
|
|
167
|
-
* Closes all currently open files for a given agent.
|
|
168
|
-
*
|
|
169
|
-
* This endpoint updates the file state for the agent so that no files are marked as open.
|
|
170
|
-
* Typically used to reset the working memory view for the agent.
|
|
171
|
-
*
|
|
172
|
-
* @param {string} agentId
|
|
173
|
-
* @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
|
|
174
|
-
*
|
|
175
|
-
* @throws {@link Letta.UnprocessableEntityError}
|
|
176
|
-
*
|
|
177
|
-
* @example
|
|
178
|
-
* await client.agents.closeAllOpenFiles("agent_id")
|
|
179
|
-
*/
|
|
180
|
-
closeAllOpenFiles(agentId: string, requestOptions?: Agents.RequestOptions): Promise<string[]>;
|
|
181
|
-
/**
|
|
182
|
-
* Opens a specific file for a given agent.
|
|
183
|
-
*
|
|
184
|
-
* This endpoint marks a specific file as open in the agent's file state.
|
|
185
|
-
* The file will be included in the agent's working memory view.
|
|
186
|
-
* Returns a list of file names that were closed due to LRU eviction.
|
|
187
|
-
*
|
|
188
|
-
* @param {string} agentId
|
|
189
|
-
* @param {string} fileId
|
|
190
|
-
* @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
|
|
191
|
-
*
|
|
192
|
-
* @throws {@link Letta.UnprocessableEntityError}
|
|
193
|
-
*
|
|
194
|
-
* @example
|
|
195
|
-
* await client.agents.openFile("agent_id", "file_id")
|
|
196
|
-
*/
|
|
197
|
-
openFile(agentId: string, fileId: string, requestOptions?: Agents.RequestOptions): Promise<string[]>;
|
|
198
|
-
/**
|
|
199
|
-
* Closes a specific file for a given agent.
|
|
200
|
-
*
|
|
201
|
-
* This endpoint marks a specific file as closed in the agent's file state.
|
|
202
|
-
* The file will be removed from the agent's working memory view.
|
|
203
|
-
*
|
|
204
|
-
* @param {string} agentId
|
|
205
|
-
* @param {string} fileId
|
|
206
|
-
* @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
|
|
207
|
-
*
|
|
208
|
-
* @throws {@link Letta.UnprocessableEntityError}
|
|
209
|
-
*
|
|
210
|
-
* @example
|
|
211
|
-
* await client.agents.closeFile("agent_id", "file_id")
|
|
212
|
-
*/
|
|
213
|
-
closeFile(agentId: string, fileId: string, requestOptions?: Agents.RequestOptions): Promise<unknown>;
|
|
214
172
|
/**
|
|
215
173
|
* Summarize an agent's conversation history to a target message length.
|
|
216
174
|
*
|
|
@@ -58,13 +58,15 @@ const errors = __importStar(require("../../../../errors/index"));
|
|
|
58
58
|
const Client_1 = require("../resources/context/client/Client");
|
|
59
59
|
const Client_2 = require("../resources/tools/client/Client");
|
|
60
60
|
const Client_3 = require("../resources/sources/client/Client");
|
|
61
|
-
const Client_4 = require("../resources/
|
|
62
|
-
const Client_5 = require("../resources/
|
|
63
|
-
const Client_6 = require("../resources/
|
|
64
|
-
const Client_7 = require("../resources/
|
|
65
|
-
const Client_8 = require("../resources/
|
|
66
|
-
const Client_9 = require("../resources/
|
|
67
|
-
const Client_10 = require("../resources/
|
|
61
|
+
const Client_4 = require("../resources/folders/client/Client");
|
|
62
|
+
const Client_5 = require("../resources/files/client/Client");
|
|
63
|
+
const Client_6 = require("../resources/coreMemory/client/Client");
|
|
64
|
+
const Client_7 = require("../resources/blocks/client/Client");
|
|
65
|
+
const Client_8 = require("../resources/passages/client/Client");
|
|
66
|
+
const Client_9 = require("../resources/messages/client/Client");
|
|
67
|
+
const Client_10 = require("../resources/groups/client/Client");
|
|
68
|
+
const Client_11 = require("../resources/templates/client/Client");
|
|
69
|
+
const Client_12 = require("../resources/memoryVariables/client/Client");
|
|
68
70
|
class Agents {
|
|
69
71
|
constructor(_options = {}) {
|
|
70
72
|
this._options = _options;
|
|
@@ -81,33 +83,41 @@ class Agents {
|
|
|
81
83
|
var _a;
|
|
82
84
|
return ((_a = this._sources) !== null && _a !== void 0 ? _a : (this._sources = new Client_3.Sources(this._options)));
|
|
83
85
|
}
|
|
86
|
+
get folders() {
|
|
87
|
+
var _a;
|
|
88
|
+
return ((_a = this._folders) !== null && _a !== void 0 ? _a : (this._folders = new Client_4.Folders(this._options)));
|
|
89
|
+
}
|
|
90
|
+
get files() {
|
|
91
|
+
var _a;
|
|
92
|
+
return ((_a = this._files) !== null && _a !== void 0 ? _a : (this._files = new Client_5.Files(this._options)));
|
|
93
|
+
}
|
|
84
94
|
get coreMemory() {
|
|
85
95
|
var _a;
|
|
86
|
-
return ((_a = this._coreMemory) !== null && _a !== void 0 ? _a : (this._coreMemory = new
|
|
96
|
+
return ((_a = this._coreMemory) !== null && _a !== void 0 ? _a : (this._coreMemory = new Client_6.CoreMemory(this._options)));
|
|
87
97
|
}
|
|
88
98
|
get blocks() {
|
|
89
99
|
var _a;
|
|
90
|
-
return ((_a = this._blocks) !== null && _a !== void 0 ? _a : (this._blocks = new
|
|
100
|
+
return ((_a = this._blocks) !== null && _a !== void 0 ? _a : (this._blocks = new Client_7.Blocks(this._options)));
|
|
91
101
|
}
|
|
92
102
|
get passages() {
|
|
93
103
|
var _a;
|
|
94
|
-
return ((_a = this._passages) !== null && _a !== void 0 ? _a : (this._passages = new
|
|
104
|
+
return ((_a = this._passages) !== null && _a !== void 0 ? _a : (this._passages = new Client_8.Passages(this._options)));
|
|
95
105
|
}
|
|
96
106
|
get messages() {
|
|
97
107
|
var _a;
|
|
98
|
-
return ((_a = this._messages) !== null && _a !== void 0 ? _a : (this._messages = new
|
|
108
|
+
return ((_a = this._messages) !== null && _a !== void 0 ? _a : (this._messages = new Client_9.Messages(this._options)));
|
|
99
109
|
}
|
|
100
110
|
get groups() {
|
|
101
111
|
var _a;
|
|
102
|
-
return ((_a = this._groups) !== null && _a !== void 0 ? _a : (this._groups = new
|
|
112
|
+
return ((_a = this._groups) !== null && _a !== void 0 ? _a : (this._groups = new Client_10.Groups(this._options)));
|
|
103
113
|
}
|
|
104
114
|
get templates() {
|
|
105
115
|
var _a;
|
|
106
|
-
return ((_a = this._templates) !== null && _a !== void 0 ? _a : (this._templates = new
|
|
116
|
+
return ((_a = this._templates) !== null && _a !== void 0 ? _a : (this._templates = new Client_11.Templates(this._options)));
|
|
107
117
|
}
|
|
108
118
|
get memoryVariables() {
|
|
109
119
|
var _a;
|
|
110
|
-
return ((_a = this._memoryVariables) !== null && _a !== void 0 ? _a : (this._memoryVariables = new
|
|
120
|
+
return ((_a = this._memoryVariables) !== null && _a !== void 0 ? _a : (this._memoryVariables = new Client_12.MemoryVariables(this._options)));
|
|
111
121
|
}
|
|
112
122
|
/**
|
|
113
123
|
* List all agents associated with a given user.
|
|
@@ -193,7 +203,7 @@ class Agents {
|
|
|
193
203
|
method: "GET",
|
|
194
204
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
195
205
|
? yield core.Supplier.get(this._options.project)
|
|
196
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
206
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.163", "User-Agent": "@letta-ai/letta-client/0.1.163", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
197
207
|
contentType: "application/json",
|
|
198
208
|
queryParameters: _queryParams,
|
|
199
209
|
requestType: "json",
|
|
@@ -261,7 +271,7 @@ class Agents {
|
|
|
261
271
|
method: "POST",
|
|
262
272
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
263
273
|
? yield core.Supplier.get(this._options.project)
|
|
264
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
274
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.163", "User-Agent": "@letta-ai/letta-client/0.1.163", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
265
275
|
contentType: "application/json",
|
|
266
276
|
requestType: "json",
|
|
267
277
|
body: serializers.CreateAgentRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -328,7 +338,7 @@ class Agents {
|
|
|
328
338
|
method: "GET",
|
|
329
339
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
330
340
|
? yield core.Supplier.get(this._options.project)
|
|
331
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
341
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.163", "User-Agent": "@letta-ai/letta-client/0.1.163", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
332
342
|
contentType: "application/json",
|
|
333
343
|
requestType: "json",
|
|
334
344
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -395,7 +405,7 @@ class Agents {
|
|
|
395
405
|
method: "GET",
|
|
396
406
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
397
407
|
? yield core.Supplier.get(this._options.project)
|
|
398
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
408
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.163", "User-Agent": "@letta-ai/letta-client/0.1.163", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
399
409
|
contentType: "application/json",
|
|
400
410
|
requestType: "json",
|
|
401
411
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -479,7 +489,7 @@ class Agents {
|
|
|
479
489
|
method: "POST",
|
|
480
490
|
headers: Object.assign(Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
481
491
|
? yield core.Supplier.get(this._options.project)
|
|
482
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
492
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.163", "User-Agent": "@letta-ai/letta-client/0.1.163", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), _maybeEncodedRequest.headers), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
483
493
|
queryParameters: _queryParams,
|
|
484
494
|
requestType: "file",
|
|
485
495
|
duplex: _maybeEncodedRequest.duplex,
|
|
@@ -559,7 +569,7 @@ class Agents {
|
|
|
559
569
|
method: "GET",
|
|
560
570
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
561
571
|
? yield core.Supplier.get(this._options.project)
|
|
562
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
572
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.163", "User-Agent": "@letta-ai/letta-client/0.1.163", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
563
573
|
contentType: "application/json",
|
|
564
574
|
queryParameters: _queryParams,
|
|
565
575
|
requestType: "json",
|
|
@@ -627,7 +637,7 @@ class Agents {
|
|
|
627
637
|
method: "DELETE",
|
|
628
638
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
629
639
|
? yield core.Supplier.get(this._options.project)
|
|
630
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
640
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.163", "User-Agent": "@letta-ai/letta-client/0.1.163", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
631
641
|
contentType: "application/json",
|
|
632
642
|
requestType: "json",
|
|
633
643
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -689,7 +699,7 @@ class Agents {
|
|
|
689
699
|
method: "PATCH",
|
|
690
700
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
691
701
|
? yield core.Supplier.get(this._options.project)
|
|
692
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
702
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.163", "User-Agent": "@letta-ai/letta-client/0.1.163", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
693
703
|
contentType: "application/json",
|
|
694
704
|
requestType: "json",
|
|
695
705
|
body: serializers.UpdateAgent.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -738,213 +748,6 @@ class Agents {
|
|
|
738
748
|
}
|
|
739
749
|
});
|
|
740
750
|
}
|
|
741
|
-
/**
|
|
742
|
-
* Closes all currently open files for a given agent.
|
|
743
|
-
*
|
|
744
|
-
* This endpoint updates the file state for the agent so that no files are marked as open.
|
|
745
|
-
* Typically used to reset the working memory view for the agent.
|
|
746
|
-
*
|
|
747
|
-
* @param {string} agentId
|
|
748
|
-
* @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
|
|
749
|
-
*
|
|
750
|
-
* @throws {@link Letta.UnprocessableEntityError}
|
|
751
|
-
*
|
|
752
|
-
* @example
|
|
753
|
-
* await client.agents.closeAllOpenFiles("agent_id")
|
|
754
|
-
*/
|
|
755
|
-
closeAllOpenFiles(agentId, requestOptions) {
|
|
756
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
757
|
-
var _a, _b, _c;
|
|
758
|
-
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
759
|
-
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/files/close-all`),
|
|
760
|
-
method: "PATCH",
|
|
761
|
-
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
762
|
-
? yield core.Supplier.get(this._options.project)
|
|
763
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.161", "User-Agent": "@letta-ai/letta-client/0.1.161", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
764
|
-
contentType: "application/json",
|
|
765
|
-
requestType: "json",
|
|
766
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
767
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
768
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
769
|
-
});
|
|
770
|
-
if (_response.ok) {
|
|
771
|
-
return serializers.agents.closeAllOpenFiles.Response.parseOrThrow(_response.body, {
|
|
772
|
-
unrecognizedObjectKeys: "passthrough",
|
|
773
|
-
allowUnrecognizedUnionMembers: true,
|
|
774
|
-
allowUnrecognizedEnumValues: true,
|
|
775
|
-
skipValidation: true,
|
|
776
|
-
breadcrumbsPrefix: ["response"],
|
|
777
|
-
});
|
|
778
|
-
}
|
|
779
|
-
if (_response.error.reason === "status-code") {
|
|
780
|
-
switch (_response.error.statusCode) {
|
|
781
|
-
case 422:
|
|
782
|
-
throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
783
|
-
unrecognizedObjectKeys: "passthrough",
|
|
784
|
-
allowUnrecognizedUnionMembers: true,
|
|
785
|
-
allowUnrecognizedEnumValues: true,
|
|
786
|
-
skipValidation: true,
|
|
787
|
-
breadcrumbsPrefix: ["response"],
|
|
788
|
-
}));
|
|
789
|
-
default:
|
|
790
|
-
throw new errors.LettaError({
|
|
791
|
-
statusCode: _response.error.statusCode,
|
|
792
|
-
body: _response.error.body,
|
|
793
|
-
});
|
|
794
|
-
}
|
|
795
|
-
}
|
|
796
|
-
switch (_response.error.reason) {
|
|
797
|
-
case "non-json":
|
|
798
|
-
throw new errors.LettaError({
|
|
799
|
-
statusCode: _response.error.statusCode,
|
|
800
|
-
body: _response.error.rawBody,
|
|
801
|
-
});
|
|
802
|
-
case "timeout":
|
|
803
|
-
throw new errors.LettaTimeoutError("Timeout exceeded when calling PATCH /v1/agents/{agent_id}/files/close-all.");
|
|
804
|
-
case "unknown":
|
|
805
|
-
throw new errors.LettaError({
|
|
806
|
-
message: _response.error.errorMessage,
|
|
807
|
-
});
|
|
808
|
-
}
|
|
809
|
-
});
|
|
810
|
-
}
|
|
811
|
-
/**
|
|
812
|
-
* Opens a specific file for a given agent.
|
|
813
|
-
*
|
|
814
|
-
* This endpoint marks a specific file as open in the agent's file state.
|
|
815
|
-
* The file will be included in the agent's working memory view.
|
|
816
|
-
* Returns a list of file names that were closed due to LRU eviction.
|
|
817
|
-
*
|
|
818
|
-
* @param {string} agentId
|
|
819
|
-
* @param {string} fileId
|
|
820
|
-
* @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
|
|
821
|
-
*
|
|
822
|
-
* @throws {@link Letta.UnprocessableEntityError}
|
|
823
|
-
*
|
|
824
|
-
* @example
|
|
825
|
-
* await client.agents.openFile("agent_id", "file_id")
|
|
826
|
-
*/
|
|
827
|
-
openFile(agentId, fileId, requestOptions) {
|
|
828
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
829
|
-
var _a, _b, _c;
|
|
830
|
-
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
831
|
-
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/${encodeURIComponent(fileId)}/open`),
|
|
832
|
-
method: "PATCH",
|
|
833
|
-
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
834
|
-
? yield core.Supplier.get(this._options.project)
|
|
835
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.161", "User-Agent": "@letta-ai/letta-client/0.1.161", "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),
|
|
836
|
-
contentType: "application/json",
|
|
837
|
-
requestType: "json",
|
|
838
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
839
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
840
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
841
|
-
});
|
|
842
|
-
if (_response.ok) {
|
|
843
|
-
return serializers.agents.openFile.Response.parseOrThrow(_response.body, {
|
|
844
|
-
unrecognizedObjectKeys: "passthrough",
|
|
845
|
-
allowUnrecognizedUnionMembers: true,
|
|
846
|
-
allowUnrecognizedEnumValues: true,
|
|
847
|
-
skipValidation: true,
|
|
848
|
-
breadcrumbsPrefix: ["response"],
|
|
849
|
-
});
|
|
850
|
-
}
|
|
851
|
-
if (_response.error.reason === "status-code") {
|
|
852
|
-
switch (_response.error.statusCode) {
|
|
853
|
-
case 422:
|
|
854
|
-
throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
855
|
-
unrecognizedObjectKeys: "passthrough",
|
|
856
|
-
allowUnrecognizedUnionMembers: true,
|
|
857
|
-
allowUnrecognizedEnumValues: true,
|
|
858
|
-
skipValidation: true,
|
|
859
|
-
breadcrumbsPrefix: ["response"],
|
|
860
|
-
}));
|
|
861
|
-
default:
|
|
862
|
-
throw new errors.LettaError({
|
|
863
|
-
statusCode: _response.error.statusCode,
|
|
864
|
-
body: _response.error.body,
|
|
865
|
-
});
|
|
866
|
-
}
|
|
867
|
-
}
|
|
868
|
-
switch (_response.error.reason) {
|
|
869
|
-
case "non-json":
|
|
870
|
-
throw new errors.LettaError({
|
|
871
|
-
statusCode: _response.error.statusCode,
|
|
872
|
-
body: _response.error.rawBody,
|
|
873
|
-
});
|
|
874
|
-
case "timeout":
|
|
875
|
-
throw new errors.LettaTimeoutError("Timeout exceeded when calling PATCH /v1/agents/{agent_id}/files/{file_id}/open.");
|
|
876
|
-
case "unknown":
|
|
877
|
-
throw new errors.LettaError({
|
|
878
|
-
message: _response.error.errorMessage,
|
|
879
|
-
});
|
|
880
|
-
}
|
|
881
|
-
});
|
|
882
|
-
}
|
|
883
|
-
/**
|
|
884
|
-
* Closes a specific file for a given agent.
|
|
885
|
-
*
|
|
886
|
-
* This endpoint marks a specific file as closed in the agent's file state.
|
|
887
|
-
* The file will be removed from the agent's working memory view.
|
|
888
|
-
*
|
|
889
|
-
* @param {string} agentId
|
|
890
|
-
* @param {string} fileId
|
|
891
|
-
* @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
|
|
892
|
-
*
|
|
893
|
-
* @throws {@link Letta.UnprocessableEntityError}
|
|
894
|
-
*
|
|
895
|
-
* @example
|
|
896
|
-
* await client.agents.closeFile("agent_id", "file_id")
|
|
897
|
-
*/
|
|
898
|
-
closeFile(agentId, fileId, requestOptions) {
|
|
899
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
900
|
-
var _a, _b, _c;
|
|
901
|
-
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
902
|
-
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/${encodeURIComponent(fileId)}/close`),
|
|
903
|
-
method: "PATCH",
|
|
904
|
-
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
905
|
-
? yield core.Supplier.get(this._options.project)
|
|
906
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.161", "User-Agent": "@letta-ai/letta-client/0.1.161", "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),
|
|
907
|
-
contentType: "application/json",
|
|
908
|
-
requestType: "json",
|
|
909
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
910
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
911
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
912
|
-
});
|
|
913
|
-
if (_response.ok) {
|
|
914
|
-
return _response.body;
|
|
915
|
-
}
|
|
916
|
-
if (_response.error.reason === "status-code") {
|
|
917
|
-
switch (_response.error.statusCode) {
|
|
918
|
-
case 422:
|
|
919
|
-
throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
920
|
-
unrecognizedObjectKeys: "passthrough",
|
|
921
|
-
allowUnrecognizedUnionMembers: true,
|
|
922
|
-
allowUnrecognizedEnumValues: true,
|
|
923
|
-
skipValidation: true,
|
|
924
|
-
breadcrumbsPrefix: ["response"],
|
|
925
|
-
}));
|
|
926
|
-
default:
|
|
927
|
-
throw new errors.LettaError({
|
|
928
|
-
statusCode: _response.error.statusCode,
|
|
929
|
-
body: _response.error.body,
|
|
930
|
-
});
|
|
931
|
-
}
|
|
932
|
-
}
|
|
933
|
-
switch (_response.error.reason) {
|
|
934
|
-
case "non-json":
|
|
935
|
-
throw new errors.LettaError({
|
|
936
|
-
statusCode: _response.error.statusCode,
|
|
937
|
-
body: _response.error.rawBody,
|
|
938
|
-
});
|
|
939
|
-
case "timeout":
|
|
940
|
-
throw new errors.LettaTimeoutError("Timeout exceeded when calling PATCH /v1/agents/{agent_id}/files/{file_id}/close.");
|
|
941
|
-
case "unknown":
|
|
942
|
-
throw new errors.LettaError({
|
|
943
|
-
message: _response.error.errorMessage,
|
|
944
|
-
});
|
|
945
|
-
}
|
|
946
|
-
});
|
|
947
|
-
}
|
|
948
751
|
/**
|
|
949
752
|
* Summarize an agent's conversation history to a target message length.
|
|
950
753
|
*
|
|
@@ -973,7 +776,7 @@ class Agents {
|
|
|
973
776
|
method: "POST",
|
|
974
777
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
975
778
|
? yield core.Supplier.get(this._options.project)
|
|
976
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
779
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.163", "User-Agent": "@letta-ai/letta-client/0.1.163", "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),
|
|
977
780
|
contentType: "application/json",
|
|
978
781
|
queryParameters: _queryParams,
|
|
979
782
|
requestType: "json",
|
|
@@ -1041,7 +844,7 @@ class Agents {
|
|
|
1041
844
|
method: "POST",
|
|
1042
845
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
1043
846
|
? yield core.Supplier.get(this._options.project)
|
|
1044
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
847
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.163", "User-Agent": "@letta-ai/letta-client/0.1.163", "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),
|
|
1045
848
|
contentType: "application/json",
|
|
1046
849
|
requestType: "json",
|
|
1047
850
|
body: serializers.AgentsSearchRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -79,7 +79,7 @@ class Blocks {
|
|
|
79
79
|
method: "GET",
|
|
80
80
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
81
81
|
? yield core.Supplier.get(this._options.project)
|
|
82
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
82
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.163", "User-Agent": "@letta-ai/letta-client/0.1.163", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
83
83
|
contentType: "application/json",
|
|
84
84
|
requestType: "json",
|
|
85
85
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -148,7 +148,7 @@ class Blocks {
|
|
|
148
148
|
method: "PATCH",
|
|
149
149
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
150
150
|
? yield core.Supplier.get(this._options.project)
|
|
151
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
151
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.163", "User-Agent": "@letta-ai/letta-client/0.1.163", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
152
152
|
contentType: "application/json",
|
|
153
153
|
requestType: "json",
|
|
154
154
|
body: serializers.BlockUpdate.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -216,7 +216,7 @@ class Blocks {
|
|
|
216
216
|
method: "GET",
|
|
217
217
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
218
218
|
? yield core.Supplier.get(this._options.project)
|
|
219
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
219
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.163", "User-Agent": "@letta-ai/letta-client/0.1.163", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
220
220
|
contentType: "application/json",
|
|
221
221
|
requestType: "json",
|
|
222
222
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -284,7 +284,7 @@ class Blocks {
|
|
|
284
284
|
method: "PATCH",
|
|
285
285
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
286
286
|
? yield core.Supplier.get(this._options.project)
|
|
287
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
287
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.163", "User-Agent": "@letta-ai/letta-client/0.1.163", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
288
288
|
contentType: "application/json",
|
|
289
289
|
requestType: "json",
|
|
290
290
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -352,7 +352,7 @@ class Blocks {
|
|
|
352
352
|
method: "PATCH",
|
|
353
353
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
354
354
|
? yield core.Supplier.get(this._options.project)
|
|
355
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
355
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.163", "User-Agent": "@letta-ai/letta-client/0.1.163", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
356
356
|
contentType: "application/json",
|
|
357
357
|
requestType: "json",
|
|
358
358
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -78,7 +78,7 @@ class Context {
|
|
|
78
78
|
method: "GET",
|
|
79
79
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
80
80
|
? yield core.Supplier.get(this._options.project)
|
|
81
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
81
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.163", "User-Agent": "@letta-ai/letta-client/0.1.163", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
82
82
|
contentType: "application/json",
|
|
83
83
|
requestType: "json",
|
|
84
84
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -79,7 +79,7 @@ class CoreMemory {
|
|
|
79
79
|
method: "GET",
|
|
80
80
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
81
81
|
? yield core.Supplier.get(this._options.project)
|
|
82
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
82
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.163", "User-Agent": "@letta-ai/letta-client/0.1.163", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
83
83
|
contentType: "application/json",
|
|
84
84
|
requestType: "json",
|
|
85
85
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -0,0 +1,83 @@
|
|
|
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
|
+
export declare namespace Files {
|
|
7
|
+
interface Options {
|
|
8
|
+
environment?: core.Supplier<environments.LettaEnvironment | string>;
|
|
9
|
+
/** Specify a custom URL to connect the client to. */
|
|
10
|
+
baseUrl?: core.Supplier<string>;
|
|
11
|
+
token?: core.Supplier<string | undefined>;
|
|
12
|
+
/** Override the X-Project header */
|
|
13
|
+
project?: core.Supplier<string | undefined>;
|
|
14
|
+
fetcher?: core.FetchFunction;
|
|
15
|
+
}
|
|
16
|
+
interface RequestOptions {
|
|
17
|
+
/** The maximum time to wait for a response in seconds. */
|
|
18
|
+
timeoutInSeconds?: number;
|
|
19
|
+
/** The number of times to retry the request. Defaults to 2. */
|
|
20
|
+
maxRetries?: number;
|
|
21
|
+
/** A hook to abort the request. */
|
|
22
|
+
abortSignal?: AbortSignal;
|
|
23
|
+
/** Override the X-Project header */
|
|
24
|
+
project?: string | undefined;
|
|
25
|
+
/** Additional headers to include in the request. */
|
|
26
|
+
headers?: Record<string, string>;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export declare class Files {
|
|
30
|
+
protected readonly _options: Files.Options;
|
|
31
|
+
constructor(_options?: Files.Options);
|
|
32
|
+
/**
|
|
33
|
+
* Closes all currently open files for a given agent.
|
|
34
|
+
*
|
|
35
|
+
* This endpoint updates the file state for the agent so that no files are marked as open.
|
|
36
|
+
* Typically used to reset the working memory view for the agent.
|
|
37
|
+
*
|
|
38
|
+
* @param {string} agentId
|
|
39
|
+
* @param {Files.RequestOptions} requestOptions - Request-specific configuration.
|
|
40
|
+
*
|
|
41
|
+
* @throws {@link Letta.UnprocessableEntityError}
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* await client.agents.files.closeAll("agent_id")
|
|
45
|
+
*/
|
|
46
|
+
closeAll(agentId: string, requestOptions?: Files.RequestOptions): Promise<string[]>;
|
|
47
|
+
/**
|
|
48
|
+
* Opens a specific file for a given agent.
|
|
49
|
+
*
|
|
50
|
+
* This endpoint marks a specific file as open in the agent's file state.
|
|
51
|
+
* The file will be included in the agent's working memory view.
|
|
52
|
+
* Returns a list of file names that were closed due to LRU eviction.
|
|
53
|
+
*
|
|
54
|
+
* @param {string} agentId
|
|
55
|
+
* @param {string} fileId
|
|
56
|
+
* @param {Files.RequestOptions} requestOptions - Request-specific configuration.
|
|
57
|
+
*
|
|
58
|
+
* @throws {@link Letta.UnprocessableEntityError}
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* await client.agents.files.open("agent_id", "file_id")
|
|
62
|
+
*/
|
|
63
|
+
open(agentId: string, fileId: string, requestOptions?: Files.RequestOptions): Promise<string[]>;
|
|
64
|
+
/**
|
|
65
|
+
* Closes a specific file for a given agent.
|
|
66
|
+
*
|
|
67
|
+
* This endpoint marks a specific file as closed in the agent's file state.
|
|
68
|
+
* The file will be removed from the agent's working memory view.
|
|
69
|
+
*
|
|
70
|
+
* @param {string} agentId
|
|
71
|
+
* @param {string} fileId
|
|
72
|
+
* @param {Files.RequestOptions} requestOptions - Request-specific configuration.
|
|
73
|
+
*
|
|
74
|
+
* @throws {@link Letta.UnprocessableEntityError}
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* await client.agents.files.close("agent_id", "file_id")
|
|
78
|
+
*/
|
|
79
|
+
close(agentId: string, fileId: string, requestOptions?: Files.RequestOptions): Promise<unknown>;
|
|
80
|
+
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
81
|
+
Authorization: string;
|
|
82
|
+
}>;
|
|
83
|
+
}
|