@letta-ai/letta-client 0.1.0 → 0.1.2
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 +38 -2
- package/api/resources/agents/client/Client.js +184 -26
- package/api/resources/agents/client/requests/AgentsCreateTemplateFromAgentRequest.d.ts +10 -0
- package/api/resources/agents/client/requests/AgentsCreateVersionRequest.d.ts +1 -1
- package/api/resources/agents/client/requests/AgentsSearchDeployedAgentsRequest.d.ts +15 -0
- package/api/resources/agents/client/requests/CreateAgentRequest.d.ts +4 -0
- package/api/resources/agents/client/requests/index.d.ts +2 -0
- package/api/resources/agents/resources/archivalMemory/client/Client.js +8 -8
- package/api/resources/agents/resources/context/client/Client.js +2 -2
- package/api/resources/agents/resources/memory/client/Client.js +2 -2
- package/api/resources/agents/resources/memory/resources/messages/client/Client.js +2 -2
- package/api/resources/agents/resources/memoryBlocks/client/Client.js +4 -4
- package/api/resources/agents/resources/messages/client/Client.js +8 -8
- package/api/resources/agents/resources/messages/types/LettaStreamingResponse.d.ts +0 -3
- package/api/resources/agents/resources/recallMemory/client/Client.js +2 -2
- package/api/resources/agents/resources/sources/client/Client.js +2 -2
- package/api/resources/agents/resources/tools/client/Client.js +6 -6
- package/api/resources/agents/types/AgentsGetAgentVariablesResponse.d.ts +6 -0
- package/api/resources/agents/types/AgentsSearchDeployedAgentsRequestCombinator.d.ts +8 -0
- package/api/{types/LettaResponseToolReturnMessageStatus.js → resources/agents/types/AgentsSearchDeployedAgentsRequestCombinator.js} +4 -4
- package/api/resources/agents/types/AgentsSearchDeployedAgentsRequestSearchItem.d.ts +5 -0
- package/api/resources/agents/types/AgentsSearchDeployedAgentsRequestSearchItemDirection.d.ts +9 -0
- package/api/resources/agents/types/AgentsSearchDeployedAgentsRequestSearchItemDirectionDirection.d.ts +8 -0
- package/api/resources/agents/types/AgentsSearchDeployedAgentsRequestSearchItemDirectionDirection.js +10 -0
- package/api/resources/agents/types/AgentsSearchDeployedAgentsRequestSearchItemDirectionValue.d.ts +8 -0
- package/api/resources/agents/types/AgentsSearchDeployedAgentsRequestSearchItemDirectionValue.js +10 -0
- package/api/resources/agents/types/AgentsSearchDeployedAgentsRequestSearchItemOperator.d.ts +9 -0
- package/api/resources/agents/types/AgentsSearchDeployedAgentsRequestSearchItemOperatorOperator.d.ts +9 -0
- package/api/resources/agents/types/AgentsSearchDeployedAgentsRequestSearchItemOperatorOperator.js +11 -0
- package/api/resources/agents/types/AgentsSearchDeployedAgentsRequestSearchItemZero.d.ts +7 -0
- package/api/resources/agents/types/index.d.ts +9 -1
- package/api/resources/agents/types/index.js +9 -1
- package/api/resources/blocks/client/Client.js +14 -14
- package/api/resources/health/client/Client.js +2 -2
- package/api/resources/jobs/client/Client.js +8 -8
- package/api/resources/models/client/Client.js +4 -4
- package/api/resources/sources/client/Client.js +16 -16
- package/api/resources/sources/resources/files/client/Client.js +6 -6
- package/api/resources/sources/resources/passages/client/Client.js +2 -2
- package/api/resources/tools/client/Client.js +24 -24
- package/api/types/InternalServerErrorBody.d.ts +1 -1
- package/api/types/LettaResponse.d.ts +12 -62
- package/api/types/LettaUsageStatistics.d.ts +1 -0
- package/api/types/NotFoundErrorBody.d.ts +1 -2
- package/api/types/index.d.ts +0 -13
- package/api/types/index.js +0 -13
- package/dist/api/resources/agents/client/Client.d.ts +38 -2
- package/dist/api/resources/agents/client/Client.js +184 -26
- package/dist/api/resources/agents/client/requests/AgentsCreateTemplateFromAgentRequest.d.ts +10 -0
- package/dist/api/resources/agents/client/requests/AgentsCreateVersionRequest.d.ts +1 -1
- package/dist/api/resources/agents/client/requests/AgentsSearchDeployedAgentsRequest.d.ts +15 -0
- package/dist/api/resources/agents/client/requests/CreateAgentRequest.d.ts +4 -0
- package/dist/api/resources/agents/client/requests/index.d.ts +2 -0
- package/dist/api/resources/agents/resources/archivalMemory/client/Client.js +8 -8
- package/dist/api/resources/agents/resources/context/client/Client.js +2 -2
- package/dist/api/resources/agents/resources/memory/client/Client.js +2 -2
- package/dist/api/resources/agents/resources/memory/resources/messages/client/Client.js +2 -2
- package/dist/api/resources/agents/resources/memoryBlocks/client/Client.js +4 -4
- package/dist/api/resources/agents/resources/messages/client/Client.js +8 -8
- package/dist/api/resources/agents/resources/messages/types/LettaStreamingResponse.d.ts +0 -3
- package/dist/api/resources/agents/resources/recallMemory/client/Client.js +2 -2
- package/dist/api/resources/agents/resources/sources/client/Client.js +2 -2
- package/dist/api/resources/agents/resources/tools/client/Client.js +6 -6
- package/dist/api/resources/agents/types/AgentsGetAgentVariablesResponse.d.ts +6 -0
- package/dist/api/resources/agents/types/AgentsSearchDeployedAgentsRequestCombinator.d.ts +8 -0
- package/dist/api/{types/LettaResponseToolReturnMessageStatus.js → resources/agents/types/AgentsSearchDeployedAgentsRequestCombinator.js} +4 -4
- package/dist/api/resources/agents/types/AgentsSearchDeployedAgentsRequestSearchItem.d.ts +5 -0
- package/dist/api/resources/agents/types/AgentsSearchDeployedAgentsRequestSearchItemDirection.d.ts +9 -0
- package/dist/api/resources/agents/types/AgentsSearchDeployedAgentsRequestSearchItemDirectionDirection.d.ts +8 -0
- package/dist/api/resources/agents/types/AgentsSearchDeployedAgentsRequestSearchItemDirectionDirection.js +10 -0
- package/dist/api/resources/agents/types/AgentsSearchDeployedAgentsRequestSearchItemDirectionValue.d.ts +8 -0
- package/dist/api/resources/agents/types/AgentsSearchDeployedAgentsRequestSearchItemDirectionValue.js +10 -0
- package/dist/api/resources/agents/types/AgentsSearchDeployedAgentsRequestSearchItemOperator.d.ts +9 -0
- package/dist/api/resources/agents/types/AgentsSearchDeployedAgentsRequestSearchItemOperatorOperator.d.ts +9 -0
- package/dist/api/resources/agents/types/AgentsSearchDeployedAgentsRequestSearchItemOperatorOperator.js +11 -0
- package/dist/api/resources/agents/types/AgentsSearchDeployedAgentsRequestSearchItemZero.d.ts +7 -0
- package/dist/api/resources/agents/types/index.d.ts +9 -1
- package/dist/api/resources/agents/types/index.js +9 -1
- package/dist/api/resources/blocks/client/Client.js +14 -14
- package/dist/api/resources/health/client/Client.js +2 -2
- package/dist/api/resources/jobs/client/Client.js +8 -8
- package/dist/api/resources/models/client/Client.js +4 -4
- package/dist/api/resources/sources/client/Client.js +16 -16
- package/dist/api/resources/sources/resources/files/client/Client.js +6 -6
- package/dist/api/resources/sources/resources/passages/client/Client.js +2 -2
- package/dist/api/resources/tools/client/Client.js +24 -24
- package/dist/api/types/InternalServerErrorBody.d.ts +1 -1
- package/dist/api/types/LettaResponse.d.ts +12 -62
- package/dist/api/types/LettaUsageStatistics.d.ts +1 -0
- package/dist/api/types/NotFoundErrorBody.d.ts +1 -2
- package/dist/api/types/index.d.ts +0 -13
- package/dist/api/types/index.js +0 -13
- package/dist/environments.d.ts +2 -2
- package/dist/environments.js +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/environments.d.ts +2 -2
- package/environments.js +1 -1
- package/package.json +1 -1
- package/reference.md +199 -2
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/api/resources/agents/types/AgentsCreateVersionResponse.d.ts +0 -7
- package/api/types/LettaResponseAssistantMessage.d.ts +0 -9
- package/api/types/LettaResponseLettaUsageStatistics.d.ts +0 -22
- package/api/types/LettaResponseReasoningMessage.d.ts +0 -17
- package/api/types/LettaResponseSystemMessage.d.ts +0 -17
- package/api/types/LettaResponseToolCall.d.ts +0 -8
- package/api/types/LettaResponseToolCallDelta.d.ts +0 -8
- package/api/types/LettaResponseToolCallMessage.d.ts +0 -18
- package/api/types/LettaResponseToolCallMessageToolCall.d.ts +0 -5
- package/api/types/LettaResponseToolCallMessageToolCallOne.d.ts +0 -8
- package/api/types/LettaResponseToolCallMessageToolCallZero.d.ts +0 -8
- package/api/types/LettaResponseToolReturnMessage.d.ts +0 -26
- package/api/types/LettaResponseToolReturnMessageStatus.d.ts +0 -8
- package/api/types/LettaResponseUserMessage.d.ts +0 -17
- package/dist/api/resources/agents/types/AgentsCreateVersionResponse.d.ts +0 -7
- package/dist/api/types/LettaResponseAssistantMessage.d.ts +0 -9
- package/dist/api/types/LettaResponseAssistantMessage.js +0 -5
- package/dist/api/types/LettaResponseLettaUsageStatistics.d.ts +0 -22
- package/dist/api/types/LettaResponseLettaUsageStatistics.js +0 -5
- package/dist/api/types/LettaResponseReasoningMessage.d.ts +0 -17
- package/dist/api/types/LettaResponseReasoningMessage.js +0 -5
- package/dist/api/types/LettaResponseSystemMessage.d.ts +0 -17
- package/dist/api/types/LettaResponseSystemMessage.js +0 -5
- package/dist/api/types/LettaResponseToolCall.d.ts +0 -8
- package/dist/api/types/LettaResponseToolCall.js +0 -5
- package/dist/api/types/LettaResponseToolCallDelta.d.ts +0 -8
- package/dist/api/types/LettaResponseToolCallDelta.js +0 -5
- package/dist/api/types/LettaResponseToolCallMessage.d.ts +0 -18
- package/dist/api/types/LettaResponseToolCallMessage.js +0 -5
- package/dist/api/types/LettaResponseToolCallMessageToolCall.d.ts +0 -5
- package/dist/api/types/LettaResponseToolCallMessageToolCall.js +0 -5
- package/dist/api/types/LettaResponseToolCallMessageToolCallOne.d.ts +0 -8
- package/dist/api/types/LettaResponseToolCallMessageToolCallOne.js +0 -5
- package/dist/api/types/LettaResponseToolCallMessageToolCallZero.d.ts +0 -8
- package/dist/api/types/LettaResponseToolCallMessageToolCallZero.js +0 -5
- package/dist/api/types/LettaResponseToolReturnMessage.d.ts +0 -26
- package/dist/api/types/LettaResponseToolReturnMessage.js +0 -5
- package/dist/api/types/LettaResponseToolReturnMessageStatus.d.ts +0 -8
- package/dist/api/types/LettaResponseUserMessage.d.ts +0 -17
- package/dist/api/types/LettaResponseUserMessage.js +0 -5
- /package/api/resources/agents/{types/AgentsCreateVersionResponse.js → client/requests/AgentsCreateTemplateFromAgentRequest.js} +0 -0
- /package/api/{types/LettaResponseAssistantMessage.js → resources/agents/client/requests/AgentsSearchDeployedAgentsRequest.js} +0 -0
- /package/api/{types/LettaResponseLettaUsageStatistics.js → resources/agents/types/AgentsGetAgentVariablesResponse.js} +0 -0
- /package/api/{types/LettaResponseReasoningMessage.js → resources/agents/types/AgentsSearchDeployedAgentsRequestSearchItem.js} +0 -0
- /package/api/{types/LettaResponseSystemMessage.js → resources/agents/types/AgentsSearchDeployedAgentsRequestSearchItemDirection.js} +0 -0
- /package/api/{types/LettaResponseToolCall.js → resources/agents/types/AgentsSearchDeployedAgentsRequestSearchItemOperator.js} +0 -0
- /package/api/{types/LettaResponseToolCallDelta.js → resources/agents/types/AgentsSearchDeployedAgentsRequestSearchItemZero.js} +0 -0
- /package/{api/types/LettaResponseToolCallMessage.js → dist/api/resources/agents/client/requests/AgentsCreateTemplateFromAgentRequest.js} +0 -0
- /package/{api/types/LettaResponseToolCallMessageToolCall.js → dist/api/resources/agents/client/requests/AgentsSearchDeployedAgentsRequest.js} +0 -0
- /package/{api/types/LettaResponseToolCallMessageToolCallOne.js → dist/api/resources/agents/types/AgentsGetAgentVariablesResponse.js} +0 -0
- /package/{api/types/LettaResponseToolCallMessageToolCallZero.js → dist/api/resources/agents/types/AgentsSearchDeployedAgentsRequestSearchItem.js} +0 -0
- /package/{api/types/LettaResponseToolReturnMessage.js → dist/api/resources/agents/types/AgentsSearchDeployedAgentsRequestSearchItemDirection.js} +0 -0
- /package/{api/types/LettaResponseUserMessage.js → dist/api/resources/agents/types/AgentsSearchDeployedAgentsRequestSearchItemOperator.js} +0 -0
- /package/dist/api/resources/agents/types/{AgentsCreateVersionResponse.js → AgentsSearchDeployedAgentsRequestSearchItemZero.js} +0 -0
|
@@ -101,7 +101,7 @@ export declare class Agents {
|
|
|
101
101
|
* @example
|
|
102
102
|
* await client.agents.delete("agent_id")
|
|
103
103
|
*/
|
|
104
|
-
delete(agentId: string, requestOptions?: Agents.RequestOptions): Promise<
|
|
104
|
+
delete(agentId: string, requestOptions?: Agents.RequestOptions): Promise<unknown>;
|
|
105
105
|
/**
|
|
106
106
|
* Update an exsiting agent
|
|
107
107
|
*
|
|
@@ -173,6 +173,16 @@ export declare class Agents {
|
|
|
173
173
|
* })
|
|
174
174
|
*/
|
|
175
175
|
createAgentMessageAsync(agentId: string, request: Letta.LettaRequest, requestOptions?: Agents.RequestOptions): Promise<Letta.Job>;
|
|
176
|
+
/**
|
|
177
|
+
* Search deployed agents
|
|
178
|
+
*
|
|
179
|
+
* @param {Letta.AgentsSearchDeployedAgentsRequest} request
|
|
180
|
+
* @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
|
|
181
|
+
*
|
|
182
|
+
* @example
|
|
183
|
+
* await client.agents.searchdeployedagents()
|
|
184
|
+
*/
|
|
185
|
+
searchdeployedagents(request?: Letta.AgentsSearchDeployedAgentsRequest, requestOptions?: Agents.RequestOptions): Promise<void>;
|
|
176
186
|
/**
|
|
177
187
|
* Creates a versioned version of an agent
|
|
178
188
|
*
|
|
@@ -186,7 +196,7 @@ export declare class Agents {
|
|
|
186
196
|
* @example
|
|
187
197
|
* await client.agents.createVersion("agent_id")
|
|
188
198
|
*/
|
|
189
|
-
createVersion(agentId: string, request?: Letta.AgentsCreateVersionRequest, requestOptions?: Agents.RequestOptions): Promise<
|
|
199
|
+
createVersion(agentId: string, request?: Letta.AgentsCreateVersionRequest, requestOptions?: Agents.RequestOptions): Promise<void>;
|
|
190
200
|
/**
|
|
191
201
|
* Migrate an agent to a new versioned agent template
|
|
192
202
|
*
|
|
@@ -205,5 +215,31 @@ export declare class Agents {
|
|
|
205
215
|
* })
|
|
206
216
|
*/
|
|
207
217
|
migrate(agentId: string, request: Letta.AgentsMigrateRequest, requestOptions?: Agents.RequestOptions): Promise<Letta.AgentsMigrateResponse>;
|
|
218
|
+
/**
|
|
219
|
+
* Create a template from an agent
|
|
220
|
+
*
|
|
221
|
+
* @param {string} agentId
|
|
222
|
+
* @param {Letta.AgentsCreateTemplateFromAgentRequest} request
|
|
223
|
+
* @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
|
|
224
|
+
*
|
|
225
|
+
* @throws {@link Letta.NotFoundError}
|
|
226
|
+
* @throws {@link Letta.InternalServerError}
|
|
227
|
+
*
|
|
228
|
+
* @example
|
|
229
|
+
* await client.agents.createtemplatefromagent("agent_id")
|
|
230
|
+
*/
|
|
231
|
+
createtemplatefromagent(agentId: string, request?: Letta.AgentsCreateTemplateFromAgentRequest, requestOptions?: Agents.RequestOptions): Promise<void>;
|
|
232
|
+
/**
|
|
233
|
+
* Get the variables associated with an agent
|
|
234
|
+
*
|
|
235
|
+
* @param {string} agentId
|
|
236
|
+
* @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
|
|
237
|
+
*
|
|
238
|
+
* @throws {@link Letta.NotFoundError}
|
|
239
|
+
*
|
|
240
|
+
* @example
|
|
241
|
+
* await client.agents.getagentvariables("agent_id")
|
|
242
|
+
*/
|
|
243
|
+
getagentvariables(agentId: string, requestOptions?: Agents.RequestOptions): Promise<Letta.AgentsGetAgentVariablesResponse>;
|
|
208
244
|
protected _getAuthorizationHeader(): Promise<string>;
|
|
209
245
|
}
|
|
@@ -131,9 +131,9 @@ class Agents {
|
|
|
131
131
|
_queryParams["match_all_tags"] = matchAllTags.toString();
|
|
132
132
|
}
|
|
133
133
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
134
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.LettaEnvironment.
|
|
134
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.LettaEnvironment.LettaCloud, "v1/agents/"),
|
|
135
135
|
method: "GET",
|
|
136
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
136
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.2", "User-Agent": "@letta-ai/letta-client/0.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
137
137
|
contentType: "application/json",
|
|
138
138
|
queryParameters: _queryParams,
|
|
139
139
|
requestType: "json",
|
|
@@ -190,9 +190,9 @@ class Agents {
|
|
|
190
190
|
var _a, _b;
|
|
191
191
|
return __awaiter(this, void 0, void 0, function* () {
|
|
192
192
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
193
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.LettaEnvironment.
|
|
193
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.LettaEnvironment.LettaCloud, "v1/agents/"),
|
|
194
194
|
method: "POST",
|
|
195
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
195
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.2", "User-Agent": "@letta-ai/letta-client/0.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
196
196
|
contentType: "application/json",
|
|
197
197
|
requestType: "json",
|
|
198
198
|
body: request,
|
|
@@ -244,9 +244,9 @@ class Agents {
|
|
|
244
244
|
var _a, _b;
|
|
245
245
|
return __awaiter(this, void 0, void 0, function* () {
|
|
246
246
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
247
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.LettaEnvironment.
|
|
247
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}`),
|
|
248
248
|
method: "GET",
|
|
249
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
249
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.2", "User-Agent": "@letta-ai/letta-client/0.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
250
250
|
contentType: "application/json",
|
|
251
251
|
requestType: "json",
|
|
252
252
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -297,9 +297,9 @@ class Agents {
|
|
|
297
297
|
var _a, _b;
|
|
298
298
|
return __awaiter(this, void 0, void 0, function* () {
|
|
299
299
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
300
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.LettaEnvironment.
|
|
300
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}`),
|
|
301
301
|
method: "DELETE",
|
|
302
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
302
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.2", "User-Agent": "@letta-ai/letta-client/0.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
303
303
|
contentType: "application/json",
|
|
304
304
|
requestType: "json",
|
|
305
305
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -351,9 +351,9 @@ class Agents {
|
|
|
351
351
|
var _a, _b;
|
|
352
352
|
return __awaiter(this, void 0, void 0, function* () {
|
|
353
353
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
354
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.LettaEnvironment.
|
|
354
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}`),
|
|
355
355
|
method: "PATCH",
|
|
356
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
356
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.2", "User-Agent": "@letta-ai/letta-client/0.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
357
357
|
contentType: "application/json",
|
|
358
358
|
requestType: "json",
|
|
359
359
|
body: request,
|
|
@@ -406,9 +406,9 @@ class Agents {
|
|
|
406
406
|
var _a, _b;
|
|
407
407
|
return __awaiter(this, void 0, void 0, function* () {
|
|
408
408
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
409
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.LettaEnvironment.
|
|
409
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/memory/block/${encodeURIComponent(blockLabel)}`),
|
|
410
410
|
method: "GET",
|
|
411
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
411
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.2", "User-Agent": "@letta-ai/letta-client/0.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
412
412
|
contentType: "application/json",
|
|
413
413
|
requestType: "json",
|
|
414
414
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -461,9 +461,9 @@ class Agents {
|
|
|
461
461
|
var _a, _b;
|
|
462
462
|
return __awaiter(this, void 0, void 0, function* () {
|
|
463
463
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
464
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.LettaEnvironment.
|
|
464
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/memory/block/${encodeURIComponent(blockLabel)}`),
|
|
465
465
|
method: "PATCH",
|
|
466
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
466
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.2", "User-Agent": "@letta-ai/letta-client/0.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
467
467
|
contentType: "application/json",
|
|
468
468
|
requestType: "json",
|
|
469
469
|
body: request,
|
|
@@ -515,9 +515,9 @@ class Agents {
|
|
|
515
515
|
var _a, _b;
|
|
516
516
|
return __awaiter(this, void 0, void 0, function* () {
|
|
517
517
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
518
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.LettaEnvironment.
|
|
518
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/memory/block`),
|
|
519
519
|
method: "GET",
|
|
520
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
520
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.2", "User-Agent": "@letta-ai/letta-client/0.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
521
521
|
contentType: "application/json",
|
|
522
522
|
requestType: "json",
|
|
523
523
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -575,9 +575,9 @@ class Agents {
|
|
|
575
575
|
var _a, _b;
|
|
576
576
|
return __awaiter(this, void 0, void 0, function* () {
|
|
577
577
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
578
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.LettaEnvironment.
|
|
578
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/messages/async`),
|
|
579
579
|
method: "POST",
|
|
580
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
580
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.2", "User-Agent": "@letta-ai/letta-client/0.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
581
581
|
contentType: "application/json",
|
|
582
582
|
requestType: "json",
|
|
583
583
|
body: request,
|
|
@@ -614,6 +614,53 @@ class Agents {
|
|
|
614
614
|
}
|
|
615
615
|
});
|
|
616
616
|
}
|
|
617
|
+
/**
|
|
618
|
+
* Search deployed agents
|
|
619
|
+
*
|
|
620
|
+
* @param {Letta.AgentsSearchDeployedAgentsRequest} request
|
|
621
|
+
* @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
|
|
622
|
+
*
|
|
623
|
+
* @example
|
|
624
|
+
* await client.agents.searchdeployedagents()
|
|
625
|
+
*/
|
|
626
|
+
searchdeployedagents(request = {}, requestOptions) {
|
|
627
|
+
var _a, _b;
|
|
628
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
629
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
630
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.LettaEnvironment.LettaCloud, "v1/agents/search"),
|
|
631
|
+
method: "POST",
|
|
632
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.2", "User-Agent": "@letta-ai/letta-client/0.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
633
|
+
contentType: "application/json",
|
|
634
|
+
requestType: "json",
|
|
635
|
+
body: request,
|
|
636
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
637
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
638
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
639
|
+
});
|
|
640
|
+
if (_response.ok) {
|
|
641
|
+
return;
|
|
642
|
+
}
|
|
643
|
+
if (_response.error.reason === "status-code") {
|
|
644
|
+
throw new errors.LettaError({
|
|
645
|
+
statusCode: _response.error.statusCode,
|
|
646
|
+
body: _response.error.body,
|
|
647
|
+
});
|
|
648
|
+
}
|
|
649
|
+
switch (_response.error.reason) {
|
|
650
|
+
case "non-json":
|
|
651
|
+
throw new errors.LettaError({
|
|
652
|
+
statusCode: _response.error.statusCode,
|
|
653
|
+
body: _response.error.rawBody,
|
|
654
|
+
});
|
|
655
|
+
case "timeout":
|
|
656
|
+
throw new errors.LettaTimeoutError("Timeout exceeded when calling POST /v1/agents/search.");
|
|
657
|
+
case "unknown":
|
|
658
|
+
throw new errors.LettaError({
|
|
659
|
+
message: _response.error.errorMessage,
|
|
660
|
+
});
|
|
661
|
+
}
|
|
662
|
+
});
|
|
663
|
+
}
|
|
617
664
|
/**
|
|
618
665
|
* Creates a versioned version of an agent
|
|
619
666
|
*
|
|
@@ -630,15 +677,15 @@ class Agents {
|
|
|
630
677
|
createVersion(agentId, request = {}, requestOptions) {
|
|
631
678
|
var _a, _b;
|
|
632
679
|
return __awaiter(this, void 0, void 0, function* () {
|
|
633
|
-
const {
|
|
680
|
+
const { returnAgentState } = request, _body = __rest(request, ["returnAgentState"]);
|
|
634
681
|
const _queryParams = {};
|
|
635
|
-
if (
|
|
636
|
-
_queryParams["
|
|
682
|
+
if (returnAgentState != null) {
|
|
683
|
+
_queryParams["returnAgentState"] = returnAgentState.toString();
|
|
637
684
|
}
|
|
638
685
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
639
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.LettaEnvironment.
|
|
686
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/version-template`),
|
|
640
687
|
method: "POST",
|
|
641
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
688
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.2", "User-Agent": "@letta-ai/letta-client/0.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
642
689
|
contentType: "application/json",
|
|
643
690
|
queryParameters: _queryParams,
|
|
644
691
|
requestType: "json",
|
|
@@ -648,7 +695,7 @@ class Agents {
|
|
|
648
695
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
649
696
|
});
|
|
650
697
|
if (_response.ok) {
|
|
651
|
-
return
|
|
698
|
+
return;
|
|
652
699
|
}
|
|
653
700
|
if (_response.error.reason === "status-code") {
|
|
654
701
|
switch (_response.error.statusCode) {
|
|
@@ -699,9 +746,9 @@ class Agents {
|
|
|
699
746
|
var _a, _b;
|
|
700
747
|
return __awaiter(this, void 0, void 0, function* () {
|
|
701
748
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
702
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.LettaEnvironment.
|
|
749
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/migrate`),
|
|
703
750
|
method: "POST",
|
|
704
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
751
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.2", "User-Agent": "@letta-ai/letta-client/0.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
705
752
|
contentType: "application/json",
|
|
706
753
|
requestType: "json",
|
|
707
754
|
body: request,
|
|
@@ -742,6 +789,117 @@ class Agents {
|
|
|
742
789
|
}
|
|
743
790
|
});
|
|
744
791
|
}
|
|
792
|
+
/**
|
|
793
|
+
* Create a template from an agent
|
|
794
|
+
*
|
|
795
|
+
* @param {string} agentId
|
|
796
|
+
* @param {Letta.AgentsCreateTemplateFromAgentRequest} request
|
|
797
|
+
* @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
|
|
798
|
+
*
|
|
799
|
+
* @throws {@link Letta.NotFoundError}
|
|
800
|
+
* @throws {@link Letta.InternalServerError}
|
|
801
|
+
*
|
|
802
|
+
* @example
|
|
803
|
+
* await client.agents.createtemplatefromagent("agent_id")
|
|
804
|
+
*/
|
|
805
|
+
createtemplatefromagent(agentId, request = {}, requestOptions) {
|
|
806
|
+
var _a, _b;
|
|
807
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
808
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
809
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/template`),
|
|
810
|
+
method: "POST",
|
|
811
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.2", "User-Agent": "@letta-ai/letta-client/0.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
812
|
+
contentType: "application/json",
|
|
813
|
+
requestType: "json",
|
|
814
|
+
body: request,
|
|
815
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
816
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
817
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
818
|
+
});
|
|
819
|
+
if (_response.ok) {
|
|
820
|
+
return;
|
|
821
|
+
}
|
|
822
|
+
if (_response.error.reason === "status-code") {
|
|
823
|
+
switch (_response.error.statusCode) {
|
|
824
|
+
case 404:
|
|
825
|
+
throw new Letta.NotFoundError(_response.error.body);
|
|
826
|
+
case 500:
|
|
827
|
+
throw new Letta.InternalServerError(_response.error.body);
|
|
828
|
+
default:
|
|
829
|
+
throw new errors.LettaError({
|
|
830
|
+
statusCode: _response.error.statusCode,
|
|
831
|
+
body: _response.error.body,
|
|
832
|
+
});
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
switch (_response.error.reason) {
|
|
836
|
+
case "non-json":
|
|
837
|
+
throw new errors.LettaError({
|
|
838
|
+
statusCode: _response.error.statusCode,
|
|
839
|
+
body: _response.error.rawBody,
|
|
840
|
+
});
|
|
841
|
+
case "timeout":
|
|
842
|
+
throw new errors.LettaTimeoutError("Timeout exceeded when calling POST /v1/agents/{agent_id}/template.");
|
|
843
|
+
case "unknown":
|
|
844
|
+
throw new errors.LettaError({
|
|
845
|
+
message: _response.error.errorMessage,
|
|
846
|
+
});
|
|
847
|
+
}
|
|
848
|
+
});
|
|
849
|
+
}
|
|
850
|
+
/**
|
|
851
|
+
* Get the variables associated with an agent
|
|
852
|
+
*
|
|
853
|
+
* @param {string} agentId
|
|
854
|
+
* @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
|
|
855
|
+
*
|
|
856
|
+
* @throws {@link Letta.NotFoundError}
|
|
857
|
+
*
|
|
858
|
+
* @example
|
|
859
|
+
* await client.agents.getagentvariables("agent_id")
|
|
860
|
+
*/
|
|
861
|
+
getagentvariables(agentId, requestOptions) {
|
|
862
|
+
var _a, _b;
|
|
863
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
864
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
865
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/variables`),
|
|
866
|
+
method: "GET",
|
|
867
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.2", "User-Agent": "@letta-ai/letta-client/0.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
868
|
+
contentType: "application/json",
|
|
869
|
+
requestType: "json",
|
|
870
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
871
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
872
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
873
|
+
});
|
|
874
|
+
if (_response.ok) {
|
|
875
|
+
return _response.body;
|
|
876
|
+
}
|
|
877
|
+
if (_response.error.reason === "status-code") {
|
|
878
|
+
switch (_response.error.statusCode) {
|
|
879
|
+
case 404:
|
|
880
|
+
throw new Letta.NotFoundError(_response.error.body);
|
|
881
|
+
default:
|
|
882
|
+
throw new errors.LettaError({
|
|
883
|
+
statusCode: _response.error.statusCode,
|
|
884
|
+
body: _response.error.body,
|
|
885
|
+
});
|
|
886
|
+
}
|
|
887
|
+
}
|
|
888
|
+
switch (_response.error.reason) {
|
|
889
|
+
case "non-json":
|
|
890
|
+
throw new errors.LettaError({
|
|
891
|
+
statusCode: _response.error.statusCode,
|
|
892
|
+
body: _response.error.rawBody,
|
|
893
|
+
});
|
|
894
|
+
case "timeout":
|
|
895
|
+
throw new errors.LettaTimeoutError("Timeout exceeded when calling GET /v1/agents/{agent_id}/variables.");
|
|
896
|
+
case "unknown":
|
|
897
|
+
throw new errors.LettaError({
|
|
898
|
+
message: _response.error.errorMessage,
|
|
899
|
+
});
|
|
900
|
+
}
|
|
901
|
+
});
|
|
902
|
+
}
|
|
745
903
|
_getAuthorizationHeader() {
|
|
746
904
|
return __awaiter(this, void 0, void 0, function* () {
|
|
747
905
|
return `Bearer ${yield core.Supplier.get(this._options.token)}`;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Letta from "../../../../index";
|
|
5
|
+
/**
|
|
6
|
+
* @example
|
|
7
|
+
* {}
|
|
8
|
+
*/
|
|
9
|
+
export interface AgentsSearchDeployedAgentsRequest {
|
|
10
|
+
search?: Letta.AgentsSearchDeployedAgentsRequestSearchItem[];
|
|
11
|
+
project_id?: string;
|
|
12
|
+
combinator?: Letta.AgentsSearchDeployedAgentsRequestCombinator;
|
|
13
|
+
limit?: number;
|
|
14
|
+
offset?: number;
|
|
15
|
+
}
|
|
@@ -52,5 +52,9 @@ export interface CreateAgentRequest {
|
|
|
52
52
|
context_window_limit?: number;
|
|
53
53
|
/** The embedding chunk size used by the agent. */
|
|
54
54
|
embedding_chunk_size?: number;
|
|
55
|
+
/** The template id used to configure the agent */
|
|
56
|
+
from_template?: string;
|
|
57
|
+
/** The project id that the agent will be associated with. */
|
|
58
|
+
project_id?: string;
|
|
55
59
|
user_id?: string;
|
|
56
60
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { type AgentsListRequest } from "./AgentsListRequest";
|
|
2
2
|
export { type CreateAgentRequest } from "./CreateAgentRequest";
|
|
3
3
|
export { type UpdateAgent } from "./UpdateAgent";
|
|
4
|
+
export { type AgentsSearchDeployedAgentsRequest } from "./AgentsSearchDeployedAgentsRequest";
|
|
4
5
|
export { type AgentsCreateVersionRequest } from "./AgentsCreateVersionRequest";
|
|
5
6
|
export { type AgentsMigrateRequest } from "./AgentsMigrateRequest";
|
|
7
|
+
export { type AgentsCreateTemplateFromAgentRequest } from "./AgentsCreateTemplateFromAgentRequest";
|
|
@@ -63,9 +63,9 @@ class ArchivalMemory {
|
|
|
63
63
|
var _a, _b;
|
|
64
64
|
return __awaiter(this, void 0, void 0, function* () {
|
|
65
65
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
66
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.LettaEnvironment.
|
|
66
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/memory/archival`),
|
|
67
67
|
method: "GET",
|
|
68
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
68
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.2", "User-Agent": "@letta-ai/letta-client/0.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
69
69
|
contentType: "application/json",
|
|
70
70
|
requestType: "json",
|
|
71
71
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -128,9 +128,9 @@ class ArchivalMemory {
|
|
|
128
128
|
_queryParams["limit"] = limit.toString();
|
|
129
129
|
}
|
|
130
130
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
131
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.LettaEnvironment.
|
|
131
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/archival`),
|
|
132
132
|
method: "GET",
|
|
133
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
133
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.2", "User-Agent": "@letta-ai/letta-client/0.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
134
134
|
contentType: "application/json",
|
|
135
135
|
queryParameters: _queryParams,
|
|
136
136
|
requestType: "json",
|
|
@@ -185,9 +185,9 @@ class ArchivalMemory {
|
|
|
185
185
|
var _a, _b;
|
|
186
186
|
return __awaiter(this, void 0, void 0, function* () {
|
|
187
187
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
188
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.LettaEnvironment.
|
|
188
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/archival`),
|
|
189
189
|
method: "POST",
|
|
190
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
190
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.2", "User-Agent": "@letta-ai/letta-client/0.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
191
191
|
contentType: "application/json",
|
|
192
192
|
requestType: "json",
|
|
193
193
|
body: request,
|
|
@@ -240,9 +240,9 @@ class ArchivalMemory {
|
|
|
240
240
|
var _a, _b;
|
|
241
241
|
return __awaiter(this, void 0, void 0, function* () {
|
|
242
242
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
243
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.LettaEnvironment.
|
|
243
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/archival/${encodeURIComponent(memoryId)}`),
|
|
244
244
|
method: "DELETE",
|
|
245
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
245
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.2", "User-Agent": "@letta-ai/letta-client/0.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
246
246
|
contentType: "application/json",
|
|
247
247
|
requestType: "json",
|
|
248
248
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -63,9 +63,9 @@ class Context {
|
|
|
63
63
|
var _a, _b;
|
|
64
64
|
return __awaiter(this, void 0, void 0, function* () {
|
|
65
65
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
66
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.LettaEnvironment.
|
|
66
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/context`),
|
|
67
67
|
method: "GET",
|
|
68
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
68
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.2", "User-Agent": "@letta-ai/letta-client/0.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
69
69
|
contentType: "application/json",
|
|
70
70
|
requestType: "json",
|
|
71
71
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -69,9 +69,9 @@ class Memory {
|
|
|
69
69
|
var _a, _b;
|
|
70
70
|
return __awaiter(this, void 0, void 0, function* () {
|
|
71
71
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
72
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.LettaEnvironment.
|
|
72
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/memory`),
|
|
73
73
|
method: "GET",
|
|
74
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
74
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.2", "User-Agent": "@letta-ai/letta-client/0.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
75
75
|
contentType: "application/json",
|
|
76
76
|
requestType: "json",
|
|
77
77
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -63,9 +63,9 @@ class Messages {
|
|
|
63
63
|
var _a, _b;
|
|
64
64
|
return __awaiter(this, void 0, void 0, function* () {
|
|
65
65
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
66
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.LettaEnvironment.
|
|
66
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/memory/messages`),
|
|
67
67
|
method: "GET",
|
|
68
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
68
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.2", "User-Agent": "@letta-ai/letta-client/0.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
69
69
|
contentType: "application/json",
|
|
70
70
|
requestType: "json",
|
|
71
71
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -64,9 +64,9 @@ class MemoryBlocks {
|
|
|
64
64
|
var _a, _b;
|
|
65
65
|
return __awaiter(this, void 0, void 0, function* () {
|
|
66
66
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
67
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.LettaEnvironment.
|
|
67
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/memory/block/${encodeURIComponent(blockLabel)}`),
|
|
68
68
|
method: "DELETE",
|
|
69
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
69
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.2", "User-Agent": "@letta-ai/letta-client/0.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
70
70
|
contentType: "application/json",
|
|
71
71
|
requestType: "json",
|
|
72
72
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -121,9 +121,9 @@ class MemoryBlocks {
|
|
|
121
121
|
var _a, _b;
|
|
122
122
|
return __awaiter(this, void 0, void 0, function* () {
|
|
123
123
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
124
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.LettaEnvironment.
|
|
124
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/memory/block`),
|
|
125
125
|
method: "POST",
|
|
126
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
126
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.2", "User-Agent": "@letta-ai/letta-client/0.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
127
127
|
contentType: "application/json",
|
|
128
128
|
requestType: "json",
|
|
129
129
|
body: request,
|