@letta-ai/letta-client 0.1.38 → 0.1.39
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 -3
- package/api/resources/agents/client/Client.js +21 -16
- package/api/resources/agents/resources/blocks/client/Client.d.ts +97 -0
- package/api/resources/agents/resources/blocks/client/Client.js +400 -0
- package/api/resources/agents/resources/blocks/client/index.d.ts +1 -0
- package/api/resources/agents/resources/context/client/Client.js +1 -1
- package/api/resources/agents/resources/coreMemory/client/Client.d.ts +0 -65
- package/api/resources/agents/resources/coreMemory/client/Client.js +1 -332
- package/api/resources/agents/resources/index.d.ts +3 -2
- package/api/resources/agents/resources/index.js +4 -3
- package/api/resources/agents/resources/memoryVariables/client/Client.js +1 -1
- package/api/resources/agents/resources/messages/client/Client.js +5 -5
- package/api/resources/agents/resources/{archivalMemory → passages}/client/Client.d.ts +14 -14
- package/{dist/api/resources/agents/resources/archivalMemory → api/resources/agents/resources/passages}/client/Client.js +15 -15
- package/api/resources/agents/resources/{archivalMemory/client/requests/ArchivalMemoryListRequest.d.ts → passages/client/requests/PassagesListRequest.d.ts} +1 -1
- package/api/resources/agents/resources/passages/client/requests/index.d.ts +2 -0
- 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/blocks/client/Client.js +6 -6
- package/api/resources/health/client/Client.js +1 -1
- package/api/resources/identities/client/Client.js +6 -6
- package/api/resources/jobs/client/Client.js +4 -4
- package/api/resources/models/client/Client.js +2 -2
- package/api/resources/providers/client/Client.js +4 -4
- package/api/resources/runs/client/Client.js +6 -6
- package/api/resources/sources/client/Client.js +6 -6
- 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/tag/client/Client.js +1 -1
- package/api/resources/templates/client/Client.js +1 -1
- package/api/resources/tools/client/Client.js +11 -11
- package/dist/api/resources/agents/client/Client.d.ts +6 -3
- package/dist/api/resources/agents/client/Client.js +21 -16
- package/dist/api/resources/agents/resources/blocks/client/Client.d.ts +97 -0
- package/dist/api/resources/agents/resources/blocks/client/Client.js +400 -0
- package/dist/api/resources/agents/resources/blocks/client/index.d.ts +1 -0
- package/dist/api/resources/agents/resources/blocks/client/index.js +2 -0
- package/dist/api/resources/agents/resources/context/client/Client.js +1 -1
- package/dist/api/resources/agents/resources/coreMemory/client/Client.d.ts +0 -65
- package/dist/api/resources/agents/resources/coreMemory/client/Client.js +1 -332
- package/dist/api/resources/agents/resources/index.d.ts +3 -2
- package/dist/api/resources/agents/resources/index.js +4 -3
- package/dist/api/resources/agents/resources/memoryVariables/client/Client.js +1 -1
- package/dist/api/resources/agents/resources/messages/client/Client.js +5 -5
- package/dist/api/resources/agents/resources/{archivalMemory → passages}/client/Client.d.ts +14 -14
- package/{api/resources/agents/resources/archivalMemory → dist/api/resources/agents/resources/passages}/client/Client.js +15 -15
- package/dist/api/resources/agents/resources/{archivalMemory/client/requests/ArchivalMemoryListRequest.d.ts → passages/client/requests/PassagesListRequest.d.ts} +1 -1
- package/dist/api/resources/agents/resources/passages/client/requests/index.d.ts +2 -0
- package/dist/api/resources/agents/resources/passages/client/requests/index.js +2 -0
- 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/blocks/client/Client.js +6 -6
- package/dist/api/resources/health/client/Client.js +1 -1
- package/dist/api/resources/identities/client/Client.js +6 -6
- package/dist/api/resources/jobs/client/Client.js +4 -4
- package/dist/api/resources/models/client/Client.js +2 -2
- package/dist/api/resources/providers/client/Client.js +4 -4
- package/dist/api/resources/runs/client/Client.js +6 -6
- package/dist/api/resources/sources/client/Client.js +6 -6
- 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/tag/client/Client.js +1 -1
- package/dist/api/resources/templates/client/Client.js +1 -1
- package/dist/api/resources/tools/client/Client.js +11 -11
- package/dist/serialization/resources/agents/resources/blocks/client/index.d.ts +1 -0
- package/dist/serialization/resources/agents/resources/{coreMemory → blocks}/client/index.js +2 -2
- package/dist/serialization/resources/agents/resources/{coreMemory/client/listBlocks.d.ts → blocks/client/list.d.ts} +1 -1
- package/dist/serialization/resources/agents/resources/index.d.ts +3 -3
- package/dist/serialization/resources/agents/resources/index.js +4 -4
- package/dist/serialization/resources/agents/resources/{archivalMemory → passages}/client/create.d.ts +1 -1
- package/dist/serialization/resources/agents/resources/{archivalMemory → passages}/client/list.d.ts +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/reference.md +28 -26
- package/serialization/resources/agents/resources/blocks/client/index.d.ts +1 -0
- package/serialization/resources/agents/resources/{coreMemory → blocks}/client/index.js +2 -2
- package/serialization/resources/agents/resources/{coreMemory/client/listBlocks.d.ts → blocks/client/list.d.ts} +1 -1
- package/serialization/resources/agents/resources/blocks/index.d.ts +1 -0
- package/serialization/resources/agents/resources/blocks/index.js +17 -0
- package/serialization/resources/agents/resources/index.d.ts +3 -3
- package/serialization/resources/agents/resources/index.js +4 -4
- package/serialization/resources/agents/resources/{archivalMemory → passages}/client/create.d.ts +1 -1
- package/serialization/resources/agents/resources/{archivalMemory → passages}/client/list.d.ts +1 -1
- package/serialization/resources/agents/resources/passages/index.d.ts +1 -0
- package/serialization/resources/agents/resources/passages/index.js +17 -0
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/api/resources/agents/resources/archivalMemory/client/requests/index.d.ts +0 -2
- package/dist/api/resources/agents/resources/archivalMemory/client/requests/index.d.ts +0 -2
- package/dist/serialization/resources/agents/resources/coreMemory/client/index.d.ts +0 -1
- package/serialization/resources/agents/resources/coreMemory/client/index.d.ts +0 -1
- /package/api/resources/agents/resources/{archivalMemory/client/requests → blocks/client}/index.js +0 -0
- /package/api/resources/agents/resources/{archivalMemory → blocks}/index.d.ts +0 -0
- /package/api/resources/agents/resources/{archivalMemory → blocks}/index.js +0 -0
- /package/api/resources/agents/resources/{archivalMemory → passages}/client/index.d.ts +0 -0
- /package/api/resources/agents/resources/{archivalMemory → passages}/client/index.js +0 -0
- /package/api/resources/agents/resources/{archivalMemory → passages}/client/requests/CreateArchivalMemory.d.ts +0 -0
- /package/api/resources/agents/resources/{archivalMemory → passages}/client/requests/CreateArchivalMemory.js +0 -0
- /package/api/resources/agents/resources/{archivalMemory/client/requests/ArchivalMemoryListRequest.js → passages/client/requests/PassagesListRequest.js} +0 -0
- /package/{dist/api/resources/agents/resources/archivalMemory → api/resources/agents/resources/passages}/client/requests/index.js +0 -0
- /package/{dist/api/resources/agents/resources/archivalMemory → api/resources/agents/resources/passages}/index.d.ts +0 -0
- /package/{dist/api/resources/agents/resources/archivalMemory → api/resources/agents/resources/passages}/index.js +0 -0
- /package/dist/{serialization/resources/agents/resources/archivalMemory → api/resources/agents/resources/blocks}/index.d.ts +0 -0
- /package/dist/{serialization/resources/agents/resources/archivalMemory → api/resources/agents/resources/blocks}/index.js +0 -0
- /package/dist/api/resources/agents/resources/{archivalMemory → passages}/client/index.d.ts +0 -0
- /package/dist/api/resources/agents/resources/{archivalMemory → passages}/client/index.js +0 -0
- /package/dist/api/resources/agents/resources/{archivalMemory → passages}/client/requests/CreateArchivalMemory.d.ts +0 -0
- /package/dist/api/resources/agents/resources/{archivalMemory → passages}/client/requests/CreateArchivalMemory.js +0 -0
- /package/dist/api/resources/agents/resources/{archivalMemory/client/requests/ArchivalMemoryListRequest.js → passages/client/requests/PassagesListRequest.js} +0 -0
- /package/dist/{serialization/resources/agents/resources/coreMemory → api/resources/agents/resources/passages}/index.d.ts +0 -0
- /package/dist/{serialization/resources/agents/resources/coreMemory → api/resources/agents/resources/passages}/index.js +0 -0
- /package/dist/serialization/resources/agents/resources/{coreMemory/client/listBlocks.js → blocks/client/list.js} +0 -0
- /package/{serialization/resources/agents/resources/archivalMemory → dist/serialization/resources/agents/resources/blocks}/index.d.ts +0 -0
- /package/{serialization/resources/agents/resources/archivalMemory → dist/serialization/resources/agents/resources/blocks}/index.js +0 -0
- /package/dist/serialization/resources/agents/resources/{archivalMemory → passages}/client/create.js +0 -0
- /package/dist/serialization/resources/agents/resources/{archivalMemory → passages}/client/index.d.ts +0 -0
- /package/dist/serialization/resources/agents/resources/{archivalMemory → passages}/client/index.js +0 -0
- /package/dist/serialization/resources/agents/resources/{archivalMemory → passages}/client/list.js +0 -0
- /package/dist/serialization/resources/agents/resources/{archivalMemory → passages}/client/requests/CreateArchivalMemory.d.ts +0 -0
- /package/dist/serialization/resources/agents/resources/{archivalMemory → passages}/client/requests/CreateArchivalMemory.js +0 -0
- /package/dist/serialization/resources/agents/resources/{archivalMemory → passages}/client/requests/index.d.ts +0 -0
- /package/dist/serialization/resources/agents/resources/{archivalMemory → passages}/client/requests/index.js +0 -0
- /package/{serialization/resources/agents/resources/coreMemory → dist/serialization/resources/agents/resources/passages}/index.d.ts +0 -0
- /package/{serialization/resources/agents/resources/coreMemory → dist/serialization/resources/agents/resources/passages}/index.js +0 -0
- /package/serialization/resources/agents/resources/{coreMemory/client/listBlocks.js → blocks/client/list.js} +0 -0
- /package/serialization/resources/agents/resources/{archivalMemory → passages}/client/create.js +0 -0
- /package/serialization/resources/agents/resources/{archivalMemory → passages}/client/index.d.ts +0 -0
- /package/serialization/resources/agents/resources/{archivalMemory → passages}/client/index.js +0 -0
- /package/serialization/resources/agents/resources/{archivalMemory → passages}/client/list.js +0 -0
- /package/serialization/resources/agents/resources/{archivalMemory → passages}/client/requests/CreateArchivalMemory.d.ts +0 -0
- /package/serialization/resources/agents/resources/{archivalMemory → passages}/client/requests/CreateArchivalMemory.js +0 -0
- /package/serialization/resources/agents/resources/{archivalMemory → passages}/client/requests/index.d.ts +0 -0
- /package/serialization/resources/agents/resources/{archivalMemory → passages}/client/requests/index.js +0 -0
|
@@ -76,7 +76,7 @@ class Context {
|
|
|
76
76
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
77
77
|
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)}/context`),
|
|
78
78
|
method: "GET",
|
|
79
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
79
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.39", "User-Agent": "@letta-ai/letta-client/0.1.39", "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),
|
|
80
80
|
contentType: "application/json",
|
|
81
81
|
requestType: "json",
|
|
82
82
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -39,71 +39,6 @@ export declare class CoreMemory {
|
|
|
39
39
|
* await client.agents.coreMemory.retrieve("agent_id")
|
|
40
40
|
*/
|
|
41
41
|
retrieve(agentId: string, requestOptions?: CoreMemory.RequestOptions): Promise<Letta.Memory>;
|
|
42
|
-
/**
|
|
43
|
-
* Retrieve a memory block from an agent.
|
|
44
|
-
*
|
|
45
|
-
* @param {string} agentId
|
|
46
|
-
* @param {string} blockLabel
|
|
47
|
-
* @param {CoreMemory.RequestOptions} requestOptions - Request-specific configuration.
|
|
48
|
-
*
|
|
49
|
-
* @throws {@link Letta.UnprocessableEntityError}
|
|
50
|
-
*
|
|
51
|
-
* @example
|
|
52
|
-
* await client.agents.coreMemory.retrieveBlock("agent_id", "block_label")
|
|
53
|
-
*/
|
|
54
|
-
retrieveBlock(agentId: string, blockLabel: string, requestOptions?: CoreMemory.RequestOptions): Promise<Letta.Block>;
|
|
55
|
-
/**
|
|
56
|
-
* Updates a memory block of an agent.
|
|
57
|
-
*
|
|
58
|
-
* @param {string} agentId
|
|
59
|
-
* @param {string} blockLabel
|
|
60
|
-
* @param {Letta.BlockUpdate} request
|
|
61
|
-
* @param {CoreMemory.RequestOptions} requestOptions - Request-specific configuration.
|
|
62
|
-
*
|
|
63
|
-
* @throws {@link Letta.UnprocessableEntityError}
|
|
64
|
-
*
|
|
65
|
-
* @example
|
|
66
|
-
* await client.agents.coreMemory.modifyBlock("agent_id", "block_label", {})
|
|
67
|
-
*/
|
|
68
|
-
modifyBlock(agentId: string, blockLabel: string, request: Letta.BlockUpdate, requestOptions?: CoreMemory.RequestOptions): Promise<Letta.Block>;
|
|
69
|
-
/**
|
|
70
|
-
* Retrieve the memory blocks of a specific agent.
|
|
71
|
-
*
|
|
72
|
-
* @param {string} agentId
|
|
73
|
-
* @param {CoreMemory.RequestOptions} requestOptions - Request-specific configuration.
|
|
74
|
-
*
|
|
75
|
-
* @throws {@link Letta.UnprocessableEntityError}
|
|
76
|
-
*
|
|
77
|
-
* @example
|
|
78
|
-
* await client.agents.coreMemory.listBlocks("agent_id")
|
|
79
|
-
*/
|
|
80
|
-
listBlocks(agentId: string, requestOptions?: CoreMemory.RequestOptions): Promise<Letta.Block[]>;
|
|
81
|
-
/**
|
|
82
|
-
* Attach a block to an agent.
|
|
83
|
-
*
|
|
84
|
-
* @param {string} agentId
|
|
85
|
-
* @param {string} blockId
|
|
86
|
-
* @param {CoreMemory.RequestOptions} requestOptions - Request-specific configuration.
|
|
87
|
-
*
|
|
88
|
-
* @throws {@link Letta.UnprocessableEntityError}
|
|
89
|
-
*
|
|
90
|
-
* @example
|
|
91
|
-
* await client.agents.coreMemory.attachBlock("agent_id", "block_id")
|
|
92
|
-
*/
|
|
93
|
-
attachBlock(agentId: string, blockId: string, requestOptions?: CoreMemory.RequestOptions): Promise<Letta.AgentState>;
|
|
94
|
-
/**
|
|
95
|
-
* Detach a block from an agent.
|
|
96
|
-
*
|
|
97
|
-
* @param {string} agentId
|
|
98
|
-
* @param {string} blockId
|
|
99
|
-
* @param {CoreMemory.RequestOptions} requestOptions - Request-specific configuration.
|
|
100
|
-
*
|
|
101
|
-
* @throws {@link Letta.UnprocessableEntityError}
|
|
102
|
-
*
|
|
103
|
-
* @example
|
|
104
|
-
* await client.agents.coreMemory.detachBlock("agent_id", "block_id")
|
|
105
|
-
*/
|
|
106
|
-
detachBlock(agentId: string, blockId: string, requestOptions?: CoreMemory.RequestOptions): Promise<Letta.AgentState>;
|
|
107
42
|
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
108
43
|
Authorization: string;
|
|
109
44
|
}>;
|
|
@@ -77,7 +77,7 @@ class CoreMemory {
|
|
|
77
77
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
78
78
|
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)}/core-memory`),
|
|
79
79
|
method: "GET",
|
|
80
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
80
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.39", "User-Agent": "@letta-ai/letta-client/0.1.39", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
81
81
|
contentType: "application/json",
|
|
82
82
|
requestType: "json",
|
|
83
83
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -125,337 +125,6 @@ class CoreMemory {
|
|
|
125
125
|
}
|
|
126
126
|
});
|
|
127
127
|
}
|
|
128
|
-
/**
|
|
129
|
-
* Retrieve a memory block from an agent.
|
|
130
|
-
*
|
|
131
|
-
* @param {string} agentId
|
|
132
|
-
* @param {string} blockLabel
|
|
133
|
-
* @param {CoreMemory.RequestOptions} requestOptions - Request-specific configuration.
|
|
134
|
-
*
|
|
135
|
-
* @throws {@link Letta.UnprocessableEntityError}
|
|
136
|
-
*
|
|
137
|
-
* @example
|
|
138
|
-
* await client.agents.coreMemory.retrieveBlock("agent_id", "block_label")
|
|
139
|
-
*/
|
|
140
|
-
retrieveBlock(agentId, blockLabel, requestOptions) {
|
|
141
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
142
|
-
var _a, _b, _c;
|
|
143
|
-
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
144
|
-
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)}/core-memory/blocks/${encodeURIComponent(blockLabel)}`),
|
|
145
|
-
method: "GET",
|
|
146
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.38", "User-Agent": "@letta-ai/letta-client/0.1.38", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
147
|
-
contentType: "application/json",
|
|
148
|
-
requestType: "json",
|
|
149
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
150
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
151
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
152
|
-
});
|
|
153
|
-
if (_response.ok) {
|
|
154
|
-
return serializers.Block.parseOrThrow(_response.body, {
|
|
155
|
-
unrecognizedObjectKeys: "passthrough",
|
|
156
|
-
allowUnrecognizedUnionMembers: true,
|
|
157
|
-
allowUnrecognizedEnumValues: true,
|
|
158
|
-
skipValidation: true,
|
|
159
|
-
breadcrumbsPrefix: ["response"],
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
if (_response.error.reason === "status-code") {
|
|
163
|
-
switch (_response.error.statusCode) {
|
|
164
|
-
case 422:
|
|
165
|
-
throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
166
|
-
unrecognizedObjectKeys: "passthrough",
|
|
167
|
-
allowUnrecognizedUnionMembers: true,
|
|
168
|
-
allowUnrecognizedEnumValues: true,
|
|
169
|
-
skipValidation: true,
|
|
170
|
-
breadcrumbsPrefix: ["response"],
|
|
171
|
-
}));
|
|
172
|
-
default:
|
|
173
|
-
throw new errors.LettaError({
|
|
174
|
-
statusCode: _response.error.statusCode,
|
|
175
|
-
body: _response.error.body,
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
switch (_response.error.reason) {
|
|
180
|
-
case "non-json":
|
|
181
|
-
throw new errors.LettaError({
|
|
182
|
-
statusCode: _response.error.statusCode,
|
|
183
|
-
body: _response.error.rawBody,
|
|
184
|
-
});
|
|
185
|
-
case "timeout":
|
|
186
|
-
throw new errors.LettaTimeoutError("Timeout exceeded when calling GET /v1/agents/{agent_id}/core-memory/blocks/{block_label}.");
|
|
187
|
-
case "unknown":
|
|
188
|
-
throw new errors.LettaError({
|
|
189
|
-
message: _response.error.errorMessage,
|
|
190
|
-
});
|
|
191
|
-
}
|
|
192
|
-
});
|
|
193
|
-
}
|
|
194
|
-
/**
|
|
195
|
-
* Updates a memory block of an agent.
|
|
196
|
-
*
|
|
197
|
-
* @param {string} agentId
|
|
198
|
-
* @param {string} blockLabel
|
|
199
|
-
* @param {Letta.BlockUpdate} request
|
|
200
|
-
* @param {CoreMemory.RequestOptions} requestOptions - Request-specific configuration.
|
|
201
|
-
*
|
|
202
|
-
* @throws {@link Letta.UnprocessableEntityError}
|
|
203
|
-
*
|
|
204
|
-
* @example
|
|
205
|
-
* await client.agents.coreMemory.modifyBlock("agent_id", "block_label", {})
|
|
206
|
-
*/
|
|
207
|
-
modifyBlock(agentId, blockLabel, request, requestOptions) {
|
|
208
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
209
|
-
var _a, _b, _c;
|
|
210
|
-
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
211
|
-
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)}/core-memory/blocks/${encodeURIComponent(blockLabel)}`),
|
|
212
|
-
method: "PATCH",
|
|
213
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.38", "User-Agent": "@letta-ai/letta-client/0.1.38", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
214
|
-
contentType: "application/json",
|
|
215
|
-
requestType: "json",
|
|
216
|
-
body: serializers.BlockUpdate.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
217
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
218
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
219
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
220
|
-
});
|
|
221
|
-
if (_response.ok) {
|
|
222
|
-
return serializers.Block.parseOrThrow(_response.body, {
|
|
223
|
-
unrecognizedObjectKeys: "passthrough",
|
|
224
|
-
allowUnrecognizedUnionMembers: true,
|
|
225
|
-
allowUnrecognizedEnumValues: true,
|
|
226
|
-
skipValidation: true,
|
|
227
|
-
breadcrumbsPrefix: ["response"],
|
|
228
|
-
});
|
|
229
|
-
}
|
|
230
|
-
if (_response.error.reason === "status-code") {
|
|
231
|
-
switch (_response.error.statusCode) {
|
|
232
|
-
case 422:
|
|
233
|
-
throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
234
|
-
unrecognizedObjectKeys: "passthrough",
|
|
235
|
-
allowUnrecognizedUnionMembers: true,
|
|
236
|
-
allowUnrecognizedEnumValues: true,
|
|
237
|
-
skipValidation: true,
|
|
238
|
-
breadcrumbsPrefix: ["response"],
|
|
239
|
-
}));
|
|
240
|
-
default:
|
|
241
|
-
throw new errors.LettaError({
|
|
242
|
-
statusCode: _response.error.statusCode,
|
|
243
|
-
body: _response.error.body,
|
|
244
|
-
});
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
switch (_response.error.reason) {
|
|
248
|
-
case "non-json":
|
|
249
|
-
throw new errors.LettaError({
|
|
250
|
-
statusCode: _response.error.statusCode,
|
|
251
|
-
body: _response.error.rawBody,
|
|
252
|
-
});
|
|
253
|
-
case "timeout":
|
|
254
|
-
throw new errors.LettaTimeoutError("Timeout exceeded when calling PATCH /v1/agents/{agent_id}/core-memory/blocks/{block_label}.");
|
|
255
|
-
case "unknown":
|
|
256
|
-
throw new errors.LettaError({
|
|
257
|
-
message: _response.error.errorMessage,
|
|
258
|
-
});
|
|
259
|
-
}
|
|
260
|
-
});
|
|
261
|
-
}
|
|
262
|
-
/**
|
|
263
|
-
* Retrieve the memory blocks of a specific agent.
|
|
264
|
-
*
|
|
265
|
-
* @param {string} agentId
|
|
266
|
-
* @param {CoreMemory.RequestOptions} requestOptions - Request-specific configuration.
|
|
267
|
-
*
|
|
268
|
-
* @throws {@link Letta.UnprocessableEntityError}
|
|
269
|
-
*
|
|
270
|
-
* @example
|
|
271
|
-
* await client.agents.coreMemory.listBlocks("agent_id")
|
|
272
|
-
*/
|
|
273
|
-
listBlocks(agentId, requestOptions) {
|
|
274
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
275
|
-
var _a, _b, _c;
|
|
276
|
-
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
277
|
-
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)}/core-memory/blocks`),
|
|
278
|
-
method: "GET",
|
|
279
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.38", "User-Agent": "@letta-ai/letta-client/0.1.38", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
280
|
-
contentType: "application/json",
|
|
281
|
-
requestType: "json",
|
|
282
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
283
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
284
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
285
|
-
});
|
|
286
|
-
if (_response.ok) {
|
|
287
|
-
return serializers.agents.coreMemory.listBlocks.Response.parseOrThrow(_response.body, {
|
|
288
|
-
unrecognizedObjectKeys: "passthrough",
|
|
289
|
-
allowUnrecognizedUnionMembers: true,
|
|
290
|
-
allowUnrecognizedEnumValues: true,
|
|
291
|
-
skipValidation: true,
|
|
292
|
-
breadcrumbsPrefix: ["response"],
|
|
293
|
-
});
|
|
294
|
-
}
|
|
295
|
-
if (_response.error.reason === "status-code") {
|
|
296
|
-
switch (_response.error.statusCode) {
|
|
297
|
-
case 422:
|
|
298
|
-
throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
299
|
-
unrecognizedObjectKeys: "passthrough",
|
|
300
|
-
allowUnrecognizedUnionMembers: true,
|
|
301
|
-
allowUnrecognizedEnumValues: true,
|
|
302
|
-
skipValidation: true,
|
|
303
|
-
breadcrumbsPrefix: ["response"],
|
|
304
|
-
}));
|
|
305
|
-
default:
|
|
306
|
-
throw new errors.LettaError({
|
|
307
|
-
statusCode: _response.error.statusCode,
|
|
308
|
-
body: _response.error.body,
|
|
309
|
-
});
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
switch (_response.error.reason) {
|
|
313
|
-
case "non-json":
|
|
314
|
-
throw new errors.LettaError({
|
|
315
|
-
statusCode: _response.error.statusCode,
|
|
316
|
-
body: _response.error.rawBody,
|
|
317
|
-
});
|
|
318
|
-
case "timeout":
|
|
319
|
-
throw new errors.LettaTimeoutError("Timeout exceeded when calling GET /v1/agents/{agent_id}/core-memory/blocks.");
|
|
320
|
-
case "unknown":
|
|
321
|
-
throw new errors.LettaError({
|
|
322
|
-
message: _response.error.errorMessage,
|
|
323
|
-
});
|
|
324
|
-
}
|
|
325
|
-
});
|
|
326
|
-
}
|
|
327
|
-
/**
|
|
328
|
-
* Attach a block to an agent.
|
|
329
|
-
*
|
|
330
|
-
* @param {string} agentId
|
|
331
|
-
* @param {string} blockId
|
|
332
|
-
* @param {CoreMemory.RequestOptions} requestOptions - Request-specific configuration.
|
|
333
|
-
*
|
|
334
|
-
* @throws {@link Letta.UnprocessableEntityError}
|
|
335
|
-
*
|
|
336
|
-
* @example
|
|
337
|
-
* await client.agents.coreMemory.attachBlock("agent_id", "block_id")
|
|
338
|
-
*/
|
|
339
|
-
attachBlock(agentId, blockId, requestOptions) {
|
|
340
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
341
|
-
var _a, _b, _c;
|
|
342
|
-
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
343
|
-
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)}/core-memory/blocks/attach/${encodeURIComponent(blockId)}`),
|
|
344
|
-
method: "PATCH",
|
|
345
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.38", "User-Agent": "@letta-ai/letta-client/0.1.38", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
346
|
-
contentType: "application/json",
|
|
347
|
-
requestType: "json",
|
|
348
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
349
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
350
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
351
|
-
});
|
|
352
|
-
if (_response.ok) {
|
|
353
|
-
return serializers.AgentState.parseOrThrow(_response.body, {
|
|
354
|
-
unrecognizedObjectKeys: "passthrough",
|
|
355
|
-
allowUnrecognizedUnionMembers: true,
|
|
356
|
-
allowUnrecognizedEnumValues: true,
|
|
357
|
-
skipValidation: true,
|
|
358
|
-
breadcrumbsPrefix: ["response"],
|
|
359
|
-
});
|
|
360
|
-
}
|
|
361
|
-
if (_response.error.reason === "status-code") {
|
|
362
|
-
switch (_response.error.statusCode) {
|
|
363
|
-
case 422:
|
|
364
|
-
throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
365
|
-
unrecognizedObjectKeys: "passthrough",
|
|
366
|
-
allowUnrecognizedUnionMembers: true,
|
|
367
|
-
allowUnrecognizedEnumValues: true,
|
|
368
|
-
skipValidation: true,
|
|
369
|
-
breadcrumbsPrefix: ["response"],
|
|
370
|
-
}));
|
|
371
|
-
default:
|
|
372
|
-
throw new errors.LettaError({
|
|
373
|
-
statusCode: _response.error.statusCode,
|
|
374
|
-
body: _response.error.body,
|
|
375
|
-
});
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
switch (_response.error.reason) {
|
|
379
|
-
case "non-json":
|
|
380
|
-
throw new errors.LettaError({
|
|
381
|
-
statusCode: _response.error.statusCode,
|
|
382
|
-
body: _response.error.rawBody,
|
|
383
|
-
});
|
|
384
|
-
case "timeout":
|
|
385
|
-
throw new errors.LettaTimeoutError("Timeout exceeded when calling PATCH /v1/agents/{agent_id}/core-memory/blocks/attach/{block_id}.");
|
|
386
|
-
case "unknown":
|
|
387
|
-
throw new errors.LettaError({
|
|
388
|
-
message: _response.error.errorMessage,
|
|
389
|
-
});
|
|
390
|
-
}
|
|
391
|
-
});
|
|
392
|
-
}
|
|
393
|
-
/**
|
|
394
|
-
* Detach a block from an agent.
|
|
395
|
-
*
|
|
396
|
-
* @param {string} agentId
|
|
397
|
-
* @param {string} blockId
|
|
398
|
-
* @param {CoreMemory.RequestOptions} requestOptions - Request-specific configuration.
|
|
399
|
-
*
|
|
400
|
-
* @throws {@link Letta.UnprocessableEntityError}
|
|
401
|
-
*
|
|
402
|
-
* @example
|
|
403
|
-
* await client.agents.coreMemory.detachBlock("agent_id", "block_id")
|
|
404
|
-
*/
|
|
405
|
-
detachBlock(agentId, blockId, requestOptions) {
|
|
406
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
407
|
-
var _a, _b, _c;
|
|
408
|
-
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
409
|
-
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)}/core-memory/blocks/detach/${encodeURIComponent(blockId)}`),
|
|
410
|
-
method: "PATCH",
|
|
411
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.38", "User-Agent": "@letta-ai/letta-client/0.1.38", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
412
|
-
contentType: "application/json",
|
|
413
|
-
requestType: "json",
|
|
414
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
415
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
416
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
417
|
-
});
|
|
418
|
-
if (_response.ok) {
|
|
419
|
-
return serializers.AgentState.parseOrThrow(_response.body, {
|
|
420
|
-
unrecognizedObjectKeys: "passthrough",
|
|
421
|
-
allowUnrecognizedUnionMembers: true,
|
|
422
|
-
allowUnrecognizedEnumValues: true,
|
|
423
|
-
skipValidation: true,
|
|
424
|
-
breadcrumbsPrefix: ["response"],
|
|
425
|
-
});
|
|
426
|
-
}
|
|
427
|
-
if (_response.error.reason === "status-code") {
|
|
428
|
-
switch (_response.error.statusCode) {
|
|
429
|
-
case 422:
|
|
430
|
-
throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
431
|
-
unrecognizedObjectKeys: "passthrough",
|
|
432
|
-
allowUnrecognizedUnionMembers: true,
|
|
433
|
-
allowUnrecognizedEnumValues: true,
|
|
434
|
-
skipValidation: true,
|
|
435
|
-
breadcrumbsPrefix: ["response"],
|
|
436
|
-
}));
|
|
437
|
-
default:
|
|
438
|
-
throw new errors.LettaError({
|
|
439
|
-
statusCode: _response.error.statusCode,
|
|
440
|
-
body: _response.error.body,
|
|
441
|
-
});
|
|
442
|
-
}
|
|
443
|
-
}
|
|
444
|
-
switch (_response.error.reason) {
|
|
445
|
-
case "non-json":
|
|
446
|
-
throw new errors.LettaError({
|
|
447
|
-
statusCode: _response.error.statusCode,
|
|
448
|
-
body: _response.error.rawBody,
|
|
449
|
-
});
|
|
450
|
-
case "timeout":
|
|
451
|
-
throw new errors.LettaTimeoutError("Timeout exceeded when calling PATCH /v1/agents/{agent_id}/core-memory/blocks/detach/{block_id}.");
|
|
452
|
-
case "unknown":
|
|
453
|
-
throw new errors.LettaError({
|
|
454
|
-
message: _response.error.errorMessage,
|
|
455
|
-
});
|
|
456
|
-
}
|
|
457
|
-
});
|
|
458
|
-
}
|
|
459
128
|
_getCustomAuthorizationHeaders() {
|
|
460
129
|
return __awaiter(this, void 0, void 0, function* () {
|
|
461
130
|
const tokenValue = yield core.Supplier.get(this._options.token);
|
|
@@ -8,7 +8,8 @@ export * as context from "./context";
|
|
|
8
8
|
export * as tools from "./tools";
|
|
9
9
|
export * as sources from "./sources";
|
|
10
10
|
export * as coreMemory from "./coreMemory";
|
|
11
|
-
export * as
|
|
12
|
-
export * from "./
|
|
11
|
+
export * as blocks from "./blocks";
|
|
12
|
+
export * as passages from "./passages";
|
|
13
|
+
export * from "./passages/client/requests";
|
|
13
14
|
export * from "./messages/client/requests";
|
|
14
15
|
export * from "./templates/client/requests";
|
|
@@ -36,7 +36,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
36
36
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.
|
|
39
|
+
exports.passages = exports.blocks = exports.coreMemory = exports.sources = exports.tools = exports.context = exports.memoryVariables = exports.templates = exports.messages = void 0;
|
|
40
40
|
exports.messages = __importStar(require("./messages"));
|
|
41
41
|
__exportStar(require("./messages/types"), exports);
|
|
42
42
|
exports.templates = __importStar(require("./templates"));
|
|
@@ -47,7 +47,8 @@ exports.context = __importStar(require("./context"));
|
|
|
47
47
|
exports.tools = __importStar(require("./tools"));
|
|
48
48
|
exports.sources = __importStar(require("./sources"));
|
|
49
49
|
exports.coreMemory = __importStar(require("./coreMemory"));
|
|
50
|
-
exports.
|
|
51
|
-
|
|
50
|
+
exports.blocks = __importStar(require("./blocks"));
|
|
51
|
+
exports.passages = __importStar(require("./passages"));
|
|
52
|
+
__exportStar(require("./passages/client/requests"), exports);
|
|
52
53
|
__exportStar(require("./messages/client/requests"), exports);
|
|
53
54
|
__exportStar(require("./templates/client/requests"), exports);
|
|
@@ -78,7 +78,7 @@ class MemoryVariables {
|
|
|
78
78
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
79
79
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/core-memory/variables`),
|
|
80
80
|
method: "GET",
|
|
81
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
81
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.39", "User-Agent": "@letta-ai/letta-client/0.1.39", "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,
|
|
@@ -97,7 +97,7 @@ class Messages {
|
|
|
97
97
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
98
98
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/messages`),
|
|
99
99
|
method: "GET",
|
|
100
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
100
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.39", "User-Agent": "@letta-ai/letta-client/0.1.39", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
101
101
|
contentType: "application/json",
|
|
102
102
|
queryParameters: _queryParams,
|
|
103
103
|
requestType: "json",
|
|
@@ -170,7 +170,7 @@ class Messages {
|
|
|
170
170
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
171
171
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/messages`),
|
|
172
172
|
method: "POST",
|
|
173
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
173
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.39", "User-Agent": "@letta-ai/letta-client/0.1.39", "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),
|
|
174
174
|
contentType: "application/json",
|
|
175
175
|
requestType: "json",
|
|
176
176
|
body: serializers.LettaRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -238,7 +238,7 @@ class Messages {
|
|
|
238
238
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
239
239
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/messages/${encodeURIComponent(messageId)}`),
|
|
240
240
|
method: "PATCH",
|
|
241
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
241
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.39", "User-Agent": "@letta-ai/letta-client/0.1.39", "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),
|
|
242
242
|
contentType: "application/json",
|
|
243
243
|
requestType: "json",
|
|
244
244
|
body: serializers.agents.MessageUpdate.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -298,7 +298,7 @@ class Messages {
|
|
|
298
298
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
299
299
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/messages/stream`),
|
|
300
300
|
method: "POST",
|
|
301
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
301
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.39", "User-Agent": "@letta-ai/letta-client/0.1.39", "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),
|
|
302
302
|
contentType: "application/json",
|
|
303
303
|
requestType: "json",
|
|
304
304
|
body: serializers.agents.LettaStreamingRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -382,7 +382,7 @@ class Messages {
|
|
|
382
382
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
383
383
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/messages/async`),
|
|
384
384
|
method: "POST",
|
|
385
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
385
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.39", "User-Agent": "@letta-ai/letta-client/0.1.39", "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),
|
|
386
386
|
contentType: "application/json",
|
|
387
387
|
requestType: "json",
|
|
388
388
|
body: serializers.LettaRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import * as environments from "../../../../../../environments";
|
|
5
5
|
import * as core from "../../../../../../core";
|
|
6
6
|
import * as Letta from "../../../../../index";
|
|
7
|
-
export declare namespace
|
|
7
|
+
export declare namespace Passages {
|
|
8
8
|
interface Options {
|
|
9
9
|
environment?: core.Supplier<environments.LettaEnvironment | string>;
|
|
10
10
|
/** Specify a custom URL to connect the client to. */
|
|
@@ -23,50 +23,50 @@ export declare namespace ArchivalMemory {
|
|
|
23
23
|
headers?: Record<string, string>;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
export declare class
|
|
27
|
-
protected readonly _options:
|
|
28
|
-
constructor(_options?:
|
|
26
|
+
export declare class Passages {
|
|
27
|
+
protected readonly _options: Passages.Options;
|
|
28
|
+
constructor(_options?: Passages.Options);
|
|
29
29
|
/**
|
|
30
30
|
* Retrieve the memories in an agent's archival memory store (paginated query).
|
|
31
31
|
*
|
|
32
32
|
* @param {string} agentId
|
|
33
|
-
* @param {Letta.agents.
|
|
34
|
-
* @param {
|
|
33
|
+
* @param {Letta.agents.PassagesListRequest} request
|
|
34
|
+
* @param {Passages.RequestOptions} requestOptions - Request-specific configuration.
|
|
35
35
|
*
|
|
36
36
|
* @throws {@link Letta.UnprocessableEntityError}
|
|
37
37
|
*
|
|
38
38
|
* @example
|
|
39
|
-
* await client.agents.
|
|
39
|
+
* await client.agents.passages.list("agent_id")
|
|
40
40
|
*/
|
|
41
|
-
list(agentId: string, request?: Letta.agents.
|
|
41
|
+
list(agentId: string, request?: Letta.agents.PassagesListRequest, requestOptions?: Passages.RequestOptions): Promise<Letta.Passage[]>;
|
|
42
42
|
/**
|
|
43
43
|
* Insert a memory into an agent's archival memory store.
|
|
44
44
|
*
|
|
45
45
|
* @param {string} agentId
|
|
46
46
|
* @param {Letta.agents.CreateArchivalMemory} request
|
|
47
|
-
* @param {
|
|
47
|
+
* @param {Passages.RequestOptions} requestOptions - Request-specific configuration.
|
|
48
48
|
*
|
|
49
49
|
* @throws {@link Letta.UnprocessableEntityError}
|
|
50
50
|
*
|
|
51
51
|
* @example
|
|
52
|
-
* await client.agents.
|
|
52
|
+
* await client.agents.passages.create("agent_id", {
|
|
53
53
|
* text: "text"
|
|
54
54
|
* })
|
|
55
55
|
*/
|
|
56
|
-
create(agentId: string, request: Letta.agents.CreateArchivalMemory, requestOptions?:
|
|
56
|
+
create(agentId: string, request: Letta.agents.CreateArchivalMemory, requestOptions?: Passages.RequestOptions): Promise<Letta.Passage[]>;
|
|
57
57
|
/**
|
|
58
58
|
* Delete a memory from an agent's archival memory store.
|
|
59
59
|
*
|
|
60
60
|
* @param {string} agentId
|
|
61
61
|
* @param {string} memoryId
|
|
62
|
-
* @param {
|
|
62
|
+
* @param {Passages.RequestOptions} requestOptions - Request-specific configuration.
|
|
63
63
|
*
|
|
64
64
|
* @throws {@link Letta.UnprocessableEntityError}
|
|
65
65
|
*
|
|
66
66
|
* @example
|
|
67
|
-
* await client.agents.
|
|
67
|
+
* await client.agents.passages.delete("agent_id", "memory_id")
|
|
68
68
|
*/
|
|
69
|
-
delete(agentId: string, memoryId: string, requestOptions?:
|
|
69
|
+
delete(agentId: string, memoryId: string, requestOptions?: Passages.RequestOptions): Promise<unknown>;
|
|
70
70
|
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
71
71
|
Authorization: string;
|
|
72
72
|
}>;
|