@letta-ai/letta-client 0.1.1 → 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 +13 -1
- package/api/resources/agents/client/Client.js +79 -26
- package/api/resources/agents/client/requests/CreateAgentRequest.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/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/index.d.ts +1 -0
- package/api/resources/agents/types/index.js +1 -0
- 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/LettaResponse.d.ts +12 -62
- package/api/types/index.d.ts +0 -13
- package/api/types/index.js +0 -13
- package/dist/api/resources/agents/client/Client.d.ts +13 -1
- package/dist/api/resources/agents/client/Client.js +79 -26
- package/dist/api/resources/agents/client/requests/CreateAgentRequest.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/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/index.d.ts +1 -0
- package/dist/api/resources/agents/types/index.js +1 -0
- 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/LettaResponse.d.ts +12 -62
- 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 +64 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/api/types/LettaResponseAssistantMessage.d.ts +0 -9
- package/api/types/LettaResponseLettaUsageStatistics.d.ts +0 -23
- package/api/types/LettaResponseReasoningMessage.d.ts +0 -17
- package/api/types/LettaResponseReasoningMessage.js +0 -5
- package/api/types/LettaResponseSystemMessage.d.ts +0 -17
- package/api/types/LettaResponseSystemMessage.js +0 -5
- package/api/types/LettaResponseToolCall.d.ts +0 -8
- package/api/types/LettaResponseToolCall.js +0 -5
- package/api/types/LettaResponseToolCallDelta.d.ts +0 -8
- package/api/types/LettaResponseToolCallDelta.js +0 -5
- package/api/types/LettaResponseToolCallMessage.d.ts +0 -18
- package/api/types/LettaResponseToolCallMessage.js +0 -5
- package/api/types/LettaResponseToolCallMessageToolCall.d.ts +0 -5
- package/api/types/LettaResponseToolCallMessageToolCall.js +0 -5
- package/api/types/LettaResponseToolCallMessageToolCallOne.d.ts +0 -8
- package/api/types/LettaResponseToolCallMessageToolCallOne.js +0 -5
- package/api/types/LettaResponseToolCallMessageToolCallZero.d.ts +0 -8
- package/api/types/LettaResponseToolCallMessageToolCallZero.js +0 -5
- package/api/types/LettaResponseToolReturnMessage.d.ts +0 -26
- package/api/types/LettaResponseToolReturnMessage.js +0 -5
- package/api/types/LettaResponseToolReturnMessageStatus.d.ts +0 -8
- package/api/types/LettaResponseToolReturnMessageStatus.js +0 -10
- package/api/types/LettaResponseUserMessage.d.ts +0 -17
- package/api/types/LettaResponseUserMessage.js +0 -5
- 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 -23
- 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/LettaResponseToolReturnMessageStatus.js +0 -10
- package/dist/api/types/LettaResponseUserMessage.d.ts +0 -17
- package/dist/api/types/LettaResponseUserMessage.js +0 -5
- /package/api/{types/LettaResponseAssistantMessage.js → resources/agents/types/AgentsGetAgentVariablesResponse.js} +0 -0
- /package/{api/types/LettaResponseLettaUsageStatistics.js → dist/api/resources/agents/types/AgentsGetAgentVariablesResponse.js} +0 -0
|
@@ -2,67 +2,17 @@
|
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
4
|
import * as Letta from "../index";
|
|
5
|
+
/**
|
|
6
|
+
* Response object from an agent interaction, consisting of the new messages generated by the agent and usage statistics.
|
|
7
|
+
* The type of the returned messages can be either `Message` or `LettaMessage`, depending on what was specified in the request.
|
|
8
|
+
*
|
|
9
|
+
* Attributes:
|
|
10
|
+
* messages (List[Union[Message, LettaMessage]]): The messages returned by the agent.
|
|
11
|
+
* usage (LettaUsageStatistics): The usage statistics
|
|
12
|
+
*/
|
|
5
13
|
export interface LettaResponse {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
* Attributes:
|
|
11
|
-
* completion_tokens (int): The number of tokens generated by the agent.
|
|
12
|
-
* prompt_tokens (int): The number of tokens in the prompt.
|
|
13
|
-
* total_tokens (int): The total number of tokens processed by the agent.
|
|
14
|
-
* step_count (int): The number of steps taken by the agent.
|
|
15
|
-
*/
|
|
16
|
-
LettaUsageStatistics?: Letta.LettaResponseLettaUsageStatistics;
|
|
17
|
-
/**
|
|
18
|
-
* Representation of an agent's internal reasoning.
|
|
19
|
-
*
|
|
20
|
-
* Attributes:
|
|
21
|
-
* reasoning (str): The internal reasoning of the agent
|
|
22
|
-
* id (str): The ID of the message
|
|
23
|
-
* date (datetime): The date the message was created in ISO format
|
|
24
|
-
*/
|
|
25
|
-
ReasoningMessage?: Letta.LettaResponseReasoningMessage;
|
|
26
|
-
/**
|
|
27
|
-
* A message generated by the system. Never streamed back on a response, only used for cursor pagination.
|
|
28
|
-
*
|
|
29
|
-
* Attributes:
|
|
30
|
-
* message (str): The message sent by the system
|
|
31
|
-
* id (str): The ID of the message
|
|
32
|
-
* date (datetime): The date the message was created in ISO format
|
|
33
|
-
*/
|
|
34
|
-
SystemMessage?: Letta.LettaResponseSystemMessage;
|
|
35
|
-
ToolCall?: Letta.LettaResponseToolCall;
|
|
36
|
-
ToolCallDelta?: Letta.LettaResponseToolCallDelta;
|
|
37
|
-
/**
|
|
38
|
-
* A message representing a request to call a tool (generated by the LLM to trigger tool execution).
|
|
39
|
-
*
|
|
40
|
-
* Attributes:
|
|
41
|
-
* tool_call (Union[ToolCall, ToolCallDelta]): The tool call
|
|
42
|
-
* id (str): The ID of the message
|
|
43
|
-
* date (datetime): The date the message was created in ISO format
|
|
44
|
-
*/
|
|
45
|
-
ToolCallMessage?: Letta.LettaResponseToolCallMessage;
|
|
46
|
-
/**
|
|
47
|
-
* A message representing the return value of a tool call (generated by Letta executing the requested tool).
|
|
48
|
-
*
|
|
49
|
-
* Attributes:
|
|
50
|
-
* tool_return (str): The return value of the tool
|
|
51
|
-
* status (Literal["success", "error"]): The status of the tool call
|
|
52
|
-
* id (str): The ID of the message
|
|
53
|
-
* date (datetime): The date the message was created in ISO format
|
|
54
|
-
* tool_call_id (str): A unique identifier for the tool call that generated this message
|
|
55
|
-
* stdout (Optional[List(str)]): Captured stdout (e.g. prints, logs) from the tool invocation
|
|
56
|
-
* stderr (Optional[List(str)]): Captured stderr from the tool invocation
|
|
57
|
-
*/
|
|
58
|
-
ToolReturnMessage?: Letta.LettaResponseToolReturnMessage;
|
|
59
|
-
/**
|
|
60
|
-
* A message sent by the user. Never streamed back on a response, only used for cursor pagination.
|
|
61
|
-
*
|
|
62
|
-
* Attributes:
|
|
63
|
-
* message (str): The message sent by the user
|
|
64
|
-
* id (str): The ID of the message
|
|
65
|
-
* date (datetime): The date the message was created in ISO format
|
|
66
|
-
*/
|
|
67
|
-
UserMessage?: Letta.LettaResponseUserMessage;
|
|
14
|
+
/** The messages returned by the agent. */
|
|
15
|
+
messages: unknown[];
|
|
16
|
+
/** The usage statistics of the agent. */
|
|
17
|
+
usage: Letta.LettaUsageStatistics;
|
|
68
18
|
}
|
package/api/types/index.d.ts
CHANGED
|
@@ -50,19 +50,6 @@ export * from "./JobStatus";
|
|
|
50
50
|
export * from "./LlmConfigModelEndpointType";
|
|
51
51
|
export * from "./LlmConfig";
|
|
52
52
|
export * from "./LettaRequest";
|
|
53
|
-
export * from "./LettaResponseAssistantMessage";
|
|
54
|
-
export * from "./LettaResponseLettaUsageStatistics";
|
|
55
|
-
export * from "./LettaResponseReasoningMessage";
|
|
56
|
-
export * from "./LettaResponseSystemMessage";
|
|
57
|
-
export * from "./LettaResponseToolCall";
|
|
58
|
-
export * from "./LettaResponseToolCallDelta";
|
|
59
|
-
export * from "./LettaResponseToolCallMessageToolCallZero";
|
|
60
|
-
export * from "./LettaResponseToolCallMessageToolCallOne";
|
|
61
|
-
export * from "./LettaResponseToolCallMessageToolCall";
|
|
62
|
-
export * from "./LettaResponseToolCallMessage";
|
|
63
|
-
export * from "./LettaResponseToolReturnMessageStatus";
|
|
64
|
-
export * from "./LettaResponseToolReturnMessage";
|
|
65
|
-
export * from "./LettaResponseUserMessage";
|
|
66
53
|
export * from "./LettaResponse";
|
|
67
54
|
export * from "./LettaUsageStatistics";
|
|
68
55
|
export * from "./LocalSandboxConfig";
|
package/api/types/index.js
CHANGED
|
@@ -66,19 +66,6 @@ __exportStar(require("./JobStatus"), exports);
|
|
|
66
66
|
__exportStar(require("./LlmConfigModelEndpointType"), exports);
|
|
67
67
|
__exportStar(require("./LlmConfig"), exports);
|
|
68
68
|
__exportStar(require("./LettaRequest"), exports);
|
|
69
|
-
__exportStar(require("./LettaResponseAssistantMessage"), exports);
|
|
70
|
-
__exportStar(require("./LettaResponseLettaUsageStatistics"), exports);
|
|
71
|
-
__exportStar(require("./LettaResponseReasoningMessage"), exports);
|
|
72
|
-
__exportStar(require("./LettaResponseSystemMessage"), exports);
|
|
73
|
-
__exportStar(require("./LettaResponseToolCall"), exports);
|
|
74
|
-
__exportStar(require("./LettaResponseToolCallDelta"), exports);
|
|
75
|
-
__exportStar(require("./LettaResponseToolCallMessageToolCallZero"), exports);
|
|
76
|
-
__exportStar(require("./LettaResponseToolCallMessageToolCallOne"), exports);
|
|
77
|
-
__exportStar(require("./LettaResponseToolCallMessageToolCall"), exports);
|
|
78
|
-
__exportStar(require("./LettaResponseToolCallMessage"), exports);
|
|
79
|
-
__exportStar(require("./LettaResponseToolReturnMessageStatus"), exports);
|
|
80
|
-
__exportStar(require("./LettaResponseToolReturnMessage"), exports);
|
|
81
|
-
__exportStar(require("./LettaResponseUserMessage"), exports);
|
|
82
69
|
__exportStar(require("./LettaResponse"), exports);
|
|
83
70
|
__exportStar(require("./LettaUsageStatistics"), exports);
|
|
84
71
|
__exportStar(require("./LocalSandboxConfig"), exports);
|
|
@@ -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
|
*
|
|
@@ -229,5 +229,17 @@ export declare class Agents {
|
|
|
229
229
|
* await client.agents.createtemplatefromagent("agent_id")
|
|
230
230
|
*/
|
|
231
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>;
|
|
232
244
|
protected _getAuthorizationHeader(): Promise<string>;
|
|
233
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,
|
|
@@ -627,9 +627,9 @@ class Agents {
|
|
|
627
627
|
var _a, _b;
|
|
628
628
|
return __awaiter(this, void 0, void 0, function* () {
|
|
629
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.
|
|
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
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.
|
|
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
633
|
contentType: "application/json",
|
|
634
634
|
requestType: "json",
|
|
635
635
|
body: request,
|
|
@@ -683,9 +683,9 @@ class Agents {
|
|
|
683
683
|
_queryParams["returnAgentState"] = returnAgentState.toString();
|
|
684
684
|
}
|
|
685
685
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
686
|
-
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`),
|
|
687
687
|
method: "POST",
|
|
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.
|
|
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),
|
|
689
689
|
contentType: "application/json",
|
|
690
690
|
queryParameters: _queryParams,
|
|
691
691
|
requestType: "json",
|
|
@@ -746,9 +746,9 @@ class Agents {
|
|
|
746
746
|
var _a, _b;
|
|
747
747
|
return __awaiter(this, void 0, void 0, function* () {
|
|
748
748
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
749
|
-
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`),
|
|
750
750
|
method: "POST",
|
|
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.
|
|
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),
|
|
752
752
|
contentType: "application/json",
|
|
753
753
|
requestType: "json",
|
|
754
754
|
body: request,
|
|
@@ -806,9 +806,9 @@ class Agents {
|
|
|
806
806
|
var _a, _b;
|
|
807
807
|
return __awaiter(this, void 0, void 0, function* () {
|
|
808
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.
|
|
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
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.
|
|
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
812
|
contentType: "application/json",
|
|
813
813
|
requestType: "json",
|
|
814
814
|
body: request,
|
|
@@ -847,6 +847,59 @@ class Agents {
|
|
|
847
847
|
}
|
|
848
848
|
});
|
|
849
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
|
+
}
|
|
850
903
|
_getAuthorizationHeader() {
|
|
851
904
|
return __awaiter(this, void 0, void 0, function* () {
|
|
852
905
|
return `Bearer ${yield core.Supplier.get(this._options.token)}`;
|
|
@@ -54,5 +54,7 @@ export interface CreateAgentRequest {
|
|
|
54
54
|
embedding_chunk_size?: number;
|
|
55
55
|
/** The template id used to configure the agent */
|
|
56
56
|
from_template?: string;
|
|
57
|
+
/** The project id that the agent will be associated with. */
|
|
58
|
+
project_id?: string;
|
|
57
59
|
user_id?: string;
|
|
58
60
|
}
|
|
@@ -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,
|
|
@@ -81,9 +81,9 @@ class Messages {
|
|
|
81
81
|
_queryParams["assistant_message_tool_kwarg"] = assistantMessageToolKwarg;
|
|
82
82
|
}
|
|
83
83
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
84
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.LettaEnvironment.
|
|
84
|
+
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`),
|
|
85
85
|
method: "GET",
|
|
86
|
-
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.
|
|
86
|
+
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),
|
|
87
87
|
contentType: "application/json",
|
|
88
88
|
queryParameters: _queryParams,
|
|
89
89
|
requestType: "json",
|
|
@@ -142,9 +142,9 @@ class Messages {
|
|
|
142
142
|
var _a, _b;
|
|
143
143
|
return __awaiter(this, void 0, void 0, function* () {
|
|
144
144
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
145
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.LettaEnvironment.
|
|
145
|
+
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`),
|
|
146
146
|
method: "POST",
|
|
147
|
-
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.
|
|
147
|
+
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),
|
|
148
148
|
contentType: "application/json",
|
|
149
149
|
requestType: "json",
|
|
150
150
|
body: request,
|
|
@@ -198,9 +198,9 @@ class Messages {
|
|
|
198
198
|
var _a, _b;
|
|
199
199
|
return __awaiter(this, void 0, void 0, function* () {
|
|
200
200
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
201
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.LettaEnvironment.
|
|
201
|
+
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/${encodeURIComponent(messageId)}`),
|
|
202
202
|
method: "PATCH",
|
|
203
|
-
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.
|
|
203
|
+
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),
|
|
204
204
|
contentType: "application/json",
|
|
205
205
|
requestType: "json",
|
|
206
206
|
body: request,
|
|
@@ -246,9 +246,9 @@ class Messages {
|
|
|
246
246
|
var _a, _b;
|
|
247
247
|
return __awaiter(this, void 0, void 0, function* () {
|
|
248
248
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
249
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.LettaEnvironment.
|
|
249
|
+
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/stream`),
|
|
250
250
|
method: "POST",
|
|
251
|
-
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.
|
|
251
|
+
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),
|
|
252
252
|
contentType: "application/json",
|
|
253
253
|
requestType: "json",
|
|
254
254
|
body: request,
|
|
@@ -63,9 +63,9 @@ class RecallMemory {
|
|
|
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/recall`),
|
|
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,
|