diff --git a/package.json b/package.json index 6cf72ab..65cb1b4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@letta-ai/letta-client", - "version": "0.1.4", + "version": "0.1.5", "private": false, "repository": "https://github.com/letta-ai/letta-node", "main": "./index.js", diff --git a/reference.md b/reference.md index 71aff84..da5d591 100644 --- a/reference.md +++ b/reference.md @@ -1831,85 +1831,6 @@ await client.agents.getAgentMemoryBlocks("agent_id"); -
client.agents.createAgentMessageAsync(agentId, { ...params }) -> Letta.Job -
-
- -#### 📝 Description - -
-
- -
-
- -Asynchronously process a user message and return a job ID. -The actual processing happens in the background, and the status can be checked using the job ID. - -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```typescript -await client.agents.createAgentMessageAsync("agent_id", { - messages: [ - { - role: "user", - text: "text", - }, - ], -}); -``` - -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**agentId:** `string` - -
-
- -
-
- -**request:** `Letta.LettaRequest` - -
-
- -
-
- -**requestOptions:** `Agents.RequestOptions` - -
-
-
-
- -
-
-
-
client.agents.searchdeployedagents({ ...params }) -> void
@@ -4230,6 +4151,85 @@ for await (const item of response) {
+
client.agents.messages.createAsync(agentId, { ...params }) -> Letta.Job +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Asynchronously process a user message and return a job ID. +The actual processing happens in the background, and the status can be checked using the job ID. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.agents.messages.createAsync("agent_id", { + messages: [ + { + role: "user", + text: "text", + }, + ], +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**agentId:** `string` + +
+
+ +
+
+ +**request:** `Letta.LettaRequest` + +
+
+ +
+
+ +**requestOptions:** `Messages.RequestOptions` + +
+
+
+
+ +
+
+
+ ## Agents Memory Messages
client.agents.memory.messages.listInContext(agentId) -> Letta.LettaSchemasMessageMessage[] diff --git a/src/api/resources/agents/client/Client.ts b/src/api/resources/agents/client/Client.ts index 43ba7cc..a1b6181 100644 --- a/src/api/resources/agents/client/Client.ts +++ b/src/api/resources/agents/client/Client.ts @@ -131,8 +131,8 @@ export class Agents { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -219,8 +219,8 @@ export class Agents { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -299,8 +299,8 @@ export class Agents { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -378,8 +378,8 @@ export class Agents { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -456,8 +456,8 @@ export class Agents { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -541,8 +541,8 @@ export class Agents { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -629,8 +629,8 @@ export class Agents { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -711,8 +711,8 @@ export class Agents { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -771,99 +771,6 @@ export class Agents { } } - /** - * Asynchronously process a user message and return a job ID. - * The actual processing happens in the background, and the status can be checked using the job ID. - * - * @param {string} agentId - * @param {Letta.LettaRequest} request - * @param {Agents.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Letta.UnprocessableEntityError} - * - * @example - * await client.agents.createAgentMessageAsync("agent_id", { - * messages: [{ - * role: "user", - * text: "text" - * }] - * }) - */ - public async createAgentMessageAsync( - agentId: string, - request: Letta.LettaRequest, - requestOptions?: Agents.RequestOptions - ): Promise { - const _response = await (this._options.fetcher ?? core.fetcher)({ - url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.LettaEnvironment.LettaCloud, - `v1/agents/${encodeURIComponent(agentId)}/messages/async` - ), - method: "POST", - headers: { - "X-Fern-Language": "JavaScript", - "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", - "X-Fern-Runtime": core.RUNTIME.type, - "X-Fern-Runtime-Version": core.RUNTIME.version, - ...(await this._getCustomAuthorizationHeaders()), - ...requestOptions?.headers, - }, - contentType: "application/json", - requestType: "json", - body: serializers.LettaRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, - abortSignal: requestOptions?.abortSignal, - }); - if (_response.ok) { - return serializers.Job.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }); - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 422: - throw new Letta.UnprocessableEntityError( - serializers.HttpValidationError.parseOrThrow(_response.error.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }) - ); - default: - throw new errors.LettaError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - }); - } - } - - switch (_response.error.reason) { - case "non-json": - throw new errors.LettaError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - }); - case "timeout": - throw new errors.LettaTimeoutError( - "Timeout exceeded when calling POST /v1/agents/{agent_id}/messages/async." - ); - case "unknown": - throw new errors.LettaError({ - message: _response.error.errorMessage, - }); - } - } - /** * Search deployed agents * @@ -886,8 +793,8 @@ export class Agents { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -961,8 +868,8 @@ export class Agents { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -1042,8 +949,8 @@ export class Agents { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -1132,8 +1039,8 @@ export class Agents { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -1207,8 +1114,8 @@ export class Agents { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), diff --git a/src/api/resources/agents/client/requests/CreateAgentRequest.ts b/src/api/resources/agents/client/requests/CreateAgentRequest.ts index 88473a5..298a030 100644 --- a/src/api/resources/agents/client/requests/CreateAgentRequest.ts +++ b/src/api/resources/agents/client/requests/CreateAgentRequest.ts @@ -60,5 +60,6 @@ export interface CreateAgentRequest { projectId?: string; /** The environment variables for tool execution specific to this agent. */ toolExecEnvironmentVariables?: Record; - userId?: string; + /** The variables that should be set for the agent. */ + variables?: Record; } diff --git a/src/api/resources/agents/resources/archivalMemory/client/Client.ts b/src/api/resources/agents/resources/archivalMemory/client/Client.ts index 68c3565..9f3c55e 100644 --- a/src/api/resources/agents/resources/archivalMemory/client/Client.ts +++ b/src/api/resources/agents/resources/archivalMemory/client/Client.ts @@ -55,8 +55,8 @@ export class ArchivalMemory { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -155,8 +155,8 @@ export class ArchivalMemory { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -242,8 +242,8 @@ export class ArchivalMemory { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -329,8 +329,8 @@ export class ArchivalMemory { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), diff --git a/src/api/resources/agents/resources/context/client/Client.ts b/src/api/resources/agents/resources/context/client/Client.ts index 69ab972..4ccfc54 100644 --- a/src/api/resources/agents/resources/context/client/Client.ts +++ b/src/api/resources/agents/resources/context/client/Client.ts @@ -52,8 +52,8 @@ export class Context { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), diff --git a/src/api/resources/agents/resources/memory/client/Client.ts b/src/api/resources/agents/resources/memory/client/Client.ts index ff69a70..df03dca 100644 --- a/src/api/resources/agents/resources/memory/client/Client.ts +++ b/src/api/resources/agents/resources/memory/client/Client.ts @@ -60,8 +60,8 @@ export class Memory { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), diff --git a/src/api/resources/agents/resources/memory/resources/messages/client/Client.ts b/src/api/resources/agents/resources/memory/resources/messages/client/Client.ts index 83c9938..1823f59 100644 --- a/src/api/resources/agents/resources/memory/resources/messages/client/Client.ts +++ b/src/api/resources/agents/resources/memory/resources/messages/client/Client.ts @@ -55,8 +55,8 @@ export class Messages { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), diff --git a/src/api/resources/agents/resources/memoryBlocks/client/Client.ts b/src/api/resources/agents/resources/memoryBlocks/client/Client.ts index c157c1f..d3d7f50 100644 --- a/src/api/resources/agents/resources/memoryBlocks/client/Client.ts +++ b/src/api/resources/agents/resources/memoryBlocks/client/Client.ts @@ -57,8 +57,8 @@ export class MemoryBlocks { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -146,8 +146,8 @@ export class MemoryBlocks { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), diff --git a/src/api/resources/agents/resources/messages/client/Client.ts b/src/api/resources/agents/resources/messages/client/Client.ts index 220e533..23c6cc8 100644 --- a/src/api/resources/agents/resources/messages/client/Client.ts +++ b/src/api/resources/agents/resources/messages/client/Client.ts @@ -80,8 +80,8 @@ export class Messages { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -171,8 +171,8 @@ export class Messages { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -260,8 +260,8 @@ export class Messages { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -340,8 +340,8 @@ export class Messages { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -412,6 +412,99 @@ export class Messages { } } + /** + * Asynchronously process a user message and return a job ID. + * The actual processing happens in the background, and the status can be checked using the job ID. + * + * @param {string} agentId + * @param {Letta.LettaRequest} request + * @param {Messages.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Letta.UnprocessableEntityError} + * + * @example + * await client.agents.messages.createAsync("agent_id", { + * messages: [{ + * role: "user", + * text: "text" + * }] + * }) + */ + public async createAsync( + agentId: string, + request: Letta.LettaRequest, + requestOptions?: Messages.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.LettaEnvironment.LettaCloud, + `v1/agents/${encodeURIComponent(agentId)}/messages/async` + ), + method: "POST", + headers: { + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@letta-ai/letta-client", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + ...(await this._getCustomAuthorizationHeaders()), + ...requestOptions?.headers, + }, + contentType: "application/json", + requestType: "json", + body: serializers.LettaRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.Job.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 422: + throw new Letta.UnprocessableEntityError( + serializers.HttpValidationError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.LettaError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.LettaError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.LettaTimeoutError( + "Timeout exceeded when calling POST /v1/agents/{agent_id}/messages/async." + ); + case "unknown": + throw new errors.LettaError({ + message: _response.error.errorMessage, + }); + } + } + protected async _getCustomAuthorizationHeaders() { const tokenValue = await core.Supplier.get(this._options.token); return { Authorization: `Bearer ${tokenValue}` }; diff --git a/src/api/resources/agents/resources/messages/client/requests/LettaStreamingRequest.ts b/src/api/resources/agents/resources/messages/client/requests/LettaStreamingRequest.ts index 3f2b24a..34d7b71 100644 --- a/src/api/resources/agents/resources/messages/client/requests/LettaStreamingRequest.ts +++ b/src/api/resources/agents/resources/messages/client/requests/LettaStreamingRequest.ts @@ -16,6 +16,8 @@ import * as Letta from "../../../../../../index"; export interface LettaStreamingRequest { /** The messages to be sent to the agent. */ messages: Letta.MessageCreate[]; + /** Whether the server should parse specific tool call arguments (default `send_message`) as `AssistantMessage` objects. */ + useAssistantMessage?: boolean; /** The name of the designated message tool. */ assistantMessageToolName?: string; /** The name of the message argument in the designated message tool. */ diff --git a/src/api/resources/agents/resources/recallMemory/client/Client.ts b/src/api/resources/agents/resources/recallMemory/client/Client.ts index e086e1c..6959389 100644 --- a/src/api/resources/agents/resources/recallMemory/client/Client.ts +++ b/src/api/resources/agents/resources/recallMemory/client/Client.ts @@ -55,8 +55,8 @@ export class RecallMemory { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), diff --git a/src/api/resources/agents/resources/sources/client/Client.ts b/src/api/resources/agents/resources/sources/client/Client.ts index b3b7de0..d0800b0 100644 --- a/src/api/resources/agents/resources/sources/client/Client.ts +++ b/src/api/resources/agents/resources/sources/client/Client.ts @@ -52,8 +52,8 @@ export class Sources { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), diff --git a/src/api/resources/agents/resources/tools/client/Client.ts b/src/api/resources/agents/resources/tools/client/Client.ts index aa95041..688c1ae 100644 --- a/src/api/resources/agents/resources/tools/client/Client.ts +++ b/src/api/resources/agents/resources/tools/client/Client.ts @@ -52,8 +52,8 @@ export class Tools { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -136,8 +136,8 @@ export class Tools { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -222,8 +222,8 @@ export class Tools { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), diff --git a/src/api/resources/blocks/client/Client.ts b/src/api/resources/blocks/client/Client.ts index a6090ff..635df45 100644 --- a/src/api/resources/blocks/client/Client.ts +++ b/src/api/resources/blocks/client/Client.ts @@ -67,8 +67,8 @@ export class Blocks { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -148,8 +148,8 @@ export class Blocks { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -226,8 +226,8 @@ export class Blocks { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -303,8 +303,8 @@ export class Blocks { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -385,8 +385,8 @@ export class Blocks { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -475,8 +475,8 @@ export class Blocks { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -559,8 +559,8 @@ export class Blocks { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), diff --git a/src/api/resources/health/client/Client.ts b/src/api/resources/health/client/Client.ts index af46fa0..316cae6 100644 --- a/src/api/resources/health/client/Client.ts +++ b/src/api/resources/health/client/Client.ts @@ -47,8 +47,8 @@ export class Health { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), diff --git a/src/api/resources/jobs/client/Client.ts b/src/api/resources/jobs/client/Client.ts index 68c6c7e..de322ca 100644 --- a/src/api/resources/jobs/client/Client.ts +++ b/src/api/resources/jobs/client/Client.ts @@ -58,8 +58,8 @@ export class Jobs { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -137,8 +137,8 @@ export class Jobs { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -216,8 +216,8 @@ export class Jobs { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -295,8 +295,8 @@ export class Jobs { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), diff --git a/src/api/resources/models/client/Client.ts b/src/api/resources/models/client/Client.ts index f700797..69fbc8b 100644 --- a/src/api/resources/models/client/Client.ts +++ b/src/api/resources/models/client/Client.ts @@ -47,8 +47,8 @@ export class Models { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -108,8 +108,8 @@ export class Models { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), diff --git a/src/api/resources/sources/client/Client.ts b/src/api/resources/sources/client/Client.ts index 929d7fc..e62f6be 100644 --- a/src/api/resources/sources/client/Client.ts +++ b/src/api/resources/sources/client/Client.ts @@ -65,8 +65,8 @@ export class Sources { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -144,8 +144,8 @@ export class Sources { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -222,8 +222,8 @@ export class Sources { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -302,8 +302,8 @@ export class Sources { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -380,8 +380,8 @@ export class Sources { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -461,8 +461,8 @@ export class Sources { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -551,8 +551,8 @@ export class Sources { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -643,8 +643,8 @@ export class Sources { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), diff --git a/src/api/resources/sources/resources/files/client/Client.ts b/src/api/resources/sources/resources/files/client/Client.ts index f92c0e3..bf4806c 100644 --- a/src/api/resources/sources/resources/files/client/Client.ts +++ b/src/api/resources/sources/resources/files/client/Client.ts @@ -62,8 +62,8 @@ export class Files { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -160,8 +160,8 @@ export class Files { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -241,8 +241,8 @@ export class Files { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), diff --git a/src/api/resources/sources/resources/passages/client/Client.ts b/src/api/resources/sources/resources/passages/client/Client.ts index 61afbd3..db7a8c9 100644 --- a/src/api/resources/sources/resources/passages/client/Client.ts +++ b/src/api/resources/sources/resources/passages/client/Client.ts @@ -52,8 +52,8 @@ export class Passages { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), diff --git a/src/api/resources/tools/client/Client.ts b/src/api/resources/tools/client/Client.ts index d182b79..4350827 100644 --- a/src/api/resources/tools/client/Client.ts +++ b/src/api/resources/tools/client/Client.ts @@ -52,8 +52,8 @@ export class Tools { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -131,8 +131,8 @@ export class Tools { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -209,8 +209,8 @@ export class Tools { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -289,8 +289,8 @@ export class Tools { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -381,8 +381,8 @@ export class Tools { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -466,8 +466,8 @@ export class Tools { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -551,8 +551,8 @@ export class Tools { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -630,8 +630,8 @@ export class Tools { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -715,8 +715,8 @@ export class Tools { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -794,8 +794,8 @@ export class Tools { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -876,8 +876,8 @@ export class Tools { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -960,8 +960,8 @@ export class Tools { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", - "X-Fern-SDK-Version": "0.1.4", - "User-Agent": "@letta-ai/letta-client/0.1.4", + "X-Fern-SDK-Version": "0.1.5", + "User-Agent": "@letta-ai/letta-client/0.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), diff --git a/src/api/types/AgentEnvironmentVariable.ts b/src/api/types/AgentEnvironmentVariable.ts index 6bbb076..f3e1c75 100644 --- a/src/api/types/AgentEnvironmentVariable.ts +++ b/src/api/types/AgentEnvironmentVariable.ts @@ -19,8 +19,6 @@ export interface AgentEnvironmentVariable { value: string; /** An optional description of the environment variable. */ description?: string; - /** The ID of the organization this environment variable belongs to. */ - organizationId?: string; /** The ID of the agent this environment variable belongs to. */ agentId: string; } diff --git a/src/api/types/AgentState.ts b/src/api/types/AgentState.ts index 8c77f52..0152e4b 100644 --- a/src/api/types/AgentState.ts +++ b/src/api/types/AgentState.ts @@ -43,8 +43,6 @@ export interface AgentState { llmConfig: Letta.LlmConfig; /** The embedding configuration used by the agent. */ embeddingConfig: Letta.EmbeddingConfig; - /** The unique identifier of the organization associated with the agent. */ - organizationId?: string; /** The description of the agent. */ description?: string; /** The metadata of the agent. */ @@ -58,5 +56,5 @@ export interface AgentState { /** The tags associated with the agent. */ tags: string[]; /** The environment variables for tool execution specific to this agent. */ - toolExecEnvironmentVariables: Letta.AgentEnvironmentVariable[]; + toolExecEnvironmentVariables?: Letta.AgentEnvironmentVariable[]; } diff --git a/src/api/types/Block.ts b/src/api/types/Block.ts index a8246e2..2d362eb 100644 --- a/src/api/types/Block.ts +++ b/src/api/types/Block.ts @@ -33,8 +33,6 @@ export interface Block { metadata?: Record; /** The human-friendly ID of the Block */ id?: string; - /** The unique identifier of the organization associated with the block. */ - organizationId?: string; /** The id of the user that made this Block. */ createdById?: string; /** The id of the user that last updated this Block. */ diff --git a/src/api/types/FileMetadata.ts b/src/api/types/FileMetadata.ts index de0fa96..ce4950d 100644 --- a/src/api/types/FileMetadata.ts +++ b/src/api/types/FileMetadata.ts @@ -8,8 +8,6 @@ export interface FileMetadata { /** The human-friendly ID of the File */ id?: string; - /** The unique identifier of the organization associated with the document. */ - organizationId?: string; /** The unique identifier of the source associated with the document. */ sourceId: string; /** The name of the file. */ diff --git a/src/api/types/Job.ts b/src/api/types/Job.ts index 90fdcb4..31c0868 100644 --- a/src/api/types/Job.ts +++ b/src/api/types/Job.ts @@ -31,6 +31,4 @@ export interface Job { metadata?: Record; /** The human-friendly ID of the Job */ id?: string; - /** The unique identifier of the user associated with the job. */ - userId?: string; } diff --git a/src/api/types/LettaRequest.ts b/src/api/types/LettaRequest.ts index 9bd165e..196a4ee 100644 --- a/src/api/types/LettaRequest.ts +++ b/src/api/types/LettaRequest.ts @@ -7,6 +7,8 @@ import * as Letta from "../index"; export interface LettaRequest { /** The messages to be sent to the agent. */ messages: Letta.MessageCreate[]; + /** Whether the server should parse specific tool call arguments (default `send_message`) as `AssistantMessage` objects. */ + useAssistantMessage?: boolean; /** The name of the designated message tool. */ assistantMessageToolName?: string; /** The name of the message argument in the designated message tool. */ diff --git a/src/api/types/LettaSchemasMessageMessage.ts b/src/api/types/LettaSchemasMessageMessage.ts index 960aadb..edd0e32 100644 --- a/src/api/types/LettaSchemasMessageMessage.ts +++ b/src/api/types/LettaSchemasMessageMessage.ts @@ -34,8 +34,6 @@ export interface LettaSchemasMessageMessage { role: Letta.MessageRole; /** The text of the message. */ text?: string; - /** The unique identifier of the organization. */ - organizationId?: string; /** The unique identifier of the agent. */ agentId?: string; /** The model used to make the function call. */ diff --git a/src/api/types/LettaSchemasToolTool.ts b/src/api/types/LettaSchemasToolTool.ts index 8d1398d..3621bc6 100644 --- a/src/api/types/LettaSchemasToolTool.ts +++ b/src/api/types/LettaSchemasToolTool.ts @@ -21,8 +21,6 @@ export interface LettaSchemasToolTool { sourceType?: string; /** The module of the function. */ module?: string; - /** The unique identifier of the organization associated with the tool. */ - organizationId?: string; /** The name of the function. */ name?: string; /** Metadata tags. */ diff --git a/src/api/types/Passage.ts b/src/api/types/Passage.ts index cecfdd8..a9a2e81 100644 --- a/src/api/types/Passage.ts +++ b/src/api/types/Passage.ts @@ -28,8 +28,6 @@ export interface Passage { updatedAt?: Date; /** Whether this passage is deleted or not. */ isDeleted?: boolean; - /** The unique identifier of the user associated with the passage. */ - organizationId?: string; /** The unique identifier of the agent associated with the passage. */ agentId?: string; /** The data source of the passage. */ diff --git a/src/api/types/SandboxConfig.ts b/src/api/types/SandboxConfig.ts index cf198da..5b322b4 100644 --- a/src/api/types/SandboxConfig.ts +++ b/src/api/types/SandboxConfig.ts @@ -17,8 +17,6 @@ export interface SandboxConfig { id?: string; /** The type of sandbox. */ type?: Letta.SandboxType; - /** The unique identifier of the organization associated with the sandbox. */ - organizationId?: string; /** The JSON sandbox settings data. */ config?: Record; } diff --git a/src/api/types/SandboxEnvironmentVariable.ts b/src/api/types/SandboxEnvironmentVariable.ts index 3263cd5..93d8047 100644 --- a/src/api/types/SandboxEnvironmentVariable.ts +++ b/src/api/types/SandboxEnvironmentVariable.ts @@ -19,8 +19,6 @@ export interface SandboxEnvironmentVariable { value: string; /** An optional description of the environment variable. */ description?: string; - /** The ID of the organization this environment variable belongs to. */ - organizationId?: string; /** The ID of the sandbox config this environment variable belongs to. */ sandboxConfigId: string; } diff --git a/src/api/types/Source.ts b/src/api/types/Source.ts index 89ba6d9..30f0ba6 100644 --- a/src/api/types/Source.ts +++ b/src/api/types/Source.ts @@ -24,8 +24,6 @@ export interface Source { description?: string; /** The embedding configuration used by the source. */ embeddingConfig: Letta.EmbeddingConfig; - /** The ID of the organization that created the source. */ - organizationId?: string; /** Metadata associated with the source. */ metadata?: Record; /** The id of the user that made this Tool. */ diff --git a/src/api/types/User.ts b/src/api/types/User.ts index e8f5a75..efa5e65 100644 --- a/src/api/types/User.ts +++ b/src/api/types/User.ts @@ -13,8 +13,6 @@ export interface User { /** The human-friendly ID of the User */ id?: string; - /** The organization id of the user */ - organizationId?: string; /** The name of the user. */ name: string; /** The creation date of the user. */ diff --git a/src/api/types/UserCreate.ts b/src/api/types/UserCreate.ts index f4bfc9a..8997017 100644 --- a/src/api/types/UserCreate.ts +++ b/src/api/types/UserCreate.ts @@ -5,6 +5,4 @@ export interface UserCreate { /** The name of the user. */ name: string; - /** The organization id of the user. */ - organizationId: string; } diff --git a/src/api/types/UserUpdate.ts b/src/api/types/UserUpdate.ts index c7e5dd3..bc503cf 100644 --- a/src/api/types/UserUpdate.ts +++ b/src/api/types/UserUpdate.ts @@ -7,6 +7,4 @@ export interface UserUpdate { id: string; /** The new name of the user. */ name?: string; - /** The new organization id of the user. */ - organizationId?: string; } diff --git a/src/serialization/resources/agents/client/requests/CreateAgentRequest.ts b/src/serialization/resources/agents/client/requests/CreateAgentRequest.ts index 70197c2..7e4a5f7 100644 --- a/src/serialization/resources/agents/client/requests/CreateAgentRequest.ts +++ b/src/serialization/resources/agents/client/requests/CreateAgentRequest.ts @@ -54,7 +54,9 @@ export const CreateAgentRequest: core.serialization.Schema< "tool_exec_environment_variables", core.serialization.record(core.serialization.string(), core.serialization.string().optional()).optional() ), - userId: core.serialization.property("user_id", core.serialization.string().optional()), + variables: core.serialization + .record(core.serialization.string(), core.serialization.string().optional()) + .optional(), }); export declare namespace CreateAgentRequest { @@ -82,6 +84,6 @@ export declare namespace CreateAgentRequest { from_template?: string | null; project_id?: string | null; tool_exec_environment_variables?: Record | null; - user_id?: string | null; + variables?: Record | null; } } diff --git a/src/serialization/resources/agents/resources/messages/client/requests/LettaStreamingRequest.ts b/src/serialization/resources/agents/resources/messages/client/requests/LettaStreamingRequest.ts index 172ec9e..9713805 100644 --- a/src/serialization/resources/agents/resources/messages/client/requests/LettaStreamingRequest.ts +++ b/src/serialization/resources/agents/resources/messages/client/requests/LettaStreamingRequest.ts @@ -12,6 +12,7 @@ export const LettaStreamingRequest: core.serialization.Schema< Letta.agents.LettaStreamingRequest > = core.serialization.object({ messages: core.serialization.list(MessageCreate), + useAssistantMessage: core.serialization.property("use_assistant_message", core.serialization.boolean().optional()), assistantMessageToolName: core.serialization.property( "assistant_message_tool_name", core.serialization.string().optional() @@ -26,6 +27,7 @@ export const LettaStreamingRequest: core.serialization.Schema< export declare namespace LettaStreamingRequest { interface Raw { messages: MessageCreate.Raw[]; + use_assistant_message?: boolean | null; assistant_message_tool_name?: string | null; assistant_message_tool_kwarg?: string | null; stream_tokens?: boolean | null; diff --git a/src/serialization/types/AgentEnvironmentVariable.ts b/src/serialization/types/AgentEnvironmentVariable.ts index 0b57c76..3bd8fc1 100644 --- a/src/serialization/types/AgentEnvironmentVariable.ts +++ b/src/serialization/types/AgentEnvironmentVariable.ts @@ -18,7 +18,6 @@ export const AgentEnvironmentVariable: core.serialization.ObjectSchema< key: core.serialization.string(), value: core.serialization.string(), description: core.serialization.string().optional(), - organizationId: core.serialization.property("organization_id", core.serialization.string().optional()), agentId: core.serialization.property("agent_id", core.serialization.string()), }); @@ -32,7 +31,6 @@ export declare namespace AgentEnvironmentVariable { key: string; value: string; description?: string | null; - organization_id?: string | null; agent_id: string; } } diff --git a/src/serialization/types/AgentState.ts b/src/serialization/types/AgentState.ts index 88be136..f26b209 100644 --- a/src/serialization/types/AgentState.ts +++ b/src/serialization/types/AgentState.ts @@ -34,7 +34,6 @@ export const AgentState: core.serialization.ObjectSchema | null; memory: Memory.Raw; tools: LettaSchemasToolTool.Raw[]; sources: Source.Raw[]; tags: string[]; - tool_exec_environment_variables: AgentEnvironmentVariable.Raw[]; + tool_exec_environment_variables?: AgentEnvironmentVariable.Raw[] | null; } } diff --git a/src/serialization/types/Block.ts b/src/serialization/types/Block.ts index 47684c7..435f110 100644 --- a/src/serialization/types/Block.ts +++ b/src/serialization/types/Block.ts @@ -18,7 +18,6 @@ export const Block: core.serialization.ObjectSchema | null; id?: string | null; - organization_id?: string | null; created_by_id?: string | null; last_updated_by_id?: string | null; } diff --git a/src/serialization/types/FileMetadata.ts b/src/serialization/types/FileMetadata.ts index 0225874..743d07d 100644 --- a/src/serialization/types/FileMetadata.ts +++ b/src/serialization/types/FileMetadata.ts @@ -9,7 +9,6 @@ import * as core from "../../core"; export const FileMetadata: core.serialization.ObjectSchema = core.serialization.object({ id: core.serialization.string().optional(), - organizationId: core.serialization.property("organization_id", core.serialization.string().optional()), sourceId: core.serialization.property("source_id", core.serialization.string()), fileName: core.serialization.property("file_name", core.serialization.string().optional()), filePath: core.serialization.property("file_path", core.serialization.string().optional()), @@ -28,7 +27,6 @@ export const FileMetadata: core.serialization.ObjectSchema | null; id?: string | null; - user_id?: string | null; } } diff --git a/src/serialization/types/LettaRequest.ts b/src/serialization/types/LettaRequest.ts index e94b497..2a787cd 100644 --- a/src/serialization/types/LettaRequest.ts +++ b/src/serialization/types/LettaRequest.ts @@ -10,6 +10,10 @@ import { MessageCreate } from "./MessageCreate"; export const LettaRequest: core.serialization.ObjectSchema = core.serialization.object({ messages: core.serialization.list(MessageCreate), + useAssistantMessage: core.serialization.property( + "use_assistant_message", + core.serialization.boolean().optional() + ), assistantMessageToolName: core.serialization.property( "assistant_message_tool_name", core.serialization.string().optional() @@ -23,6 +27,7 @@ export const LettaRequest: core.serialization.ObjectSchema | null; } } diff --git a/src/serialization/types/SandboxEnvironmentVariable.ts b/src/serialization/types/SandboxEnvironmentVariable.ts index 8c2e316..600e4fe 100644 --- a/src/serialization/types/SandboxEnvironmentVariable.ts +++ b/src/serialization/types/SandboxEnvironmentVariable.ts @@ -18,7 +18,6 @@ export const SandboxEnvironmentVariable: core.serialization.ObjectSchema< key: core.serialization.string(), value: core.serialization.string(), description: core.serialization.string().optional(), - organizationId: core.serialization.property("organization_id", core.serialization.string().optional()), sandboxConfigId: core.serialization.property("sandbox_config_id", core.serialization.string()), }); @@ -32,7 +31,6 @@ export declare namespace SandboxEnvironmentVariable { key: string; value: string; description?: string | null; - organization_id?: string | null; sandbox_config_id: string; } } diff --git a/src/serialization/types/Source.ts b/src/serialization/types/Source.ts index 9d89b9d..b328809 100644 --- a/src/serialization/types/Source.ts +++ b/src/serialization/types/Source.ts @@ -12,7 +12,6 @@ export const Source: core.serialization.ObjectSchema | null; created_by_id?: string | null; last_updated_by_id?: string | null; diff --git a/src/serialization/types/User.ts b/src/serialization/types/User.ts index ffb8a78..9d283d9 100644 --- a/src/serialization/types/User.ts +++ b/src/serialization/types/User.ts @@ -8,7 +8,6 @@ import * as core from "../../core"; export const User: core.serialization.ObjectSchema = core.serialization.object({ id: core.serialization.string().optional(), - organizationId: core.serialization.property("organization_id", core.serialization.string().optional()), name: core.serialization.string(), createdAt: core.serialization.property("created_at", core.serialization.date().optional()), updatedAt: core.serialization.property("updated_at", core.serialization.date().optional()), @@ -18,7 +17,6 @@ export const User: core.serialization.ObjectSchema = core.serialization.object({ name: core.serialization.string(), - organizationId: core.serialization.property("organization_id", core.serialization.string()), }); export declare namespace UserCreate { interface Raw { name: string; - organization_id: string; } } diff --git a/src/serialization/types/UserUpdate.ts b/src/serialization/types/UserUpdate.ts index 93a3c4d..a6c616f 100644 --- a/src/serialization/types/UserUpdate.ts +++ b/src/serialization/types/UserUpdate.ts @@ -10,13 +10,11 @@ export const UserUpdate: core.serialization.ObjectSchema