@letta-ai/letta-client 0.1.111 → 0.1.113

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.
Files changed (162) hide show
  1. package/Client.d.ts +0 -3
  2. package/Client.js +6 -11
  3. package/api/resources/agents/client/Client.js +9 -9
  4. package/api/resources/agents/resources/blocks/client/Client.js +5 -5
  5. package/api/resources/agents/resources/context/client/Client.js +1 -1
  6. package/api/resources/agents/resources/coreMemory/client/Client.js +1 -1
  7. package/api/resources/agents/resources/groups/client/Client.js +1 -1
  8. package/api/resources/agents/resources/memoryVariables/client/Client.js +1 -1
  9. package/api/resources/agents/resources/messages/client/Client.js +6 -6
  10. package/api/resources/agents/resources/passages/client/Client.js +4 -4
  11. package/api/resources/agents/resources/sources/client/Client.js +3 -3
  12. package/api/resources/agents/resources/templates/client/Client.js +3 -3
  13. package/api/resources/agents/resources/tools/client/Client.js +3 -3
  14. package/api/resources/batches/client/Client.js +4 -4
  15. package/api/resources/blocks/client/Client.js +5 -5
  16. package/api/resources/blocks/resources/agents/client/Client.js +1 -1
  17. package/api/resources/clientSideAccessTokens/client/Client.js +2 -2
  18. package/api/resources/embeddingModels/client/Client.js +1 -1
  19. package/api/resources/groups/client/Client.js +5 -5
  20. package/api/resources/groups/resources/messages/client/Client.js +5 -5
  21. package/api/resources/health/client/Client.js +1 -1
  22. package/api/resources/identities/client/Client.js +7 -7
  23. package/api/resources/identities/resources/properties/client/Client.js +1 -1
  24. package/api/resources/index.d.ts +0 -1
  25. package/api/resources/index.js +1 -2
  26. package/api/resources/jobs/client/Client.js +4 -4
  27. package/api/resources/models/client/Client.js +1 -1
  28. package/api/resources/projects/client/Client.js +1 -1
  29. package/api/resources/providers/client/Client.js +4 -4
  30. package/api/resources/runs/client/Client.js +4 -4
  31. package/api/resources/runs/resources/messages/client/Client.js +1 -1
  32. package/api/resources/runs/resources/steps/client/Client.js +1 -1
  33. package/api/resources/runs/resources/usage/client/Client.js +1 -1
  34. package/api/resources/sources/client/Client.js +7 -7
  35. package/api/resources/sources/resources/files/client/Client.js +3 -3
  36. package/api/resources/sources/resources/passages/client/Client.js +1 -1
  37. package/api/resources/steps/client/Client.js +2 -2
  38. package/api/resources/tags/client/Client.js +1 -1
  39. package/api/resources/templates/client/Client.js +1 -1
  40. package/api/resources/templates/resources/agents/client/Client.js +1 -1
  41. package/api/resources/tools/client/Client.js +17 -17
  42. package/api/resources/voice/client/Client.js +1 -1
  43. package/api/types/AssistantMessage.d.ts +1 -0
  44. package/api/types/HiddenReasoningMessage.d.ts +1 -0
  45. package/api/types/Message.d.ts +5 -0
  46. package/api/types/ReasoningMessage.d.ts +1 -0
  47. package/api/types/SystemMessage.d.ts +1 -0
  48. package/api/types/ToolCallMessage.d.ts +1 -0
  49. package/api/types/ToolReturnMessage.d.ts +1 -0
  50. package/api/types/UserMessage.d.ts +1 -0
  51. package/dist/Client.d.ts +0 -3
  52. package/dist/Client.js +6 -11
  53. package/dist/api/resources/agents/client/Client.js +9 -9
  54. package/dist/api/resources/agents/resources/blocks/client/Client.js +5 -5
  55. package/dist/api/resources/agents/resources/context/client/Client.js +1 -1
  56. package/dist/api/resources/agents/resources/coreMemory/client/Client.js +1 -1
  57. package/dist/api/resources/agents/resources/groups/client/Client.js +1 -1
  58. package/dist/api/resources/agents/resources/memoryVariables/client/Client.js +1 -1
  59. package/dist/api/resources/agents/resources/messages/client/Client.js +6 -6
  60. package/dist/api/resources/agents/resources/passages/client/Client.js +4 -4
  61. package/dist/api/resources/agents/resources/sources/client/Client.js +3 -3
  62. package/dist/api/resources/agents/resources/templates/client/Client.js +3 -3
  63. package/dist/api/resources/agents/resources/tools/client/Client.js +3 -3
  64. package/dist/api/resources/batches/client/Client.js +4 -4
  65. package/dist/api/resources/blocks/client/Client.js +5 -5
  66. package/dist/api/resources/blocks/resources/agents/client/Client.js +1 -1
  67. package/dist/api/resources/clientSideAccessTokens/client/Client.js +2 -2
  68. package/dist/api/resources/embeddingModels/client/Client.js +1 -1
  69. package/dist/api/resources/groups/client/Client.js +5 -5
  70. package/dist/api/resources/groups/resources/messages/client/Client.js +5 -5
  71. package/dist/api/resources/health/client/Client.js +1 -1
  72. package/dist/api/resources/identities/client/Client.js +7 -7
  73. package/dist/api/resources/identities/resources/properties/client/Client.js +1 -1
  74. package/dist/api/resources/index.d.ts +0 -1
  75. package/dist/api/resources/index.js +1 -2
  76. package/dist/api/resources/jobs/client/Client.js +4 -4
  77. package/dist/api/resources/models/client/Client.js +1 -1
  78. package/dist/api/resources/projects/client/Client.js +1 -1
  79. package/dist/api/resources/providers/client/Client.js +4 -4
  80. package/dist/api/resources/runs/client/Client.js +4 -4
  81. package/dist/api/resources/runs/resources/messages/client/Client.js +1 -1
  82. package/dist/api/resources/runs/resources/steps/client/Client.js +1 -1
  83. package/dist/api/resources/runs/resources/usage/client/Client.js +1 -1
  84. package/dist/api/resources/sources/client/Client.js +7 -7
  85. package/dist/api/resources/sources/resources/files/client/Client.js +3 -3
  86. package/dist/api/resources/sources/resources/passages/client/Client.js +1 -1
  87. package/dist/api/resources/steps/client/Client.js +2 -2
  88. package/dist/api/resources/tags/client/Client.js +1 -1
  89. package/dist/api/resources/templates/client/Client.js +1 -1
  90. package/dist/api/resources/templates/resources/agents/client/Client.js +1 -1
  91. package/dist/api/resources/tools/client/Client.js +17 -17
  92. package/dist/api/resources/voice/client/Client.js +1 -1
  93. package/dist/api/types/AssistantMessage.d.ts +1 -0
  94. package/dist/api/types/HiddenReasoningMessage.d.ts +1 -0
  95. package/dist/api/types/Message.d.ts +5 -0
  96. package/dist/api/types/ReasoningMessage.d.ts +1 -0
  97. package/dist/api/types/SystemMessage.d.ts +1 -0
  98. package/dist/api/types/ToolCallMessage.d.ts +1 -0
  99. package/dist/api/types/ToolReturnMessage.d.ts +1 -0
  100. package/dist/api/types/UserMessage.d.ts +1 -0
  101. package/dist/serialization/resources/index.d.ts +0 -1
  102. package/dist/serialization/resources/index.js +1 -2
  103. package/dist/serialization/types/AssistantMessage.d.ts +1 -0
  104. package/dist/serialization/types/AssistantMessage.js +1 -0
  105. package/dist/serialization/types/HiddenReasoningMessage.d.ts +1 -0
  106. package/dist/serialization/types/HiddenReasoningMessage.js +1 -0
  107. package/dist/serialization/types/ReasoningMessage.d.ts +1 -0
  108. package/dist/serialization/types/ReasoningMessage.js +1 -0
  109. package/dist/serialization/types/SystemMessage.d.ts +1 -0
  110. package/dist/serialization/types/SystemMessage.js +1 -0
  111. package/dist/serialization/types/ToolCallMessage.d.ts +1 -0
  112. package/dist/serialization/types/ToolCallMessage.js +1 -0
  113. package/dist/serialization/types/ToolReturnMessage.d.ts +1 -0
  114. package/dist/serialization/types/ToolReturnMessage.js +1 -0
  115. package/dist/serialization/types/UserMessage.d.ts +1 -0
  116. package/dist/serialization/types/UserMessage.js +1 -0
  117. package/dist/version.d.ts +1 -1
  118. package/dist/version.js +1 -1
  119. package/package.json +1 -1
  120. package/reference.md +0 -57
  121. package/serialization/resources/index.d.ts +0 -1
  122. package/serialization/resources/index.js +1 -2
  123. package/serialization/types/AssistantMessage.d.ts +1 -0
  124. package/serialization/types/AssistantMessage.js +1 -0
  125. package/serialization/types/HiddenReasoningMessage.d.ts +1 -0
  126. package/serialization/types/HiddenReasoningMessage.js +1 -0
  127. package/serialization/types/ReasoningMessage.d.ts +1 -0
  128. package/serialization/types/ReasoningMessage.js +1 -0
  129. package/serialization/types/SystemMessage.d.ts +1 -0
  130. package/serialization/types/SystemMessage.js +1 -0
  131. package/serialization/types/ToolCallMessage.d.ts +1 -0
  132. package/serialization/types/ToolCallMessage.js +1 -0
  133. package/serialization/types/ToolReturnMessage.d.ts +1 -0
  134. package/serialization/types/ToolReturnMessage.js +1 -0
  135. package/serialization/types/UserMessage.d.ts +1 -0
  136. package/serialization/types/UserMessage.js +1 -0
  137. package/version.d.ts +1 -1
  138. package/version.js +1 -1
  139. package/api/resources/embeddings/client/Client.d.ts +0 -42
  140. package/api/resources/embeddings/client/Client.js +0 -133
  141. package/api/resources/embeddings/client/index.d.ts +0 -1
  142. package/api/resources/embeddings/client/index.js +0 -2
  143. package/api/resources/embeddings/index.d.ts +0 -1
  144. package/api/resources/embeddings/index.js +0 -17
  145. package/dist/api/resources/embeddings/client/Client.d.ts +0 -42
  146. package/dist/api/resources/embeddings/client/Client.js +0 -133
  147. package/dist/api/resources/embeddings/client/index.d.ts +0 -1
  148. package/dist/api/resources/embeddings/client/index.js +0 -2
  149. package/dist/api/resources/embeddings/index.d.ts +0 -1
  150. package/dist/api/resources/embeddings/index.js +0 -17
  151. package/dist/serialization/resources/embeddings/client/getEmbeddingsTotalStorageSize.d.ts +0 -9
  152. package/dist/serialization/resources/embeddings/client/getEmbeddingsTotalStorageSize.js +0 -41
  153. package/dist/serialization/resources/embeddings/client/index.d.ts +0 -1
  154. package/dist/serialization/resources/embeddings/client/index.js +0 -37
  155. package/dist/serialization/resources/embeddings/index.d.ts +0 -1
  156. package/dist/serialization/resources/embeddings/index.js +0 -17
  157. package/serialization/resources/embeddings/client/getEmbeddingsTotalStorageSize.d.ts +0 -9
  158. package/serialization/resources/embeddings/client/getEmbeddingsTotalStorageSize.js +0 -41
  159. package/serialization/resources/embeddings/client/index.d.ts +0 -1
  160. package/serialization/resources/embeddings/client/index.js +0 -37
  161. package/serialization/resources/embeddings/index.d.ts +0 -1
  162. package/serialization/resources/embeddings/index.js +0 -17
@@ -14,6 +14,7 @@ export declare namespace ToolCallMessage {
14
14
  message_type: "tool_call_message";
15
15
  otid?: string | null;
16
16
  sender_id?: string | null;
17
+ step_id?: string | null;
17
18
  tool_call: ToolCallMessageToolCall.Raw;
18
19
  }
19
20
  }
@@ -46,5 +46,6 @@ exports.ToolCallMessage = core.serialization.object({
46
46
  messageType: core.serialization.property("message_type", core.serialization.stringLiteral("tool_call_message")),
47
47
  otid: core.serialization.string().optional(),
48
48
  senderId: core.serialization.property("sender_id", core.serialization.string().optional()),
49
+ stepId: core.serialization.property("step_id", core.serialization.string().optional()),
49
50
  toolCall: core.serialization.property("tool_call", ToolCallMessageToolCall_1.ToolCallMessageToolCall),
50
51
  });
@@ -14,6 +14,7 @@ export declare namespace ToolReturnMessage {
14
14
  message_type: "tool_return_message";
15
15
  otid?: string | null;
16
16
  sender_id?: string | null;
17
+ step_id?: string | null;
17
18
  tool_return: string;
18
19
  status: ToolReturnMessageStatus.Raw;
19
20
  tool_call_id: string;
@@ -46,6 +46,7 @@ exports.ToolReturnMessage = core.serialization.object({
46
46
  messageType: core.serialization.property("message_type", core.serialization.stringLiteral("tool_return_message")),
47
47
  otid: core.serialization.string().optional(),
48
48
  senderId: core.serialization.property("sender_id", core.serialization.string().optional()),
49
+ stepId: core.serialization.property("step_id", core.serialization.string().optional()),
49
50
  toolReturn: core.serialization.property("tool_return", core.serialization.string()),
50
51
  status: ToolReturnMessageStatus_1.ToolReturnMessageStatus,
51
52
  toolCallId: core.serialization.property("tool_call_id", core.serialization.string()),
@@ -14,6 +14,7 @@ export declare namespace UserMessage {
14
14
  message_type: "user_message";
15
15
  otid?: string | null;
16
16
  sender_id?: string | null;
17
+ step_id?: string | null;
17
18
  content: UserMessageContent.Raw;
18
19
  }
19
20
  }
@@ -46,5 +46,6 @@ exports.UserMessage = core.serialization.object({
46
46
  messageType: core.serialization.property("message_type", core.serialization.stringLiteral("user_message")),
47
47
  otid: core.serialization.string().optional(),
48
48
  senderId: core.serialization.property("sender_id", core.serialization.string().optional()),
49
+ stepId: core.serialization.property("step_id", core.serialization.string().optional()),
49
50
  content: UserMessageContent_1.UserMessageContent,
50
51
  });
package/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.1.111";
1
+ export declare const SDK_VERSION = "0.1.113";
package/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "0.1.111";
4
+ exports.SDK_VERSION = "0.1.113";
@@ -1,42 +0,0 @@
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
- export declare namespace Embeddings {
7
- interface Options {
8
- environment?: core.Supplier<environments.LettaEnvironment | string>;
9
- /** Specify a custom URL to connect the client to. */
10
- baseUrl?: core.Supplier<string>;
11
- token?: core.Supplier<string | undefined>;
12
- fetcher?: core.FetchFunction;
13
- }
14
- interface RequestOptions {
15
- /** The maximum time to wait for a response in seconds. */
16
- timeoutInSeconds?: number;
17
- /** The number of times to retry the request. Defaults to 2. */
18
- maxRetries?: number;
19
- /** A hook to abort the request. */
20
- abortSignal?: AbortSignal;
21
- /** Additional headers to include in the request. */
22
- headers?: Record<string, string>;
23
- }
24
- }
25
- export declare class Embeddings {
26
- protected readonly _options: Embeddings.Options;
27
- constructor(_options?: Embeddings.Options);
28
- /**
29
- * Get the total size of all embeddings in the database for a user in the storage unit given.
30
- *
31
- * @param {Embeddings.RequestOptions} requestOptions - Request-specific configuration.
32
- *
33
- * @throws {@link Letta.UnprocessableEntityError}
34
- *
35
- * @example
36
- * await client.embeddings.getEmbeddingsTotalStorageSize()
37
- */
38
- getEmbeddingsTotalStorageSize(requestOptions?: Embeddings.RequestOptions): Promise<number>;
39
- protected _getCustomAuthorizationHeaders(): Promise<{
40
- Authorization: string;
41
- }>;
42
- }
@@ -1,133 +0,0 @@
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.Embeddings = 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 Embeddings {
59
- constructor(_options = {}) {
60
- this._options = _options;
61
- }
62
- /**
63
- * Get the total size of all embeddings in the database for a user in the storage unit given.
64
- *
65
- * @param {Embeddings.RequestOptions} requestOptions - Request-specific configuration.
66
- *
67
- * @throws {@link Letta.UnprocessableEntityError}
68
- *
69
- * @example
70
- * await client.embeddings.getEmbeddingsTotalStorageSize()
71
- */
72
- getEmbeddingsTotalStorageSize(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/embeddings/total_storage_size"),
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.111", "User-Agent": "@letta-ai/letta-client/0.1.111", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, "storage-unit": "GB" }, (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.embeddings.getEmbeddingsTotalStorageSize.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/embeddings/total_storage_size.");
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.Embeddings = Embeddings;
@@ -1 +0,0 @@
1
- export {};
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1 +0,0 @@
1
- export * from "./client";
@@ -1,17 +0,0 @@
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);
@@ -1,42 +0,0 @@
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
- export declare namespace Embeddings {
7
- interface Options {
8
- environment?: core.Supplier<environments.LettaEnvironment | string>;
9
- /** Specify a custom URL to connect the client to. */
10
- baseUrl?: core.Supplier<string>;
11
- token?: core.Supplier<string | undefined>;
12
- fetcher?: core.FetchFunction;
13
- }
14
- interface RequestOptions {
15
- /** The maximum time to wait for a response in seconds. */
16
- timeoutInSeconds?: number;
17
- /** The number of times to retry the request. Defaults to 2. */
18
- maxRetries?: number;
19
- /** A hook to abort the request. */
20
- abortSignal?: AbortSignal;
21
- /** Additional headers to include in the request. */
22
- headers?: Record<string, string>;
23
- }
24
- }
25
- export declare class Embeddings {
26
- protected readonly _options: Embeddings.Options;
27
- constructor(_options?: Embeddings.Options);
28
- /**
29
- * Get the total size of all embeddings in the database for a user in the storage unit given.
30
- *
31
- * @param {Embeddings.RequestOptions} requestOptions - Request-specific configuration.
32
- *
33
- * @throws {@link Letta.UnprocessableEntityError}
34
- *
35
- * @example
36
- * await client.embeddings.getEmbeddingsTotalStorageSize()
37
- */
38
- getEmbeddingsTotalStorageSize(requestOptions?: Embeddings.RequestOptions): Promise<number>;
39
- protected _getCustomAuthorizationHeaders(): Promise<{
40
- Authorization: string;
41
- }>;
42
- }
@@ -1,133 +0,0 @@
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.Embeddings = 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 Embeddings {
59
- constructor(_options = {}) {
60
- this._options = _options;
61
- }
62
- /**
63
- * Get the total size of all embeddings in the database for a user in the storage unit given.
64
- *
65
- * @param {Embeddings.RequestOptions} requestOptions - Request-specific configuration.
66
- *
67
- * @throws {@link Letta.UnprocessableEntityError}
68
- *
69
- * @example
70
- * await client.embeddings.getEmbeddingsTotalStorageSize()
71
- */
72
- getEmbeddingsTotalStorageSize(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/embeddings/total_storage_size"),
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.111", "User-Agent": "@letta-ai/letta-client/0.1.111", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, "storage-unit": "GB" }, (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.embeddings.getEmbeddingsTotalStorageSize.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/embeddings/total_storage_size.");
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.Embeddings = Embeddings;
@@ -1 +0,0 @@
1
- export {};
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1 +0,0 @@
1
- export * from "./client";
@@ -1,17 +0,0 @@
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);
@@ -1,9 +0,0 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
4
- import * as serializers from "../../../index";
5
- import * as core from "../../../../core";
6
- export declare const Response: core.serialization.Schema<serializers.embeddings.getEmbeddingsTotalStorageSize.Response.Raw, number>;
7
- export declare namespace Response {
8
- type Raw = number;
9
- }
@@ -1,41 +0,0 @@
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
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.Response = void 0;
40
- const core = __importStar(require("../../../../core"));
41
- exports.Response = core.serialization.number();
@@ -1 +0,0 @@
1
- export * as getEmbeddingsTotalStorageSize from "./getEmbeddingsTotalStorageSize";
@@ -1,37 +0,0 @@
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.getEmbeddingsTotalStorageSize = void 0;
37
- exports.getEmbeddingsTotalStorageSize = __importStar(require("./getEmbeddingsTotalStorageSize"));
@@ -1 +0,0 @@
1
- export * from "./client";
@@ -1,17 +0,0 @@
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);
@@ -1,9 +0,0 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
4
- import * as serializers from "../../../index";
5
- import * as core from "../../../../core";
6
- export declare const Response: core.serialization.Schema<serializers.embeddings.getEmbeddingsTotalStorageSize.Response.Raw, number>;
7
- export declare namespace Response {
8
- type Raw = number;
9
- }
@@ -1,41 +0,0 @@
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
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.Response = void 0;
40
- const core = __importStar(require("../../../../core"));
41
- exports.Response = core.serialization.number();
@@ -1 +0,0 @@
1
- export * as getEmbeddingsTotalStorageSize from "./getEmbeddingsTotalStorageSize";