@letta-ai/letta-client 0.1.93 → 0.1.94
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/Client.d.ts +3 -0
- package/Client.js +13 -8
- package/api/resources/agents/client/Client.d.ts +0 -34
- package/api/resources/agents/client/Client.js +11 -154
- package/api/resources/agents/resources/blocks/client/Client.js +5 -5
- package/api/resources/agents/resources/context/client/Client.js +1 -1
- package/api/resources/agents/resources/coreMemory/client/Client.js +1 -1
- package/api/resources/agents/resources/memoryVariables/client/Client.js +1 -1
- package/api/resources/agents/resources/messages/client/Client.js +5 -5
- package/api/resources/agents/resources/passages/client/Client.js +3 -3
- package/api/resources/agents/resources/sources/client/Client.js +3 -3
- package/api/resources/agents/resources/templates/client/Client.js +3 -3
- package/api/resources/agents/resources/tools/client/Client.js +3 -3
- package/api/resources/blocks/client/Client.js +6 -6
- package/api/resources/clientSideAccessTokens/client/Client.js +2 -2
- package/api/resources/groups/client/Client.js +6 -6
- package/api/resources/groups/resources/messages/client/Client.js +4 -4
- package/api/resources/health/client/Client.js +1 -1
- package/api/resources/identities/client/Client.js +7 -7
- package/api/resources/index.d.ts +1 -0
- package/api/resources/index.js +2 -1
- package/api/resources/jobs/client/Client.js +4 -4
- package/api/resources/messages/client/Client.d.ts +46 -0
- package/api/resources/messages/client/Client.js +133 -0
- package/api/resources/messages/client/index.d.ts +1 -0
- package/api/resources/messages/client/index.js +2 -0
- package/api/resources/messages/index.d.ts +2 -0
- package/api/resources/messages/index.js +18 -0
- package/api/resources/messages/resources/batches/client/Client.d.ts +87 -0
- package/api/resources/messages/resources/batches/client/Client.js +320 -0
- package/api/resources/messages/resources/batches/client/index.d.ts +1 -0
- package/api/resources/messages/resources/batches/client/index.js +17 -0
- package/api/resources/messages/resources/batches/client/requests/CreateBatch.d.ts +23 -0
- package/api/resources/messages/resources/batches/client/requests/index.d.ts +1 -0
- package/api/resources/messages/resources/batches/client/requests/index.js +2 -0
- package/api/resources/messages/resources/batches/index.d.ts +1 -0
- package/api/resources/messages/resources/batches/index.js +17 -0
- package/api/resources/messages/resources/index.d.ts +2 -0
- package/api/resources/messages/resources/index.js +41 -0
- package/api/resources/models/client/Client.js +2 -2
- package/api/resources/projects/client/Client.js +1 -1
- package/api/resources/providers/client/Client.js +4 -4
- package/api/resources/runs/client/Client.js +7 -7
- package/api/resources/sources/client/Client.js +6 -6
- package/api/resources/sources/resources/files/client/Client.js +3 -3
- package/api/resources/sources/resources/passages/client/Client.js +1 -1
- package/api/resources/steps/client/Client.js +2 -2
- package/api/resources/tag/client/Client.js +1 -1
- package/api/resources/templates/client/Client.js +2 -2
- package/api/resources/tools/client/Client.js +16 -16
- package/api/resources/voice/client/Client.js +1 -1
- package/api/types/BatchJob.d.ts +23 -0
- package/api/types/JobType.d.ts +2 -1
- package/api/types/JobType.js +1 -0
- package/api/types/index.d.ts +1 -1
- package/api/types/index.js +1 -1
- package/dist/Client.d.ts +3 -0
- package/dist/Client.js +13 -8
- package/dist/api/resources/agents/client/Client.d.ts +0 -34
- package/dist/api/resources/agents/client/Client.js +11 -154
- package/dist/api/resources/agents/resources/blocks/client/Client.js +5 -5
- package/dist/api/resources/agents/resources/context/client/Client.js +1 -1
- package/dist/api/resources/agents/resources/coreMemory/client/Client.js +1 -1
- package/dist/api/resources/agents/resources/memoryVariables/client/Client.js +1 -1
- package/dist/api/resources/agents/resources/messages/client/Client.js +5 -5
- package/dist/api/resources/agents/resources/passages/client/Client.js +3 -3
- package/dist/api/resources/agents/resources/sources/client/Client.js +3 -3
- package/dist/api/resources/agents/resources/templates/client/Client.js +3 -3
- package/dist/api/resources/agents/resources/tools/client/Client.js +3 -3
- package/dist/api/resources/blocks/client/Client.js +6 -6
- package/dist/api/resources/clientSideAccessTokens/client/Client.js +2 -2
- package/dist/api/resources/groups/client/Client.js +6 -6
- package/dist/api/resources/groups/resources/messages/client/Client.js +4 -4
- package/dist/api/resources/health/client/Client.js +1 -1
- package/dist/api/resources/identities/client/Client.js +7 -7
- package/dist/api/resources/index.d.ts +1 -0
- package/dist/api/resources/index.js +2 -1
- package/dist/api/resources/jobs/client/Client.js +4 -4
- package/dist/api/resources/messages/client/Client.d.ts +46 -0
- package/dist/api/resources/messages/client/Client.js +133 -0
- package/dist/api/resources/messages/client/index.d.ts +1 -0
- package/dist/api/resources/messages/client/index.js +2 -0
- package/dist/api/resources/messages/index.d.ts +2 -0
- package/dist/api/resources/messages/index.js +18 -0
- package/dist/api/resources/messages/resources/batches/client/Client.d.ts +87 -0
- package/dist/api/resources/messages/resources/batches/client/Client.js +320 -0
- package/dist/api/resources/messages/resources/batches/client/index.d.ts +1 -0
- package/dist/api/resources/messages/resources/batches/client/index.js +17 -0
- package/dist/api/resources/messages/resources/batches/client/requests/CreateBatch.d.ts +23 -0
- package/dist/api/resources/messages/resources/batches/client/requests/CreateBatch.js +5 -0
- package/dist/api/resources/messages/resources/batches/client/requests/index.d.ts +1 -0
- package/dist/api/resources/messages/resources/batches/client/requests/index.js +2 -0
- package/dist/api/resources/messages/resources/batches/index.d.ts +1 -0
- package/dist/api/resources/messages/resources/batches/index.js +17 -0
- package/dist/api/resources/messages/resources/index.d.ts +2 -0
- package/dist/api/resources/messages/resources/index.js +41 -0
- package/dist/api/resources/models/client/Client.js +2 -2
- package/dist/api/resources/projects/client/Client.js +1 -1
- package/dist/api/resources/providers/client/Client.js +4 -4
- package/dist/api/resources/runs/client/Client.js +7 -7
- package/dist/api/resources/sources/client/Client.js +6 -6
- package/dist/api/resources/sources/resources/files/client/Client.js +3 -3
- package/dist/api/resources/sources/resources/passages/client/Client.js +1 -1
- package/dist/api/resources/steps/client/Client.js +2 -2
- package/dist/api/resources/tag/client/Client.js +1 -1
- package/dist/api/resources/templates/client/Client.js +2 -2
- package/dist/api/resources/tools/client/Client.js +16 -16
- package/dist/api/resources/voice/client/Client.js +1 -1
- package/dist/api/types/BatchJob.d.ts +23 -0
- package/dist/api/types/BatchJob.js +5 -0
- package/dist/api/types/JobType.d.ts +2 -1
- package/dist/api/types/JobType.js +1 -0
- package/dist/api/types/index.d.ts +1 -1
- package/dist/api/types/index.js +1 -1
- package/dist/serialization/resources/agents/client/index.d.ts +0 -1
- package/dist/serialization/resources/agents/client/index.js +1 -2
- package/dist/serialization/resources/index.d.ts +1 -0
- package/dist/serialization/resources/index.js +2 -1
- package/dist/serialization/resources/messages/index.d.ts +1 -0
- package/dist/serialization/resources/messages/index.js +17 -0
- package/dist/serialization/resources/messages/resources/batches/client/index.d.ts +2 -0
- package/dist/serialization/resources/messages/resources/batches/client/index.js +41 -0
- package/dist/serialization/resources/messages/resources/batches/client/list.d.ts +11 -0
- package/dist/serialization/resources/{agents/client/createBatchMessageRequest.js → messages/resources/batches/client/list.js} +4 -4
- package/dist/serialization/resources/messages/resources/batches/client/requests/CreateBatch.d.ts +13 -0
- package/dist/serialization/{types/LettaBatchResponse.js → resources/messages/resources/batches/client/requests/CreateBatch.js} +5 -9
- package/dist/serialization/resources/messages/resources/batches/client/requests/index.d.ts +1 -0
- package/dist/serialization/resources/messages/resources/batches/client/requests/index.js +5 -0
- package/dist/serialization/resources/messages/resources/batches/index.d.ts +1 -0
- package/dist/serialization/resources/messages/resources/batches/index.js +17 -0
- package/dist/serialization/resources/messages/resources/index.d.ts +2 -0
- package/dist/serialization/resources/messages/resources/index.js +41 -0
- package/dist/serialization/types/BatchJob.d.ts +22 -0
- package/dist/serialization/types/BatchJob.js +53 -0
- package/dist/serialization/types/JobType.d.ts +1 -1
- package/dist/serialization/types/JobType.js +1 -0
- package/dist/serialization/types/index.d.ts +1 -1
- package/dist/serialization/types/index.js +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/reference.md +314 -142
- package/serialization/resources/agents/client/index.d.ts +0 -1
- package/serialization/resources/agents/client/index.js +1 -2
- package/serialization/resources/index.d.ts +1 -0
- package/serialization/resources/index.js +2 -1
- package/serialization/resources/messages/index.d.ts +1 -0
- package/serialization/resources/messages/index.js +17 -0
- package/serialization/resources/messages/resources/batches/client/index.d.ts +2 -0
- package/serialization/resources/messages/resources/batches/client/index.js +41 -0
- package/serialization/resources/messages/resources/batches/client/list.d.ts +11 -0
- package/serialization/resources/{agents/client/createBatchMessageRequest.js → messages/resources/batches/client/list.js} +4 -4
- package/serialization/resources/messages/resources/batches/client/requests/CreateBatch.d.ts +13 -0
- package/serialization/{types/LettaBatchResponse.js → resources/messages/resources/batches/client/requests/CreateBatch.js} +5 -9
- package/serialization/resources/messages/resources/batches/client/requests/index.d.ts +1 -0
- package/serialization/resources/messages/resources/batches/client/requests/index.js +5 -0
- package/serialization/resources/messages/resources/batches/index.d.ts +1 -0
- package/serialization/resources/messages/resources/batches/index.js +17 -0
- package/serialization/resources/messages/resources/index.d.ts +2 -0
- package/serialization/resources/messages/resources/index.js +41 -0
- package/serialization/types/BatchJob.d.ts +22 -0
- package/serialization/types/BatchJob.js +53 -0
- package/serialization/types/JobType.d.ts +1 -1
- package/serialization/types/JobType.js +1 -0
- package/serialization/types/index.d.ts +1 -1
- package/serialization/types/index.js +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/api/types/LettaBatchResponse.d.ts +0 -16
- package/dist/api/types/LettaBatchResponse.d.ts +0 -16
- package/dist/serialization/resources/agents/client/createBatchMessageRequest.d.ts +0 -11
- package/dist/serialization/types/LettaBatchResponse.d.ts +0 -17
- package/serialization/resources/agents/client/createBatchMessageRequest.d.ts +0 -11
- package/serialization/types/LettaBatchResponse.d.ts +0 -17
- /package/api/{types/LettaBatchResponse.js → resources/messages/resources/batches/client/requests/CreateBatch.js} +0 -0
- /package/{dist/api/types/LettaBatchResponse.js → api/types/BatchJob.js} +0 -0
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
39
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
40
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
41
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
42
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
43
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
44
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
48
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
49
|
+
};
|
|
50
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
51
|
+
exports.Messages = void 0;
|
|
52
|
+
const environments = __importStar(require("../../../../environments"));
|
|
53
|
+
const core = __importStar(require("../../../../core"));
|
|
54
|
+
const Letta = __importStar(require("../../../index"));
|
|
55
|
+
const url_join_1 = __importDefault(require("url-join"));
|
|
56
|
+
const errors = __importStar(require("../../../../errors/index"));
|
|
57
|
+
const serializers = __importStar(require("../../../../serialization/index"));
|
|
58
|
+
const Client_1 = require("../resources/batches/client/Client");
|
|
59
|
+
class Messages {
|
|
60
|
+
constructor(_options = {}) {
|
|
61
|
+
this._options = _options;
|
|
62
|
+
}
|
|
63
|
+
get batches() {
|
|
64
|
+
var _a;
|
|
65
|
+
return ((_a = this._batches) !== null && _a !== void 0 ? _a : (this._batches = new Client_1.Batches(this._options)));
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Cancel a batch run.
|
|
69
|
+
*
|
|
70
|
+
* @param {string} batchId
|
|
71
|
+
* @param {Messages.RequestOptions} requestOptions - Request-specific configuration.
|
|
72
|
+
*
|
|
73
|
+
* @throws {@link Letta.UnprocessableEntityError}
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* await client.messages.cancelBatchRun("batch_id")
|
|
77
|
+
*/
|
|
78
|
+
cancelBatchRun(batchId, requestOptions) {
|
|
79
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
80
|
+
var _a, _b, _c;
|
|
81
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
82
|
+
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/messages/batches/${encodeURIComponent(batchId)}/cancel`),
|
|
83
|
+
method: "PATCH",
|
|
84
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.94", "User-Agent": "@letta-ai/letta-client/0.1.94", "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),
|
|
85
|
+
contentType: "application/json",
|
|
86
|
+
requestType: "json",
|
|
87
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
88
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
89
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
90
|
+
});
|
|
91
|
+
if (_response.ok) {
|
|
92
|
+
return _response.body;
|
|
93
|
+
}
|
|
94
|
+
if (_response.error.reason === "status-code") {
|
|
95
|
+
switch (_response.error.statusCode) {
|
|
96
|
+
case 422:
|
|
97
|
+
throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
98
|
+
unrecognizedObjectKeys: "passthrough",
|
|
99
|
+
allowUnrecognizedUnionMembers: true,
|
|
100
|
+
allowUnrecognizedEnumValues: true,
|
|
101
|
+
skipValidation: true,
|
|
102
|
+
breadcrumbsPrefix: ["response"],
|
|
103
|
+
}));
|
|
104
|
+
default:
|
|
105
|
+
throw new errors.LettaError({
|
|
106
|
+
statusCode: _response.error.statusCode,
|
|
107
|
+
body: _response.error.body,
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
switch (_response.error.reason) {
|
|
112
|
+
case "non-json":
|
|
113
|
+
throw new errors.LettaError({
|
|
114
|
+
statusCode: _response.error.statusCode,
|
|
115
|
+
body: _response.error.rawBody,
|
|
116
|
+
});
|
|
117
|
+
case "timeout":
|
|
118
|
+
throw new errors.LettaTimeoutError("Timeout exceeded when calling PATCH /v1/messages/batches/{batch_id}/cancel.");
|
|
119
|
+
case "unknown":
|
|
120
|
+
throw new errors.LettaError({
|
|
121
|
+
message: _response.error.errorMessage,
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
_getCustomAuthorizationHeaders() {
|
|
127
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
128
|
+
const tokenValue = yield core.Supplier.get(this._options.token);
|
|
129
|
+
return { Authorization: `Bearer ${tokenValue}` };
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
exports.Messages = Messages;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./client"), exports);
|
|
18
|
+
__exportStar(require("./resources"), exports);
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as environments from "../../../../../../environments";
|
|
5
|
+
import * as core from "../../../../../../core";
|
|
6
|
+
import * as Letta from "../../../../../index";
|
|
7
|
+
export declare namespace Batches {
|
|
8
|
+
interface Options {
|
|
9
|
+
environment?: core.Supplier<environments.LettaEnvironment | string>;
|
|
10
|
+
/** Specify a custom URL to connect the client to. */
|
|
11
|
+
baseUrl?: core.Supplier<string>;
|
|
12
|
+
token?: core.Supplier<string | undefined>;
|
|
13
|
+
fetcher?: core.FetchFunction;
|
|
14
|
+
}
|
|
15
|
+
interface RequestOptions {
|
|
16
|
+
/** The maximum time to wait for a response in seconds. */
|
|
17
|
+
timeoutInSeconds?: number;
|
|
18
|
+
/** The number of times to retry the request. Defaults to 2. */
|
|
19
|
+
maxRetries?: number;
|
|
20
|
+
/** A hook to abort the request. */
|
|
21
|
+
abortSignal?: AbortSignal;
|
|
22
|
+
/** Additional headers to include in the request. */
|
|
23
|
+
headers?: Record<string, string>;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export declare class Batches {
|
|
27
|
+
protected readonly _options: Batches.Options;
|
|
28
|
+
constructor(_options?: Batches.Options);
|
|
29
|
+
/**
|
|
30
|
+
* List all batch runs.
|
|
31
|
+
*
|
|
32
|
+
* @param {Batches.RequestOptions} requestOptions - Request-specific configuration.
|
|
33
|
+
*
|
|
34
|
+
* @throws {@link Letta.UnprocessableEntityError}
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* await client.messages.batches.list()
|
|
38
|
+
*/
|
|
39
|
+
list(requestOptions?: Batches.RequestOptions): Promise<Letta.BatchJob[]>;
|
|
40
|
+
/**
|
|
41
|
+
* Submit a batch of agent messages for asynchronous processing.
|
|
42
|
+
* Creates a job that will fan out messages to all listed agents and process them in parallel.
|
|
43
|
+
*
|
|
44
|
+
* @param {Letta.messages.CreateBatch} request
|
|
45
|
+
* @param {Batches.RequestOptions} requestOptions - Request-specific configuration.
|
|
46
|
+
*
|
|
47
|
+
* @throws {@link Letta.UnprocessableEntityError}
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* await client.messages.batches.create({
|
|
51
|
+
* requests: [{
|
|
52
|
+
* messages: [{
|
|
53
|
+
* role: "user",
|
|
54
|
+
* content: [{
|
|
55
|
+
* type: "text",
|
|
56
|
+
* text: "text"
|
|
57
|
+
* }]
|
|
58
|
+
* }],
|
|
59
|
+
* agentId: "agent_id"
|
|
60
|
+
* }]
|
|
61
|
+
* })
|
|
62
|
+
*/
|
|
63
|
+
create(request: Letta.messages.CreateBatch, requestOptions?: Batches.RequestOptions): Promise<Letta.BatchJob>;
|
|
64
|
+
/**
|
|
65
|
+
* Get the status of a batch run.
|
|
66
|
+
*
|
|
67
|
+
* @param {string} batchId
|
|
68
|
+
* @param {Batches.RequestOptions} requestOptions - Request-specific configuration.
|
|
69
|
+
*
|
|
70
|
+
* @throws {@link Letta.UnprocessableEntityError}
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* await client.messages.batches.retrieve("batch_id")
|
|
74
|
+
*/
|
|
75
|
+
retrieve(batchId: string, requestOptions?: Batches.RequestOptions): Promise<Letta.BatchJob>;
|
|
76
|
+
/**
|
|
77
|
+
* @param {string} batchId
|
|
78
|
+
* @param {Batches.RequestOptions} requestOptions - Request-specific configuration.
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* await client.messages.batches.cancel("batch_id")
|
|
82
|
+
*/
|
|
83
|
+
cancel(batchId: string, requestOptions?: Batches.RequestOptions): Promise<void>;
|
|
84
|
+
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
85
|
+
Authorization: string;
|
|
86
|
+
}>;
|
|
87
|
+
}
|
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
39
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
40
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
41
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
42
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
43
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
44
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
48
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
49
|
+
};
|
|
50
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
51
|
+
exports.Batches = void 0;
|
|
52
|
+
const environments = __importStar(require("../../../../../../environments"));
|
|
53
|
+
const core = __importStar(require("../../../../../../core"));
|
|
54
|
+
const Letta = __importStar(require("../../../../../index"));
|
|
55
|
+
const url_join_1 = __importDefault(require("url-join"));
|
|
56
|
+
const serializers = __importStar(require("../../../../../../serialization/index"));
|
|
57
|
+
const errors = __importStar(require("../../../../../../errors/index"));
|
|
58
|
+
class Batches {
|
|
59
|
+
constructor(_options = {}) {
|
|
60
|
+
this._options = _options;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* List all batch runs.
|
|
64
|
+
*
|
|
65
|
+
* @param {Batches.RequestOptions} requestOptions - Request-specific configuration.
|
|
66
|
+
*
|
|
67
|
+
* @throws {@link Letta.UnprocessableEntityError}
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* await client.messages.batches.list()
|
|
71
|
+
*/
|
|
72
|
+
list(requestOptions) {
|
|
73
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
74
|
+
var _a, _b, _c;
|
|
75
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
76
|
+
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/messages/batches"),
|
|
77
|
+
method: "GET",
|
|
78
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.94", "User-Agent": "@letta-ai/letta-client/0.1.94", "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),
|
|
79
|
+
contentType: "application/json",
|
|
80
|
+
requestType: "json",
|
|
81
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
82
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
83
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
84
|
+
});
|
|
85
|
+
if (_response.ok) {
|
|
86
|
+
return serializers.messages.batches.list.Response.parseOrThrow(_response.body, {
|
|
87
|
+
unrecognizedObjectKeys: "passthrough",
|
|
88
|
+
allowUnrecognizedUnionMembers: true,
|
|
89
|
+
allowUnrecognizedEnumValues: true,
|
|
90
|
+
skipValidation: true,
|
|
91
|
+
breadcrumbsPrefix: ["response"],
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
if (_response.error.reason === "status-code") {
|
|
95
|
+
switch (_response.error.statusCode) {
|
|
96
|
+
case 422:
|
|
97
|
+
throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
98
|
+
unrecognizedObjectKeys: "passthrough",
|
|
99
|
+
allowUnrecognizedUnionMembers: true,
|
|
100
|
+
allowUnrecognizedEnumValues: true,
|
|
101
|
+
skipValidation: true,
|
|
102
|
+
breadcrumbsPrefix: ["response"],
|
|
103
|
+
}));
|
|
104
|
+
default:
|
|
105
|
+
throw new errors.LettaError({
|
|
106
|
+
statusCode: _response.error.statusCode,
|
|
107
|
+
body: _response.error.body,
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
switch (_response.error.reason) {
|
|
112
|
+
case "non-json":
|
|
113
|
+
throw new errors.LettaError({
|
|
114
|
+
statusCode: _response.error.statusCode,
|
|
115
|
+
body: _response.error.rawBody,
|
|
116
|
+
});
|
|
117
|
+
case "timeout":
|
|
118
|
+
throw new errors.LettaTimeoutError("Timeout exceeded when calling GET /v1/messages/batches.");
|
|
119
|
+
case "unknown":
|
|
120
|
+
throw new errors.LettaError({
|
|
121
|
+
message: _response.error.errorMessage,
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Submit a batch of agent messages for asynchronous processing.
|
|
128
|
+
* Creates a job that will fan out messages to all listed agents and process them in parallel.
|
|
129
|
+
*
|
|
130
|
+
* @param {Letta.messages.CreateBatch} request
|
|
131
|
+
* @param {Batches.RequestOptions} requestOptions - Request-specific configuration.
|
|
132
|
+
*
|
|
133
|
+
* @throws {@link Letta.UnprocessableEntityError}
|
|
134
|
+
*
|
|
135
|
+
* @example
|
|
136
|
+
* await client.messages.batches.create({
|
|
137
|
+
* requests: [{
|
|
138
|
+
* messages: [{
|
|
139
|
+
* role: "user",
|
|
140
|
+
* content: [{
|
|
141
|
+
* type: "text",
|
|
142
|
+
* text: "text"
|
|
143
|
+
* }]
|
|
144
|
+
* }],
|
|
145
|
+
* agentId: "agent_id"
|
|
146
|
+
* }]
|
|
147
|
+
* })
|
|
148
|
+
*/
|
|
149
|
+
create(request, requestOptions) {
|
|
150
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
151
|
+
var _a, _b, _c;
|
|
152
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
153
|
+
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/messages/batches"),
|
|
154
|
+
method: "POST",
|
|
155
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.94", "User-Agent": "@letta-ai/letta-client/0.1.94", "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),
|
|
156
|
+
contentType: "application/json",
|
|
157
|
+
requestType: "json",
|
|
158
|
+
body: serializers.messages.CreateBatch.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
159
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
160
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
161
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
162
|
+
});
|
|
163
|
+
if (_response.ok) {
|
|
164
|
+
return serializers.BatchJob.parseOrThrow(_response.body, {
|
|
165
|
+
unrecognizedObjectKeys: "passthrough",
|
|
166
|
+
allowUnrecognizedUnionMembers: true,
|
|
167
|
+
allowUnrecognizedEnumValues: true,
|
|
168
|
+
skipValidation: true,
|
|
169
|
+
breadcrumbsPrefix: ["response"],
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
if (_response.error.reason === "status-code") {
|
|
173
|
+
switch (_response.error.statusCode) {
|
|
174
|
+
case 422:
|
|
175
|
+
throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
176
|
+
unrecognizedObjectKeys: "passthrough",
|
|
177
|
+
allowUnrecognizedUnionMembers: true,
|
|
178
|
+
allowUnrecognizedEnumValues: true,
|
|
179
|
+
skipValidation: true,
|
|
180
|
+
breadcrumbsPrefix: ["response"],
|
|
181
|
+
}));
|
|
182
|
+
default:
|
|
183
|
+
throw new errors.LettaError({
|
|
184
|
+
statusCode: _response.error.statusCode,
|
|
185
|
+
body: _response.error.body,
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
switch (_response.error.reason) {
|
|
190
|
+
case "non-json":
|
|
191
|
+
throw new errors.LettaError({
|
|
192
|
+
statusCode: _response.error.statusCode,
|
|
193
|
+
body: _response.error.rawBody,
|
|
194
|
+
});
|
|
195
|
+
case "timeout":
|
|
196
|
+
throw new errors.LettaTimeoutError("Timeout exceeded when calling POST /v1/messages/batches.");
|
|
197
|
+
case "unknown":
|
|
198
|
+
throw new errors.LettaError({
|
|
199
|
+
message: _response.error.errorMessage,
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Get the status of a batch run.
|
|
206
|
+
*
|
|
207
|
+
* @param {string} batchId
|
|
208
|
+
* @param {Batches.RequestOptions} requestOptions - Request-specific configuration.
|
|
209
|
+
*
|
|
210
|
+
* @throws {@link Letta.UnprocessableEntityError}
|
|
211
|
+
*
|
|
212
|
+
* @example
|
|
213
|
+
* await client.messages.batches.retrieve("batch_id")
|
|
214
|
+
*/
|
|
215
|
+
retrieve(batchId, requestOptions) {
|
|
216
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
217
|
+
var _a, _b, _c;
|
|
218
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
219
|
+
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/messages/batches/${encodeURIComponent(batchId)}`),
|
|
220
|
+
method: "GET",
|
|
221
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.94", "User-Agent": "@letta-ai/letta-client/0.1.94", "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),
|
|
222
|
+
contentType: "application/json",
|
|
223
|
+
requestType: "json",
|
|
224
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
225
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
226
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
227
|
+
});
|
|
228
|
+
if (_response.ok) {
|
|
229
|
+
return serializers.BatchJob.parseOrThrow(_response.body, {
|
|
230
|
+
unrecognizedObjectKeys: "passthrough",
|
|
231
|
+
allowUnrecognizedUnionMembers: true,
|
|
232
|
+
allowUnrecognizedEnumValues: true,
|
|
233
|
+
skipValidation: true,
|
|
234
|
+
breadcrumbsPrefix: ["response"],
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
if (_response.error.reason === "status-code") {
|
|
238
|
+
switch (_response.error.statusCode) {
|
|
239
|
+
case 422:
|
|
240
|
+
throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
241
|
+
unrecognizedObjectKeys: "passthrough",
|
|
242
|
+
allowUnrecognizedUnionMembers: true,
|
|
243
|
+
allowUnrecognizedEnumValues: true,
|
|
244
|
+
skipValidation: true,
|
|
245
|
+
breadcrumbsPrefix: ["response"],
|
|
246
|
+
}));
|
|
247
|
+
default:
|
|
248
|
+
throw new errors.LettaError({
|
|
249
|
+
statusCode: _response.error.statusCode,
|
|
250
|
+
body: _response.error.body,
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
switch (_response.error.reason) {
|
|
255
|
+
case "non-json":
|
|
256
|
+
throw new errors.LettaError({
|
|
257
|
+
statusCode: _response.error.statusCode,
|
|
258
|
+
body: _response.error.rawBody,
|
|
259
|
+
});
|
|
260
|
+
case "timeout":
|
|
261
|
+
throw new errors.LettaTimeoutError("Timeout exceeded when calling GET /v1/messages/batches/{batch_id}.");
|
|
262
|
+
case "unknown":
|
|
263
|
+
throw new errors.LettaError({
|
|
264
|
+
message: _response.error.errorMessage,
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* @param {string} batchId
|
|
271
|
+
* @param {Batches.RequestOptions} requestOptions - Request-specific configuration.
|
|
272
|
+
*
|
|
273
|
+
* @example
|
|
274
|
+
* await client.messages.batches.cancel("batch_id")
|
|
275
|
+
*/
|
|
276
|
+
cancel(batchId, requestOptions) {
|
|
277
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
278
|
+
var _a, _b, _c;
|
|
279
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
280
|
+
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/messages/batches/${encodeURIComponent(batchId)}`),
|
|
281
|
+
method: "PATCH",
|
|
282
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.94", "User-Agent": "@letta-ai/letta-client/0.1.94", "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),
|
|
283
|
+
contentType: "application/json",
|
|
284
|
+
requestType: "json",
|
|
285
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
286
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
287
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
288
|
+
});
|
|
289
|
+
if (_response.ok) {
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
if (_response.error.reason === "status-code") {
|
|
293
|
+
throw new errors.LettaError({
|
|
294
|
+
statusCode: _response.error.statusCode,
|
|
295
|
+
body: _response.error.body,
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
switch (_response.error.reason) {
|
|
299
|
+
case "non-json":
|
|
300
|
+
throw new errors.LettaError({
|
|
301
|
+
statusCode: _response.error.statusCode,
|
|
302
|
+
body: _response.error.rawBody,
|
|
303
|
+
});
|
|
304
|
+
case "timeout":
|
|
305
|
+
throw new errors.LettaTimeoutError("Timeout exceeded when calling PATCH /v1/messages/batches/{batch_id}.");
|
|
306
|
+
case "unknown":
|
|
307
|
+
throw new errors.LettaError({
|
|
308
|
+
message: _response.error.errorMessage,
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
_getCustomAuthorizationHeaders() {
|
|
314
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
315
|
+
const tokenValue = yield core.Supplier.get(this._options.token);
|
|
316
|
+
return { Authorization: `Bearer ${tokenValue}` };
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
exports.Batches = Batches;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./requests"), exports);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Letta from "../../../../../../index";
|
|
5
|
+
/**
|
|
6
|
+
* @example
|
|
7
|
+
* {
|
|
8
|
+
* requests: [{
|
|
9
|
+
* messages: [{
|
|
10
|
+
* role: "user",
|
|
11
|
+
* content: [{
|
|
12
|
+
* type: "text",
|
|
13
|
+
* text: "text"
|
|
14
|
+
* }]
|
|
15
|
+
* }],
|
|
16
|
+
* agentId: "agent_id"
|
|
17
|
+
* }]
|
|
18
|
+
* }
|
|
19
|
+
*/
|
|
20
|
+
export interface CreateBatch {
|
|
21
|
+
/** List of requests to be processed in batch. */
|
|
22
|
+
requests: Letta.LettaBatchRequest[];
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { type CreateBatch } from "./CreateBatch";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./client"), exports);
|