@letta-ai/letta-client 0.1.9 → 0.1.12
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 +1 -4
- package/api/resources/agents/client/Client.js +21 -23
- package/api/resources/agents/client/requests/AgentsListRequest.d.ts +5 -1
- package/api/resources/agents/client/requests/CreateAgentRequest.d.ts +5 -3
- package/api/resources/agents/resources/archivalMemory/client/Client.d.ts +0 -12
- package/api/resources/agents/resources/archivalMemory/client/Client.js +9 -74
- package/api/resources/agents/resources/context/client/Client.js +1 -1
- package/api/resources/agents/resources/coreMemory/client/Client.d.ts +2 -14
- package/api/resources/agents/resources/coreMemory/client/Client.js +21 -86
- package/api/resources/agents/resources/index.d.ts +0 -1
- package/api/resources/agents/resources/index.js +1 -2
- package/api/resources/agents/resources/memoryVariables/client/Client.js +3 -3
- package/api/resources/agents/resources/messages/client/Client.d.ts +3 -3
- package/api/resources/agents/resources/messages/client/Client.js +8 -8
- package/api/resources/agents/resources/messages/client/requests/LettaStreamingRequest.d.ts +2 -6
- package/api/resources/agents/resources/messages/types/MessagesListResponse.d.ts +1 -1
- package/api/resources/agents/resources/messages/types/index.d.ts +0 -1
- package/api/resources/agents/resources/messages/types/index.js +0 -1
- package/api/resources/agents/resources/sources/client/Client.js +1 -1
- package/api/resources/agents/resources/templates/client/Client.js +3 -3
- package/api/resources/agents/resources/tools/client/Client.js +3 -3
- package/api/resources/agents/types/AgentsSearchRequestSearchItem.d.ts +4 -1
- package/api/resources/agents/types/AgentsSearchRequestSearchItemTags.d.ts +7 -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 +7 -7
- package/api/resources/health/client/Client.js +1 -1
- package/api/resources/jobs/client/Client.js +4 -4
- package/api/resources/models/client/Client.js +2 -2
- package/api/resources/providers/client/Client.d.ts +11 -11
- package/api/resources/providers/client/Client.js +32 -32
- package/api/resources/providers/client/requests/index.d.ts +1 -1
- package/api/resources/runs/client/Client.d.ts +6 -8
- package/api/resources/runs/client/Client.js +12 -37
- package/api/resources/runs/client/requests/GetRunMessagesRequest.d.ts +1 -25
- package/api/resources/sources/client/Client.js +8 -8
- package/api/resources/sources/resources/files/client/Client.js +3 -3
- package/api/resources/sources/resources/passages/client/Client.js +1 -1
- package/api/resources/tag/client/Client.js +1 -1
- package/api/resources/tools/client/Client.d.ts +0 -12
- package/api/resources/tools/client/Client.js +11 -76
- package/api/types/EmbeddingConfigEmbeddingEndpointType.d.ts +2 -1
- package/api/types/EmbeddingConfigEmbeddingEndpointType.js +1 -0
- package/{dist/api/types/LettaResponseMessagesItem.d.ts → api/types/LettaMessageUnion.d.ts} +2 -2
- package/api/types/LettaRequest.d.ts +2 -6
- package/api/types/LettaRequestConfig.d.ts +11 -0
- package/api/types/LettaResponse.d.ts +1 -1
- package/api/types/LettaSchemasMessageMessage.d.ts +2 -0
- package/api/types/LlmConfigModelEndpointType.d.ts +2 -1
- package/api/types/LlmConfigModelEndpointType.js +1 -0
- package/api/types/Run.d.ts +2 -0
- package/api/types/ToolType.d.ts +2 -1
- package/api/types/ToolType.js +1 -0
- package/api/types/index.d.ts +2 -3
- package/api/types/index.js +2 -3
- package/dist/api/resources/agents/client/Client.d.ts +1 -4
- package/dist/api/resources/agents/client/Client.js +21 -23
- package/dist/api/resources/agents/client/requests/AgentsListRequest.d.ts +5 -1
- package/dist/api/resources/agents/client/requests/CreateAgentRequest.d.ts +5 -3
- package/dist/api/resources/agents/resources/archivalMemory/client/Client.d.ts +0 -12
- package/dist/api/resources/agents/resources/archivalMemory/client/Client.js +9 -74
- package/dist/api/resources/agents/resources/context/client/Client.js +1 -1
- package/dist/api/resources/agents/resources/coreMemory/client/Client.d.ts +2 -14
- package/dist/api/resources/agents/resources/coreMemory/client/Client.js +21 -86
- package/dist/api/resources/agents/resources/index.d.ts +0 -1
- package/dist/api/resources/agents/resources/index.js +1 -2
- package/dist/api/resources/agents/resources/memoryVariables/client/Client.js +3 -3
- package/dist/api/resources/agents/resources/messages/client/Client.d.ts +3 -3
- package/dist/api/resources/agents/resources/messages/client/Client.js +8 -8
- package/dist/api/resources/agents/resources/messages/client/requests/LettaStreamingRequest.d.ts +2 -6
- package/dist/api/resources/agents/resources/messages/types/MessagesListResponse.d.ts +1 -1
- package/dist/api/resources/agents/resources/messages/types/index.d.ts +0 -1
- package/dist/api/resources/agents/resources/messages/types/index.js +0 -1
- package/dist/api/resources/agents/resources/sources/client/Client.js +1 -1
- package/dist/api/resources/agents/resources/templates/client/Client.js +3 -3
- package/dist/api/resources/agents/resources/tools/client/Client.js +3 -3
- package/dist/api/resources/agents/types/AgentsSearchRequestSearchItem.d.ts +4 -1
- package/dist/api/resources/agents/types/AgentsSearchRequestSearchItemTags.d.ts +7 -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 +7 -7
- package/dist/api/resources/health/client/Client.js +1 -1
- package/dist/api/resources/jobs/client/Client.js +4 -4
- package/dist/api/resources/models/client/Client.js +2 -2
- package/dist/api/resources/providers/client/Client.d.ts +11 -11
- package/dist/api/resources/providers/client/Client.js +32 -32
- package/dist/api/resources/providers/client/requests/index.d.ts +1 -1
- package/dist/api/resources/runs/client/Client.d.ts +6 -8
- package/dist/api/resources/runs/client/Client.js +12 -37
- package/dist/api/resources/runs/client/requests/GetRunMessagesRequest.d.ts +1 -25
- package/dist/api/resources/sources/client/Client.js +8 -8
- package/dist/api/resources/sources/resources/files/client/Client.js +3 -3
- package/dist/api/resources/sources/resources/passages/client/Client.js +1 -1
- package/dist/api/resources/tag/client/Client.js +1 -1
- package/dist/api/resources/tools/client/Client.d.ts +0 -12
- package/dist/api/resources/tools/client/Client.js +11 -76
- package/dist/api/types/EmbeddingConfigEmbeddingEndpointType.d.ts +2 -1
- package/dist/api/types/EmbeddingConfigEmbeddingEndpointType.js +1 -0
- package/{api/types/LettaResponseMessagesItem.d.ts → dist/api/types/LettaMessageUnion.d.ts} +2 -2
- package/dist/api/types/LettaRequest.d.ts +2 -6
- package/dist/api/types/LettaRequestConfig.d.ts +11 -0
- package/dist/api/types/LettaResponse.d.ts +1 -1
- package/dist/api/types/LettaSchemasMessageMessage.d.ts +2 -0
- package/dist/api/types/LlmConfigModelEndpointType.d.ts +2 -1
- package/dist/api/types/LlmConfigModelEndpointType.js +1 -0
- package/dist/api/types/Run.d.ts +2 -0
- package/dist/api/types/ToolType.d.ts +2 -1
- package/dist/api/types/ToolType.js +1 -0
- package/dist/api/types/index.d.ts +2 -3
- package/dist/api/types/index.js +2 -3
- package/dist/serialization/resources/agents/client/requests/CreateAgentRequest.d.ts +3 -2
- package/dist/serialization/resources/agents/client/requests/CreateAgentRequest.js +3 -4
- package/dist/serialization/resources/agents/resources/coreMemory/client/index.d.ts +1 -2
- package/dist/serialization/resources/agents/resources/coreMemory/client/index.js +2 -3
- package/dist/serialization/resources/agents/resources/coreMemory/client/{getBlocks.d.ts → list.d.ts} +1 -1
- package/dist/serialization/resources/agents/resources/messages/client/requests/LettaStreamingRequest.d.ts +2 -3
- package/dist/serialization/resources/agents/resources/messages/client/requests/LettaStreamingRequest.js +2 -3
- package/dist/serialization/resources/agents/resources/messages/types/MessagesListResponse.d.ts +2 -2
- package/dist/serialization/resources/agents/resources/messages/types/MessagesListResponse.js +2 -2
- package/dist/serialization/resources/agents/resources/messages/types/index.d.ts +0 -1
- package/dist/serialization/resources/agents/resources/messages/types/index.js +0 -1
- package/dist/serialization/resources/agents/types/AgentsSearchRequestSearchItem.d.ts +5 -1
- package/dist/serialization/resources/agents/types/AgentsSearchRequestSearchItem.js +2 -0
- package/dist/serialization/resources/agents/types/AgentsSearchRequestSearchItemTags.d.ts +13 -0
- package/{serialization/resources/tools/client/getByName.js → dist/serialization/resources/agents/types/AgentsSearchRequestSearchItemTags.js} +5 -2
- package/dist/serialization/resources/agents/types/index.d.ts +1 -0
- package/dist/serialization/resources/agents/types/index.js +1 -0
- package/dist/serialization/resources/runs/client/getRunMessages.d.ts +3 -3
- package/dist/serialization/resources/runs/client/getRunMessages.js +2 -2
- package/dist/serialization/resources/tools/client/index.d.ts +0 -1
- package/dist/serialization/resources/tools/client/index.js +1 -2
- package/dist/serialization/types/EmbeddingConfigEmbeddingEndpointType.d.ts +1 -1
- package/dist/serialization/types/EmbeddingConfigEmbeddingEndpointType.js +1 -0
- package/dist/serialization/types/{LettaResponseMessagesItem.d.ts → LettaMessageUnion.d.ts} +3 -3
- package/dist/serialization/types/{LettaResponseMessagesItem.js → LettaMessageUnion.js} +2 -2
- package/dist/serialization/types/LettaRequest.d.ts +2 -3
- package/dist/serialization/types/LettaRequest.js +2 -3
- package/dist/serialization/types/LettaRequestConfig.d.ts +14 -0
- package/dist/serialization/types/{RecallMemorySummary.js → LettaRequestConfig.js} +5 -3
- package/dist/serialization/types/LettaResponse.d.ts +2 -2
- package/dist/serialization/types/LettaResponse.js +2 -2
- package/dist/serialization/types/LettaSchemasMessageMessage.d.ts +1 -0
- package/dist/serialization/types/LettaSchemasMessageMessage.js +1 -0
- package/dist/serialization/types/LlmConfigModelEndpointType.d.ts +1 -1
- package/dist/serialization/types/LlmConfigModelEndpointType.js +1 -0
- package/dist/serialization/types/Run.d.ts +2 -0
- package/dist/serialization/types/Run.js +2 -0
- package/dist/serialization/types/ToolType.d.ts +1 -1
- package/dist/serialization/types/ToolType.js +1 -0
- package/dist/serialization/types/index.d.ts +2 -3
- package/dist/serialization/types/index.js +2 -3
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/reference.md +24 -280
- package/serialization/resources/agents/client/requests/CreateAgentRequest.d.ts +3 -2
- package/serialization/resources/agents/client/requests/CreateAgentRequest.js +3 -4
- package/serialization/resources/agents/resources/coreMemory/client/index.d.ts +1 -2
- package/serialization/resources/agents/resources/coreMemory/client/index.js +2 -3
- package/serialization/resources/agents/resources/coreMemory/client/{getBlocks.d.ts → list.d.ts} +1 -1
- package/serialization/resources/agents/resources/messages/client/requests/LettaStreamingRequest.d.ts +2 -3
- package/serialization/resources/agents/resources/messages/client/requests/LettaStreamingRequest.js +2 -3
- package/serialization/resources/agents/resources/messages/types/MessagesListResponse.d.ts +2 -2
- package/serialization/resources/agents/resources/messages/types/MessagesListResponse.js +2 -2
- package/serialization/resources/agents/resources/messages/types/index.d.ts +0 -1
- package/serialization/resources/agents/resources/messages/types/index.js +0 -1
- package/serialization/resources/agents/types/AgentsSearchRequestSearchItem.d.ts +5 -1
- package/serialization/resources/agents/types/AgentsSearchRequestSearchItem.js +2 -0
- package/serialization/resources/agents/types/AgentsSearchRequestSearchItemTags.d.ts +13 -0
- package/{dist/serialization/resources/tools/client/getByName.js → serialization/resources/agents/types/AgentsSearchRequestSearchItemTags.js} +5 -2
- package/serialization/resources/agents/types/index.d.ts +1 -0
- package/serialization/resources/agents/types/index.js +1 -0
- package/serialization/resources/runs/client/getRunMessages.d.ts +3 -3
- package/serialization/resources/runs/client/getRunMessages.js +2 -2
- package/serialization/resources/tools/client/index.d.ts +0 -1
- package/serialization/resources/tools/client/index.js +1 -2
- package/serialization/types/EmbeddingConfigEmbeddingEndpointType.d.ts +1 -1
- package/serialization/types/EmbeddingConfigEmbeddingEndpointType.js +1 -0
- package/serialization/types/{LettaResponseMessagesItem.d.ts → LettaMessageUnion.d.ts} +3 -3
- package/serialization/types/{LettaResponseMessagesItem.js → LettaMessageUnion.js} +2 -2
- package/serialization/types/LettaRequest.d.ts +2 -3
- package/serialization/types/LettaRequest.js +2 -3
- package/serialization/types/LettaRequestConfig.d.ts +14 -0
- package/serialization/types/{ArchivalMemorySummary.js → LettaRequestConfig.js} +5 -3
- package/serialization/types/LettaResponse.d.ts +2 -2
- package/serialization/types/LettaResponse.js +2 -2
- package/serialization/types/LettaSchemasMessageMessage.d.ts +1 -0
- package/serialization/types/LettaSchemasMessageMessage.js +1 -0
- package/serialization/types/LlmConfigModelEndpointType.d.ts +1 -1
- package/serialization/types/LlmConfigModelEndpointType.js +1 -0
- package/serialization/types/Run.d.ts +2 -0
- package/serialization/types/Run.js +2 -0
- package/serialization/types/ToolType.d.ts +1 -1
- package/serialization/types/ToolType.js +1 -0
- package/serialization/types/index.d.ts +2 -3
- package/serialization/types/index.js +2 -3
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/api/resources/agents/resources/messages/types/MessagesListResponseItem.d.ts +0 -25
- package/api/resources/agents/resources/recallMemory/client/Client.d.ts +0 -44
- package/api/resources/agents/resources/recallMemory/client/Client.js +0 -134
- package/api/resources/agents/resources/recallMemory/client/index.d.ts +0 -1
- package/api/resources/agents/resources/recallMemory/client/index.js +0 -2
- package/api/resources/agents/resources/recallMemory/index.d.ts +0 -1
- package/api/resources/agents/resources/recallMemory/index.js +0 -17
- package/api/types/ArchivalMemorySummary.d.ts +0 -7
- package/api/types/RecallMemorySummary.d.ts +0 -7
- package/dist/api/resources/agents/resources/messages/types/MessagesListResponseItem.d.ts +0 -25
- package/dist/api/resources/agents/resources/recallMemory/client/Client.d.ts +0 -44
- package/dist/api/resources/agents/resources/recallMemory/client/Client.js +0 -134
- package/dist/api/resources/agents/resources/recallMemory/client/index.d.ts +0 -1
- package/dist/api/resources/agents/resources/recallMemory/client/index.js +0 -2
- package/dist/api/resources/agents/resources/recallMemory/index.d.ts +0 -1
- package/dist/api/resources/agents/resources/recallMemory/index.js +0 -17
- package/dist/api/types/ArchivalMemorySummary.d.ts +0 -7
- package/dist/api/types/LettaResponseMessagesItem.js +0 -5
- package/dist/api/types/RecallMemorySummary.d.ts +0 -7
- package/dist/api/types/RecallMemorySummary.js +0 -5
- package/dist/serialization/resources/agents/resources/coreMemory/client/listInContext.d.ts +0 -11
- package/dist/serialization/resources/agents/resources/coreMemory/client/listInContext.js +0 -42
- package/dist/serialization/resources/agents/resources/messages/types/MessagesListResponseItem.d.ts +0 -34
- package/dist/serialization/resources/agents/resources/messages/types/MessagesListResponseItem.js +0 -59
- package/dist/serialization/resources/tools/client/getByName.d.ts +0 -9
- package/dist/serialization/types/ArchivalMemorySummary.d.ts +0 -12
- package/dist/serialization/types/ArchivalMemorySummary.js +0 -43
- package/dist/serialization/types/RecallMemorySummary.d.ts +0 -12
- package/serialization/resources/agents/resources/coreMemory/client/listInContext.d.ts +0 -11
- package/serialization/resources/agents/resources/coreMemory/client/listInContext.js +0 -42
- package/serialization/resources/agents/resources/messages/types/MessagesListResponseItem.d.ts +0 -34
- package/serialization/resources/agents/resources/messages/types/MessagesListResponseItem.js +0 -59
- package/serialization/resources/tools/client/getByName.d.ts +0 -9
- package/serialization/types/ArchivalMemorySummary.d.ts +0 -12
- package/serialization/types/RecallMemorySummary.d.ts +0 -12
- package/serialization/types/RecallMemorySummary.js +0 -43
- /package/api/resources/agents/{resources/messages/types/MessagesListResponseItem.js → types/AgentsSearchRequestSearchItemTags.js} +0 -0
- /package/api/types/{ArchivalMemorySummary.js → LettaMessageUnion.js} +0 -0
- /package/api/types/{LettaResponseMessagesItem.js → LettaRequestConfig.js} +0 -0
- /package/{api/types/RecallMemorySummary.js → dist/api/resources/agents/types/AgentsSearchRequestSearchItemTags.js} +0 -0
- /package/dist/api/{resources/agents/resources/messages/types/MessagesListResponseItem.js → types/LettaMessageUnion.js} +0 -0
- /package/dist/api/types/{ArchivalMemorySummary.js → LettaRequestConfig.js} +0 -0
- /package/dist/serialization/resources/agents/resources/coreMemory/client/{getBlocks.js → list.js} +0 -0
- /package/serialization/resources/agents/resources/coreMemory/client/{getBlocks.js → list.js} +0 -0
|
@@ -59,11 +59,10 @@ const Client_1 = require("../resources/context/client/Client");
|
|
|
59
59
|
const Client_2 = require("../resources/tools/client/Client");
|
|
60
60
|
const Client_3 = require("../resources/sources/client/Client");
|
|
61
61
|
const Client_4 = require("../resources/coreMemory/client/Client");
|
|
62
|
-
const Client_5 = require("../resources/
|
|
63
|
-
const Client_6 = require("../resources/
|
|
64
|
-
const Client_7 = require("../resources/
|
|
65
|
-
const Client_8 = require("../resources/
|
|
66
|
-
const Client_9 = require("../resources/memoryVariables/client/Client");
|
|
62
|
+
const Client_5 = require("../resources/archivalMemory/client/Client");
|
|
63
|
+
const Client_6 = require("../resources/messages/client/Client");
|
|
64
|
+
const Client_7 = require("../resources/templates/client/Client");
|
|
65
|
+
const Client_8 = require("../resources/memoryVariables/client/Client");
|
|
67
66
|
class Agents {
|
|
68
67
|
constructor(_options = {}) {
|
|
69
68
|
this._options = _options;
|
|
@@ -84,25 +83,21 @@ class Agents {
|
|
|
84
83
|
var _a;
|
|
85
84
|
return ((_a = this._coreMemory) !== null && _a !== void 0 ? _a : (this._coreMemory = new Client_4.CoreMemory(this._options)));
|
|
86
85
|
}
|
|
87
|
-
get recallMemory() {
|
|
88
|
-
var _a;
|
|
89
|
-
return ((_a = this._recallMemory) !== null && _a !== void 0 ? _a : (this._recallMemory = new Client_5.RecallMemory(this._options)));
|
|
90
|
-
}
|
|
91
86
|
get archivalMemory() {
|
|
92
87
|
var _a;
|
|
93
|
-
return ((_a = this._archivalMemory) !== null && _a !== void 0 ? _a : (this._archivalMemory = new
|
|
88
|
+
return ((_a = this._archivalMemory) !== null && _a !== void 0 ? _a : (this._archivalMemory = new Client_5.ArchivalMemory(this._options)));
|
|
94
89
|
}
|
|
95
90
|
get messages() {
|
|
96
91
|
var _a;
|
|
97
|
-
return ((_a = this._messages) !== null && _a !== void 0 ? _a : (this._messages = new
|
|
92
|
+
return ((_a = this._messages) !== null && _a !== void 0 ? _a : (this._messages = new Client_6.Messages(this._options)));
|
|
98
93
|
}
|
|
99
94
|
get templates() {
|
|
100
95
|
var _a;
|
|
101
|
-
return ((_a = this._templates) !== null && _a !== void 0 ? _a : (this._templates = new
|
|
96
|
+
return ((_a = this._templates) !== null && _a !== void 0 ? _a : (this._templates = new Client_7.Templates(this._options)));
|
|
102
97
|
}
|
|
103
98
|
get memoryVariables() {
|
|
104
99
|
var _a;
|
|
105
|
-
return ((_a = this._memoryVariables) !== null && _a !== void 0 ? _a : (this._memoryVariables = new
|
|
100
|
+
return ((_a = this._memoryVariables) !== null && _a !== void 0 ? _a : (this._memoryVariables = new Client_8.MemoryVariables(this._options)));
|
|
106
101
|
}
|
|
107
102
|
/**
|
|
108
103
|
* List all agents associated with a given user.
|
|
@@ -119,7 +114,7 @@ class Agents {
|
|
|
119
114
|
list() {
|
|
120
115
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
121
116
|
var _a, _b, _c;
|
|
122
|
-
const { name, tags, matchAllTags, cursor, limit } = request;
|
|
117
|
+
const { name, tags, matchAllTags, cursor, limit, queryText } = request;
|
|
123
118
|
const _queryParams = {};
|
|
124
119
|
if (name != null) {
|
|
125
120
|
_queryParams["name"] = name;
|
|
@@ -136,15 +131,18 @@ class Agents {
|
|
|
136
131
|
_queryParams["match_all_tags"] = matchAllTags.toString();
|
|
137
132
|
}
|
|
138
133
|
if (cursor != null) {
|
|
139
|
-
_queryParams["cursor"] = cursor
|
|
134
|
+
_queryParams["cursor"] = cursor;
|
|
140
135
|
}
|
|
141
136
|
if (limit != null) {
|
|
142
137
|
_queryParams["limit"] = limit.toString();
|
|
143
138
|
}
|
|
139
|
+
if (queryText != null) {
|
|
140
|
+
_queryParams["query_text"] = queryText;
|
|
141
|
+
}
|
|
144
142
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
145
143
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, "v1/agents/"),
|
|
146
144
|
method: "GET",
|
|
147
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
145
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.12", "User-Agent": "@letta-ai/letta-client/0.1.12", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
148
146
|
contentType: "application/json",
|
|
149
147
|
queryParameters: _queryParams,
|
|
150
148
|
requestType: "json",
|
|
@@ -210,7 +208,7 @@ class Agents {
|
|
|
210
208
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
211
209
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, "v1/agents/"),
|
|
212
210
|
method: "POST",
|
|
213
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
211
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.12", "User-Agent": "@letta-ai/letta-client/0.1.12", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
214
212
|
contentType: "application/json",
|
|
215
213
|
requestType: "json",
|
|
216
214
|
body: serializers.CreateAgentRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -276,7 +274,7 @@ class Agents {
|
|
|
276
274
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
277
275
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}`),
|
|
278
276
|
method: "GET",
|
|
279
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
277
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.12", "User-Agent": "@letta-ai/letta-client/0.1.12", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
280
278
|
contentType: "application/json",
|
|
281
279
|
requestType: "json",
|
|
282
280
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -341,7 +339,7 @@ class Agents {
|
|
|
341
339
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
342
340
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}`),
|
|
343
341
|
method: "DELETE",
|
|
344
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
342
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.12", "User-Agent": "@letta-ai/letta-client/0.1.12", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
345
343
|
contentType: "application/json",
|
|
346
344
|
requestType: "json",
|
|
347
345
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -384,7 +382,7 @@ class Agents {
|
|
|
384
382
|
});
|
|
385
383
|
}
|
|
386
384
|
/**
|
|
387
|
-
* Update an
|
|
385
|
+
* Update an existing agent
|
|
388
386
|
*
|
|
389
387
|
* @param {string} agentId
|
|
390
388
|
* @param {Letta.UpdateAgent} request
|
|
@@ -401,7 +399,7 @@ class Agents {
|
|
|
401
399
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
402
400
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}`),
|
|
403
401
|
method: "PATCH",
|
|
404
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
402
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.12", "User-Agent": "@letta-ai/letta-client/0.1.12", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
405
403
|
contentType: "application/json",
|
|
406
404
|
requestType: "json",
|
|
407
405
|
body: serializers.UpdateAgent.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -473,7 +471,7 @@ class Agents {
|
|
|
473
471
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
474
472
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/reset-messages`),
|
|
475
473
|
method: "PATCH",
|
|
476
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
474
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.12", "User-Agent": "@letta-ai/letta-client/0.1.12", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
477
475
|
contentType: "application/json",
|
|
478
476
|
queryParameters: _queryParams,
|
|
479
477
|
requestType: "json",
|
|
@@ -539,7 +537,7 @@ class Agents {
|
|
|
539
537
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
540
538
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, "v1/agents/search"),
|
|
541
539
|
method: "POST",
|
|
542
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
540
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.12", "User-Agent": "@letta-ai/letta-client/0.1.12", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
543
541
|
contentType: "application/json",
|
|
544
542
|
requestType: "json",
|
|
545
543
|
body: serializers.AgentsSearchRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -33,14 +33,16 @@ export interface CreateAgentRequest {
|
|
|
33
33
|
embeddingConfig?: Letta.EmbeddingConfig;
|
|
34
34
|
/** The initial set of messages to put in the agent's in-context memory. */
|
|
35
35
|
initialMessageSequence?: Letta.MessageCreate[];
|
|
36
|
-
/**
|
|
36
|
+
/** If true, attaches the Letta core tools (e.g. archival_memory and core_memory related functions). */
|
|
37
37
|
includeBaseTools?: boolean;
|
|
38
|
+
/** If true, attaches the Letta multi-agent tools (e.g. sending a message to another agent). */
|
|
39
|
+
includeMultiAgentTools?: boolean;
|
|
38
40
|
/** The description of the agent. */
|
|
39
41
|
description?: string;
|
|
40
42
|
/** The metadata of the agent. */
|
|
41
43
|
metadata?: Record<string, unknown>;
|
|
42
44
|
/** The LLM configuration handle used by the agent, specified in the format provider/model-name, as an alternative to specifying llm_config. */
|
|
43
|
-
|
|
45
|
+
model?: string;
|
|
44
46
|
/** The embedding configuration handle used by the agent, specified in the format provider/model-name. */
|
|
45
47
|
embedding?: string;
|
|
46
48
|
/** The context window limit used by the agent. */
|
|
@@ -56,5 +58,5 @@ export interface CreateAgentRequest {
|
|
|
56
58
|
/** The environment variables for tool execution specific to this agent. */
|
|
57
59
|
toolExecEnvironmentVariables?: Record<string, string | undefined>;
|
|
58
60
|
/** The variables that should be set for the agent. */
|
|
59
|
-
|
|
61
|
+
memoryVariables?: Record<string, string | undefined>;
|
|
60
62
|
}
|
|
@@ -26,18 +26,6 @@ export declare namespace ArchivalMemory {
|
|
|
26
26
|
export declare class ArchivalMemory {
|
|
27
27
|
protected readonly _options: ArchivalMemory.Options;
|
|
28
28
|
constructor(_options?: ArchivalMemory.Options);
|
|
29
|
-
/**
|
|
30
|
-
* Retrieve the summary of the archival memory of a specific agent.
|
|
31
|
-
*
|
|
32
|
-
* @param {string} agentId
|
|
33
|
-
* @param {ArchivalMemory.RequestOptions} requestOptions - Request-specific configuration.
|
|
34
|
-
*
|
|
35
|
-
* @throws {@link Letta.UnprocessableEntityError}
|
|
36
|
-
*
|
|
37
|
-
* @example
|
|
38
|
-
* await client.agents.archivalMemory.getSummary("agent_id")
|
|
39
|
-
*/
|
|
40
|
-
getSummary(agentId: string, requestOptions?: ArchivalMemory.RequestOptions): Promise<Letta.ArchivalMemorySummary>;
|
|
41
29
|
/**
|
|
42
30
|
* Retrieve the memories in an agent's archival memory store (paginated query).
|
|
43
31
|
*
|
|
@@ -59,71 +59,6 @@ class ArchivalMemory {
|
|
|
59
59
|
constructor(_options = {}) {
|
|
60
60
|
this._options = _options;
|
|
61
61
|
}
|
|
62
|
-
/**
|
|
63
|
-
* Retrieve the summary of the archival memory of a specific agent.
|
|
64
|
-
*
|
|
65
|
-
* @param {string} agentId
|
|
66
|
-
* @param {ArchivalMemory.RequestOptions} requestOptions - Request-specific configuration.
|
|
67
|
-
*
|
|
68
|
-
* @throws {@link Letta.UnprocessableEntityError}
|
|
69
|
-
*
|
|
70
|
-
* @example
|
|
71
|
-
* await client.agents.archivalMemory.getSummary("agent_id")
|
|
72
|
-
*/
|
|
73
|
-
getSummary(agentId, requestOptions) {
|
|
74
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
75
|
-
var _a, _b, _c;
|
|
76
|
-
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
77
|
-
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/memory/archival`),
|
|
78
|
-
method: "GET",
|
|
79
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.9", "User-Agent": "@letta-ai/letta-client/0.1.9", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
80
|
-
contentType: "application/json",
|
|
81
|
-
requestType: "json",
|
|
82
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
83
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
84
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
85
|
-
});
|
|
86
|
-
if (_response.ok) {
|
|
87
|
-
return serializers.ArchivalMemorySummary.parseOrThrow(_response.body, {
|
|
88
|
-
unrecognizedObjectKeys: "passthrough",
|
|
89
|
-
allowUnrecognizedUnionMembers: true,
|
|
90
|
-
allowUnrecognizedEnumValues: true,
|
|
91
|
-
skipValidation: true,
|
|
92
|
-
breadcrumbsPrefix: ["response"],
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
if (_response.error.reason === "status-code") {
|
|
96
|
-
switch (_response.error.statusCode) {
|
|
97
|
-
case 422:
|
|
98
|
-
throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
99
|
-
unrecognizedObjectKeys: "passthrough",
|
|
100
|
-
allowUnrecognizedUnionMembers: true,
|
|
101
|
-
allowUnrecognizedEnumValues: true,
|
|
102
|
-
skipValidation: true,
|
|
103
|
-
breadcrumbsPrefix: ["response"],
|
|
104
|
-
}));
|
|
105
|
-
default:
|
|
106
|
-
throw new errors.LettaError({
|
|
107
|
-
statusCode: _response.error.statusCode,
|
|
108
|
-
body: _response.error.body,
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
switch (_response.error.reason) {
|
|
113
|
-
case "non-json":
|
|
114
|
-
throw new errors.LettaError({
|
|
115
|
-
statusCode: _response.error.statusCode,
|
|
116
|
-
body: _response.error.rawBody,
|
|
117
|
-
});
|
|
118
|
-
case "timeout":
|
|
119
|
-
throw new errors.LettaTimeoutError("Timeout exceeded when calling GET /v1/agents/{agent_id}/memory/archival.");
|
|
120
|
-
case "unknown":
|
|
121
|
-
throw new errors.LettaError({
|
|
122
|
-
message: _response.error.errorMessage,
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
62
|
/**
|
|
128
63
|
* Retrieve the memories in an agent's archival memory store (paginated query).
|
|
129
64
|
*
|
|
@@ -151,9 +86,9 @@ class ArchivalMemory {
|
|
|
151
86
|
_queryParams["limit"] = limit.toString();
|
|
152
87
|
}
|
|
153
88
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
154
|
-
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/
|
|
89
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/archival_memory`),
|
|
155
90
|
method: "GET",
|
|
156
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
91
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.12", "User-Agent": "@letta-ai/letta-client/0.1.12", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
157
92
|
contentType: "application/json",
|
|
158
93
|
queryParameters: _queryParams,
|
|
159
94
|
requestType: "json",
|
|
@@ -194,7 +129,7 @@ class ArchivalMemory {
|
|
|
194
129
|
body: _response.error.rawBody,
|
|
195
130
|
});
|
|
196
131
|
case "timeout":
|
|
197
|
-
throw new errors.LettaTimeoutError("Timeout exceeded when calling GET /v1/agents/{agent_id}/
|
|
132
|
+
throw new errors.LettaTimeoutError("Timeout exceeded when calling GET /v1/agents/{agent_id}/archival_memory.");
|
|
198
133
|
case "unknown":
|
|
199
134
|
throw new errors.LettaError({
|
|
200
135
|
message: _response.error.errorMessage,
|
|
@@ -220,9 +155,9 @@ class ArchivalMemory {
|
|
|
220
155
|
return __awaiter(this, void 0, void 0, function* () {
|
|
221
156
|
var _a, _b, _c;
|
|
222
157
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
223
|
-
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/
|
|
158
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/archival_memory`),
|
|
224
159
|
method: "POST",
|
|
225
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
160
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.12", "User-Agent": "@letta-ai/letta-client/0.1.12", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
226
161
|
contentType: "application/json",
|
|
227
162
|
requestType: "json",
|
|
228
163
|
body: serializers.agents.CreateArchivalMemory.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -263,7 +198,7 @@ class ArchivalMemory {
|
|
|
263
198
|
body: _response.error.rawBody,
|
|
264
199
|
});
|
|
265
200
|
case "timeout":
|
|
266
|
-
throw new errors.LettaTimeoutError("Timeout exceeded when calling POST /v1/agents/{agent_id}/
|
|
201
|
+
throw new errors.LettaTimeoutError("Timeout exceeded when calling POST /v1/agents/{agent_id}/archival_memory.");
|
|
267
202
|
case "unknown":
|
|
268
203
|
throw new errors.LettaError({
|
|
269
204
|
message: _response.error.errorMessage,
|
|
@@ -287,9 +222,9 @@ class ArchivalMemory {
|
|
|
287
222
|
return __awaiter(this, void 0, void 0, function* () {
|
|
288
223
|
var _a, _b, _c;
|
|
289
224
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
290
|
-
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/
|
|
225
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/archival_memory/${encodeURIComponent(memoryId)}`),
|
|
291
226
|
method: "DELETE",
|
|
292
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
227
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.12", "User-Agent": "@letta-ai/letta-client/0.1.12", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
293
228
|
contentType: "application/json",
|
|
294
229
|
requestType: "json",
|
|
295
230
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -323,7 +258,7 @@ class ArchivalMemory {
|
|
|
323
258
|
body: _response.error.rawBody,
|
|
324
259
|
});
|
|
325
260
|
case "timeout":
|
|
326
|
-
throw new errors.LettaTimeoutError("Timeout exceeded when calling DELETE /v1/agents/{agent_id}/
|
|
261
|
+
throw new errors.LettaTimeoutError("Timeout exceeded when calling DELETE /v1/agents/{agent_id}/archival_memory/{memory_id}.");
|
|
327
262
|
case "unknown":
|
|
328
263
|
throw new errors.LettaError({
|
|
329
264
|
message: _response.error.errorMessage,
|
|
@@ -76,7 +76,7 @@ class Context {
|
|
|
76
76
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
77
77
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/context`),
|
|
78
78
|
method: "GET",
|
|
79
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
79
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.12", "User-Agent": "@letta-ai/letta-client/0.1.12", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
80
80
|
contentType: "application/json",
|
|
81
81
|
requestType: "json",
|
|
82
82
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -26,18 +26,6 @@ export declare namespace CoreMemory {
|
|
|
26
26
|
export declare class CoreMemory {
|
|
27
27
|
protected readonly _options: CoreMemory.Options;
|
|
28
28
|
constructor(_options?: CoreMemory.Options);
|
|
29
|
-
/**
|
|
30
|
-
* Retrieve the messages in the context of a specific agent.
|
|
31
|
-
*
|
|
32
|
-
* @param {string} agentId
|
|
33
|
-
* @param {CoreMemory.RequestOptions} requestOptions - Request-specific configuration.
|
|
34
|
-
*
|
|
35
|
-
* @throws {@link Letta.UnprocessableEntityError}
|
|
36
|
-
*
|
|
37
|
-
* @example
|
|
38
|
-
* await client.agents.coreMemory.listInContext("agent_id")
|
|
39
|
-
*/
|
|
40
|
-
listInContext(agentId: string, requestOptions?: CoreMemory.RequestOptions): Promise<Letta.LettaSchemasMessageMessage[]>;
|
|
41
29
|
/**
|
|
42
30
|
* Retrieve the memory state of a specific agent.
|
|
43
31
|
* This endpoint fetches the current memory state of the agent identified by the user ID and agent ID.
|
|
@@ -100,9 +88,9 @@ export declare class CoreMemory {
|
|
|
100
88
|
* @throws {@link Letta.UnprocessableEntityError}
|
|
101
89
|
*
|
|
102
90
|
* @example
|
|
103
|
-
* await client.agents.coreMemory.
|
|
91
|
+
* await client.agents.coreMemory.list("agent_id")
|
|
104
92
|
*/
|
|
105
|
-
|
|
93
|
+
list(agentId: string, requestOptions?: CoreMemory.RequestOptions): Promise<Letta.Block[]>;
|
|
106
94
|
/**
|
|
107
95
|
* Creates a memory block and links it to the agent.
|
|
108
96
|
*
|
|
@@ -59,71 +59,6 @@ class CoreMemory {
|
|
|
59
59
|
constructor(_options = {}) {
|
|
60
60
|
this._options = _options;
|
|
61
61
|
}
|
|
62
|
-
/**
|
|
63
|
-
* Retrieve the messages in the context of a specific agent.
|
|
64
|
-
*
|
|
65
|
-
* @param {string} agentId
|
|
66
|
-
* @param {CoreMemory.RequestOptions} requestOptions - Request-specific configuration.
|
|
67
|
-
*
|
|
68
|
-
* @throws {@link Letta.UnprocessableEntityError}
|
|
69
|
-
*
|
|
70
|
-
* @example
|
|
71
|
-
* await client.agents.coreMemory.listInContext("agent_id")
|
|
72
|
-
*/
|
|
73
|
-
listInContext(agentId, requestOptions) {
|
|
74
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
75
|
-
var _a, _b, _c;
|
|
76
|
-
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
77
|
-
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/memory/messages`),
|
|
78
|
-
method: "GET",
|
|
79
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.9", "User-Agent": "@letta-ai/letta-client/0.1.9", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
80
|
-
contentType: "application/json",
|
|
81
|
-
requestType: "json",
|
|
82
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
83
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
84
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
85
|
-
});
|
|
86
|
-
if (_response.ok) {
|
|
87
|
-
return serializers.agents.coreMemory.listInContext.Response.parseOrThrow(_response.body, {
|
|
88
|
-
unrecognizedObjectKeys: "passthrough",
|
|
89
|
-
allowUnrecognizedUnionMembers: true,
|
|
90
|
-
allowUnrecognizedEnumValues: true,
|
|
91
|
-
skipValidation: true,
|
|
92
|
-
breadcrumbsPrefix: ["response"],
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
if (_response.error.reason === "status-code") {
|
|
96
|
-
switch (_response.error.statusCode) {
|
|
97
|
-
case 422:
|
|
98
|
-
throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
99
|
-
unrecognizedObjectKeys: "passthrough",
|
|
100
|
-
allowUnrecognizedUnionMembers: true,
|
|
101
|
-
allowUnrecognizedEnumValues: true,
|
|
102
|
-
skipValidation: true,
|
|
103
|
-
breadcrumbsPrefix: ["response"],
|
|
104
|
-
}));
|
|
105
|
-
default:
|
|
106
|
-
throw new errors.LettaError({
|
|
107
|
-
statusCode: _response.error.statusCode,
|
|
108
|
-
body: _response.error.body,
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
switch (_response.error.reason) {
|
|
113
|
-
case "non-json":
|
|
114
|
-
throw new errors.LettaError({
|
|
115
|
-
statusCode: _response.error.statusCode,
|
|
116
|
-
body: _response.error.rawBody,
|
|
117
|
-
});
|
|
118
|
-
case "timeout":
|
|
119
|
-
throw new errors.LettaTimeoutError("Timeout exceeded when calling GET /v1/agents/{agent_id}/memory/messages.");
|
|
120
|
-
case "unknown":
|
|
121
|
-
throw new errors.LettaError({
|
|
122
|
-
message: _response.error.errorMessage,
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
62
|
/**
|
|
128
63
|
* Retrieve the memory state of a specific agent.
|
|
129
64
|
* This endpoint fetches the current memory state of the agent identified by the user ID and agent ID.
|
|
@@ -140,9 +75,9 @@ class CoreMemory {
|
|
|
140
75
|
return __awaiter(this, void 0, void 0, function* () {
|
|
141
76
|
var _a, _b, _c;
|
|
142
77
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
143
|
-
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/
|
|
78
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/core_memory`),
|
|
144
79
|
method: "GET",
|
|
145
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
80
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.12", "User-Agent": "@letta-ai/letta-client/0.1.12", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
146
81
|
contentType: "application/json",
|
|
147
82
|
requestType: "json",
|
|
148
83
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -182,7 +117,7 @@ class CoreMemory {
|
|
|
182
117
|
body: _response.error.rawBody,
|
|
183
118
|
});
|
|
184
119
|
case "timeout":
|
|
185
|
-
throw new errors.LettaTimeoutError("Timeout exceeded when calling GET /v1/agents/{agent_id}/
|
|
120
|
+
throw new errors.LettaTimeoutError("Timeout exceeded when calling GET /v1/agents/{agent_id}/core_memory.");
|
|
186
121
|
case "unknown":
|
|
187
122
|
throw new errors.LettaError({
|
|
188
123
|
message: _response.error.errorMessage,
|
|
@@ -206,9 +141,9 @@ class CoreMemory {
|
|
|
206
141
|
return __awaiter(this, void 0, void 0, function* () {
|
|
207
142
|
var _a, _b, _c;
|
|
208
143
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
209
|
-
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/
|
|
144
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/core_memory/blocks/${encodeURIComponent(blockLabel)}`),
|
|
210
145
|
method: "GET",
|
|
211
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
146
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.12", "User-Agent": "@letta-ai/letta-client/0.1.12", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
212
147
|
contentType: "application/json",
|
|
213
148
|
requestType: "json",
|
|
214
149
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -248,7 +183,7 @@ class CoreMemory {
|
|
|
248
183
|
body: _response.error.rawBody,
|
|
249
184
|
});
|
|
250
185
|
case "timeout":
|
|
251
|
-
throw new errors.LettaTimeoutError("Timeout exceeded when calling GET /v1/agents/{agent_id}/
|
|
186
|
+
throw new errors.LettaTimeoutError("Timeout exceeded when calling GET /v1/agents/{agent_id}/core_memory/blocks/{block_label}.");
|
|
252
187
|
case "unknown":
|
|
253
188
|
throw new errors.LettaError({
|
|
254
189
|
message: _response.error.errorMessage,
|
|
@@ -272,9 +207,9 @@ class CoreMemory {
|
|
|
272
207
|
return __awaiter(this, void 0, void 0, function* () {
|
|
273
208
|
var _a, _b, _c;
|
|
274
209
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
275
|
-
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/
|
|
210
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/core_memory/blocks/${encodeURIComponent(blockLabel)}`),
|
|
276
211
|
method: "DELETE",
|
|
277
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
212
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.12", "User-Agent": "@letta-ai/letta-client/0.1.12", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
278
213
|
contentType: "application/json",
|
|
279
214
|
requestType: "json",
|
|
280
215
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -314,7 +249,7 @@ class CoreMemory {
|
|
|
314
249
|
body: _response.error.rawBody,
|
|
315
250
|
});
|
|
316
251
|
case "timeout":
|
|
317
|
-
throw new errors.LettaTimeoutError("Timeout exceeded when calling DELETE /v1/agents/{agent_id}/
|
|
252
|
+
throw new errors.LettaTimeoutError("Timeout exceeded when calling DELETE /v1/agents/{agent_id}/core_memory/blocks/{block_label}.");
|
|
318
253
|
case "unknown":
|
|
319
254
|
throw new errors.LettaError({
|
|
320
255
|
message: _response.error.errorMessage,
|
|
@@ -339,9 +274,9 @@ class CoreMemory {
|
|
|
339
274
|
return __awaiter(this, void 0, void 0, function* () {
|
|
340
275
|
var _a, _b, _c;
|
|
341
276
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
342
|
-
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/
|
|
277
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/core_memory/blocks/${encodeURIComponent(blockLabel)}`),
|
|
343
278
|
method: "PATCH",
|
|
344
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
279
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.12", "User-Agent": "@letta-ai/letta-client/0.1.12", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
345
280
|
contentType: "application/json",
|
|
346
281
|
requestType: "json",
|
|
347
282
|
body: serializers.BlockUpdate.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -382,7 +317,7 @@ class CoreMemory {
|
|
|
382
317
|
body: _response.error.rawBody,
|
|
383
318
|
});
|
|
384
319
|
case "timeout":
|
|
385
|
-
throw new errors.LettaTimeoutError("Timeout exceeded when calling PATCH /v1/agents/{agent_id}/
|
|
320
|
+
throw new errors.LettaTimeoutError("Timeout exceeded when calling PATCH /v1/agents/{agent_id}/core_memory/blocks/{block_label}.");
|
|
386
321
|
case "unknown":
|
|
387
322
|
throw new errors.LettaError({
|
|
388
323
|
message: _response.error.errorMessage,
|
|
@@ -399,15 +334,15 @@ class CoreMemory {
|
|
|
399
334
|
* @throws {@link Letta.UnprocessableEntityError}
|
|
400
335
|
*
|
|
401
336
|
* @example
|
|
402
|
-
* await client.agents.coreMemory.
|
|
337
|
+
* await client.agents.coreMemory.list("agent_id")
|
|
403
338
|
*/
|
|
404
|
-
|
|
339
|
+
list(agentId, requestOptions) {
|
|
405
340
|
return __awaiter(this, void 0, void 0, function* () {
|
|
406
341
|
var _a, _b, _c;
|
|
407
342
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
408
|
-
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/
|
|
343
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/core_memory/blocks`),
|
|
409
344
|
method: "GET",
|
|
410
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
345
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.12", "User-Agent": "@letta-ai/letta-client/0.1.12", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
411
346
|
contentType: "application/json",
|
|
412
347
|
requestType: "json",
|
|
413
348
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -415,7 +350,7 @@ class CoreMemory {
|
|
|
415
350
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
416
351
|
});
|
|
417
352
|
if (_response.ok) {
|
|
418
|
-
return serializers.agents.coreMemory.
|
|
353
|
+
return serializers.agents.coreMemory.list.Response.parseOrThrow(_response.body, {
|
|
419
354
|
unrecognizedObjectKeys: "passthrough",
|
|
420
355
|
allowUnrecognizedUnionMembers: true,
|
|
421
356
|
allowUnrecognizedEnumValues: true,
|
|
@@ -447,7 +382,7 @@ class CoreMemory {
|
|
|
447
382
|
body: _response.error.rawBody,
|
|
448
383
|
});
|
|
449
384
|
case "timeout":
|
|
450
|
-
throw new errors.LettaTimeoutError("Timeout exceeded when calling GET /v1/agents/{agent_id}/
|
|
385
|
+
throw new errors.LettaTimeoutError("Timeout exceeded when calling GET /v1/agents/{agent_id}/core_memory/blocks.");
|
|
451
386
|
case "unknown":
|
|
452
387
|
throw new errors.LettaError({
|
|
453
388
|
message: _response.error.errorMessage,
|
|
@@ -474,9 +409,9 @@ class CoreMemory {
|
|
|
474
409
|
return __awaiter(this, void 0, void 0, function* () {
|
|
475
410
|
var _a, _b, _c;
|
|
476
411
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
477
|
-
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/
|
|
412
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/core_memory/blocks`),
|
|
478
413
|
method: "POST",
|
|
479
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
414
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.12", "User-Agent": "@letta-ai/letta-client/0.1.12", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
480
415
|
contentType: "application/json",
|
|
481
416
|
requestType: "json",
|
|
482
417
|
body: serializers.CreateBlock.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -517,7 +452,7 @@ class CoreMemory {
|
|
|
517
452
|
body: _response.error.rawBody,
|
|
518
453
|
});
|
|
519
454
|
case "timeout":
|
|
520
|
-
throw new errors.LettaTimeoutError("Timeout exceeded when calling POST /v1/agents/{agent_id}/
|
|
455
|
+
throw new errors.LettaTimeoutError("Timeout exceeded when calling POST /v1/agents/{agent_id}/core_memory/blocks.");
|
|
521
456
|
case "unknown":
|
|
522
457
|
throw new errors.LettaError({
|
|
523
458
|
message: _response.error.errorMessage,
|