@letta-ai/letta-client 0.1.170 → 0.1.172
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/README.md +16 -3
- package/api/errors/BadRequestError.d.ts +2 -1
- package/api/errors/BadRequestError.js +2 -1
- package/api/errors/ConflictError.d.ts +2 -1
- package/api/errors/ConflictError.js +2 -1
- package/api/errors/InternalServerError.d.ts +2 -1
- package/api/errors/InternalServerError.js +2 -1
- package/api/errors/NotFoundError.d.ts +2 -1
- package/api/errors/NotFoundError.js +2 -1
- package/api/errors/PaymentRequiredError.d.ts +2 -1
- package/api/errors/PaymentRequiredError.js +2 -1
- package/api/errors/UnprocessableEntityError.d.ts +2 -1
- package/api/errors/UnprocessableEntityError.js +2 -1
- package/api/resources/agents/client/Client.d.ts +20 -10
- package/api/resources/agents/client/Client.js +166 -82
- package/api/resources/agents/resources/blocks/client/Client.d.ts +10 -5
- package/api/resources/agents/resources/blocks/client/Client.js +90 -45
- package/api/resources/agents/resources/context/client/Client.d.ts +2 -1
- package/api/resources/agents/resources/context/client/Client.js +18 -9
- package/api/resources/agents/resources/coreMemory/client/Client.d.ts +2 -1
- package/api/resources/agents/resources/coreMemory/client/Client.js +18 -9
- package/api/resources/agents/resources/files/client/Client.d.ts +6 -3
- package/api/resources/agents/resources/files/client/Client.js +45 -21
- package/api/resources/agents/resources/folders/client/Client.d.ts +6 -3
- package/api/resources/agents/resources/folders/client/Client.js +54 -27
- package/api/resources/agents/resources/groups/client/Client.d.ts +2 -1
- package/api/resources/agents/resources/groups/client/Client.js +19 -10
- package/api/resources/agents/resources/memoryVariables/client/Client.d.ts +2 -1
- package/api/resources/agents/resources/memoryVariables/client/Client.js +18 -9
- package/api/resources/agents/resources/messages/client/Client.d.ts +16 -8
- package/api/resources/agents/resources/messages/client/Client.js +155 -83
- package/api/resources/agents/resources/passages/client/Client.d.ts +8 -4
- package/api/resources/agents/resources/passages/client/Client.js +64 -31
- package/api/resources/agents/resources/sources/client/Client.d.ts +6 -3
- package/api/resources/agents/resources/sources/client/Client.js +54 -27
- package/api/resources/agents/resources/templates/client/Client.d.ts +6 -3
- package/api/resources/agents/resources/templates/client/Client.js +54 -27
- package/api/resources/agents/resources/tools/client/Client.d.ts +6 -3
- package/api/resources/agents/resources/tools/client/Client.js +54 -27
- package/api/resources/batches/client/Client.d.ts +8 -4
- package/api/resources/batches/client/Client.js +63 -30
- package/api/resources/blocks/client/Client.d.ts +12 -6
- package/api/resources/blocks/client/Client.js +100 -49
- package/api/resources/blocks/resources/agents/client/Client.d.ts +2 -1
- package/api/resources/blocks/resources/agents/client/Client.js +19 -10
- package/api/resources/clientSideAccessTokens/client/Client.d.ts +6 -3
- package/api/resources/clientSideAccessTokens/client/Client.js +46 -22
- package/api/resources/embeddingModels/client/Client.d.ts +2 -1
- package/api/resources/embeddingModels/client/Client.js +18 -9
- package/api/resources/folders/client/Client.d.ts +18 -9
- package/api/resources/folders/client/Client.js +154 -76
- package/api/resources/folders/resources/files/client/Client.d.ts +6 -3
- package/api/resources/folders/resources/files/client/Client.js +48 -24
- package/api/resources/folders/resources/passages/client/Client.d.ts +2 -1
- package/api/resources/folders/resources/passages/client/Client.js +19 -10
- package/api/resources/groups/client/Client.d.ts +12 -6
- package/api/resources/groups/client/Client.js +105 -52
- package/api/resources/groups/resources/messages/client/Client.d.ts +10 -5
- package/api/resources/groups/resources/messages/client/Client.js +91 -49
- package/api/resources/health/client/Client.d.ts +2 -1
- package/api/resources/health/client/Client.js +17 -8
- package/api/resources/identities/client/Client.d.ts +14 -7
- package/api/resources/identities/client/Client.js +123 -61
- package/api/resources/identities/resources/properties/client/Client.d.ts +2 -1
- package/api/resources/identities/resources/properties/client/Client.js +9 -3
- package/api/resources/jobs/client/Client.d.ts +10 -5
- package/api/resources/jobs/client/Client.js +92 -47
- package/api/resources/messages/client/Client.d.ts +2 -1
- package/api/resources/messages/client/Client.js +19 -10
- package/api/resources/models/client/Client.d.ts +2 -1
- package/api/resources/models/client/Client.js +27 -14
- package/api/resources/projects/client/Client.d.ts +2 -1
- package/api/resources/projects/client/Client.js +18 -9
- package/api/resources/providers/client/Client.d.ts +10 -5
- package/api/resources/providers/client/Client.js +77 -36
- package/api/resources/runs/client/Client.d.ts +8 -4
- package/api/resources/runs/client/Client.js +74 -38
- package/api/resources/runs/resources/messages/client/Client.d.ts +2 -1
- package/api/resources/runs/resources/messages/client/Client.js +21 -12
- package/api/resources/runs/resources/steps/client/Client.d.ts +2 -1
- package/api/resources/runs/resources/steps/client/Client.js +19 -10
- package/api/resources/runs/resources/usage/client/Client.d.ts +2 -1
- package/api/resources/runs/resources/usage/client/Client.js +18 -9
- package/api/resources/sources/client/Client.d.ts +20 -10
- package/api/resources/sources/client/Client.js +173 -86
- package/api/resources/sources/resources/files/client/Client.d.ts +6 -3
- package/api/resources/sources/resources/files/client/Client.js +48 -24
- package/api/resources/sources/resources/passages/client/Client.d.ts +2 -1
- package/api/resources/sources/resources/passages/client/Client.js +19 -10
- package/api/resources/steps/client/Client.d.ts +4 -2
- package/api/resources/steps/client/Client.js +41 -21
- package/api/resources/steps/resources/feedback/client/Client.d.ts +2 -1
- package/api/resources/steps/resources/feedback/client/Client.js +23 -12
- package/api/resources/tags/client/Client.d.ts +2 -1
- package/api/resources/tags/client/Client.js +19 -10
- package/api/resources/telemetry/client/Client.d.ts +2 -1
- package/api/resources/telemetry/client/Client.js +18 -9
- package/api/resources/templates/client/Client.d.ts +2 -1
- package/api/resources/templates/client/Client.js +18 -9
- package/api/resources/templates/resources/agents/client/Client.d.ts +2 -1
- package/api/resources/templates/resources/agents/client/Client.js +19 -10
- package/api/resources/tools/client/Client.d.ts +40 -20
- package/api/resources/tools/client/Client.js +356 -182
- package/api/resources/voice/client/Client.d.ts +2 -1
- package/api/resources/voice/client/Client.js +9 -3
- package/api/types/LettaStreamingRequest.d.ts +2 -0
- package/core/fetcher/APIResponse.d.ts +10 -0
- package/core/fetcher/Fetcher.d.ts +1 -1
- package/core/fetcher/Fetcher.js +11 -3
- package/core/fetcher/Headers.d.ts +2 -0
- package/core/fetcher/Headers.js +84 -0
- package/core/fetcher/HttpResponsePromise.d.ts +58 -0
- package/core/fetcher/HttpResponsePromise.js +103 -0
- package/core/fetcher/RawResponse.d.ts +29 -0
- package/core/fetcher/RawResponse.js +44 -0
- package/core/fetcher/createRequestUrl.d.ts +1 -1
- package/core/fetcher/getRequestBody.js +2 -1
- package/core/fetcher/index.d.ts +3 -0
- package/core/fetcher/index.js +7 -1
- package/core/fetcher/requestWithRetries.js +1 -1
- package/core/form-data-utils/FormDataWrapper.d.ts +3 -0
- package/core/form-data-utils/FormDataWrapper.js +53 -10
- package/core/form-data-utils/encodeAsFormParameter.d.ts +4 -0
- package/core/form-data-utils/encodeAsFormParameter.js +18 -0
- package/core/form-data-utils/index.d.ts +1 -0
- package/core/form-data-utils/index.js +3 -0
- package/core/json.d.ts +15 -0
- package/core/json.js +24 -0
- package/core/schemas/Schema.d.ts +2 -0
- package/core/schemas/Schema.js +2 -0
- package/core/schemas/builders/bigint/bigint.d.ts +1 -1
- package/core/schemas/builders/bigint/bigint.js +21 -17
- package/core/schemas/builders/object/object.js +1 -0
- package/core/schemas/builders/record/record.js +1 -2
- package/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +4 -0
- package/core/schemas/builders/schema-utils/getSchemaUtils.js +64 -0
- package/core/schemas/utils/addQuestionMarksToNullableProperties.d.ts +1 -1
- package/dist/api/errors/BadRequestError.d.ts +2 -1
- package/dist/api/errors/BadRequestError.js +2 -1
- package/dist/api/errors/ConflictError.d.ts +2 -1
- package/dist/api/errors/ConflictError.js +2 -1
- package/dist/api/errors/InternalServerError.d.ts +2 -1
- package/dist/api/errors/InternalServerError.js +2 -1
- package/dist/api/errors/NotFoundError.d.ts +2 -1
- package/dist/api/errors/NotFoundError.js +2 -1
- package/dist/api/errors/PaymentRequiredError.d.ts +2 -1
- package/dist/api/errors/PaymentRequiredError.js +2 -1
- package/dist/api/errors/UnprocessableEntityError.d.ts +2 -1
- package/dist/api/errors/UnprocessableEntityError.js +2 -1
- package/dist/api/resources/agents/client/Client.d.ts +20 -10
- package/dist/api/resources/agents/client/Client.js +166 -82
- package/dist/api/resources/agents/resources/blocks/client/Client.d.ts +10 -5
- package/dist/api/resources/agents/resources/blocks/client/Client.js +90 -45
- package/dist/api/resources/agents/resources/context/client/Client.d.ts +2 -1
- package/dist/api/resources/agents/resources/context/client/Client.js +18 -9
- package/dist/api/resources/agents/resources/coreMemory/client/Client.d.ts +2 -1
- package/dist/api/resources/agents/resources/coreMemory/client/Client.js +18 -9
- package/dist/api/resources/agents/resources/files/client/Client.d.ts +6 -3
- package/dist/api/resources/agents/resources/files/client/Client.js +45 -21
- package/dist/api/resources/agents/resources/folders/client/Client.d.ts +6 -3
- package/dist/api/resources/agents/resources/folders/client/Client.js +54 -27
- package/dist/api/resources/agents/resources/groups/client/Client.d.ts +2 -1
- package/dist/api/resources/agents/resources/groups/client/Client.js +19 -10
- package/dist/api/resources/agents/resources/memoryVariables/client/Client.d.ts +2 -1
- package/dist/api/resources/agents/resources/memoryVariables/client/Client.js +18 -9
- package/dist/api/resources/agents/resources/messages/client/Client.d.ts +16 -8
- package/dist/api/resources/agents/resources/messages/client/Client.js +155 -83
- package/dist/api/resources/agents/resources/passages/client/Client.d.ts +8 -4
- package/dist/api/resources/agents/resources/passages/client/Client.js +64 -31
- package/dist/api/resources/agents/resources/sources/client/Client.d.ts +6 -3
- package/dist/api/resources/agents/resources/sources/client/Client.js +54 -27
- package/dist/api/resources/agents/resources/templates/client/Client.d.ts +6 -3
- package/dist/api/resources/agents/resources/templates/client/Client.js +54 -27
- package/dist/api/resources/agents/resources/tools/client/Client.d.ts +6 -3
- package/dist/api/resources/agents/resources/tools/client/Client.js +54 -27
- package/dist/api/resources/batches/client/Client.d.ts +8 -4
- package/dist/api/resources/batches/client/Client.js +63 -30
- package/dist/api/resources/blocks/client/Client.d.ts +12 -6
- package/dist/api/resources/blocks/client/Client.js +100 -49
- package/dist/api/resources/blocks/resources/agents/client/Client.d.ts +2 -1
- package/dist/api/resources/blocks/resources/agents/client/Client.js +19 -10
- package/dist/api/resources/clientSideAccessTokens/client/Client.d.ts +6 -3
- package/dist/api/resources/clientSideAccessTokens/client/Client.js +46 -22
- package/dist/api/resources/embeddingModels/client/Client.d.ts +2 -1
- package/dist/api/resources/embeddingModels/client/Client.js +18 -9
- package/dist/api/resources/folders/client/Client.d.ts +18 -9
- package/dist/api/resources/folders/client/Client.js +154 -76
- package/dist/api/resources/folders/resources/files/client/Client.d.ts +6 -3
- package/dist/api/resources/folders/resources/files/client/Client.js +48 -24
- package/dist/api/resources/folders/resources/passages/client/Client.d.ts +2 -1
- package/dist/api/resources/folders/resources/passages/client/Client.js +19 -10
- package/dist/api/resources/groups/client/Client.d.ts +12 -6
- package/dist/api/resources/groups/client/Client.js +105 -52
- package/dist/api/resources/groups/resources/messages/client/Client.d.ts +10 -5
- package/dist/api/resources/groups/resources/messages/client/Client.js +91 -49
- package/dist/api/resources/health/client/Client.d.ts +2 -1
- package/dist/api/resources/health/client/Client.js +17 -8
- package/dist/api/resources/identities/client/Client.d.ts +14 -7
- package/dist/api/resources/identities/client/Client.js +123 -61
- package/dist/api/resources/identities/resources/properties/client/Client.d.ts +2 -1
- package/dist/api/resources/identities/resources/properties/client/Client.js +9 -3
- package/dist/api/resources/jobs/client/Client.d.ts +10 -5
- package/dist/api/resources/jobs/client/Client.js +92 -47
- package/dist/api/resources/messages/client/Client.d.ts +2 -1
- package/dist/api/resources/messages/client/Client.js +19 -10
- package/dist/api/resources/models/client/Client.d.ts +2 -1
- package/dist/api/resources/models/client/Client.js +27 -14
- package/dist/api/resources/projects/client/Client.d.ts +2 -1
- package/dist/api/resources/projects/client/Client.js +18 -9
- package/dist/api/resources/providers/client/Client.d.ts +10 -5
- package/dist/api/resources/providers/client/Client.js +77 -36
- package/dist/api/resources/runs/client/Client.d.ts +8 -4
- package/dist/api/resources/runs/client/Client.js +74 -38
- package/dist/api/resources/runs/resources/messages/client/Client.d.ts +2 -1
- package/dist/api/resources/runs/resources/messages/client/Client.js +21 -12
- package/dist/api/resources/runs/resources/steps/client/Client.d.ts +2 -1
- package/dist/api/resources/runs/resources/steps/client/Client.js +19 -10
- package/dist/api/resources/runs/resources/usage/client/Client.d.ts +2 -1
- package/dist/api/resources/runs/resources/usage/client/Client.js +18 -9
- package/dist/api/resources/sources/client/Client.d.ts +20 -10
- package/dist/api/resources/sources/client/Client.js +173 -86
- package/dist/api/resources/sources/resources/files/client/Client.d.ts +6 -3
- package/dist/api/resources/sources/resources/files/client/Client.js +48 -24
- package/dist/api/resources/sources/resources/passages/client/Client.d.ts +2 -1
- package/dist/api/resources/sources/resources/passages/client/Client.js +19 -10
- package/dist/api/resources/steps/client/Client.d.ts +4 -2
- package/dist/api/resources/steps/client/Client.js +41 -21
- package/dist/api/resources/steps/resources/feedback/client/Client.d.ts +2 -1
- package/dist/api/resources/steps/resources/feedback/client/Client.js +23 -12
- package/dist/api/resources/tags/client/Client.d.ts +2 -1
- package/dist/api/resources/tags/client/Client.js +19 -10
- package/dist/api/resources/telemetry/client/Client.d.ts +2 -1
- package/dist/api/resources/telemetry/client/Client.js +18 -9
- package/dist/api/resources/templates/client/Client.d.ts +2 -1
- package/dist/api/resources/templates/client/Client.js +18 -9
- package/dist/api/resources/templates/resources/agents/client/Client.d.ts +2 -1
- package/dist/api/resources/templates/resources/agents/client/Client.js +19 -10
- package/dist/api/resources/tools/client/Client.d.ts +40 -20
- package/dist/api/resources/tools/client/Client.js +356 -182
- package/dist/api/resources/voice/client/Client.d.ts +2 -1
- package/dist/api/resources/voice/client/Client.js +9 -3
- package/dist/api/types/LettaStreamingRequest.d.ts +2 -0
- package/dist/core/fetcher/APIResponse.d.ts +10 -0
- package/dist/core/fetcher/Fetcher.d.ts +1 -1
- package/dist/core/fetcher/Fetcher.js +11 -3
- package/dist/core/fetcher/Headers.d.ts +2 -0
- package/dist/core/fetcher/Headers.js +84 -0
- package/dist/core/fetcher/HttpResponsePromise.d.ts +58 -0
- package/dist/core/fetcher/HttpResponsePromise.js +103 -0
- package/dist/core/fetcher/RawResponse.d.ts +29 -0
- package/dist/core/fetcher/RawResponse.js +44 -0
- package/dist/core/fetcher/createRequestUrl.d.ts +1 -1
- package/dist/core/fetcher/getRequestBody.js +2 -1
- package/dist/core/fetcher/index.d.ts +3 -0
- package/dist/core/fetcher/index.js +7 -1
- package/dist/core/fetcher/requestWithRetries.js +1 -1
- package/dist/core/form-data-utils/FormDataWrapper.d.ts +3 -0
- package/dist/core/form-data-utils/FormDataWrapper.js +53 -10
- package/dist/core/form-data-utils/encodeAsFormParameter.d.ts +4 -0
- package/dist/core/form-data-utils/encodeAsFormParameter.js +18 -0
- package/dist/core/form-data-utils/index.d.ts +1 -0
- package/dist/core/form-data-utils/index.js +3 -0
- package/dist/core/json.d.ts +15 -0
- package/dist/core/json.js +24 -0
- package/dist/core/schemas/Schema.d.ts +2 -0
- package/dist/core/schemas/Schema.js +2 -0
- package/dist/core/schemas/builders/bigint/bigint.d.ts +1 -1
- package/dist/core/schemas/builders/bigint/bigint.js +21 -17
- package/dist/core/schemas/builders/object/object.js +1 -0
- package/dist/core/schemas/builders/record/record.js +1 -2
- package/dist/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +4 -0
- package/dist/core/schemas/builders/schema-utils/getSchemaUtils.js +64 -0
- package/dist/core/schemas/utils/addQuestionMarksToNullableProperties.d.ts +1 -1
- package/dist/errors/LettaError.d.ts +4 -1
- package/dist/errors/LettaError.js +6 -8
- package/dist/serialization/types/LettaStreamingRequest.d.ts +1 -0
- package/dist/serialization/types/LettaStreamingRequest.js +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/errors/LettaError.d.ts +4 -1
- package/errors/LettaError.js +6 -8
- package/package.json +4 -4
- package/serialization/types/LettaStreamingRequest.d.ts +1 -0
- package/serialization/types/LettaStreamingRequest.js +1 -0
- package/version.d.ts +1 -1
- package/version.js +1 -1
package/README.md
CHANGED
|
@@ -56,6 +56,7 @@ try {
|
|
|
56
56
|
console.log(err.statusCode);
|
|
57
57
|
console.log(err.message);
|
|
58
58
|
console.log(err.body);
|
|
59
|
+
console.log(err.rawResponse);
|
|
59
60
|
}
|
|
60
61
|
}
|
|
61
62
|
```
|
|
@@ -77,10 +78,10 @@ const response = await client.tools.create(..., {
|
|
|
77
78
|
### Retries
|
|
78
79
|
|
|
79
80
|
The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long
|
|
80
|
-
as the request is deemed
|
|
81
|
+
as the request is deemed retryable and the number of retry attempts has not grown larger than the configured
|
|
81
82
|
retry limit (default: 2).
|
|
82
83
|
|
|
83
|
-
A request is deemed
|
|
84
|
+
A request is deemed retryable when any of the following HTTP status codes is returned:
|
|
84
85
|
|
|
85
86
|
- [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
|
|
86
87
|
- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
|
|
@@ -116,6 +117,18 @@ const response = await client.tools.create(..., {
|
|
|
116
117
|
controller.abort(); // aborts the request
|
|
117
118
|
```
|
|
118
119
|
|
|
120
|
+
### Access Raw Response Data
|
|
121
|
+
|
|
122
|
+
The SDK provides access to raw response data, including headers, through the `.withRawResponse()` method.
|
|
123
|
+
The `.withRawResponse()` method returns a promise that results to an object with a `data` and a `rawResponse` property.
|
|
124
|
+
|
|
125
|
+
```typescript
|
|
126
|
+
const { data, rawResponse } = await client.tools.create(...).withRawResponse();
|
|
127
|
+
|
|
128
|
+
console.log(data);
|
|
129
|
+
console.log(rawResponse.headers['X-My-Header']);
|
|
130
|
+
```
|
|
131
|
+
|
|
119
132
|
### Runtime Compatibility
|
|
120
133
|
|
|
121
134
|
The SDK defaults to `node-fetch` but will use the global fetch client if present. The SDK works in the following
|
|
@@ -130,7 +143,7 @@ runtimes:
|
|
|
130
143
|
|
|
131
144
|
### Customizing Fetch Client
|
|
132
145
|
|
|
133
|
-
The SDK provides a way for
|
|
146
|
+
The SDK provides a way for you to customize the underlying HTTP client / Fetch function. If you're running in an
|
|
134
147
|
unsupported environment, this provides a way for you to break glass and ensure the SDK works.
|
|
135
148
|
|
|
136
149
|
```typescript
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
4
|
import * as errors from "../../errors/index";
|
|
5
|
+
import * as core from "../../core";
|
|
5
6
|
export declare class BadRequestError extends errors.LettaError {
|
|
6
|
-
constructor(body?: unknown);
|
|
7
|
+
constructor(body?: unknown, rawResponse?: core.RawResponse);
|
|
7
8
|
}
|
|
@@ -39,11 +39,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
39
39
|
exports.BadRequestError = void 0;
|
|
40
40
|
const errors = __importStar(require("../../errors/index"));
|
|
41
41
|
class BadRequestError extends errors.LettaError {
|
|
42
|
-
constructor(body) {
|
|
42
|
+
constructor(body, rawResponse) {
|
|
43
43
|
super({
|
|
44
44
|
message: "BadRequestError",
|
|
45
45
|
statusCode: 400,
|
|
46
46
|
body: body,
|
|
47
|
+
rawResponse: rawResponse,
|
|
47
48
|
});
|
|
48
49
|
Object.setPrototypeOf(this, BadRequestError.prototype);
|
|
49
50
|
}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as errors from "../../errors/index";
|
|
5
5
|
import * as Letta from "../index";
|
|
6
|
+
import * as core from "../../core";
|
|
6
7
|
export declare class ConflictError extends errors.LettaError {
|
|
7
|
-
constructor(body: Letta.ConflictErrorBody);
|
|
8
|
+
constructor(body: Letta.ConflictErrorBody, rawResponse?: core.RawResponse);
|
|
8
9
|
}
|
|
@@ -39,11 +39,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
39
39
|
exports.ConflictError = void 0;
|
|
40
40
|
const errors = __importStar(require("../../errors/index"));
|
|
41
41
|
class ConflictError extends errors.LettaError {
|
|
42
|
-
constructor(body) {
|
|
42
|
+
constructor(body, rawResponse) {
|
|
43
43
|
super({
|
|
44
44
|
message: "ConflictError",
|
|
45
45
|
statusCode: 409,
|
|
46
46
|
body: body,
|
|
47
|
+
rawResponse: rawResponse,
|
|
47
48
|
});
|
|
48
49
|
Object.setPrototypeOf(this, ConflictError.prototype);
|
|
49
50
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
4
|
import * as errors from "../../errors/index";
|
|
5
|
+
import * as core from "../../core";
|
|
5
6
|
export declare class InternalServerError extends errors.LettaError {
|
|
6
|
-
constructor(body?: unknown);
|
|
7
|
+
constructor(body?: unknown, rawResponse?: core.RawResponse);
|
|
7
8
|
}
|
|
@@ -39,11 +39,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
39
39
|
exports.InternalServerError = void 0;
|
|
40
40
|
const errors = __importStar(require("../../errors/index"));
|
|
41
41
|
class InternalServerError extends errors.LettaError {
|
|
42
|
-
constructor(body) {
|
|
42
|
+
constructor(body, rawResponse) {
|
|
43
43
|
super({
|
|
44
44
|
message: "InternalServerError",
|
|
45
45
|
statusCode: 500,
|
|
46
46
|
body: body,
|
|
47
|
+
rawResponse: rawResponse,
|
|
47
48
|
});
|
|
48
49
|
Object.setPrototypeOf(this, InternalServerError.prototype);
|
|
49
50
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
4
|
import * as errors from "../../errors/index";
|
|
5
|
+
import * as core from "../../core";
|
|
5
6
|
export declare class NotFoundError extends errors.LettaError {
|
|
6
|
-
constructor(body?: unknown);
|
|
7
|
+
constructor(body?: unknown, rawResponse?: core.RawResponse);
|
|
7
8
|
}
|
|
@@ -39,11 +39,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
39
39
|
exports.NotFoundError = void 0;
|
|
40
40
|
const errors = __importStar(require("../../errors/index"));
|
|
41
41
|
class NotFoundError extends errors.LettaError {
|
|
42
|
-
constructor(body) {
|
|
42
|
+
constructor(body, rawResponse) {
|
|
43
43
|
super({
|
|
44
44
|
message: "NotFoundError",
|
|
45
45
|
statusCode: 404,
|
|
46
46
|
body: body,
|
|
47
|
+
rawResponse: rawResponse,
|
|
47
48
|
});
|
|
48
49
|
Object.setPrototypeOf(this, NotFoundError.prototype);
|
|
49
50
|
}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as errors from "../../errors/index";
|
|
5
5
|
import * as Letta from "../index";
|
|
6
|
+
import * as core from "../../core";
|
|
6
7
|
export declare class PaymentRequiredError extends errors.LettaError {
|
|
7
|
-
constructor(body: Letta.PaymentRequiredErrorBody);
|
|
8
|
+
constructor(body: Letta.PaymentRequiredErrorBody, rawResponse?: core.RawResponse);
|
|
8
9
|
}
|
|
@@ -39,11 +39,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
39
39
|
exports.PaymentRequiredError = void 0;
|
|
40
40
|
const errors = __importStar(require("../../errors/index"));
|
|
41
41
|
class PaymentRequiredError extends errors.LettaError {
|
|
42
|
-
constructor(body) {
|
|
42
|
+
constructor(body, rawResponse) {
|
|
43
43
|
super({
|
|
44
44
|
message: "PaymentRequiredError",
|
|
45
45
|
statusCode: 402,
|
|
46
46
|
body: body,
|
|
47
|
+
rawResponse: rawResponse,
|
|
47
48
|
});
|
|
48
49
|
Object.setPrototypeOf(this, PaymentRequiredError.prototype);
|
|
49
50
|
}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as errors from "../../errors/index";
|
|
5
5
|
import * as Letta from "../index";
|
|
6
|
+
import * as core from "../../core";
|
|
6
7
|
export declare class UnprocessableEntityError extends errors.LettaError {
|
|
7
|
-
constructor(body: Letta.HttpValidationError);
|
|
8
|
+
constructor(body: Letta.HttpValidationError, rawResponse?: core.RawResponse);
|
|
8
9
|
}
|
|
@@ -39,11 +39,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
39
39
|
exports.UnprocessableEntityError = void 0;
|
|
40
40
|
const errors = __importStar(require("../../errors/index"));
|
|
41
41
|
class UnprocessableEntityError extends errors.LettaError {
|
|
42
|
-
constructor(body) {
|
|
42
|
+
constructor(body, rawResponse) {
|
|
43
43
|
super({
|
|
44
44
|
message: "UnprocessableEntityError",
|
|
45
45
|
statusCode: 422,
|
|
46
46
|
body: body,
|
|
47
|
+
rawResponse: rawResponse,
|
|
47
48
|
});
|
|
48
49
|
Object.setPrototypeOf(this, UnprocessableEntityError.prototype);
|
|
49
50
|
}
|
|
@@ -82,7 +82,8 @@ export declare class Agents {
|
|
|
82
82
|
* @example
|
|
83
83
|
* await client.agents.list()
|
|
84
84
|
*/
|
|
85
|
-
list(request?: Letta.AgentsListRequest, requestOptions?: Agents.RequestOptions):
|
|
85
|
+
list(request?: Letta.AgentsListRequest, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<Letta.AgentState[]>;
|
|
86
|
+
private __list;
|
|
86
87
|
/**
|
|
87
88
|
* Create a new agent with the specified configuration.
|
|
88
89
|
*
|
|
@@ -94,7 +95,8 @@ export declare class Agents {
|
|
|
94
95
|
* @example
|
|
95
96
|
* await client.agents.create()
|
|
96
97
|
*/
|
|
97
|
-
create(request?: Letta.CreateAgentRequest, requestOptions?: Agents.RequestOptions):
|
|
98
|
+
create(request?: Letta.CreateAgentRequest, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<Letta.AgentState>;
|
|
99
|
+
private __create;
|
|
98
100
|
/**
|
|
99
101
|
* Get the count of all agents associated with a given user.
|
|
100
102
|
*
|
|
@@ -105,7 +107,8 @@ export declare class Agents {
|
|
|
105
107
|
* @example
|
|
106
108
|
* await client.agents.count()
|
|
107
109
|
*/
|
|
108
|
-
count(requestOptions?: Agents.RequestOptions):
|
|
110
|
+
count(requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<number>;
|
|
111
|
+
private __count;
|
|
109
112
|
/**
|
|
110
113
|
* Export the serialized JSON representation of an agent, formatted with indentation.
|
|
111
114
|
*
|
|
@@ -117,7 +120,8 @@ export declare class Agents {
|
|
|
117
120
|
* @example
|
|
118
121
|
* await client.agents.exportFile("agent_id")
|
|
119
122
|
*/
|
|
120
|
-
exportFile(agentId: string, requestOptions?: Agents.RequestOptions):
|
|
123
|
+
exportFile(agentId: string, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<string>;
|
|
124
|
+
private __exportFile;
|
|
121
125
|
/**
|
|
122
126
|
* Import a serialized agent file and recreate the agent in the system.
|
|
123
127
|
*
|
|
@@ -130,7 +134,8 @@ export declare class Agents {
|
|
|
130
134
|
* @example
|
|
131
135
|
* await client.agents.importFile(fs.createReadStream("/path/to/your/file"), {})
|
|
132
136
|
*/
|
|
133
|
-
importFile(file: File | fs.ReadStream | Blob, request: Letta.BodyImportAgentSerialized, requestOptions?: Agents.RequestOptions):
|
|
137
|
+
importFile(file: File | fs.ReadStream | Blob, request: Letta.BodyImportAgentSerialized, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<Letta.AgentState>;
|
|
138
|
+
private __importFile;
|
|
134
139
|
/**
|
|
135
140
|
* Get the state of the agent.
|
|
136
141
|
*
|
|
@@ -143,7 +148,8 @@ export declare class Agents {
|
|
|
143
148
|
* @example
|
|
144
149
|
* await client.agents.retrieve("agent_id")
|
|
145
150
|
*/
|
|
146
|
-
retrieve(agentId: string, request?: Letta.AgentsRetrieveRequest, requestOptions?: Agents.RequestOptions):
|
|
151
|
+
retrieve(agentId: string, request?: Letta.AgentsRetrieveRequest, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<Letta.AgentState>;
|
|
152
|
+
private __retrieve;
|
|
147
153
|
/**
|
|
148
154
|
* Delete an agent.
|
|
149
155
|
*
|
|
@@ -155,7 +161,8 @@ export declare class Agents {
|
|
|
155
161
|
* @example
|
|
156
162
|
* await client.agents.delete("agent_id")
|
|
157
163
|
*/
|
|
158
|
-
delete(agentId: string, requestOptions?: Agents.RequestOptions):
|
|
164
|
+
delete(agentId: string, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
165
|
+
private __delete;
|
|
159
166
|
/**
|
|
160
167
|
* Update an existing agent
|
|
161
168
|
*
|
|
@@ -168,7 +175,8 @@ export declare class Agents {
|
|
|
168
175
|
* @example
|
|
169
176
|
* await client.agents.modify("agent_id")
|
|
170
177
|
*/
|
|
171
|
-
modify(agentId: string, request?: Letta.UpdateAgent, requestOptions?: Agents.RequestOptions):
|
|
178
|
+
modify(agentId: string, request?: Letta.UpdateAgent, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<Letta.AgentState>;
|
|
179
|
+
private __modify;
|
|
172
180
|
/**
|
|
173
181
|
* Summarize an agent's conversation history to a target message length.
|
|
174
182
|
*
|
|
@@ -186,7 +194,8 @@ export declare class Agents {
|
|
|
186
194
|
* maxMessageLength: 1
|
|
187
195
|
* })
|
|
188
196
|
*/
|
|
189
|
-
summarizeAgentConversation(agentId: string, request: Letta.SummarizeAgentConversationRequest, requestOptions?: Agents.RequestOptions):
|
|
197
|
+
summarizeAgentConversation(agentId: string, request: Letta.SummarizeAgentConversationRequest, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<void>;
|
|
198
|
+
private __summarizeAgentConversation;
|
|
190
199
|
/**
|
|
191
200
|
* <Note>This endpoint is only available on Letta Cloud.</Note>
|
|
192
201
|
*
|
|
@@ -198,7 +207,8 @@ export declare class Agents {
|
|
|
198
207
|
* @example
|
|
199
208
|
* await client.agents.search()
|
|
200
209
|
*/
|
|
201
|
-
search(request?: Letta.AgentsSearchRequest, requestOptions?: Agents.RequestOptions):
|
|
210
|
+
search(request?: Letta.AgentsSearchRequest, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<Letta.AgentsSearchResponse>;
|
|
211
|
+
private __search;
|
|
202
212
|
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
203
213
|
Authorization: string;
|
|
204
214
|
}>;
|