diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.AgentsCountDeployedAgents.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.AgentsCountDeployedAgents.g.cs
index 1aec37aa..65d51443 100644
--- a/src/libs/Letta/Generated/Letta.AgentsClient.AgentsCountDeployedAgents.g.cs
+++ b/src/libs/Letta/Generated/Letta.AgentsClient.AgentsCountDeployedAgents.g.cs
@@ -74,6 +74,33 @@ partial void ProcessAgentsCountDeployedAgentsResponseContent(
global::Letta.AgentsCountDeployedAgentsCombinator? combinator = default,
global::Letta.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await AgentsCountDeployedAgentsAsResponseAsync(
+ search: search,
+ projectId: projectId,
+ combinator: combinator,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Count Deployed Agents
+ /// Count deployed agents matching search criteria
+ ///
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> AgentsCountDeployedAgentsAsResponseAsync(
+ global::System.Collections.Generic.IList>? search = default,
+ string? projectId = default,
+ global::Letta.AgentsCountDeployedAgentsCombinator? combinator = default,
+ global::Letta.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -105,15 +132,16 @@ partial void ProcessAgentsCountDeployedAgentsResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Letta.PathBuilder(
path: "/v1/agents/search/count",
baseUri: ResolveBaseUri(
servers: s_AgentsCountDeployedAgentsServers,
- defaultBaseUrl: "https://app.letta.com/"));
+ defaultBaseUrl: "https://app.letta.com/"));
__pathBuilder
.AddOptionalParameter("search", search, selector: static x => x.ToString() ?? string.Empty, delimiter: ",", explode: true)
.AddOptionalParameter("project_id", projectId)
- .AddOptionalParameter("combinator", combinator?.ToValueString())
+ .AddOptionalParameter("combinator", combinator?.ToValueString())
;
var __path = __pathBuilder.ToString();
__path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters(
@@ -187,6 +215,8 @@ partial void ProcessAgentsCountDeployedAgentsResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -197,6 +227,11 @@ partial void ProcessAgentsCountDeployedAgentsResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -214,6 +249,8 @@ partial void ProcessAgentsCountDeployedAgentsResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -223,8 +260,7 @@ partial void ProcessAgentsCountDeployedAgentsResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -233,6 +269,11 @@ partial void ProcessAgentsCountDeployedAgentsResponseContent(
__attempt < __maxAttempts &&
global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -249,14 +290,15 @@ partial void ProcessAgentsCountDeployedAgentsResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -296,6 +338,8 @@ partial void ProcessAgentsCountDeployedAgentsResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -316,6 +360,8 @@ partial void ProcessAgentsCountDeployedAgentsResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -340,9 +386,13 @@ partial void ProcessAgentsCountDeployedAgentsResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Letta.AgentsCountDeployedAgentsResponse.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Letta.AgentsCountDeployedAgentsResponse.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -370,9 +420,13 @@ partial void ProcessAgentsCountDeployedAgentsResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Letta.AgentsCountDeployedAgentsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Letta.AgentsCountDeployedAgentsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.AgentsGetAgentVariables.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.AgentsGetAgentVariables.g.cs
index 10d91424..13bde044 100644
--- a/src/libs/Letta/Generated/Letta.AgentsClient.AgentsGetAgentVariables.g.cs
+++ b/src/libs/Letta/Generated/Letta.AgentsClient.AgentsGetAgentVariables.g.cs
@@ -66,6 +66,27 @@ partial void ProcessAgentsGetAgentVariablesResponseContent(
string agentId,
global::Letta.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await AgentsGetAgentVariablesAsResponseAsync(
+ agentId: agentId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Retrieve Memory Variables
+ /// Get the variables associated with an agent
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> AgentsGetAgentVariablesAsResponseAsync(
+ string agentId,
+ global::Letta.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -95,6 +116,7 @@ partial void ProcessAgentsGetAgentVariablesResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Letta.PathBuilder(
path: $"/v1/agents/{agentId}/core-memory/variables",
baseUri: ResolveBaseUri(
@@ -170,6 +192,8 @@ partial void ProcessAgentsGetAgentVariablesResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -180,6 +204,11 @@ partial void ProcessAgentsGetAgentVariablesResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -197,6 +226,8 @@ partial void ProcessAgentsGetAgentVariablesResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -206,8 +237,7 @@ partial void ProcessAgentsGetAgentVariablesResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -216,6 +246,11 @@ partial void ProcessAgentsGetAgentVariablesResponseContent(
__attempt < __maxAttempts &&
global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -232,14 +267,15 @@ partial void ProcessAgentsGetAgentVariablesResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -279,6 +315,8 @@ partial void ProcessAgentsGetAgentVariablesResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -299,6 +337,8 @@ partial void ProcessAgentsGetAgentVariablesResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// 404
@@ -361,9 +401,13 @@ partial void ProcessAgentsGetAgentVariablesResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Letta.AgentsGetAgentVariablesResponse.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Letta.AgentsGetAgentVariablesResponse.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -391,9 +435,13 @@ partial void ProcessAgentsGetAgentVariablesResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Letta.AgentsGetAgentVariablesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Letta.AgentsGetAgentVariablesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.AgentsSearchDeployedAgents.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.AgentsSearchDeployedAgents.g.cs
index 809e1625..1d558515 100644
--- a/src/libs/Letta/Generated/Letta.AgentsClient.AgentsSearchDeployedAgents.g.cs
+++ b/src/libs/Letta/Generated/Letta.AgentsClient.AgentsSearchDeployedAgents.g.cs
@@ -64,6 +64,29 @@ partial void ProcessAgentsSearchDeployedAgentsResponseContent(
///
public async global::System.Threading.Tasks.Task AgentsSearchDeployedAgentsAsync(
+ global::Letta.AgentsSearchDeployedAgentsRequest request,
+ global::Letta.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await AgentsSearchDeployedAgentsAsResponseAsync(
+
+ request: request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Search Deployed Agents
+ /// Search deployed agents
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> AgentsSearchDeployedAgentsAsResponseAsync(
+
global::Letta.AgentsSearchDeployedAgentsRequest request,
global::Letta.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
@@ -98,6 +121,7 @@ partial void ProcessAgentsSearchDeployedAgentsResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Letta.PathBuilder(
path: "/v1/agents/search",
baseUri: ResolveBaseUri(
@@ -179,6 +203,8 @@ partial void ProcessAgentsSearchDeployedAgentsResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -189,6 +215,11 @@ partial void ProcessAgentsSearchDeployedAgentsResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -206,6 +237,8 @@ partial void ProcessAgentsSearchDeployedAgentsResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -215,8 +248,7 @@ partial void ProcessAgentsSearchDeployedAgentsResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -225,6 +257,11 @@ partial void ProcessAgentsSearchDeployedAgentsResponseContent(
__attempt < __maxAttempts &&
global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -241,14 +278,15 @@ partial void ProcessAgentsSearchDeployedAgentsResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -288,6 +326,8 @@ partial void ProcessAgentsSearchDeployedAgentsResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -308,6 +348,8 @@ partial void ProcessAgentsSearchDeployedAgentsResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -332,9 +374,13 @@ partial void ProcessAgentsSearchDeployedAgentsResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Letta.AgentsSearchDeployedAgentsResponse.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Letta.AgentsSearchDeployedAgentsResponse.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -362,9 +408,13 @@ partial void ProcessAgentsSearchDeployedAgentsResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Letta.AgentsSearchDeployedAgentsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Letta.AgentsSearchDeployedAgentsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.AttachArchiveToAgent.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.AttachArchiveToAgent.g.cs
index 4715402a..27a11246 100644
--- a/src/libs/Letta/Generated/Letta.AgentsClient.AttachArchiveToAgent.g.cs
+++ b/src/libs/Letta/Generated/Letta.AgentsClient.AttachArchiveToAgent.g.cs
@@ -72,6 +72,32 @@ partial void ProcessAttachArchiveToAgentResponseContent(
string agentId,
global::Letta.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await AttachArchiveToAgentAsResponseAsync(
+ archiveId: archiveId,
+ agentId: agentId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Attach Archive To Agent
+ /// Attach an archive to an agent.
+ ///
+ ///
+ ///
+ /// The ID of the agent in the format 'agent-<uuid4>'
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> AttachArchiveToAgentAsResponseAsync(
+ string archiveId,
+ string agentId,
+ global::Letta.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -102,6 +128,7 @@ partial void ProcessAttachArchiveToAgentResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Letta.PathBuilder(
path: $"/v1/agents/{agentId}/archives/attach/{archiveId}",
baseUri: ResolveBaseUri(
@@ -178,6 +205,8 @@ partial void ProcessAttachArchiveToAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -188,6 +217,11 @@ partial void ProcessAttachArchiveToAgentResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -205,6 +239,8 @@ partial void ProcessAttachArchiveToAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -214,8 +250,7 @@ partial void ProcessAttachArchiveToAgentResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -224,6 +259,11 @@ partial void ProcessAttachArchiveToAgentResponseContent(
__attempt < __maxAttempts &&
global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -240,14 +280,15 @@ partial void ProcessAttachArchiveToAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -287,6 +328,8 @@ partial void ProcessAttachArchiveToAgentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -307,6 +350,8 @@ partial void ProcessAttachArchiveToAgentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -369,7 +414,11 @@ partial void ProcessAttachArchiveToAgentResponseContent(
{
__response.EnsureSuccessStatusCode();
- return __content;
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __content);
}
catch (global::System.Exception __ex)
{
@@ -397,7 +446,11 @@ partial void ProcessAttachArchiveToAgentResponseContent(
#endif
).ConfigureAwait(false);
- return __content;
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __content);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.AttachCoreMemoryBlock.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.AttachCoreMemoryBlock.g.cs
index 2999cc1c..ac319b1c 100644
--- a/src/libs/Letta/Generated/Letta.AgentsClient.AttachCoreMemoryBlock.g.cs
+++ b/src/libs/Letta/Generated/Letta.AgentsClient.AttachCoreMemoryBlock.g.cs
@@ -74,6 +74,34 @@ partial void ProcessAttachCoreMemoryBlockResponseContent(
string agentId,
global::Letta.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await AttachCoreMemoryBlockAsResponseAsync(
+ blockId: blockId,
+ agentId: agentId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Attach Block To Agent
+ /// Attach a core memory block to an agent.
+ ///
+ ///
+ /// The ID of the block in the format 'block-<uuid4>'
+ ///
+ ///
+ /// The ID of the agent in the format 'agent-<uuid4>'
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> AttachCoreMemoryBlockAsResponseAsync(
+ string blockId,
+ string agentId,
+ global::Letta.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -104,6 +132,7 @@ partial void ProcessAttachCoreMemoryBlockResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Letta.PathBuilder(
path: $"/v1/agents/{agentId}/core-memory/blocks/attach/{blockId}",
baseUri: ResolveBaseUri(
@@ -180,6 +209,8 @@ partial void ProcessAttachCoreMemoryBlockResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -190,6 +221,11 @@ partial void ProcessAttachCoreMemoryBlockResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -207,6 +243,8 @@ partial void ProcessAttachCoreMemoryBlockResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -216,8 +254,7 @@ partial void ProcessAttachCoreMemoryBlockResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -226,6 +263,11 @@ partial void ProcessAttachCoreMemoryBlockResponseContent(
__attempt < __maxAttempts &&
global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -242,14 +284,15 @@ partial void ProcessAttachCoreMemoryBlockResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -289,6 +332,8 @@ partial void ProcessAttachCoreMemoryBlockResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -309,6 +354,8 @@ partial void ProcessAttachCoreMemoryBlockResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -371,9 +418,13 @@ partial void ProcessAttachCoreMemoryBlockResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Letta.AgentState.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Letta.AgentState.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -401,9 +452,13 @@ partial void ProcessAttachCoreMemoryBlockResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Letta.AgentState.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Letta.AgentState.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.AttachFolderToAgent.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.AttachFolderToAgent.g.cs
index 7b3a5ebc..0ea153f9 100644
--- a/src/libs/Letta/Generated/Letta.AgentsClient.AttachFolderToAgent.g.cs
+++ b/src/libs/Letta/Generated/Letta.AgentsClient.AttachFolderToAgent.g.cs
@@ -74,6 +74,34 @@ partial void ProcessAttachFolderToAgentResponseContent(
string agentId,
global::Letta.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await AttachFolderToAgentAsResponseAsync(
+ folderId: folderId,
+ agentId: agentId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Attach Folder To Agent
+ /// Attach a folder to an agent.
+ ///
+ ///
+ /// The ID of the source in the format 'source-<uuid4>'
+ ///
+ ///
+ /// The ID of the agent in the format 'agent-<uuid4>'
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> AttachFolderToAgentAsResponseAsync(
+ string folderId,
+ string agentId,
+ global::Letta.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -104,6 +132,7 @@ partial void ProcessAttachFolderToAgentResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Letta.PathBuilder(
path: $"/v1/agents/{agentId}/folders/attach/{folderId}",
baseUri: ResolveBaseUri(
@@ -180,6 +209,8 @@ partial void ProcessAttachFolderToAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -190,6 +221,11 @@ partial void ProcessAttachFolderToAgentResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -207,6 +243,8 @@ partial void ProcessAttachFolderToAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -216,8 +254,7 @@ partial void ProcessAttachFolderToAgentResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -226,6 +263,11 @@ partial void ProcessAttachFolderToAgentResponseContent(
__attempt < __maxAttempts &&
global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -242,14 +284,15 @@ partial void ProcessAttachFolderToAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -289,6 +332,8 @@ partial void ProcessAttachFolderToAgentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -309,6 +354,8 @@ partial void ProcessAttachFolderToAgentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -371,9 +418,13 @@ partial void ProcessAttachFolderToAgentResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Letta.AgentState.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Letta.AgentState.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -401,9 +452,13 @@ partial void ProcessAttachFolderToAgentResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Letta.AgentState.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Letta.AgentState.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.AttachIdentityToAgent.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.AttachIdentityToAgent.g.cs
index 40f3098a..74909dd9 100644
--- a/src/libs/Letta/Generated/Letta.AgentsClient.AttachIdentityToAgent.g.cs
+++ b/src/libs/Letta/Generated/Letta.AgentsClient.AttachIdentityToAgent.g.cs
@@ -72,6 +72,32 @@ partial void ProcessAttachIdentityToAgentResponseContent(
string agentId,
global::Letta.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await AttachIdentityToAgentAsResponseAsync(
+ identityId: identityId,
+ agentId: agentId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Attach Identity To Agent
+ /// Attach an identity to an agent.
+ ///
+ ///
+ ///
+ /// The ID of the agent in the format 'agent-<uuid4>'
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> AttachIdentityToAgentAsResponseAsync(
+ string identityId,
+ string agentId,
+ global::Letta.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -102,6 +128,7 @@ partial void ProcessAttachIdentityToAgentResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Letta.PathBuilder(
path: $"/v1/agents/{agentId}/identities/attach/{identityId}",
baseUri: ResolveBaseUri(
@@ -178,6 +205,8 @@ partial void ProcessAttachIdentityToAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -188,6 +217,11 @@ partial void ProcessAttachIdentityToAgentResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -205,6 +239,8 @@ partial void ProcessAttachIdentityToAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -214,8 +250,7 @@ partial void ProcessAttachIdentityToAgentResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -224,6 +259,11 @@ partial void ProcessAttachIdentityToAgentResponseContent(
__attempt < __maxAttempts &&
global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -240,14 +280,15 @@ partial void ProcessAttachIdentityToAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -287,6 +328,8 @@ partial void ProcessAttachIdentityToAgentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -307,6 +350,8 @@ partial void ProcessAttachIdentityToAgentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -369,7 +414,11 @@ partial void ProcessAttachIdentityToAgentResponseContent(
{
__response.EnsureSuccessStatusCode();
- return __content;
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __content);
}
catch (global::System.Exception __ex)
{
@@ -397,7 +446,11 @@ partial void ProcessAttachIdentityToAgentResponseContent(
#endif
).ConfigureAwait(false);
- return __content;
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __content);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.AttachToolToAgent.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.AttachToolToAgent.g.cs
index a8a848ae..a8778d35 100644
--- a/src/libs/Letta/Generated/Letta.AgentsClient.AttachToolToAgent.g.cs
+++ b/src/libs/Letta/Generated/Letta.AgentsClient.AttachToolToAgent.g.cs
@@ -74,6 +74,34 @@ partial void ProcessAttachToolToAgentResponseContent(
string agentId,
global::Letta.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await AttachToolToAgentAsResponseAsync(
+ toolId: toolId,
+ agentId: agentId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Attach Tool To Agent
+ /// Attach a tool to an agent.
+ ///
+ ///
+ /// The ID of the tool in the format 'tool-<uuid4>'
+ ///
+ ///
+ /// The ID of the agent in the format 'agent-<uuid4>'
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> AttachToolToAgentAsResponseAsync(
+ string toolId,
+ string agentId,
+ global::Letta.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -104,6 +132,7 @@ partial void ProcessAttachToolToAgentResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Letta.PathBuilder(
path: $"/v1/agents/{agentId}/tools/attach/{toolId}",
baseUri: ResolveBaseUri(
@@ -180,6 +209,8 @@ partial void ProcessAttachToolToAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -190,6 +221,11 @@ partial void ProcessAttachToolToAgentResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -207,6 +243,8 @@ partial void ProcessAttachToolToAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -216,8 +254,7 @@ partial void ProcessAttachToolToAgentResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -226,6 +263,11 @@ partial void ProcessAttachToolToAgentResponseContent(
__attempt < __maxAttempts &&
global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -242,14 +284,15 @@ partial void ProcessAttachToolToAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -289,6 +332,8 @@ partial void ProcessAttachToolToAgentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -309,6 +354,8 @@ partial void ProcessAttachToolToAgentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -371,9 +418,13 @@ partial void ProcessAttachToolToAgentResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Letta.AgentState.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Letta.AgentState.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -401,9 +452,13 @@ partial void ProcessAttachToolToAgentResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Letta.AgentState.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Letta.AgentState.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.CancelMessage.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.CancelMessage.g.cs
index 733e6763..17b94597 100644
--- a/src/libs/Letta/Generated/Letta.AgentsClient.CancelMessage.g.cs
+++ b/src/libs/Letta/Generated/Letta.AgentsClient.CancelMessage.g.cs
@@ -71,6 +71,35 @@ partial void ProcessCancelMessageResponseContent(
public async global::System.Threading.Tasks.Task CancelMessageAsync(
string agentId,
+ global::Letta.CancelAgentRunRequest request,
+ global::Letta.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await CancelMessageAsResponseAsync(
+ agentId: agentId,
+
+ request: request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Cancel Message
+ /// Cancel runs associated with an agent. If run_ids are passed in, cancel those in particular.
+ /// Note to cancel active runs associated with an agent, redis is required.
+ ///
+ ///
+ /// The ID of the agent in the format 'agent-<uuid4>'
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> CancelMessageAsResponseAsync(
+ string agentId,
+
global::Letta.CancelAgentRunRequest request,
global::Letta.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
@@ -106,6 +135,7 @@ partial void ProcessCancelMessageResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Letta.PathBuilder(
path: $"/v1/agents/{agentId}/messages/cancel",
baseUri: ResolveBaseUri(
@@ -188,6 +218,8 @@ partial void ProcessCancelMessageResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -198,6 +230,11 @@ partial void ProcessCancelMessageResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -215,6 +252,8 @@ partial void ProcessCancelMessageResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -224,8 +263,7 @@ partial void ProcessCancelMessageResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -234,6 +272,11 @@ partial void ProcessCancelMessageResponseContent(
__attempt < __maxAttempts &&
global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -250,14 +293,15 @@ partial void ProcessCancelMessageResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -297,6 +341,8 @@ partial void ProcessCancelMessageResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -317,6 +363,8 @@ partial void ProcessCancelMessageResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -379,7 +427,11 @@ partial void ProcessCancelMessageResponseContent(
{
__response.EnsureSuccessStatusCode();
- return __content;
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __content);
}
catch (global::System.Exception __ex)
{
@@ -407,7 +459,11 @@ partial void ProcessCancelMessageResponseContent(
#endif
).ConfigureAwait(false);
- return __content;
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __content);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.CloseAllFilesForAgent.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.CloseAllFilesForAgent.g.cs
index d8086a06..10e4991a 100644
--- a/src/libs/Letta/Generated/Letta.AgentsClient.CloseAllFilesForAgent.g.cs
+++ b/src/libs/Letta/Generated/Letta.AgentsClient.CloseAllFilesForAgent.g.cs
@@ -70,6 +70,31 @@ partial void ProcessCloseAllFilesForAgentResponseContent(
string agentId,
global::Letta.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await CloseAllFilesForAgentAsResponseAsync(
+ agentId: agentId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Close All Files For Agent
+ /// Closes all currently open files for a given agent.
+ /// This endpoint updates the file state for the agent so that no files are marked as open.
+ /// Typically used to reset the working memory view for the agent.
+ ///
+ ///
+ /// The ID of the agent in the format 'agent-<uuid4>'
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task>> CloseAllFilesForAgentAsResponseAsync(
+ string agentId,
+ global::Letta.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -99,6 +124,7 @@ partial void ProcessCloseAllFilesForAgentResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Letta.PathBuilder(
path: $"/v1/agents/{agentId}/files/close-all",
baseUri: ResolveBaseUri(
@@ -174,6 +200,8 @@ partial void ProcessCloseAllFilesForAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -184,6 +212,11 @@ partial void ProcessCloseAllFilesForAgentResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -201,6 +234,8 @@ partial void ProcessCloseAllFilesForAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -210,8 +245,7 @@ partial void ProcessCloseAllFilesForAgentResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -220,6 +254,11 @@ partial void ProcessCloseAllFilesForAgentResponseContent(
__attempt < __maxAttempts &&
global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -236,14 +275,15 @@ partial void ProcessCloseAllFilesForAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -283,6 +323,8 @@ partial void ProcessCloseAllFilesForAgentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -303,6 +345,8 @@ partial void ProcessCloseAllFilesForAgentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -365,9 +409,13 @@ partial void ProcessCloseAllFilesForAgentResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ??
+ var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Letta.AutoSDKHttpResponse>(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -395,9 +443,13 @@ partial void ProcessCloseAllFilesForAgentResponseContent(
#endif
).ConfigureAwait(false);
- return
- (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Letta.AutoSDKHttpResponse>(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.CloseFileForAgent.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.CloseFileForAgent.g.cs
index fb5712c8..450fd93b 100644
--- a/src/libs/Letta/Generated/Letta.AgentsClient.CloseFileForAgent.g.cs
+++ b/src/libs/Letta/Generated/Letta.AgentsClient.CloseFileForAgent.g.cs
@@ -76,6 +76,36 @@ partial void ProcessCloseFileForAgentResponseContent(
string agentId,
global::Letta.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await CloseFileForAgentAsResponseAsync(
+ fileId: fileId,
+ agentId: agentId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Close File For Agent
+ /// Closes a specific file for a given agent.
+ /// This endpoint marks a specific file as closed in the agent's file state.
+ /// The file will be removed from the agent's working memory view.
+ ///
+ ///
+ /// The ID of the file in the format 'file-<uuid4>'
+ ///
+ ///
+ /// The ID of the agent in the format 'agent-<uuid4>'
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> CloseFileForAgentAsResponseAsync(
+ string fileId,
+ string agentId,
+ global::Letta.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -106,6 +136,7 @@ partial void ProcessCloseFileForAgentResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Letta.PathBuilder(
path: $"/v1/agents/{agentId}/files/{fileId}/close",
baseUri: ResolveBaseUri(
@@ -182,6 +213,8 @@ partial void ProcessCloseFileForAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -192,6 +225,11 @@ partial void ProcessCloseFileForAgentResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -209,6 +247,8 @@ partial void ProcessCloseFileForAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -218,8 +258,7 @@ partial void ProcessCloseFileForAgentResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -228,6 +267,11 @@ partial void ProcessCloseFileForAgentResponseContent(
__attempt < __maxAttempts &&
global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -244,14 +288,15 @@ partial void ProcessCloseFileForAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -291,6 +336,8 @@ partial void ProcessCloseFileForAgentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -311,6 +358,8 @@ partial void ProcessCloseFileForAgentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -373,7 +422,11 @@ partial void ProcessCloseFileForAgentResponseContent(
{
__response.EnsureSuccessStatusCode();
- return __content;
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __content);
}
catch (global::System.Exception __ex)
{
@@ -401,7 +454,11 @@ partial void ProcessCloseFileForAgentResponseContent(
#endif
).ConfigureAwait(false);
- return __content;
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __content);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.CountAgents.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.CountAgents.g.cs
index fa8d751f..340ce2bf 100644
--- a/src/libs/Letta/Generated/Letta.AgentsClient.CountAgents.g.cs
+++ b/src/libs/Letta/Generated/Letta.AgentsClient.CountAgents.g.cs
@@ -130,6 +130,81 @@ partial void ProcessCountAgentsResponseContent(
string? createdById = default,
global::Letta.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await CountAgentsAsResponseAsync(
+ name: name,
+ tags: tags,
+ matchAllTags: matchAllTags,
+ queryText: queryText,
+ projectId: projectId,
+ templateId: templateId,
+ baseTemplateId: baseTemplateId,
+ identityId: identityId,
+ identifierKeys: identifierKeys,
+ lastStopReason: lastStopReason,
+ createdById: createdById,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Count Agents
+ /// Get the total number of agents with optional filtering.
+ /// Supports the same filters as list_agents for consistent querying.
+ ///
+ ///
+ /// Name of the agent
+ ///
+ ///
+ /// List of tags to filter agents by
+ ///
+ ///
+ /// If True, only counts agents that match ALL given tags. Otherwise, counts agents that have ANY of the passed-in tags.
+ /// Default Value: false
+ ///
+ ///
+ /// Search agents by name
+ ///
+ ///
+ /// Search agents by project ID - this will default to your default project on cloud
+ ///
+ ///
+ /// Search agents by template ID
+ ///
+ ///
+ /// Search agents by base template ID
+ ///
+ ///
+ /// Search agents by identity ID
+ ///
+ ///
+ /// Search agents by identifier keys
+ ///
+ ///
+ /// Filter agents by their last stop reason.
+ ///
+ ///
+ /// Filter agents by the user who created them.
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> CountAgentsAsResponseAsync(
+ string? name = default,
+ global::System.Collections.Generic.IList? tags = default,
+ bool? matchAllTags = default,
+ string? queryText = default,
+ string? projectId = default,
+ string? templateId = default,
+ string? baseTemplateId = default,
+ string? identityId = default,
+ global::System.Collections.Generic.IList? identifierKeys = default,
+ global::Letta.StopReasonType? lastStopReason = default,
+ string? createdById = default,
+ global::Letta.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -169,11 +244,12 @@ partial void ProcessCountAgentsResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Letta.PathBuilder(
path: "/v1/agents/count",
baseUri: ResolveBaseUri(
servers: s_CountAgentsServers,
- defaultBaseUrl: "https://app.letta.com/"));
+ defaultBaseUrl: "https://app.letta.com/"));
__pathBuilder
.AddOptionalParameter("name", name)
.AddOptionalParameter("tags", tags?.ToString())
@@ -185,7 +261,7 @@ partial void ProcessCountAgentsResponseContent(
.AddOptionalParameter("identity_id", identityId)
.AddOptionalParameter("identifier_keys", identifierKeys?.ToString())
.AddOptionalParameter("last_stop_reason", lastStopReason?.ToString())
- .AddOptionalParameter("created_by_id", createdById)
+ .AddOptionalParameter("created_by_id", createdById)
;
var __path = __pathBuilder.ToString();
__path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters(
@@ -267,6 +343,8 @@ partial void ProcessCountAgentsResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -277,6 +355,11 @@ partial void ProcessCountAgentsResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -294,6 +377,8 @@ partial void ProcessCountAgentsResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -303,8 +388,7 @@ partial void ProcessCountAgentsResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -313,6 +397,11 @@ partial void ProcessCountAgentsResponseContent(
__attempt < __maxAttempts &&
global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -329,14 +418,15 @@ partial void ProcessCountAgentsResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -376,6 +466,8 @@ partial void ProcessCountAgentsResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -396,6 +488,8 @@ partial void ProcessCountAgentsResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -458,9 +552,13 @@ partial void ProcessCountAgentsResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- (int?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(int?), JsonSerializerContext) ??
+ var __value = (int?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(int?), JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -488,9 +586,13 @@ partial void ProcessCountAgentsResponseContent(
#endif
).ConfigureAwait(false);
- return
- (int?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(int?), JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = (int?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(int?), JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.CreateAgent.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.CreateAgent.g.cs
index 270f30c2..4335db1d 100644
--- a/src/libs/Letta/Generated/Letta.AgentsClient.CreateAgent.g.cs
+++ b/src/libs/Letta/Generated/Letta.AgentsClient.CreateAgent.g.cs
@@ -71,6 +71,34 @@ partial void ProcessCreateAgentResponseContent(
///
public async global::System.Threading.Tasks.Task CreateAgentAsync(
+ global::Letta.CreateAgentRequest request,
+ string? xProject = default,
+ global::Letta.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await CreateAgentAsResponseAsync(
+
+ request: request,
+ xProject: xProject,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Create Agent
+ /// Create an agent.
+ ///
+ ///
+ /// The project slug to associate with the agent (cloud only).
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> CreateAgentAsResponseAsync(
+
global::Letta.CreateAgentRequest request,
string? xProject = default,
global::Letta.AutoSDKRequestOptions? requestOptions = default,
@@ -107,6 +135,7 @@ partial void ProcessCreateAgentResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Letta.PathBuilder(
path: "/v1/agents/",
baseUri: ResolveBaseUri(
@@ -195,6 +224,8 @@ partial void ProcessCreateAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -205,6 +236,11 @@ partial void ProcessCreateAgentResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -222,6 +258,8 @@ partial void ProcessCreateAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -231,8 +269,7 @@ partial void ProcessCreateAgentResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -241,6 +278,11 @@ partial void ProcessCreateAgentResponseContent(
__attempt < __maxAttempts &&
global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -257,14 +299,15 @@ partial void ProcessCreateAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -304,6 +347,8 @@ partial void ProcessCreateAgentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -324,6 +369,8 @@ partial void ProcessCreateAgentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -386,9 +433,13 @@ partial void ProcessCreateAgentResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Letta.AgentState.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Letta.AgentState.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -416,9 +467,13 @@ partial void ProcessCreateAgentResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Letta.AgentState.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Letta.AgentState.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.CreateAgentMessageAsync.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.CreateAgentMessageAsync.g.cs
index 3cbf44e0..65483ad0 100644
--- a/src/libs/Letta/Generated/Letta.AgentsClient.CreateAgentMessageAsync.g.cs
+++ b/src/libs/Letta/Generated/Letta.AgentsClient.CreateAgentMessageAsync.g.cs
@@ -77,6 +77,39 @@ partial void ProcessCreateAgentMessageAsyncResponseContent(
public async global::System.Threading.Tasks.Task CreateAgentMessageAsyncAsync(
string agentId,
+ global::Letta.LettaAsyncRequest request,
+ global::Letta.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await CreateAgentMessageAsyncAsResponseAsync(
+ agentId: agentId,
+
+ request: request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Send Message Async
+ /// Asynchronously process a user message and return a run object.
+ /// The actual processing happens in the background, and the status can be checked using the run ID.
+ /// This is "asynchronous" in the sense that it's a background run and explicitly must be fetched by the run ID.
+ /// **Note:** Sending multiple concurrent requests to the same agent can lead to undefined behavior.
+ /// Each agent processes messages sequentially, and concurrent requests may interleave in unexpected ways.
+ /// Wait for each request to complete before sending the next one. Use separate agents or conversations for parallel processing.
+ ///
+ ///
+ /// The ID of the agent in the format 'agent-<uuid4>'
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> CreateAgentMessageAsyncAsResponseAsync(
+ string agentId,
+
global::Letta.LettaAsyncRequest request,
global::Letta.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
@@ -112,6 +145,7 @@ partial void ProcessCreateAgentMessageAsyncResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Letta.PathBuilder(
path: $"/v1/agents/{agentId}/messages/async",
baseUri: ResolveBaseUri(
@@ -194,6 +228,8 @@ partial void ProcessCreateAgentMessageAsyncResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -204,6 +240,11 @@ partial void ProcessCreateAgentMessageAsyncResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -221,6 +262,8 @@ partial void ProcessCreateAgentMessageAsyncResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -230,8 +273,7 @@ partial void ProcessCreateAgentMessageAsyncResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -240,6 +282,11 @@ partial void ProcessCreateAgentMessageAsyncResponseContent(
__attempt < __maxAttempts &&
global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -256,14 +303,15 @@ partial void ProcessCreateAgentMessageAsyncResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -303,6 +351,8 @@ partial void ProcessCreateAgentMessageAsyncResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -323,6 +373,8 @@ partial void ProcessCreateAgentMessageAsyncResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -385,9 +437,13 @@ partial void ProcessCreateAgentMessageAsyncResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Letta.Run.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Letta.Run.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -415,9 +471,13 @@ partial void ProcessCreateAgentMessageAsyncResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Letta.Run.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Letta.Run.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.CreatePassage.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.CreatePassage.g.cs
index 0a577254..3e4ea606 100644
--- a/src/libs/Letta/Generated/Letta.AgentsClient.CreatePassage.g.cs
+++ b/src/libs/Letta/Generated/Letta.AgentsClient.CreatePassage.g.cs
@@ -70,6 +70,34 @@ partial void ProcessCreatePassageResponseContent(
public async global::System.Threading.Tasks.Task> CreatePassageAsync(
string agentId,
+ global::Letta.CreateArchivalMemory request,
+ global::Letta.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await CreatePassageAsResponseAsync(
+ agentId: agentId,
+
+ request: request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Create Passage
+ /// Insert a memory into an agent's archival memory store.
+ ///
+ ///
+ /// The ID of the agent in the format 'agent-<uuid4>'
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task>> CreatePassageAsResponseAsync(
+ string agentId,
+
global::Letta.CreateArchivalMemory request,
global::Letta.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
@@ -105,6 +133,7 @@ partial void ProcessCreatePassageResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Letta.PathBuilder(
path: $"/v1/agents/{agentId}/archival-memory",
baseUri: ResolveBaseUri(
@@ -187,6 +216,8 @@ partial void ProcessCreatePassageResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -197,6 +228,11 @@ partial void ProcessCreatePassageResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -214,6 +250,8 @@ partial void ProcessCreatePassageResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -223,8 +261,7 @@ partial void ProcessCreatePassageResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -233,6 +270,11 @@ partial void ProcessCreatePassageResponseContent(
__attempt < __maxAttempts &&
global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -249,14 +291,15 @@ partial void ProcessCreatePassageResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -296,6 +339,8 @@ partial void ProcessCreatePassageResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -316,6 +361,8 @@ partial void ProcessCreatePassageResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -378,9 +425,13 @@ partial void ProcessCreatePassageResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ??
+ var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Letta.AutoSDKHttpResponse>(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -408,9 +459,13 @@ partial void ProcessCreatePassageResponseContent(
#endif
).ConfigureAwait(false);
- return
- (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Letta.AutoSDKHttpResponse>(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.DeleteAgent.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.DeleteAgent.g.cs
index 1ca700fd..ab05511c 100644
--- a/src/libs/Letta/Generated/Letta.AgentsClient.DeleteAgent.g.cs
+++ b/src/libs/Letta/Generated/Letta.AgentsClient.DeleteAgent.g.cs
@@ -68,6 +68,29 @@ partial void ProcessDeleteAgentResponseContent(
string agentId,
global::Letta.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await DeleteAgentAsResponseAsync(
+ agentId: agentId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Delete Agent
+ /// Delete an agent.
+ ///
+ ///
+ /// The ID of the agent in the format 'agent-<uuid4>'
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> DeleteAgentAsResponseAsync(
+ string agentId,
+ global::Letta.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -97,6 +120,7 @@ partial void ProcessDeleteAgentResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Letta.PathBuilder(
path: $"/v1/agents/{agentId}",
baseUri: ResolveBaseUri(
@@ -172,6 +196,8 @@ partial void ProcessDeleteAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -182,6 +208,11 @@ partial void ProcessDeleteAgentResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -199,6 +230,8 @@ partial void ProcessDeleteAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -208,8 +241,7 @@ partial void ProcessDeleteAgentResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -218,6 +250,11 @@ partial void ProcessDeleteAgentResponseContent(
__attempt < __maxAttempts &&
global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -234,14 +271,15 @@ partial void ProcessDeleteAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -281,6 +319,8 @@ partial void ProcessDeleteAgentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -301,6 +341,8 @@ partial void ProcessDeleteAgentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -363,7 +405,11 @@ partial void ProcessDeleteAgentResponseContent(
{
__response.EnsureSuccessStatusCode();
- return __content;
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __content);
}
catch (global::System.Exception __ex)
{
@@ -391,7 +437,11 @@ partial void ProcessDeleteAgentResponseContent(
#endif
).ConfigureAwait(false);
- return __content;
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __content);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.DeletePassage.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.DeletePassage.g.cs
index 41856376..156bf9cd 100644
--- a/src/libs/Letta/Generated/Letta.AgentsClient.DeletePassage.g.cs
+++ b/src/libs/Letta/Generated/Letta.AgentsClient.DeletePassage.g.cs
@@ -72,6 +72,32 @@ partial void ProcessDeletePassageResponseContent(
string agentId,
global::Letta.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await DeletePassageAsResponseAsync(
+ memoryId: memoryId,
+ agentId: agentId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Delete Passage
+ /// Delete a memory from an agent's archival memory store.
+ ///
+ ///
+ ///
+ /// The ID of the agent in the format 'agent-<uuid4>'
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> DeletePassageAsResponseAsync(
+ string memoryId,
+ string agentId,
+ global::Letta.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -102,6 +128,7 @@ partial void ProcessDeletePassageResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Letta.PathBuilder(
path: $"/v1/agents/{agentId}/archival-memory/{memoryId}",
baseUri: ResolveBaseUri(
@@ -178,6 +205,8 @@ partial void ProcessDeletePassageResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -188,6 +217,11 @@ partial void ProcessDeletePassageResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -205,6 +239,8 @@ partial void ProcessDeletePassageResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -214,8 +250,7 @@ partial void ProcessDeletePassageResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -224,6 +259,11 @@ partial void ProcessDeletePassageResponseContent(
__attempt < __maxAttempts &&
global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -240,14 +280,15 @@ partial void ProcessDeletePassageResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -287,6 +328,8 @@ partial void ProcessDeletePassageResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -307,6 +350,8 @@ partial void ProcessDeletePassageResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -369,7 +414,11 @@ partial void ProcessDeletePassageResponseContent(
{
__response.EnsureSuccessStatusCode();
- return __content;
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __content);
}
catch (global::System.Exception __ex)
{
@@ -397,7 +446,11 @@ partial void ProcessDeletePassageResponseContent(
#endif
).ConfigureAwait(false);
- return __content;
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __content);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.DetachArchiveFromAgent.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.DetachArchiveFromAgent.g.cs
index 4a3ffa3a..48eb4aae 100644
--- a/src/libs/Letta/Generated/Letta.AgentsClient.DetachArchiveFromAgent.g.cs
+++ b/src/libs/Letta/Generated/Letta.AgentsClient.DetachArchiveFromAgent.g.cs
@@ -72,6 +72,32 @@ partial void ProcessDetachArchiveFromAgentResponseContent(
string agentId,
global::Letta.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await DetachArchiveFromAgentAsResponseAsync(
+ archiveId: archiveId,
+ agentId: agentId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Detach Archive From Agent
+ /// Detach an archive from an agent.
+ ///
+ ///
+ ///
+ /// The ID of the agent in the format 'agent-<uuid4>'
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> DetachArchiveFromAgentAsResponseAsync(
+ string archiveId,
+ string agentId,
+ global::Letta.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -102,6 +128,7 @@ partial void ProcessDetachArchiveFromAgentResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Letta.PathBuilder(
path: $"/v1/agents/{agentId}/archives/detach/{archiveId}",
baseUri: ResolveBaseUri(
@@ -178,6 +205,8 @@ partial void ProcessDetachArchiveFromAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -188,6 +217,11 @@ partial void ProcessDetachArchiveFromAgentResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -205,6 +239,8 @@ partial void ProcessDetachArchiveFromAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -214,8 +250,7 @@ partial void ProcessDetachArchiveFromAgentResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -224,6 +259,11 @@ partial void ProcessDetachArchiveFromAgentResponseContent(
__attempt < __maxAttempts &&
global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -240,14 +280,15 @@ partial void ProcessDetachArchiveFromAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -287,6 +328,8 @@ partial void ProcessDetachArchiveFromAgentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -307,6 +350,8 @@ partial void ProcessDetachArchiveFromAgentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -369,7 +414,11 @@ partial void ProcessDetachArchiveFromAgentResponseContent(
{
__response.EnsureSuccessStatusCode();
- return __content;
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __content);
}
catch (global::System.Exception __ex)
{
@@ -397,7 +446,11 @@ partial void ProcessDetachArchiveFromAgentResponseContent(
#endif
).ConfigureAwait(false);
- return __content;
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __content);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.DetachCoreMemoryBlock.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.DetachCoreMemoryBlock.g.cs
index 0356e681..b5603d7d 100644
--- a/src/libs/Letta/Generated/Letta.AgentsClient.DetachCoreMemoryBlock.g.cs
+++ b/src/libs/Letta/Generated/Letta.AgentsClient.DetachCoreMemoryBlock.g.cs
@@ -74,6 +74,34 @@ partial void ProcessDetachCoreMemoryBlockResponseContent(
string agentId,
global::Letta.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await DetachCoreMemoryBlockAsResponseAsync(
+ blockId: blockId,
+ agentId: agentId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Detach Block From Agent
+ /// Detach a core memory block from an agent.
+ ///
+ ///
+ /// The ID of the block in the format 'block-<uuid4>'
+ ///
+ ///
+ /// The ID of the agent in the format 'agent-<uuid4>'
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> DetachCoreMemoryBlockAsResponseAsync(
+ string blockId,
+ string agentId,
+ global::Letta.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -104,6 +132,7 @@ partial void ProcessDetachCoreMemoryBlockResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Letta.PathBuilder(
path: $"/v1/agents/{agentId}/core-memory/blocks/detach/{blockId}",
baseUri: ResolveBaseUri(
@@ -180,6 +209,8 @@ partial void ProcessDetachCoreMemoryBlockResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -190,6 +221,11 @@ partial void ProcessDetachCoreMemoryBlockResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -207,6 +243,8 @@ partial void ProcessDetachCoreMemoryBlockResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -216,8 +254,7 @@ partial void ProcessDetachCoreMemoryBlockResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -226,6 +263,11 @@ partial void ProcessDetachCoreMemoryBlockResponseContent(
__attempt < __maxAttempts &&
global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -242,14 +284,15 @@ partial void ProcessDetachCoreMemoryBlockResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -289,6 +332,8 @@ partial void ProcessDetachCoreMemoryBlockResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -309,6 +354,8 @@ partial void ProcessDetachCoreMemoryBlockResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -371,9 +418,13 @@ partial void ProcessDetachCoreMemoryBlockResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Letta.AgentState.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Letta.AgentState.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -401,9 +452,13 @@ partial void ProcessDetachCoreMemoryBlockResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Letta.AgentState.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Letta.AgentState.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.DetachFolderFromAgent.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.DetachFolderFromAgent.g.cs
index 1b8a7adc..0fffba7d 100644
--- a/src/libs/Letta/Generated/Letta.AgentsClient.DetachFolderFromAgent.g.cs
+++ b/src/libs/Letta/Generated/Letta.AgentsClient.DetachFolderFromAgent.g.cs
@@ -74,6 +74,34 @@ partial void ProcessDetachFolderFromAgentResponseContent(
string agentId,
global::Letta.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await DetachFolderFromAgentAsResponseAsync(
+ folderId: folderId,
+ agentId: agentId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Detach Folder From Agent
+ /// Detach a folder from an agent.
+ ///
+ ///
+ /// The ID of the source in the format 'source-<uuid4>'
+ ///
+ ///
+ /// The ID of the agent in the format 'agent-<uuid4>'
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> DetachFolderFromAgentAsResponseAsync(
+ string folderId,
+ string agentId,
+ global::Letta.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -104,6 +132,7 @@ partial void ProcessDetachFolderFromAgentResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Letta.PathBuilder(
path: $"/v1/agents/{agentId}/folders/detach/{folderId}",
baseUri: ResolveBaseUri(
@@ -180,6 +209,8 @@ partial void ProcessDetachFolderFromAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -190,6 +221,11 @@ partial void ProcessDetachFolderFromAgentResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -207,6 +243,8 @@ partial void ProcessDetachFolderFromAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -216,8 +254,7 @@ partial void ProcessDetachFolderFromAgentResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -226,6 +263,11 @@ partial void ProcessDetachFolderFromAgentResponseContent(
__attempt < __maxAttempts &&
global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -242,14 +284,15 @@ partial void ProcessDetachFolderFromAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -289,6 +332,8 @@ partial void ProcessDetachFolderFromAgentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -309,6 +354,8 @@ partial void ProcessDetachFolderFromAgentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -371,9 +418,13 @@ partial void ProcessDetachFolderFromAgentResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Letta.AgentState.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Letta.AgentState.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -401,9 +452,13 @@ partial void ProcessDetachFolderFromAgentResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Letta.AgentState.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Letta.AgentState.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.DetachIdentityFromAgent.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.DetachIdentityFromAgent.g.cs
index d4e7de5a..8a628f30 100644
--- a/src/libs/Letta/Generated/Letta.AgentsClient.DetachIdentityFromAgent.g.cs
+++ b/src/libs/Letta/Generated/Letta.AgentsClient.DetachIdentityFromAgent.g.cs
@@ -72,6 +72,32 @@ partial void ProcessDetachIdentityFromAgentResponseContent(
string agentId,
global::Letta.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await DetachIdentityFromAgentAsResponseAsync(
+ identityId: identityId,
+ agentId: agentId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Detach Identity From Agent
+ /// Detach an identity from an agent.
+ ///
+ ///
+ ///
+ /// The ID of the agent in the format 'agent-<uuid4>'
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> DetachIdentityFromAgentAsResponseAsync(
+ string identityId,
+ string agentId,
+ global::Letta.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -102,6 +128,7 @@ partial void ProcessDetachIdentityFromAgentResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Letta.PathBuilder(
path: $"/v1/agents/{agentId}/identities/detach/{identityId}",
baseUri: ResolveBaseUri(
@@ -178,6 +205,8 @@ partial void ProcessDetachIdentityFromAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -188,6 +217,11 @@ partial void ProcessDetachIdentityFromAgentResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -205,6 +239,8 @@ partial void ProcessDetachIdentityFromAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -214,8 +250,7 @@ partial void ProcessDetachIdentityFromAgentResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -224,6 +259,11 @@ partial void ProcessDetachIdentityFromAgentResponseContent(
__attempt < __maxAttempts &&
global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -240,14 +280,15 @@ partial void ProcessDetachIdentityFromAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -287,6 +328,8 @@ partial void ProcessDetachIdentityFromAgentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -307,6 +350,8 @@ partial void ProcessDetachIdentityFromAgentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -369,7 +414,11 @@ partial void ProcessDetachIdentityFromAgentResponseContent(
{
__response.EnsureSuccessStatusCode();
- return __content;
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __content);
}
catch (global::System.Exception __ex)
{
@@ -397,7 +446,11 @@ partial void ProcessDetachIdentityFromAgentResponseContent(
#endif
).ConfigureAwait(false);
- return __content;
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __content);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.DetachToolFromAgent.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.DetachToolFromAgent.g.cs
index c05877ba..5745f2fc 100644
--- a/src/libs/Letta/Generated/Letta.AgentsClient.DetachToolFromAgent.g.cs
+++ b/src/libs/Letta/Generated/Letta.AgentsClient.DetachToolFromAgent.g.cs
@@ -74,6 +74,34 @@ partial void ProcessDetachToolFromAgentResponseContent(
string agentId,
global::Letta.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await DetachToolFromAgentAsResponseAsync(
+ toolId: toolId,
+ agentId: agentId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Detach Tool From Agent
+ /// Detach a tool from an agent.
+ ///
+ ///
+ /// The ID of the tool in the format 'tool-<uuid4>'
+ ///
+ ///
+ /// The ID of the agent in the format 'agent-<uuid4>'
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> DetachToolFromAgentAsResponseAsync(
+ string toolId,
+ string agentId,
+ global::Letta.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -104,6 +132,7 @@ partial void ProcessDetachToolFromAgentResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Letta.PathBuilder(
path: $"/v1/agents/{agentId}/tools/detach/{toolId}",
baseUri: ResolveBaseUri(
@@ -180,6 +209,8 @@ partial void ProcessDetachToolFromAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -190,6 +221,11 @@ partial void ProcessDetachToolFromAgentResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -207,6 +243,8 @@ partial void ProcessDetachToolFromAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -216,8 +254,7 @@ partial void ProcessDetachToolFromAgentResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -226,6 +263,11 @@ partial void ProcessDetachToolFromAgentResponseContent(
__attempt < __maxAttempts &&
global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -242,14 +284,15 @@ partial void ProcessDetachToolFromAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -289,6 +332,8 @@ partial void ProcessDetachToolFromAgentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -309,6 +354,8 @@ partial void ProcessDetachToolFromAgentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -371,9 +418,13 @@ partial void ProcessDetachToolFromAgentResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Letta.AgentState.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Letta.AgentState.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -401,9 +452,13 @@ partial void ProcessDetachToolFromAgentResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Letta.AgentState.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Letta.AgentState.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.ExportAgent.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.ExportAgent.g.cs
index ed86a782..86b008eb 100644
--- a/src/libs/Letta/Generated/Letta.AgentsClient.ExportAgent.g.cs
+++ b/src/libs/Letta/Generated/Letta.AgentsClient.ExportAgent.g.cs
@@ -92,6 +92,54 @@ partial void ProcessExportAgentResponseContent(
public async global::System.Threading.Tasks.Task ExportAgentAsync(
string agentId,
+ global::Letta.BodyExportAgent request,
+ int? maxSteps = default,
+ bool? useLegacyFormat = default,
+ string? conversationId = default,
+ bool? scrubMessages = default,
+ global::Letta.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await ExportAgentAsResponseAsync(
+ agentId: agentId,
+
+ request: request,
+ maxSteps: maxSteps,
+ useLegacyFormat: useLegacyFormat,
+ conversationId: conversationId,
+ scrubMessages: scrubMessages,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Export Agent
+ /// Export the serialized JSON representation of an agent, formatted with indentation.
+ ///
+ ///
+ ///
+ /// Default Value: 100
+ ///
+ ///
+ /// If True, exports using the legacy single-agent 'v1' format with inline tools/blocks. If False, exports using the new multi-entity 'v2' format, with separate agents, tools, blocks, files, etc.
+ /// Default Value: false
+ ///
+ ///
+ /// Conversation ID to export. If provided, uses messages from this conversation instead of the agent's global message history.
+ ///
+ ///
+ /// If True, excludes all messages from the export. Useful for sharing agent configs without conversation history.
+ /// Default Value: false
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> ExportAgentAsResponseAsync(
+ string agentId,
+
global::Letta.BodyExportAgent request,
int? maxSteps = default,
bool? useLegacyFormat = default,
@@ -135,16 +183,17 @@ partial void ProcessExportAgentResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Letta.PathBuilder(
path: $"/v1/agents/{agentId}/export",
baseUri: ResolveBaseUri(
servers: s_ExportAgentServers,
- defaultBaseUrl: "https://app.letta.com/"));
+ defaultBaseUrl: "https://app.letta.com/"));
__pathBuilder
.AddOptionalParameter("max_steps", maxSteps?.ToString())
.AddOptionalParameter("use_legacy_format", useLegacyFormat?.ToString().ToLowerInvariant())
.AddOptionalParameter("conversation_id", conversationId)
- .AddOptionalParameter("scrub_messages", scrubMessages?.ToString().ToLowerInvariant())
+ .AddOptionalParameter("scrub_messages", scrubMessages?.ToString().ToLowerInvariant())
;
var __path = __pathBuilder.ToString();
__path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters(
@@ -227,6 +276,8 @@ partial void ProcessExportAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -237,6 +288,11 @@ partial void ProcessExportAgentResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -254,6 +310,8 @@ partial void ProcessExportAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -263,8 +321,7 @@ partial void ProcessExportAgentResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -273,6 +330,11 @@ partial void ProcessExportAgentResponseContent(
__attempt < __maxAttempts &&
global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -289,14 +351,15 @@ partial void ProcessExportAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -336,6 +399,8 @@ partial void ProcessExportAgentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -356,6 +421,8 @@ partial void ProcessExportAgentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -418,7 +485,11 @@ partial void ProcessExportAgentResponseContent(
{
__response.EnsureSuccessStatusCode();
- return __content;
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __content);
}
catch (global::System.Exception __ex)
{
@@ -446,7 +517,11 @@ partial void ProcessExportAgentResponseContent(
#endif
).ConfigureAwait(false);
- return __content;
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __content);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.ExportAgentWithSkills.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.ExportAgentWithSkills.g.cs
index e8cfb0d0..e6a48ccf 100644
--- a/src/libs/Letta/Generated/Letta.AgentsClient.ExportAgentWithSkills.g.cs
+++ b/src/libs/Letta/Generated/Letta.AgentsClient.ExportAgentWithSkills.g.cs
@@ -70,6 +70,34 @@ partial void ProcessExportAgentWithSkillsResponseContent(
public async global::System.Threading.Tasks.Task ExportAgentWithSkillsAsync(
string agentId,
+ global::Letta.ExportAgentRequest request,
+ global::Letta.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await ExportAgentWithSkillsAsResponseAsync(
+ agentId: agentId,
+
+ request: request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Export Agent With Skills
+ /// Export the serialized JSON representation of an agent with optional skills.
+ /// This POST endpoint allows including skills in the export by providing them in the request body.
+ /// Skills are resolved client-side and passed as SkillSchema objects containing the skill files.
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> ExportAgentWithSkillsAsResponseAsync(
+ string agentId,
+
global::Letta.ExportAgentRequest request,
global::Letta.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
@@ -105,6 +133,7 @@ partial void ProcessExportAgentWithSkillsResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Letta.PathBuilder(
path: $"/v1/agents/{agentId}/export",
baseUri: ResolveBaseUri(
@@ -187,6 +216,8 @@ partial void ProcessExportAgentWithSkillsResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -197,6 +228,11 @@ partial void ProcessExportAgentWithSkillsResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -214,6 +250,8 @@ partial void ProcessExportAgentWithSkillsResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -223,8 +261,7 @@ partial void ProcessExportAgentWithSkillsResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -233,6 +270,11 @@ partial void ProcessExportAgentWithSkillsResponseContent(
__attempt < __maxAttempts &&
global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -249,14 +291,15 @@ partial void ProcessExportAgentWithSkillsResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -296,6 +339,8 @@ partial void ProcessExportAgentWithSkillsResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -316,6 +361,8 @@ partial void ProcessExportAgentWithSkillsResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -378,7 +425,11 @@ partial void ProcessExportAgentWithSkillsResponseContent(
{
__response.EnsureSuccessStatusCode();
- return __content;
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __content);
}
catch (global::System.Exception __ex)
{
@@ -406,7 +457,11 @@ partial void ProcessExportAgentWithSkillsResponseContent(
#endif
).ConfigureAwait(false);
- return __content;
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __content);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.GenerateCompletion.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.GenerateCompletion.g.cs
index 3bb6b8d9..e81fe514 100644
--- a/src/libs/Letta/Generated/Letta.AgentsClient.GenerateCompletion.g.cs
+++ b/src/libs/Letta/Generated/Letta.AgentsClient.GenerateCompletion.g.cs
@@ -85,6 +85,49 @@ partial void ProcessGenerateCompletionResponseContent(
public async global::System.Threading.Tasks.Task GenerateCompletionAsync(
string agentId,
+ global::Letta.GenerateRequest request,
+ global::Letta.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await GenerateCompletionAsResponseAsync(
+ agentId: agentId,
+
+ request: request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Generate Completion
+ /// Generate a completion directly from the LLM provider using the agent's configuration.
+ /// This endpoint makes a direct request to the LLM provider without any agent processing:
+ /// - No memory or context retrieval
+ /// - No tool calling
+ /// - No message persistence
+ /// - No agent state modification
+ /// Simply provide a prompt, and the endpoint formats it as a user message.
+ /// Optionally include a system_prompt for context/instructions.
+ /// The agent's LLM configuration (model, credentials, settings) is used by default.
+ /// Use override_model to switch to a different model/provider while still using
+ /// the organization's configured providers.
+ /// Example use cases:
+ /// - Quick LLM queries without agent overhead
+ /// - Testing different models with the same prompt
+ /// - Simple chat completions using agent's credentials
+ /// - Comparing model outputs on identical prompts
+ ///
+ ///
+ /// The ID of the agent in the format 'agent-<uuid4>'
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> GenerateCompletionAsResponseAsync(
+ string agentId,
+
global::Letta.GenerateRequest request,
global::Letta.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
@@ -120,6 +163,7 @@ partial void ProcessGenerateCompletionResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Letta.PathBuilder(
path: $"/v1/agents/{agentId}/generate",
baseUri: ResolveBaseUri(
@@ -202,6 +246,8 @@ partial void ProcessGenerateCompletionResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -212,6 +258,11 @@ partial void ProcessGenerateCompletionResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -229,6 +280,8 @@ partial void ProcessGenerateCompletionResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -238,8 +291,7 @@ partial void ProcessGenerateCompletionResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -248,6 +300,11 @@ partial void ProcessGenerateCompletionResponseContent(
__attempt < __maxAttempts &&
global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -264,14 +321,15 @@ partial void ProcessGenerateCompletionResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -311,6 +369,8 @@ partial void ProcessGenerateCompletionResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -331,6 +391,8 @@ partial void ProcessGenerateCompletionResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
//
@@ -454,9 +516,13 @@ partial void ProcessGenerateCompletionResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Letta.GenerateResponse.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Letta.GenerateResponse.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -484,9 +550,13 @@ partial void ProcessGenerateCompletionResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Letta.GenerateResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Letta.GenerateResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.ImportAgent.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.ImportAgent.g.cs
index 2a64b21a..fd0efca5 100644
--- a/src/libs/Letta/Generated/Letta.AgentsClient.ImportAgent.g.cs
+++ b/src/libs/Letta/Generated/Letta.AgentsClient.ImportAgent.g.cs
@@ -70,6 +70,33 @@ partial void ProcessImportAgentResponseContent(
///
public async global::System.Threading.Tasks.Task ImportAgentAsync(
+ global::Letta.BodyImportAgent request,
+ string? xOverrideEmbeddingModel = default,
+ global::Letta.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await ImportAgentAsResponseAsync(
+
+ request: request,
+ xOverrideEmbeddingModel: xOverrideEmbeddingModel,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Import Agent
+ /// Import a serialized agent file and recreate the agent(s) in the system.
+ /// Returns the IDs of all imported agents.
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> ImportAgentAsResponseAsync(
+
global::Letta.BodyImportAgent request,
string? xOverrideEmbeddingModel = default,
global::Letta.AutoSDKRequestOptions? requestOptions = default,
@@ -102,10 +129,11 @@ partial void ProcessImportAgentResponseContent(
var __maxAttempts = global::Letta.AutoSDKRequestOptionsSupport.GetMaxAttempts(
clientOptions: Options,
requestOptions: requestOptions,
- supportsRetry: true);
+ supportsRetry: false);
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Letta.PathBuilder(
path: "/v1/agents/import",
baseUri: ResolveBaseUri(
@@ -146,6 +174,7 @@ partial void ProcessImportAgentResponseContent(
__httpRequest.Headers.TryAddWithoutValidation("x-override-embedding-model", xOverrideEmbeddingModel.ToString());
}
+
var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent();
if (xOverrideEmbeddingModel != default)
{
@@ -153,6 +182,7 @@ partial void ProcessImportAgentResponseContent(
__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent(xOverrideEmbeddingModel ?? string.Empty),
name: "\"x-override-embedding-model\"");
+
}
var __contentFile = new global::System.Net.Http.ByteArrayContent(request.File ?? global::System.Array.Empty());
__contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue(
@@ -191,91 +221,106 @@ request.Filename is null
{
__contentFile.Headers.ContentDisposition.FileNameStar = null;
}
+
if (request.OverrideExistingTools != default)
{
__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.OverrideExistingTools, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()),
name: "\"override_existing_tools\"");
- }
+
+ }
if (request.StripMessages != default)
{
__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.StripMessages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()),
name: "\"strip_messages\"");
- }
+
+ }
if (request.Secrets != default)
{
__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent(request.Secrets ?? string.Empty),
name: "\"secrets\"");
- }
+
+ }
if (request.Name != default)
{
__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent(request.Name ?? string.Empty),
name: "\"name\"");
- }
+
+ }
if (request.Embedding != default)
{
__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent(request.Embedding ?? string.Empty),
name: "\"embedding\"");
- }
+
+ }
if (request.Model != default)
{
__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent(request.Model ?? string.Empty),
name: "\"model\"");
- }
+
+ }
if (request.AppendCopySuffix != default)
{
__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.AppendCopySuffix, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()),
name: "\"append_copy_suffix\"");
- }
+
+ }
if (request.OverrideName != default)
{
__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent(request.OverrideName ?? string.Empty),
name: "\"override_name\"");
- }
+
+ }
if (request.OverrideEmbeddingHandle != default)
{
__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent(request.OverrideEmbeddingHandle ?? string.Empty),
name: "\"override_embedding_handle\"");
- }
+
+ }
if (request.OverrideModelHandle != default)
{
__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent(request.OverrideModelHandle ?? string.Empty),
name: "\"override_model_handle\"");
- }
+
+ }
if (request.ProjectId != default)
{
__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent(request.ProjectId ?? string.Empty),
name: "\"project_id\"");
- }
+
+ }
if (request.EnvVarsJson != default)
{
__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent(request.EnvVarsJson ?? string.Empty),
name: "\"env_vars_json\"");
+
}
+
__httpRequest.Content = __httpRequestContent;
+
global::Letta.AutoSDKRequestOptionsSupport.ApplyHeaders(
request: __httpRequest,
clientHeaders: Options.Headers,
@@ -318,6 +363,8 @@ request.Filename is null
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -328,6 +375,11 @@ request.Filename is null
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -345,6 +397,8 @@ request.Filename is null
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -354,8 +408,7 @@ request.Filename is null
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -364,6 +417,11 @@ request.Filename is null
__attempt < __maxAttempts &&
global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -380,14 +438,15 @@ request.Filename is null
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -427,6 +486,8 @@ request.Filename is null
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -447,6 +508,8 @@ request.Filename is null
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -509,9 +572,13 @@ request.Filename is null
{
__response.EnsureSuccessStatusCode();
- return
- global::Letta.ImportedAgentsResponse.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Letta.ImportedAgentsResponse.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -539,9 +606,13 @@ request.Filename is null
#endif
).ConfigureAwait(false);
- return
- await global::Letta.ImportedAgentsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Letta.ImportedAgentsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -641,5 +712,1208 @@ request.Filename is null
requestOptions: requestOptions,
cancellationToken: cancellationToken).ConfigureAwait(false);
}
+
+ ///
+ /// Import Agent
+ /// Import a serialized agent file and recreate the agent(s) in the system.
+ /// Returns the IDs of all imported agents.
+ ///
+ ///
+ ///
+ /// The stream to send as the multipart 'file' file part.
+ ///
+ ///
+ ///
+ /// If set to True, existing tools can get their source code overwritten by the uploaded tool definitions. Note that Letta core tools can never be updated externally.
+ /// Default Value: true
+ ///
+ ///
+ /// If set to True, strips all messages from the agent before importing.
+ /// Default Value: false
+ ///
+ ///
+ /// Secrets as a JSON string to pass to the agent for tool execution.
+ ///
+ ///
+ /// If provided, overrides the agent name with this value.
+ ///
+ ///
+ /// Embedding handle to override with.
+ ///
+ ///
+ /// Model handle to override the agent's default model. This allows the imported agent to use a different model while keeping other defaults (e.g., context size) from the original configuration.
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task ImportAgentAsync(
+ global::System.IO.Stream file,
+ string filename,
+ string? xOverrideEmbeddingModel = default,
+ bool? overrideExistingTools = default,
+ bool? stripMessages = default,
+ string? secrets = default,
+ string? name = default,
+ string? embedding = default,
+ string? model = default,
+ global::Letta.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+
+ file = file ?? throw new global::System.ArgumentNullException(nameof(file));
+ var request = new global::Letta.BodyImportAgent
+ {
+ File = global::System.Array.Empty(),
+ Filename = filename,
+ OverrideExistingTools = overrideExistingTools,
+ StripMessages = stripMessages,
+ Secrets = secrets,
+ Name = name,
+ Embedding = embedding,
+ Model = model,
+ };
+ PrepareArguments(
+ client: HttpClient);
+ PrepareImportAgentArguments(
+ httpClient: HttpClient,
+ xOverrideEmbeddingModel: ref xOverrideEmbeddingModel,
+ request: request);
+
+
+ var __authorizations = global::Letta.EndPointSecurityResolver.ResolveAuthorizations(
+ availableAuthorizations: Authorizations,
+ securityRequirements: s_ImportAgentSecurityRequirements,
+ operationName: "ImportAgentAsync");
+
+ using var __timeoutCancellationTokenSource = global::Letta.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken);
+ var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
+ var __effectiveReadResponseAsString = global::Letta.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ fallbackValue: ReadResponseAsString);
+ var __maxAttempts = global::Letta.AutoSDKRequestOptionsSupport.GetMaxAttempts(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ supportsRetry: false);
+
+ global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
+ {
+
+ var __pathBuilder = new global::Letta.PathBuilder(
+ path: "/v1/agents/import",
+ baseUri: ResolveBaseUri(
+ servers: s_ImportAgentServers,
+ defaultBaseUrl: "https://app.letta.com/"));
+ var __path = __pathBuilder.ToString();
+ __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters(
+ path: __path,
+ clientParameters: Options.QueryParameters,
+ requestParameters: requestOptions?.QueryParameters);
+ var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
+ method: global::System.Net.Http.HttpMethod.Post,
+ requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute));
+#if NET6_0_OR_GREATER
+ __httpRequest.Version = global::System.Net.HttpVersion.Version11;
+ __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher;
+#endif
+
+ foreach (var __authorization in __authorizations)
+ {
+ if (__authorization.Type == "Http" ||
+ __authorization.Type == "OAuth2" ||
+ __authorization.Type == "OpenIdConnect")
+ {
+ __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue(
+ scheme: __authorization.Name,
+ parameter: __authorization.Value);
+ }
+ else if (__authorization.Type == "ApiKey" &&
+ __authorization.Location == "Header")
+ {
+ __httpRequest.Headers.Add(__authorization.Name, __authorization.Value);
+ }
+ }
+
+ if (xOverrideEmbeddingModel != default)
+ {
+ __httpRequest.Headers.TryAddWithoutValidation("x-override-embedding-model", xOverrideEmbeddingModel.ToString());
+ }
+
+
+ var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent();
+ if (xOverrideEmbeddingModel != default)
+ {
+
+ __httpRequestContent.Add(
+ content: new global::System.Net.Http.StringContent(xOverrideEmbeddingModel ?? string.Empty),
+ name: "\"x-override-embedding-model\"");
+
+ }
+ var __contentFile = new global::System.Net.Http.StreamContent(file);
+ __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue(
+ request.Filename is null
+ ? "application/octet-stream"
+ : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch
+ {
+ ".aac" => "audio/aac",
+ ".flac" => "audio/flac",
+ ".gif" => "image/gif",
+ ".jpeg" => "image/jpeg",
+ ".jpg" => "image/jpeg",
+ ".json" => "application/json",
+ ".m4a" => "audio/mp4",
+ ".mp3" => "audio/mpeg",
+ ".mp4" => "video/mp4",
+ ".mpeg" => "audio/mpeg",
+ ".mpga" => "audio/mpeg",
+ ".oga" => "audio/ogg",
+ ".ogg" => "audio/ogg",
+ ".opus" => "audio/ogg",
+ ".pdf" => "application/pdf",
+ ".png" => "image/png",
+ ".txt" => "text/plain",
+ ".wav" => "audio/wav",
+ ".weba" => "audio/webm",
+ ".webm" => "video/webm",
+ ".webp" => "image/webp",
+ _ => "application/octet-stream",
+ });
+ __httpRequestContent.Add(
+ content: __contentFile,
+ name: "\"file\"",
+ fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty);
+ if (__contentFile.Headers.ContentDisposition != null)
+ {
+ __contentFile.Headers.ContentDisposition.FileNameStar = null;
+ }
+
+ if (request.OverrideExistingTools != default)
+ {
+
+ __httpRequestContent.Add(
+ content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.OverrideExistingTools, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()),
+ name: "\"override_existing_tools\"");
+
+ }
+ if (request.StripMessages != default)
+ {
+
+ __httpRequestContent.Add(
+ content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.StripMessages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()),
+ name: "\"strip_messages\"");
+
+ }
+ if (request.Secrets != default)
+ {
+
+ __httpRequestContent.Add(
+ content: new global::System.Net.Http.StringContent(request.Secrets ?? string.Empty),
+ name: "\"secrets\"");
+
+ }
+ if (request.Name != default)
+ {
+
+ __httpRequestContent.Add(
+ content: new global::System.Net.Http.StringContent(request.Name ?? string.Empty),
+ name: "\"name\"");
+
+ }
+ if (request.Embedding != default)
+ {
+
+ __httpRequestContent.Add(
+ content: new global::System.Net.Http.StringContent(request.Embedding ?? string.Empty),
+ name: "\"embedding\"");
+
+ }
+ if (request.Model != default)
+ {
+
+ __httpRequestContent.Add(
+ content: new global::System.Net.Http.StringContent(request.Model ?? string.Empty),
+ name: "\"model\"");
+
+ }
+ if (request.AppendCopySuffix != default)
+ {
+
+ __httpRequestContent.Add(
+ content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.AppendCopySuffix, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()),
+ name: "\"append_copy_suffix\"");
+
+ }
+ if (request.OverrideName != default)
+ {
+
+ __httpRequestContent.Add(
+ content: new global::System.Net.Http.StringContent(request.OverrideName ?? string.Empty),
+ name: "\"override_name\"");
+
+ }
+ if (request.OverrideEmbeddingHandle != default)
+ {
+
+ __httpRequestContent.Add(
+ content: new global::System.Net.Http.StringContent(request.OverrideEmbeddingHandle ?? string.Empty),
+ name: "\"override_embedding_handle\"");
+
+ }
+ if (request.OverrideModelHandle != default)
+ {
+
+ __httpRequestContent.Add(
+ content: new global::System.Net.Http.StringContent(request.OverrideModelHandle ?? string.Empty),
+ name: "\"override_model_handle\"");
+
+ }
+ if (request.ProjectId != default)
+ {
+
+ __httpRequestContent.Add(
+ content: new global::System.Net.Http.StringContent(request.ProjectId ?? string.Empty),
+ name: "\"project_id\"");
+
+ }
+ if (request.EnvVarsJson != default)
+ {
+
+ __httpRequestContent.Add(
+ content: new global::System.Net.Http.StringContent(request.EnvVarsJson ?? string.Empty),
+ name: "\"env_vars_json\"");
+
+ }
+
+ __httpRequest.Content = __httpRequestContent;
+
+ global::Letta.AutoSDKRequestOptionsSupport.ApplyHeaders(
+ request: __httpRequest,
+ clientHeaders: Options.Headers,
+ requestHeaders: requestOptions?.Headers);
+
+ PrepareRequest(
+ client: HttpClient,
+ request: __httpRequest);
+ PrepareImportAgentRequest(
+ httpClient: HttpClient,
+ httpRequestMessage: __httpRequest,
+ xOverrideEmbeddingModel: xOverrideEmbeddingModel,
+ request: request);
+
+ return __httpRequest;
+ }
+
+ global::System.Net.Http.HttpRequestMessage? __httpRequest = null;
+ global::System.Net.Http.HttpResponseMessage? __response = null;
+ var __attemptNumber = 0;
+ try
+ {
+ for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++)
+ {
+ __attemptNumber = __attempt;
+ __httpRequest = __CreateHttpRequest();
+ await global::Letta.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
+ clientOptions: Options,
+ context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "ImportAgent",
+ methodName: "ImportAgentAsync",
+ pathTemplate: "\"/v1/agents/import\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ try
+ {
+ __response = await HttpClient.SendAsync(
+ request: __httpRequest,
+ completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ }
+ catch (global::System.Net.Http.HttpRequestException __exception)
+ {
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
+ var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
+ await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "ImportAgent",
+ methodName: "ImportAgentAsync",
+ pathTemplate: "\"/v1/agents/import\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: __exception,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ if (!__willRetry)
+ {
+ throw;
+ }
+
+ __httpRequest.Dispose();
+ __httpRequest = null;
+ await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ if (__response != null &&
+ __attempt < __maxAttempts &&
+ global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
+ {
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
+ await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "ImportAgent",
+ methodName: "ImportAgentAsync",
+ pathTemplate: "\"/v1/agents/import\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ __response.Dispose();
+ __response = null;
+ __httpRequest.Dispose();
+ __httpRequest = null;
+ await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ break;
+ }
+
+ if (__response == null)
+ {
+ throw new global::System.InvalidOperationException("No response received.");
+ }
+
+ using (__response)
+ {
+
+ ProcessResponse(
+ client: HttpClient,
+ response: __response);
+ ProcessImportAgentResponse(
+ httpClient: HttpClient,
+ httpResponseMessage: __response);
+ if (__response.IsSuccessStatusCode)
+ {
+ await global::Letta.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
+ clientOptions: Options,
+ context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "ImportAgent",
+ methodName: "ImportAgentAsync",
+ pathTemplate: "\"/v1/agents/import\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ else
+ {
+ await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "ImportAgent",
+ methodName: "ImportAgentAsync",
+ pathTemplate: "\"/v1/agents/import\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ // Validation Error
+ if ((int)__response.StatusCode == 422)
+ {
+ string? __content_422 = null;
+ global::System.Exception? __exception_422 = null;
+ global::Letta.HTTPValidationError? __value_422 = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_422 = global::Letta.HTTPValidationError.FromJson(__content_422, JsonSerializerContext);
+ }
+ else
+ {
+ __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_422 = global::Letta.HTTPValidationError.FromJson(__content_422, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_422 = __ex;
+ }
+
+ throw new global::Letta.ApiException(
+ message: __content_422 ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_422,
+ statusCode: __response.StatusCode)
+ {
+ ResponseBody = __content_422,
+ ResponseObject = __value_422,
+ ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value),
+ };
+ }
+
+ if (__effectiveReadResponseAsString)
+ {
+ var __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ ProcessResponseContent(
+ client: HttpClient,
+ response: __response,
+ content: ref __content);
+ ProcessImportAgentResponseContent(
+ httpClient: HttpClient,
+ httpResponseMessage: __response,
+ content: ref __content);
+
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+
+ return
+ global::Letta.ImportedAgentsResponse.FromJson(__content, JsonSerializerContext) ??
+ throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ }
+ catch (global::System.Exception __ex)
+ {
+ throw new global::Letta.ApiException(
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ statusCode: __response.StatusCode)
+ {
+ ResponseBody = __content,
+ ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value),
+ };
+ }
+ }
+ else
+ {
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+ using var __content = await __response.Content.ReadAsStreamAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ return
+ await global::Letta.ImportedAgentsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ throw new global::System.InvalidOperationException("Response deserialization failed.");
+ }
+ catch (global::System.Exception __ex)
+ {
+ string? __content = null;
+ try
+ {
+ __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+ }
+ catch (global::System.Exception)
+ {
+ }
+
+ throw new global::Letta.ApiException(
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ statusCode: __response.StatusCode)
+ {
+ ResponseBody = __content,
+ ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value),
+ };
+ }
+ }
+
+ }
+ }
+ finally
+ {
+ __httpRequest?.Dispose();
+ }
+ }
+ ///
+ /// Import Agent
+ /// Import a serialized agent file and recreate the agent(s) in the system.
+ /// Returns the IDs of all imported agents.
+ ///
+ ///
+ ///
+ /// The stream to send as the multipart 'file' file part.
+ ///
+ ///
+ ///
+ /// If set to True, existing tools can get their source code overwritten by the uploaded tool definitions. Note that Letta core tools can never be updated externally.
+ /// Default Value: true
+ ///
+ ///
+ /// If set to True, strips all messages from the agent before importing.
+ /// Default Value: false
+ ///
+ ///
+ /// Secrets as a JSON string to pass to the agent for tool execution.
+ ///
+ ///
+ /// If provided, overrides the agent name with this value.
+ ///
+ ///
+ /// Embedding handle to override with.
+ ///
+ ///
+ /// Model handle to override the agent's default model. This allows the imported agent to use a different model while keeping other defaults (e.g., context size) from the original configuration.
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> ImportAgentAsResponseAsync(
+ global::System.IO.Stream file,
+ string filename,
+ string? xOverrideEmbeddingModel = default,
+ bool? overrideExistingTools = default,
+ bool? stripMessages = default,
+ string? secrets = default,
+ string? name = default,
+ string? embedding = default,
+ string? model = default,
+ global::Letta.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+
+ file = file ?? throw new global::System.ArgumentNullException(nameof(file));
+ var request = new global::Letta.BodyImportAgent
+ {
+ File = global::System.Array.Empty(),
+ Filename = filename,
+ OverrideExistingTools = overrideExistingTools,
+ StripMessages = stripMessages,
+ Secrets = secrets,
+ Name = name,
+ Embedding = embedding,
+ Model = model,
+ };
+ PrepareArguments(
+ client: HttpClient);
+ PrepareImportAgentArguments(
+ httpClient: HttpClient,
+ xOverrideEmbeddingModel: ref xOverrideEmbeddingModel,
+ request: request);
+
+
+ var __authorizations = global::Letta.EndPointSecurityResolver.ResolveAuthorizations(
+ availableAuthorizations: Authorizations,
+ securityRequirements: s_ImportAgentSecurityRequirements,
+ operationName: "ImportAgentAsync");
+
+ using var __timeoutCancellationTokenSource = global::Letta.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken);
+ var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
+ var __effectiveReadResponseAsString = global::Letta.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ fallbackValue: ReadResponseAsString);
+ var __maxAttempts = global::Letta.AutoSDKRequestOptionsSupport.GetMaxAttempts(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ supportsRetry: false);
+
+ global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
+ {
+
+ var __pathBuilder = new global::Letta.PathBuilder(
+ path: "/v1/agents/import",
+ baseUri: ResolveBaseUri(
+ servers: s_ImportAgentServers,
+ defaultBaseUrl: "https://app.letta.com/"));
+ var __path = __pathBuilder.ToString();
+ __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters(
+ path: __path,
+ clientParameters: Options.QueryParameters,
+ requestParameters: requestOptions?.QueryParameters);
+ var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
+ method: global::System.Net.Http.HttpMethod.Post,
+ requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute));
+#if NET6_0_OR_GREATER
+ __httpRequest.Version = global::System.Net.HttpVersion.Version11;
+ __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher;
+#endif
+
+ foreach (var __authorization in __authorizations)
+ {
+ if (__authorization.Type == "Http" ||
+ __authorization.Type == "OAuth2" ||
+ __authorization.Type == "OpenIdConnect")
+ {
+ __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue(
+ scheme: __authorization.Name,
+ parameter: __authorization.Value);
+ }
+ else if (__authorization.Type == "ApiKey" &&
+ __authorization.Location == "Header")
+ {
+ __httpRequest.Headers.Add(__authorization.Name, __authorization.Value);
+ }
+ }
+
+ if (xOverrideEmbeddingModel != default)
+ {
+ __httpRequest.Headers.TryAddWithoutValidation("x-override-embedding-model", xOverrideEmbeddingModel.ToString());
+ }
+
+
+ var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent();
+ if (xOverrideEmbeddingModel != default)
+ {
+
+ __httpRequestContent.Add(
+ content: new global::System.Net.Http.StringContent(xOverrideEmbeddingModel ?? string.Empty),
+ name: "\"x-override-embedding-model\"");
+
+ }
+ var __contentFile = new global::System.Net.Http.StreamContent(file);
+ __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue(
+ request.Filename is null
+ ? "application/octet-stream"
+ : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch
+ {
+ ".aac" => "audio/aac",
+ ".flac" => "audio/flac",
+ ".gif" => "image/gif",
+ ".jpeg" => "image/jpeg",
+ ".jpg" => "image/jpeg",
+ ".json" => "application/json",
+ ".m4a" => "audio/mp4",
+ ".mp3" => "audio/mpeg",
+ ".mp4" => "video/mp4",
+ ".mpeg" => "audio/mpeg",
+ ".mpga" => "audio/mpeg",
+ ".oga" => "audio/ogg",
+ ".ogg" => "audio/ogg",
+ ".opus" => "audio/ogg",
+ ".pdf" => "application/pdf",
+ ".png" => "image/png",
+ ".txt" => "text/plain",
+ ".wav" => "audio/wav",
+ ".weba" => "audio/webm",
+ ".webm" => "video/webm",
+ ".webp" => "image/webp",
+ _ => "application/octet-stream",
+ });
+ __httpRequestContent.Add(
+ content: __contentFile,
+ name: "\"file\"",
+ fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty);
+ if (__contentFile.Headers.ContentDisposition != null)
+ {
+ __contentFile.Headers.ContentDisposition.FileNameStar = null;
+ }
+
+ if (request.OverrideExistingTools != default)
+ {
+
+ __httpRequestContent.Add(
+ content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.OverrideExistingTools, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()),
+ name: "\"override_existing_tools\"");
+
+ }
+ if (request.StripMessages != default)
+ {
+
+ __httpRequestContent.Add(
+ content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.StripMessages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()),
+ name: "\"strip_messages\"");
+
+ }
+ if (request.Secrets != default)
+ {
+
+ __httpRequestContent.Add(
+ content: new global::System.Net.Http.StringContent(request.Secrets ?? string.Empty),
+ name: "\"secrets\"");
+
+ }
+ if (request.Name != default)
+ {
+
+ __httpRequestContent.Add(
+ content: new global::System.Net.Http.StringContent(request.Name ?? string.Empty),
+ name: "\"name\"");
+
+ }
+ if (request.Embedding != default)
+ {
+
+ __httpRequestContent.Add(
+ content: new global::System.Net.Http.StringContent(request.Embedding ?? string.Empty),
+ name: "\"embedding\"");
+
+ }
+ if (request.Model != default)
+ {
+
+ __httpRequestContent.Add(
+ content: new global::System.Net.Http.StringContent(request.Model ?? string.Empty),
+ name: "\"model\"");
+
+ }
+ if (request.AppendCopySuffix != default)
+ {
+
+ __httpRequestContent.Add(
+ content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.AppendCopySuffix, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()),
+ name: "\"append_copy_suffix\"");
+
+ }
+ if (request.OverrideName != default)
+ {
+
+ __httpRequestContent.Add(
+ content: new global::System.Net.Http.StringContent(request.OverrideName ?? string.Empty),
+ name: "\"override_name\"");
+
+ }
+ if (request.OverrideEmbeddingHandle != default)
+ {
+
+ __httpRequestContent.Add(
+ content: new global::System.Net.Http.StringContent(request.OverrideEmbeddingHandle ?? string.Empty),
+ name: "\"override_embedding_handle\"");
+
+ }
+ if (request.OverrideModelHandle != default)
+ {
+
+ __httpRequestContent.Add(
+ content: new global::System.Net.Http.StringContent(request.OverrideModelHandle ?? string.Empty),
+ name: "\"override_model_handle\"");
+
+ }
+ if (request.ProjectId != default)
+ {
+
+ __httpRequestContent.Add(
+ content: new global::System.Net.Http.StringContent(request.ProjectId ?? string.Empty),
+ name: "\"project_id\"");
+
+ }
+ if (request.EnvVarsJson != default)
+ {
+
+ __httpRequestContent.Add(
+ content: new global::System.Net.Http.StringContent(request.EnvVarsJson ?? string.Empty),
+ name: "\"env_vars_json\"");
+
+ }
+
+ __httpRequest.Content = __httpRequestContent;
+
+ global::Letta.AutoSDKRequestOptionsSupport.ApplyHeaders(
+ request: __httpRequest,
+ clientHeaders: Options.Headers,
+ requestHeaders: requestOptions?.Headers);
+
+ PrepareRequest(
+ client: HttpClient,
+ request: __httpRequest);
+ PrepareImportAgentRequest(
+ httpClient: HttpClient,
+ httpRequestMessage: __httpRequest,
+ xOverrideEmbeddingModel: xOverrideEmbeddingModel,
+ request: request);
+
+ return __httpRequest;
+ }
+
+ global::System.Net.Http.HttpRequestMessage? __httpRequest = null;
+ global::System.Net.Http.HttpResponseMessage? __response = null;
+ var __attemptNumber = 0;
+ try
+ {
+ for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++)
+ {
+ __attemptNumber = __attempt;
+ __httpRequest = __CreateHttpRequest();
+ await global::Letta.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
+ clientOptions: Options,
+ context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "ImportAgent",
+ methodName: "ImportAgentAsync",
+ pathTemplate: "\"/v1/agents/import\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ try
+ {
+ __response = await HttpClient.SendAsync(
+ request: __httpRequest,
+ completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ }
+ catch (global::System.Net.Http.HttpRequestException __exception)
+ {
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
+ var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
+ await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "ImportAgent",
+ methodName: "ImportAgentAsync",
+ pathTemplate: "\"/v1/agents/import\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: __exception,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ if (!__willRetry)
+ {
+ throw;
+ }
+
+ __httpRequest.Dispose();
+ __httpRequest = null;
+ await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ if (__response != null &&
+ __attempt < __maxAttempts &&
+ global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
+ {
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
+ await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "ImportAgent",
+ methodName: "ImportAgentAsync",
+ pathTemplate: "\"/v1/agents/import\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ __response.Dispose();
+ __response = null;
+ __httpRequest.Dispose();
+ __httpRequest = null;
+ await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ break;
+ }
+
+ if (__response == null)
+ {
+ throw new global::System.InvalidOperationException("No response received.");
+ }
+
+ using (__response)
+ {
+
+ ProcessResponse(
+ client: HttpClient,
+ response: __response);
+ ProcessImportAgentResponse(
+ httpClient: HttpClient,
+ httpResponseMessage: __response);
+ if (__response.IsSuccessStatusCode)
+ {
+ await global::Letta.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
+ clientOptions: Options,
+ context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "ImportAgent",
+ methodName: "ImportAgentAsync",
+ pathTemplate: "\"/v1/agents/import\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ else
+ {
+ await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "ImportAgent",
+ methodName: "ImportAgentAsync",
+ pathTemplate: "\"/v1/agents/import\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ // Validation Error
+ if ((int)__response.StatusCode == 422)
+ {
+ string? __content_422 = null;
+ global::System.Exception? __exception_422 = null;
+ global::Letta.HTTPValidationError? __value_422 = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_422 = global::Letta.HTTPValidationError.FromJson(__content_422, JsonSerializerContext);
+ }
+ else
+ {
+ __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_422 = global::Letta.HTTPValidationError.FromJson(__content_422, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_422 = __ex;
+ }
+
+ throw new global::Letta.ApiException(
+ message: __content_422 ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_422,
+ statusCode: __response.StatusCode)
+ {
+ ResponseBody = __content_422,
+ ResponseObject = __value_422,
+ ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value),
+ };
+ }
+
+ if (__effectiveReadResponseAsString)
+ {
+ var __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ ProcessResponseContent(
+ client: HttpClient,
+ response: __response,
+ content: ref __content);
+ ProcessImportAgentResponseContent(
+ httpClient: HttpClient,
+ httpResponseMessage: __response,
+ content: ref __content);
+
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+
+ var __value = global::Letta.ImportedAgentsResponse.FromJson(__content, JsonSerializerContext) ??
+ throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ throw new global::Letta.ApiException(
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ statusCode: __response.StatusCode)
+ {
+ ResponseBody = __content,
+ ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value),
+ };
+ }
+ }
+ else
+ {
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+ using var __content = await __response.Content.ReadAsStreamAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ var __value = await global::Letta.ImportedAgentsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ string? __content = null;
+ try
+ {
+ __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+ }
+ catch (global::System.Exception)
+ {
+ }
+
+ throw new global::Letta.ApiException(
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ statusCode: __response.StatusCode)
+ {
+ ResponseBody = __content,
+ ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value),
+ };
+ }
+ }
+
+ }
+ }
+ finally
+ {
+ __httpRequest?.Dispose();
+ }
+ }
}
}
\ No newline at end of file
diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.ListAgents.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.ListAgents.g.cs
index a1a14526..5dee6a87 100644
--- a/src/libs/Letta/Generated/Letta.AgentsClient.ListAgents.g.cs
+++ b/src/libs/Letta/Generated/Letta.AgentsClient.ListAgents.g.cs
@@ -191,6 +191,131 @@ partial void ProcessListAgentsResponseContent(
string? createdById = default,
global::Letta.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await ListAgentsAsResponseAsync(
+ name: name,
+ tags: tags,
+ matchAllTags: matchAllTags,
+ before: before,
+ after: after,
+ limit: limit,
+ queryText: queryText,
+ projectId: projectId,
+ templateId: templateId,
+ baseTemplateId: baseTemplateId,
+ identityId: identityId,
+ identifierKeys: identifierKeys,
+ includeRelationships: includeRelationships,
+ include: include,
+ order: order,
+ orderBy: orderBy,
+ ascending: ascending,
+ sortBy: sortBy,
+ lastStopReason: lastStopReason,
+ createdById: createdById,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// List Agents
+ /// Get a list of all agents.
+ ///
+ ///
+ /// Name of the agent
+ ///
+ ///
+ /// List of tags to filter agents by
+ ///
+ ///
+ /// If True, only returns agents that match ALL given tags. Otherwise, return agents that have ANY of the passed-in tags.
+ /// Default Value: false
+ ///
+ ///
+ /// Cursor for pagination
+ ///
+ ///
+ /// Cursor for pagination
+ ///
+ ///
+ /// Limit for pagination
+ /// Default Value: 50
+ ///
+ ///
+ /// Search agents by name
+ ///
+ ///
+ /// Search agents by project ID - this will default to your default project on cloud
+ ///
+ ///
+ /// Search agents by template ID
+ ///
+ ///
+ /// Search agents by base template ID
+ ///
+ ///
+ /// Search agents by identity ID
+ ///
+ ///
+ /// Search agents by identifier keys
+ ///
+ ///
+ /// Specify which relational fields (e.g., 'tools', 'sources', 'memory') to include in the response. If not provided, all relationships are loaded by default. Using this can optimize performance by reducing unnecessary joins.This is a legacy parameter, and no longer supported after 1.0.0 SDK versions.
+ ///
+ ///
+ /// Specify which relational fields to include in the response. No relationships are included by default.
+ /// Default Value: []
+ ///
+ ///
+ /// Sort order for agents by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc
+ ///
+ ///
+ /// Field to sort by
+ /// Default Value: created_at
+ ///
+ ///
+ /// Whether to sort agents oldest to newest (True) or newest to oldest (False, default)
+ /// Default Value: false
+ ///
+ ///
+ /// Field to sort by. Options: 'created_at' (default), 'last_run_completion'
+ /// Default Value: created_at
+ ///
+ ///
+ /// Filter agents by their last stop reason.
+ ///
+ ///
+ /// Filter agents by the user who created them.
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task>> ListAgentsAsResponseAsync(
+ string? name = default,
+ global::System.Collections.Generic.IList? tags = default,
+ bool? matchAllTags = default,
+ string? before = default,
+ string? after = default,
+ int? limit = default,
+ string? queryText = default,
+ string? projectId = default,
+ string? templateId = default,
+ string? baseTemplateId = default,
+ string? identityId = default,
+ global::System.Collections.Generic.IList? identifierKeys = default,
+ global::System.Collections.Generic.IList? includeRelationships = default,
+ global::System.Collections.Generic.IList? include = default,
+ global::Letta.ListAgentsOrder? order = default,
+ global::Letta.ListAgentsOrderBy? orderBy = default,
+ bool? ascending = default,
+ string? sortBy = default,
+ global::Letta.StopReasonType? lastStopReason = default,
+ string? createdById = default,
+ global::Letta.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -239,11 +364,12 @@ partial void ProcessListAgentsResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Letta.PathBuilder(
path: "/v1/agents/",
baseUri: ResolveBaseUri(
servers: s_ListAgentsServers,
- defaultBaseUrl: "https://app.letta.com/"));
+ defaultBaseUrl: "https://app.letta.com/"));
__pathBuilder
.AddOptionalParameter("name", name)
.AddOptionalParameter("tags", tags?.ToString())
@@ -264,7 +390,7 @@ partial void ProcessListAgentsResponseContent(
.AddOptionalParameter("ascending", ascending?.ToString().ToLowerInvariant())
.AddOptionalParameter("sort_by", sortBy)
.AddOptionalParameter("last_stop_reason", lastStopReason?.ToString())
- .AddOptionalParameter("created_by_id", createdById)
+ .AddOptionalParameter("created_by_id", createdById)
;
var __path = __pathBuilder.ToString();
__path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters(
@@ -355,6 +481,8 @@ partial void ProcessListAgentsResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -365,6 +493,11 @@ partial void ProcessListAgentsResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -382,6 +515,8 @@ partial void ProcessListAgentsResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -391,8 +526,7 @@ partial void ProcessListAgentsResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -401,6 +535,11 @@ partial void ProcessListAgentsResponseContent(
__attempt < __maxAttempts &&
global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -417,14 +556,15 @@ partial void ProcessListAgentsResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -464,6 +604,8 @@ partial void ProcessListAgentsResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -484,6 +626,8 @@ partial void ProcessListAgentsResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -546,9 +690,13 @@ partial void ProcessListAgentsResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ??
+ var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Letta.AutoSDKHttpResponse>(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -576,9 +724,13 @@ partial void ProcessListAgentsResponseContent(
#endif
).ConfigureAwait(false);
- return
- (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Letta.AutoSDKHttpResponse>(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.ListCoreMemoryBlocks.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.ListCoreMemoryBlocks.g.cs
index 3c137f94..3d114a2b 100644
--- a/src/libs/Letta/Generated/Letta.AgentsClient.ListCoreMemoryBlocks.g.cs
+++ b/src/libs/Letta/Generated/Letta.AgentsClient.ListCoreMemoryBlocks.g.cs
@@ -101,6 +101,57 @@ partial void ProcessListCoreMemoryBlocksResponseContent(
string? orderBy = default,
global::Letta.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await ListCoreMemoryBlocksAsResponseAsync(
+ agentId: agentId,
+ before: before,
+ after: after,
+ limit: limit,
+ order: order,
+ orderBy: orderBy,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// List Blocks For Agent
+ /// Retrieve the core memory blocks of a specific agent.
+ ///
+ ///
+ /// The ID of the agent in the format 'agent-<uuid4>'
+ ///
+ ///
+ /// Block ID cursor for pagination. Returns blocks that come before this block ID in the specified sort order
+ ///
+ ///
+ /// Block ID cursor for pagination. Returns blocks that come after this block ID in the specified sort order
+ ///
+ ///
+ /// Maximum number of blocks to return
+ /// Default Value: 100
+ ///
+ ///
+ /// Sort order for blocks by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc
+ ///
+ ///
+ /// Field to sort by
+ /// Default Value: created_at
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task>> ListCoreMemoryBlocksAsResponseAsync(
+ string agentId,
+ string? before = default,
+ string? after = default,
+ int? limit = default,
+ global::Letta.ListCoreMemoryBlocksOrder? order = default,
+ string? orderBy = default,
+ global::Letta.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -135,17 +186,18 @@ partial void ProcessListCoreMemoryBlocksResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Letta.PathBuilder(
path: $"/v1/agents/{agentId}/core-memory/blocks",
baseUri: ResolveBaseUri(
servers: s_ListCoreMemoryBlocksServers,
- defaultBaseUrl: "https://app.letta.com/"));
+ defaultBaseUrl: "https://app.letta.com/"));
__pathBuilder
.AddOptionalParameter("before", before)
.AddOptionalParameter("after", after)
.AddOptionalParameter("limit", limit?.ToString())
.AddOptionalParameter("order", order?.ToValueString())
- .AddOptionalParameter("order_by", orderBy)
+ .AddOptionalParameter("order_by", orderBy)
;
var __path = __pathBuilder.ToString();
__path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters(
@@ -222,6 +274,8 @@ partial void ProcessListCoreMemoryBlocksResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -232,6 +286,11 @@ partial void ProcessListCoreMemoryBlocksResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -249,6 +308,8 @@ partial void ProcessListCoreMemoryBlocksResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -258,8 +319,7 @@ partial void ProcessListCoreMemoryBlocksResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -268,6 +328,11 @@ partial void ProcessListCoreMemoryBlocksResponseContent(
__attempt < __maxAttempts &&
global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -284,14 +349,15 @@ partial void ProcessListCoreMemoryBlocksResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -331,6 +397,8 @@ partial void ProcessListCoreMemoryBlocksResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -351,6 +419,8 @@ partial void ProcessListCoreMemoryBlocksResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -413,9 +483,13 @@ partial void ProcessListCoreMemoryBlocksResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ??
+ var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Letta.AutoSDKHttpResponse>(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -443,9 +517,13 @@ partial void ProcessListCoreMemoryBlocksResponseContent(
#endif
).ConfigureAwait(false);
- return
- (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Letta.AutoSDKHttpResponse>(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.ListFilesForAgent.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.ListFilesForAgent.g.cs
index a47dab0d..8f6a1b13 100644
--- a/src/libs/Letta/Generated/Letta.AgentsClient.ListFilesForAgent.g.cs
+++ b/src/libs/Letta/Generated/Letta.AgentsClient.ListFilesForAgent.g.cs
@@ -115,6 +115,67 @@ partial void ProcessListFilesForAgentResponseContent(
bool? isOpen = default,
global::Letta.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await ListFilesForAgentAsResponseAsync(
+ agentId: agentId,
+ before: before,
+ after: after,
+ limit: limit,
+ order: order,
+ orderBy: orderBy,
+ cursor: cursor,
+ isOpen: isOpen,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// List Files For Agent
+ /// Get the files attached to an agent with their open/closed status.
+ ///
+ ///
+ /// The ID of the agent in the format 'agent-<uuid4>'
+ ///
+ ///
+ /// File ID cursor for pagination. Returns files that come before this file ID in the specified sort order
+ ///
+ ///
+ /// File ID cursor for pagination. Returns files that come after this file ID in the specified sort order
+ ///
+ ///
+ /// Maximum number of files to return
+ /// Default Value: 100
+ ///
+ ///
+ /// Sort order for files by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc
+ ///
+ ///
+ /// Field to sort by
+ /// Default Value: created_at
+ ///
+ ///
+ /// Pagination cursor from previous response (deprecated, use before/after)
+ ///
+ ///
+ /// Filter by open status (true for open files, false for closed files)
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> ListFilesForAgentAsResponseAsync(
+ string agentId,
+ string? before = default,
+ string? after = default,
+ int? limit = default,
+ global::Letta.ListFilesForAgentOrder? order = default,
+ string? orderBy = default,
+ string? cursor = default,
+ bool? isOpen = default,
+ global::Letta.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -151,11 +212,12 @@ partial void ProcessListFilesForAgentResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Letta.PathBuilder(
path: $"/v1/agents/{agentId}/files",
baseUri: ResolveBaseUri(
servers: s_ListFilesForAgentServers,
- defaultBaseUrl: "https://app.letta.com/"));
+ defaultBaseUrl: "https://app.letta.com/"));
__pathBuilder
.AddOptionalParameter("before", before)
.AddOptionalParameter("after", after)
@@ -163,7 +225,7 @@ partial void ProcessListFilesForAgentResponseContent(
.AddOptionalParameter("order", order?.ToValueString())
.AddOptionalParameter("order_by", orderBy)
.AddOptionalParameter("cursor", cursor)
- .AddOptionalParameter("is_open", isOpen?.ToString().ToLowerInvariant())
+ .AddOptionalParameter("is_open", isOpen?.ToString().ToLowerInvariant())
;
var __path = __pathBuilder.ToString();
__path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters(
@@ -242,6 +304,8 @@ partial void ProcessListFilesForAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -252,6 +316,11 @@ partial void ProcessListFilesForAgentResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -269,6 +338,8 @@ partial void ProcessListFilesForAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -278,8 +349,7 @@ partial void ProcessListFilesForAgentResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -288,6 +358,11 @@ partial void ProcessListFilesForAgentResponseContent(
__attempt < __maxAttempts &&
global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -304,14 +379,15 @@ partial void ProcessListFilesForAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -351,6 +427,8 @@ partial void ProcessListFilesForAgentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -371,6 +449,8 @@ partial void ProcessListFilesForAgentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -433,9 +513,13 @@ partial void ProcessListFilesForAgentResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Letta.PaginatedAgentFiles.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Letta.PaginatedAgentFiles.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -463,9 +547,13 @@ partial void ProcessListFilesForAgentResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Letta.PaginatedAgentFiles.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Letta.PaginatedAgentFiles.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.ListFoldersForAgent.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.ListFoldersForAgent.g.cs
index 56f1555a..c4860555 100644
--- a/src/libs/Letta/Generated/Letta.AgentsClient.ListFoldersForAgent.g.cs
+++ b/src/libs/Letta/Generated/Letta.AgentsClient.ListFoldersForAgent.g.cs
@@ -101,6 +101,57 @@ partial void ProcessListFoldersForAgentResponseContent(
string? orderBy = default,
global::Letta.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await ListFoldersForAgentAsResponseAsync(
+ agentId: agentId,
+ before: before,
+ after: after,
+ limit: limit,
+ order: order,
+ orderBy: orderBy,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// List Folders For Agent
+ /// Get the folders associated with an agent.
+ ///
+ ///
+ /// The ID of the agent in the format 'agent-<uuid4>'
+ ///
+ ///
+ /// Source ID cursor for pagination. Returns sources that come before this source ID in the specified sort order
+ ///
+ ///
+ /// Source ID cursor for pagination. Returns sources that come after this source ID in the specified sort order
+ ///
+ ///
+ /// Maximum number of sources to return
+ /// Default Value: 100
+ ///
+ ///
+ /// Sort order for sources by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc
+ ///
+ ///
+ /// Field to sort by
+ /// Default Value: created_at
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task>> ListFoldersForAgentAsResponseAsync(
+ string agentId,
+ string? before = default,
+ string? after = default,
+ int? limit = default,
+ global::Letta.ListFoldersForAgentOrder? order = default,
+ string? orderBy = default,
+ global::Letta.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -135,17 +186,18 @@ partial void ProcessListFoldersForAgentResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Letta.PathBuilder(
path: $"/v1/agents/{agentId}/folders",
baseUri: ResolveBaseUri(
servers: s_ListFoldersForAgentServers,
- defaultBaseUrl: "https://app.letta.com/"));
+ defaultBaseUrl: "https://app.letta.com/"));
__pathBuilder
.AddOptionalParameter("before", before)
.AddOptionalParameter("after", after)
.AddOptionalParameter("limit", limit?.ToString())
.AddOptionalParameter("order", order?.ToValueString())
- .AddOptionalParameter("order_by", orderBy)
+ .AddOptionalParameter("order_by", orderBy)
;
var __path = __pathBuilder.ToString();
__path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters(
@@ -222,6 +274,8 @@ partial void ProcessListFoldersForAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -232,6 +286,11 @@ partial void ProcessListFoldersForAgentResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -249,6 +308,8 @@ partial void ProcessListFoldersForAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -258,8 +319,7 @@ partial void ProcessListFoldersForAgentResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -268,6 +328,11 @@ partial void ProcessListFoldersForAgentResponseContent(
__attempt < __maxAttempts &&
global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -284,14 +349,15 @@ partial void ProcessListFoldersForAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -331,6 +397,8 @@ partial void ProcessListFoldersForAgentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -351,6 +419,8 @@ partial void ProcessListFoldersForAgentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -413,9 +483,13 @@ partial void ProcessListFoldersForAgentResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ??
+ var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Letta.AutoSDKHttpResponse>(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -443,9 +517,13 @@ partial void ProcessListFoldersForAgentResponseContent(
#endif
).ConfigureAwait(false);
- return
- (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Letta.AutoSDKHttpResponse>(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.ListGroupsForAgent.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.ListGroupsForAgent.g.cs
index 5e532911..f35e99bf 100644
--- a/src/libs/Letta/Generated/Letta.AgentsClient.ListGroupsForAgent.g.cs
+++ b/src/libs/Letta/Generated/Letta.AgentsClient.ListGroupsForAgent.g.cs
@@ -107,6 +107,62 @@ partial void ProcessListGroupsForAgentResponseContent(
string? orderBy = default,
global::Letta.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await ListGroupsForAgentAsResponseAsync(
+ agentId: agentId,
+ managerType: managerType,
+ before: before,
+ after: after,
+ limit: limit,
+ order: order,
+ orderBy: orderBy,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// List Groups For Agent
+ /// Lists the groups for an agent.
+ ///
+ ///
+ /// The ID of the agent in the format 'agent-<uuid4>'
+ ///
+ ///
+ /// Manager type to filter groups by
+ ///
+ ///
+ /// Group ID cursor for pagination. Returns groups that come before this group ID in the specified sort order
+ ///
+ ///
+ /// Group ID cursor for pagination. Returns groups that come after this group ID in the specified sort order
+ ///
+ ///
+ /// Maximum number of groups to return
+ /// Default Value: 100
+ ///
+ ///
+ /// Sort order for groups by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc
+ ///
+ ///
+ /// Field to sort by
+ /// Default Value: created_at
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task>> ListGroupsForAgentAsResponseAsync(
+ string agentId,
+ string? managerType = default,
+ string? before = default,
+ string? after = default,
+ int? limit = default,
+ global::Letta.ListGroupsForAgentOrder? order = default,
+ string? orderBy = default,
+ global::Letta.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -142,18 +198,19 @@ partial void ProcessListGroupsForAgentResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Letta.PathBuilder(
path: $"/v1/agents/{agentId}/groups",
baseUri: ResolveBaseUri(
servers: s_ListGroupsForAgentServers,
- defaultBaseUrl: "https://app.letta.com/"));
+ defaultBaseUrl: "https://app.letta.com/"));
__pathBuilder
.AddOptionalParameter("manager_type", managerType)
.AddOptionalParameter("before", before)
.AddOptionalParameter("after", after)
.AddOptionalParameter("limit", limit?.ToString())
.AddOptionalParameter("order", order?.ToValueString())
- .AddOptionalParameter("order_by", orderBy)
+ .AddOptionalParameter("order_by", orderBy)
;
var __path = __pathBuilder.ToString();
__path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters(
@@ -231,6 +288,8 @@ partial void ProcessListGroupsForAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -241,6 +300,11 @@ partial void ProcessListGroupsForAgentResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -258,6 +322,8 @@ partial void ProcessListGroupsForAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -267,8 +333,7 @@ partial void ProcessListGroupsForAgentResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -277,6 +342,11 @@ partial void ProcessListGroupsForAgentResponseContent(
__attempt < __maxAttempts &&
global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -293,14 +363,15 @@ partial void ProcessListGroupsForAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -340,6 +411,8 @@ partial void ProcessListGroupsForAgentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -360,6 +433,8 @@ partial void ProcessListGroupsForAgentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -422,9 +497,13 @@ partial void ProcessListGroupsForAgentResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ??
+ var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Letta.AutoSDKHttpResponse>(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -452,9 +531,13 @@ partial void ProcessListGroupsForAgentResponseContent(
#endif
).ConfigureAwait(false);
- return
- (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Letta.AutoSDKHttpResponse>(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.ListMessages.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.ListMessages.g.cs
index edd83f30..3fb2aa80 100644
--- a/src/libs/Letta/Generated/Letta.AgentsClient.ListMessages.g.cs
+++ b/src/libs/Letta/Generated/Letta.AgentsClient.ListMessages.g.cs
@@ -148,6 +148,95 @@ partial void ProcessListMessagesResponseContent(
global::System.Collections.Generic.IList? includeReturnMessageTypes = default,
global::Letta.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await ListMessagesAsResponseAsync(
+ agentId: agentId,
+ before: before,
+ after: after,
+ limit: limit,
+ order: order,
+ orderBy: orderBy,
+ groupId: groupId,
+ conversationId: conversationId,
+ useAssistantMessage: useAssistantMessage,
+ assistantMessageToolName: assistantMessageToolName,
+ assistantMessageToolKwarg: assistantMessageToolKwarg,
+ includeErr: includeErr,
+ includeReturnMessageTypes: includeReturnMessageTypes,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// List Messages
+ /// Retrieve message history for an agent.
+ ///
+ ///
+ /// The ID of the agent in the format 'agent-<uuid4>'
+ ///
+ ///
+ /// Message ID cursor for pagination. Returns messages that come before this message ID in the specified sort order
+ ///
+ ///
+ /// Message ID cursor for pagination. Returns messages that come after this message ID in the specified sort order
+ ///
+ ///
+ /// Maximum number of messages to return
+ /// Default Value: 100
+ ///
+ ///
+ /// Sort order for messages by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc
+ ///
+ ///
+ /// Field to sort by
+ /// Default Value: created_at
+ ///
+ ///
+ /// Group ID to filter messages by.
+ ///
+ ///
+ /// Conversation ID to filter messages by.
+ ///
+ ///
+ /// Whether to use assistant messages
+ /// Default Value: true
+ ///
+ ///
+ /// The name of the designated message tool.
+ /// Default Value: send_message
+ ///
+ ///
+ /// The name of the message argument.
+ /// Default Value: message
+ ///
+ ///
+ /// Whether to include error messages and error statuses. For debugging purposes only.
+ ///
+ ///
+ /// Message types to include in response. When null, all message types are returned.
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task>> ListMessagesAsResponseAsync(
+ string agentId,
+ string? before = default,
+ string? after = default,
+ int? limit = default,
+ global::Letta.ListMessagesOrder? order = default,
+ string? orderBy = default,
+ string? groupId = default,
+ string? conversationId = default,
+ bool? useAssistantMessage = default,
+ string? assistantMessageToolName = default,
+ string? assistantMessageToolKwarg = default,
+ bool? includeErr = default,
+ global::System.Collections.Generic.IList? includeReturnMessageTypes = default,
+ global::Letta.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -189,11 +278,12 @@ partial void ProcessListMessagesResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Letta.PathBuilder(
path: $"/v1/agents/{agentId}/messages",
baseUri: ResolveBaseUri(
servers: s_ListMessagesServers,
- defaultBaseUrl: "https://app.letta.com/"));
+ defaultBaseUrl: "https://app.letta.com/"));
__pathBuilder
.AddOptionalParameter("before", before)
.AddOptionalParameter("after", after)
@@ -206,7 +296,7 @@ partial void ProcessListMessagesResponseContent(
.AddOptionalParameter("assistant_message_tool_name", assistantMessageToolName)
.AddOptionalParameter("assistant_message_tool_kwarg", assistantMessageToolKwarg)
.AddOptionalParameter("include_err", includeErr?.ToString().ToLowerInvariant())
- .AddOptionalParameter("include_return_message_types", includeReturnMessageTypes?.ToString())
+ .AddOptionalParameter("include_return_message_types", includeReturnMessageTypes?.ToString())
;
var __path = __pathBuilder.ToString();
__path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters(
@@ -290,6 +380,8 @@ partial void ProcessListMessagesResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -300,6 +392,11 @@ partial void ProcessListMessagesResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -317,6 +414,8 @@ partial void ProcessListMessagesResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -326,8 +425,7 @@ partial void ProcessListMessagesResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -336,6 +434,11 @@ partial void ProcessListMessagesResponseContent(
__attempt < __maxAttempts &&
global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -352,14 +455,15 @@ partial void ProcessListMessagesResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -399,6 +503,8 @@ partial void ProcessListMessagesResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -419,6 +525,8 @@ partial void ProcessListMessagesResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -481,9 +589,13 @@ partial void ProcessListMessagesResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ??
+ var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Letta.AutoSDKHttpResponse>(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -511,9 +623,13 @@ partial void ProcessListMessagesResponseContent(
#endif
).ConfigureAwait(false);
- return
- (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Letta.AutoSDKHttpResponse>(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.ListPassages.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.ListPassages.g.cs
index 87883982..f0b6d700 100644
--- a/src/libs/Letta/Generated/Letta.AgentsClient.ListPassages.g.cs
+++ b/src/libs/Letta/Generated/Letta.AgentsClient.ListPassages.g.cs
@@ -100,6 +100,56 @@ partial void ProcessListPassagesResponseContent(
bool? ascending = default,
global::Letta.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await ListPassagesAsResponseAsync(
+ agentId: agentId,
+ after: after,
+ before: before,
+ limit: limit,
+ search: search,
+ ascending: ascending,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// List Passages
+ /// Retrieve the memories in an agent's archival memory store (paginated query).
+ ///
+ ///
+ /// The ID of the agent in the format 'agent-<uuid4>'
+ ///
+ ///
+ /// Unique ID of the memory to start the query range at.
+ ///
+ ///
+ /// Unique ID of the memory to end the query range at.
+ ///
+ ///
+ /// How many results to include in the response.
+ /// Default Value: 100
+ ///
+ ///
+ /// Search passages by text
+ ///
+ ///
+ /// Whether to sort passages oldest to newest (True, default) or newest to oldest (False)
+ /// Default Value: true
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task>> ListPassagesAsResponseAsync(
+ string agentId,
+ string? after = default,
+ string? before = default,
+ int? limit = default,
+ string? search = default,
+ bool? ascending = default,
+ global::Letta.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -134,17 +184,18 @@ partial void ProcessListPassagesResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Letta.PathBuilder(
path: $"/v1/agents/{agentId}/archival-memory",
baseUri: ResolveBaseUri(
servers: s_ListPassagesServers,
- defaultBaseUrl: "https://app.letta.com/"));
+ defaultBaseUrl: "https://app.letta.com/"));
__pathBuilder
.AddOptionalParameter("after", after)
.AddOptionalParameter("before", before)
.AddOptionalParameter("limit", limit?.ToString())
.AddOptionalParameter("search", search)
- .AddOptionalParameter("ascending", ascending?.ToString().ToLowerInvariant())
+ .AddOptionalParameter("ascending", ascending?.ToString().ToLowerInvariant())
;
var __path = __pathBuilder.ToString();
__path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters(
@@ -221,6 +272,8 @@ partial void ProcessListPassagesResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -231,6 +284,11 @@ partial void ProcessListPassagesResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -248,6 +306,8 @@ partial void ProcessListPassagesResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -257,8 +317,7 @@ partial void ProcessListPassagesResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -267,6 +326,11 @@ partial void ProcessListPassagesResponseContent(
__attempt < __maxAttempts &&
global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -283,14 +347,15 @@ partial void ProcessListPassagesResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -330,6 +395,8 @@ partial void ProcessListPassagesResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -350,6 +417,8 @@ partial void ProcessListPassagesResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -412,9 +481,13 @@ partial void ProcessListPassagesResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ??
+ var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Letta.AutoSDKHttpResponse>(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -442,9 +515,13 @@ partial void ProcessListPassagesResponseContent(
#endif
).ConfigureAwait(false);
- return
- (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Letta.AutoSDKHttpResponse>(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.ListToolsForAgent.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.ListToolsForAgent.g.cs
index 2374ee8c..aea6ae3a 100644
--- a/src/libs/Letta/Generated/Letta.AgentsClient.ListToolsForAgent.g.cs
+++ b/src/libs/Letta/Generated/Letta.AgentsClient.ListToolsForAgent.g.cs
@@ -101,6 +101,57 @@ partial void ProcessListToolsForAgentResponseContent(
string? orderBy = default,
global::Letta.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await ListToolsForAgentAsResponseAsync(
+ agentId: agentId,
+ before: before,
+ after: after,
+ limit: limit,
+ order: order,
+ orderBy: orderBy,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// List Tools For Agent
+ /// Get tools from an existing agent.
+ ///
+ ///
+ /// The ID of the agent in the format 'agent-<uuid4>'
+ ///
+ ///
+ /// Tool ID cursor for pagination. Returns tools that come before this tool ID in the specified sort order
+ ///
+ ///
+ /// Tool ID cursor for pagination. Returns tools that come after this tool ID in the specified sort order
+ ///
+ ///
+ /// Maximum number of tools to return
+ /// Default Value: 10
+ ///
+ ///
+ /// Sort order for tools by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc
+ ///
+ ///
+ /// Field to sort by
+ /// Default Value: created_at
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task>> ListToolsForAgentAsResponseAsync(
+ string agentId,
+ string? before = default,
+ string? after = default,
+ int? limit = default,
+ global::Letta.ListToolsForAgentOrder? order = default,
+ string? orderBy = default,
+ global::Letta.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -135,17 +186,18 @@ partial void ProcessListToolsForAgentResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Letta.PathBuilder(
path: $"/v1/agents/{agentId}/tools",
baseUri: ResolveBaseUri(
servers: s_ListToolsForAgentServers,
- defaultBaseUrl: "https://app.letta.com/"));
+ defaultBaseUrl: "https://app.letta.com/"));
__pathBuilder
.AddOptionalParameter("before", before)
.AddOptionalParameter("after", after)
.AddOptionalParameter("limit", limit?.ToString())
.AddOptionalParameter("order", order?.ToValueString())
- .AddOptionalParameter("order_by", orderBy)
+ .AddOptionalParameter("order_by", orderBy)
;
var __path = __pathBuilder.ToString();
__path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters(
@@ -222,6 +274,8 @@ partial void ProcessListToolsForAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -232,6 +286,11 @@ partial void ProcessListToolsForAgentResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -249,6 +308,8 @@ partial void ProcessListToolsForAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -258,8 +319,7 @@ partial void ProcessListToolsForAgentResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -268,6 +328,11 @@ partial void ProcessListToolsForAgentResponseContent(
__attempt < __maxAttempts &&
global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -284,14 +349,15 @@ partial void ProcessListToolsForAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -331,6 +397,8 @@ partial void ProcessListToolsForAgentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -351,6 +419,8 @@ partial void ProcessListToolsForAgentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -413,9 +483,13 @@ partial void ProcessListToolsForAgentResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ??
+ var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Letta.AutoSDKHttpResponse>(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -443,9 +517,13 @@ partial void ProcessListToolsForAgentResponseContent(
#endif
).ConfigureAwait(false);
- return
- (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Letta.AutoSDKHttpResponse>(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.ModifyAgent.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.ModifyAgent.g.cs
index 17222dc8..71d8445d 100644
--- a/src/libs/Letta/Generated/Letta.AgentsClient.ModifyAgent.g.cs
+++ b/src/libs/Letta/Generated/Letta.AgentsClient.ModifyAgent.g.cs
@@ -72,6 +72,34 @@ partial void ProcessModifyAgentResponseContent(
public async global::System.Threading.Tasks.Task ModifyAgentAsync(
string agentId,
+ global::Letta.UpdateAgent request,
+ global::Letta.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await ModifyAgentAsResponseAsync(
+ agentId: agentId,
+
+ request: request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Modify Agent
+ /// Update an existing agent.
+ ///
+ ///
+ /// The ID of the agent in the format 'agent-<uuid4>'
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> ModifyAgentAsResponseAsync(
+ string agentId,
+
global::Letta.UpdateAgent request,
global::Letta.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
@@ -107,6 +135,7 @@ partial void ProcessModifyAgentResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Letta.PathBuilder(
path: $"/v1/agents/{agentId}",
baseUri: ResolveBaseUri(
@@ -189,6 +218,8 @@ partial void ProcessModifyAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -199,6 +230,11 @@ partial void ProcessModifyAgentResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -216,6 +252,8 @@ partial void ProcessModifyAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -225,8 +263,7 @@ partial void ProcessModifyAgentResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -235,6 +272,11 @@ partial void ProcessModifyAgentResponseContent(
__attempt < __maxAttempts &&
global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -251,14 +293,15 @@ partial void ProcessModifyAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -298,6 +341,8 @@ partial void ProcessModifyAgentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -318,6 +363,8 @@ partial void ProcessModifyAgentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -380,9 +427,13 @@ partial void ProcessModifyAgentResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Letta.AgentState.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Letta.AgentState.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -410,9 +461,13 @@ partial void ProcessModifyAgentResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Letta.AgentState.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Letta.AgentState.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.ModifyApprovalForTool.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.ModifyApprovalForTool.g.cs
index 500579f0..fbcb1682 100644
--- a/src/libs/Letta/Generated/Letta.AgentsClient.ModifyApprovalForTool.g.cs
+++ b/src/libs/Letta/Generated/Letta.AgentsClient.ModifyApprovalForTool.g.cs
@@ -82,6 +82,43 @@ partial void ProcessModifyApprovalForToolResponseContent(
string toolName,
string agentId,
+ global::Letta.ModifyApprovalRequest request,
+ bool? requiresApproval = default,
+ global::Letta.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await ModifyApprovalForToolAsResponseAsync(
+ toolName: toolName,
+ agentId: agentId,
+
+ request: request,
+ requiresApproval: requiresApproval,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Modify Approval For Tool
+ /// Modify the approval requirement for a tool attached to an agent.
+ /// Accepts requires_approval via request body (preferred) or query parameter (deprecated).
+ ///
+ ///
+ ///
+ /// The ID of the agent in the format 'agent-<uuid4>'
+ ///
+ ///
+ /// Whether the tool requires approval before execution
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> ModifyApprovalForToolAsResponseAsync(
+ string toolName,
+ string agentId,
+
global::Letta.ModifyApprovalRequest request,
bool? requiresApproval = default,
global::Letta.AutoSDKRequestOptions? requestOptions = default,
@@ -120,13 +157,14 @@ partial void ProcessModifyApprovalForToolResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Letta.PathBuilder(
path: $"/v1/agents/{agentId}/tools/approval/{toolName}",
baseUri: ResolveBaseUri(
servers: s_ModifyApprovalForToolServers,
- defaultBaseUrl: "https://app.letta.com/"));
+ defaultBaseUrl: "https://app.letta.com/"));
__pathBuilder
- .AddOptionalParameter("requires_approval", requiresApproval?.ToString().ToLowerInvariant())
+ .AddOptionalParameter("requires_approval", requiresApproval?.ToString().ToLowerInvariant())
;
var __path = __pathBuilder.ToString();
__path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters(
@@ -207,6 +245,8 @@ partial void ProcessModifyApprovalForToolResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -217,6 +257,11 @@ partial void ProcessModifyApprovalForToolResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -234,6 +279,8 @@ partial void ProcessModifyApprovalForToolResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -243,8 +290,7 @@ partial void ProcessModifyApprovalForToolResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -253,6 +299,11 @@ partial void ProcessModifyApprovalForToolResponseContent(
__attempt < __maxAttempts &&
global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -269,14 +320,15 @@ partial void ProcessModifyApprovalForToolResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -316,6 +368,8 @@ partial void ProcessModifyApprovalForToolResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -336,6 +390,8 @@ partial void ProcessModifyApprovalForToolResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -398,9 +454,13 @@ partial void ProcessModifyApprovalForToolResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Letta.AgentState.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Letta.AgentState.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -428,9 +488,13 @@ partial void ProcessModifyApprovalForToolResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Letta.AgentState.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Letta.AgentState.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.ModifyCoreMemoryBlock.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.ModifyCoreMemoryBlock.g.cs
index 99555aa9..389845fe 100644
--- a/src/libs/Letta/Generated/Letta.AgentsClient.ModifyCoreMemoryBlock.g.cs
+++ b/src/libs/Letta/Generated/Letta.AgentsClient.ModifyCoreMemoryBlock.g.cs
@@ -74,6 +74,37 @@ partial void ProcessModifyCoreMemoryBlockResponseContent(
string blockLabel,
string agentId,
+ global::Letta.BlockUpdate request,
+ global::Letta.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await ModifyCoreMemoryBlockAsResponseAsync(
+ blockLabel: blockLabel,
+ agentId: agentId,
+
+ request: request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Modify Block For Agent
+ /// Updates a core memory block of an agent.
+ ///
+ ///
+ ///
+ /// The ID of the agent in the format 'agent-<uuid4>'
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> ModifyCoreMemoryBlockAsResponseAsync(
+ string blockLabel,
+ string agentId,
+
global::Letta.BlockUpdate request,
global::Letta.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
@@ -110,6 +141,7 @@ partial void ProcessModifyCoreMemoryBlockResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Letta.PathBuilder(
path: $"/v1/agents/{agentId}/core-memory/blocks/{blockLabel}",
baseUri: ResolveBaseUri(
@@ -193,6 +225,8 @@ partial void ProcessModifyCoreMemoryBlockResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -203,6 +237,11 @@ partial void ProcessModifyCoreMemoryBlockResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -220,6 +259,8 @@ partial void ProcessModifyCoreMemoryBlockResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -229,8 +270,7 @@ partial void ProcessModifyCoreMemoryBlockResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -239,6 +279,11 @@ partial void ProcessModifyCoreMemoryBlockResponseContent(
__attempt < __maxAttempts &&
global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -255,14 +300,15 @@ partial void ProcessModifyCoreMemoryBlockResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -302,6 +348,8 @@ partial void ProcessModifyCoreMemoryBlockResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -322,6 +370,8 @@ partial void ProcessModifyCoreMemoryBlockResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -384,9 +434,13 @@ partial void ProcessModifyCoreMemoryBlockResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Letta.BlockResponse.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Letta.BlockResponse.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -414,9 +468,13 @@ partial void ProcessModifyCoreMemoryBlockResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Letta.BlockResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Letta.BlockResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.OpenFileForAgent.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.OpenFileForAgent.g.cs
index 5d9e8f0a..ec1a513c 100644
--- a/src/libs/Letta/Generated/Letta.AgentsClient.OpenFileForAgent.g.cs
+++ b/src/libs/Letta/Generated/Letta.AgentsClient.OpenFileForAgent.g.cs
@@ -77,6 +77,37 @@ partial void ProcessOpenFileForAgentResponseContent(
string agentId,
global::Letta.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await OpenFileForAgentAsResponseAsync(
+ fileId: fileId,
+ agentId: agentId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Open File For Agent
+ /// Opens a specific file for a given agent.
+ /// This endpoint marks a specific file as open in the agent's file state.
+ /// The file will be included in the agent's working memory view.
+ /// Returns a list of file names that were closed due to LRU eviction.
+ ///
+ ///
+ /// The ID of the file in the format 'file-<uuid4>'
+ ///
+ ///
+ /// The ID of the agent in the format 'agent-<uuid4>'
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task>> OpenFileForAgentAsResponseAsync(
+ string fileId,
+ string agentId,
+ global::Letta.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -107,6 +138,7 @@ partial void ProcessOpenFileForAgentResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Letta.PathBuilder(
path: $"/v1/agents/{agentId}/files/{fileId}/open",
baseUri: ResolveBaseUri(
@@ -183,6 +215,8 @@ partial void ProcessOpenFileForAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -193,6 +227,11 @@ partial void ProcessOpenFileForAgentResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -210,6 +249,8 @@ partial void ProcessOpenFileForAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -219,8 +260,7 @@ partial void ProcessOpenFileForAgentResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -229,6 +269,11 @@ partial void ProcessOpenFileForAgentResponseContent(
__attempt < __maxAttempts &&
global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -245,14 +290,15 @@ partial void ProcessOpenFileForAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -292,6 +338,8 @@ partial void ProcessOpenFileForAgentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -312,6 +360,8 @@ partial void ProcessOpenFileForAgentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -374,9 +424,13 @@ partial void ProcessOpenFileForAgentResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ??
+ var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Letta.AutoSDKHttpResponse>(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -404,9 +458,13 @@ partial void ProcessOpenFileForAgentResponseContent(
#endif
).ConfigureAwait(false);
- return
- (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Letta.AutoSDKHttpResponse>(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.PreviewModelRequest.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.PreviewModelRequest.g.cs
index f9217148..42b13eb0 100644
--- a/src/libs/Letta/Generated/Letta.AgentsClient.PreviewModelRequest.g.cs
+++ b/src/libs/Letta/Generated/Letta.AgentsClient.PreviewModelRequest.g.cs
@@ -73,6 +73,37 @@ partial void ProcessPreviewModelRequestResponseContent(
public async global::System.Threading.Tasks.Task PreviewModelRequestAsync(
string agentId,
+ global::Letta.AnyOf request,
+ global::Letta.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await PreviewModelRequestAsResponseAsync(
+ agentId: agentId,
+
+ request: request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Preview Model Request
+ /// Inspect the raw LLM request payload without sending it.
+ /// This endpoint processes the message through the agent loop up until
+ /// the LLM request, then returns the raw request payload that would
+ /// be sent to the LLM provider. Useful for debugging and inspection.
+ ///
+ ///
+ /// The ID of the agent in the format 'agent-<uuid4>'
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> PreviewModelRequestAsResponseAsync(
+ string agentId,
+
global::Letta.AnyOf request,
global::Letta.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
@@ -106,6 +137,7 @@ partial void ProcessPreviewModelRequestResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Letta.PathBuilder(
path: $"/v1/agents/{agentId}/messages/preview-raw-payload",
baseUri: ResolveBaseUri(
@@ -188,6 +220,8 @@ partial void ProcessPreviewModelRequestResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -198,6 +232,11 @@ partial void ProcessPreviewModelRequestResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -215,6 +254,8 @@ partial void ProcessPreviewModelRequestResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -224,8 +265,7 @@ partial void ProcessPreviewModelRequestResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -234,6 +274,11 @@ partial void ProcessPreviewModelRequestResponseContent(
__attempt < __maxAttempts &&
global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -250,14 +295,15 @@ partial void ProcessPreviewModelRequestResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -297,6 +343,8 @@ partial void ProcessPreviewModelRequestResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -317,6 +365,8 @@ partial void ProcessPreviewModelRequestResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -379,7 +429,11 @@ partial void ProcessPreviewModelRequestResponseContent(
{
__response.EnsureSuccessStatusCode();
- return __content;
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __content);
}
catch (global::System.Exception __ex)
{
@@ -407,7 +461,11 @@ partial void ProcessPreviewModelRequestResponseContent(
#endif
).ConfigureAwait(false);
- return __content;
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __content);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.RecompileAgent.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.RecompileAgent.g.cs
index aec348b6..90c95be2 100644
--- a/src/libs/Letta/Generated/Letta.AgentsClient.RecompileAgent.g.cs
+++ b/src/libs/Letta/Generated/Letta.AgentsClient.RecompileAgent.g.cs
@@ -82,6 +82,41 @@ partial void ProcessRecompileAgentResponseContent(
bool? dryRun = default,
global::Letta.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await RecompileAgentAsResponseAsync(
+ agentId: agentId,
+ updateTimestamp: updateTimestamp,
+ dryRun: dryRun,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Recompile Agent
+ /// Manually trigger system prompt recompilation for an agent.
+ ///
+ ///
+ /// The ID of the agent in the format 'agent-<uuid4>'
+ ///
+ ///
+ /// If True, update the in-context memory last edit timestamp embedded in the system prompt.
+ /// Default Value: false
+ ///
+ ///
+ /// If True, do not persist changes; still returns the compiled system prompt.
+ /// Default Value: false
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> RecompileAgentAsResponseAsync(
+ string agentId,
+ bool? updateTimestamp = default,
+ bool? dryRun = default,
+ global::Letta.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -113,14 +148,15 @@ partial void ProcessRecompileAgentResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Letta.PathBuilder(
path: $"/v1/agents/{agentId}/recompile",
baseUri: ResolveBaseUri(
servers: s_RecompileAgentServers,
- defaultBaseUrl: "https://app.letta.com/"));
+ defaultBaseUrl: "https://app.letta.com/"));
__pathBuilder
.AddOptionalParameter("update_timestamp", updateTimestamp?.ToString().ToLowerInvariant())
- .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant())
+ .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant())
;
var __path = __pathBuilder.ToString();
__path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters(
@@ -194,6 +230,8 @@ partial void ProcessRecompileAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -204,6 +242,11 @@ partial void ProcessRecompileAgentResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -221,6 +264,8 @@ partial void ProcessRecompileAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -230,8 +275,7 @@ partial void ProcessRecompileAgentResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -240,6 +284,11 @@ partial void ProcessRecompileAgentResponseContent(
__attempt < __maxAttempts &&
global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -256,14 +305,15 @@ partial void ProcessRecompileAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -303,6 +353,8 @@ partial void ProcessRecompileAgentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -323,6 +375,8 @@ partial void ProcessRecompileAgentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -385,7 +439,11 @@ partial void ProcessRecompileAgentResponseContent(
{
__response.EnsureSuccessStatusCode();
- return __content;
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __content);
}
catch (global::System.Exception __ex)
{
@@ -413,7 +471,11 @@ partial void ProcessRecompileAgentResponseContent(
#endif
).ConfigureAwait(false);
- return __content;
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __content);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.ResetMessages.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.ResetMessages.g.cs
index a61027af..474f423b 100644
--- a/src/libs/Letta/Generated/Letta.AgentsClient.ResetMessages.g.cs
+++ b/src/libs/Letta/Generated/Letta.AgentsClient.ResetMessages.g.cs
@@ -70,6 +70,34 @@ partial void ProcessResetMessagesResponseContent(
public async global::System.Threading.Tasks.Task ResetMessagesAsync(
string agentId,
+ global::Letta.ResetMessagesRequest request,
+ global::Letta.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await ResetMessagesAsResponseAsync(
+ agentId: agentId,
+
+ request: request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Reset Messages
+ /// Resets the messages for an agent
+ ///
+ ///
+ /// The ID of the agent in the format 'agent-<uuid4>'
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> ResetMessagesAsResponseAsync(
+ string agentId,
+
global::Letta.ResetMessagesRequest request,
global::Letta.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
@@ -105,6 +133,7 @@ partial void ProcessResetMessagesResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Letta.PathBuilder(
path: $"/v1/agents/{agentId}/reset-messages",
baseUri: ResolveBaseUri(
@@ -187,6 +216,8 @@ partial void ProcessResetMessagesResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -197,6 +228,11 @@ partial void ProcessResetMessagesResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -214,6 +250,8 @@ partial void ProcessResetMessagesResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -223,8 +261,7 @@ partial void ProcessResetMessagesResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -233,6 +270,11 @@ partial void ProcessResetMessagesResponseContent(
__attempt < __maxAttempts &&
global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -249,14 +291,15 @@ partial void ProcessResetMessagesResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -296,6 +339,8 @@ partial void ProcessResetMessagesResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -316,6 +361,8 @@ partial void ProcessResetMessagesResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -378,9 +425,13 @@ partial void ProcessResetMessagesResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Letta.AgentState.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Letta.AgentState.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -408,9 +459,13 @@ partial void ProcessResetMessagesResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Letta.AgentState.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Letta.AgentState.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.RetrieveAgent.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.RetrieveAgent.g.cs
index 07bfbe7b..2b25e187 100644
--- a/src/libs/Letta/Generated/Letta.AgentsClient.RetrieveAgent.g.cs
+++ b/src/libs/Letta/Generated/Letta.AgentsClient.RetrieveAgent.g.cs
@@ -83,6 +83,40 @@ partial void ProcessRetrieveAgentResponseContent(
global::System.Collections.Generic.IList? include = default,
global::Letta.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await RetrieveAgentAsResponseAsync(
+ agentId: agentId,
+ includeRelationships: includeRelationships,
+ include: include,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Retrieve Agent
+ /// Get the state of the agent.
+ ///
+ ///
+ /// The ID of the agent in the format 'agent-<uuid4>'
+ ///
+ ///
+ /// Specify which relational fields (e.g., 'tools', 'sources', 'memory') to include in the response. If not provided, all relationships are loaded by default. Using this can optimize performance by reducing unnecessary joins.This is a legacy parameter, and no longer supported after 1.0.0 SDK versions.
+ ///
+ ///
+ /// Specify which relational fields to include in the response. No relationships are included by default.
+ /// Default Value: []
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> RetrieveAgentAsResponseAsync(
+ string agentId,
+ global::System.Collections.Generic.IList? includeRelationships = default,
+ global::System.Collections.Generic.IList? include = default,
+ global::Letta.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -114,14 +148,15 @@ partial void ProcessRetrieveAgentResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Letta.PathBuilder(
path: $"/v1/agents/{agentId}",
baseUri: ResolveBaseUri(
servers: s_RetrieveAgentServers,
- defaultBaseUrl: "https://app.letta.com/"));
+ defaultBaseUrl: "https://app.letta.com/"));
__pathBuilder
.AddOptionalParameter("include_relationships", includeRelationships?.ToString())
- .AddOptionalParameter("include", include, selector: static x => x.ToValueString(), delimiter: ",", explode: true)
+ .AddOptionalParameter("include", include, selector: static x => x.ToValueString(), delimiter: ",", explode: true)
;
var __path = __pathBuilder.ToString();
__path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters(
@@ -195,6 +230,8 @@ partial void ProcessRetrieveAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -205,6 +242,11 @@ partial void ProcessRetrieveAgentResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -222,6 +264,8 @@ partial void ProcessRetrieveAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -231,8 +275,7 @@ partial void ProcessRetrieveAgentResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -241,6 +284,11 @@ partial void ProcessRetrieveAgentResponseContent(
__attempt < __maxAttempts &&
global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -257,14 +305,15 @@ partial void ProcessRetrieveAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -304,6 +353,8 @@ partial void ProcessRetrieveAgentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -324,6 +375,8 @@ partial void ProcessRetrieveAgentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -386,9 +439,13 @@ partial void ProcessRetrieveAgentResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Letta.AgentState.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Letta.AgentState.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -416,9 +473,13 @@ partial void ProcessRetrieveAgentResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Letta.AgentState.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Letta.AgentState.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.RetrieveCoreMemoryBlock.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.RetrieveCoreMemoryBlock.g.cs
index cc3c69fb..94473c01 100644
--- a/src/libs/Letta/Generated/Letta.AgentsClient.RetrieveCoreMemoryBlock.g.cs
+++ b/src/libs/Letta/Generated/Letta.AgentsClient.RetrieveCoreMemoryBlock.g.cs
@@ -72,6 +72,32 @@ partial void ProcessRetrieveCoreMemoryBlockResponseContent(
string agentId,
global::Letta.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await RetrieveCoreMemoryBlockAsResponseAsync(
+ blockLabel: blockLabel,
+ agentId: agentId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Retrieve Block For Agent
+ /// Retrieve a core memory block from an agent.
+ ///
+ ///
+ ///
+ /// The ID of the agent in the format 'agent-<uuid4>'
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> RetrieveCoreMemoryBlockAsResponseAsync(
+ string blockLabel,
+ string agentId,
+ global::Letta.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -102,6 +128,7 @@ partial void ProcessRetrieveCoreMemoryBlockResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Letta.PathBuilder(
path: $"/v1/agents/{agentId}/core-memory/blocks/{blockLabel}",
baseUri: ResolveBaseUri(
@@ -178,6 +205,8 @@ partial void ProcessRetrieveCoreMemoryBlockResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -188,6 +217,11 @@ partial void ProcessRetrieveCoreMemoryBlockResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -205,6 +239,8 @@ partial void ProcessRetrieveCoreMemoryBlockResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -214,8 +250,7 @@ partial void ProcessRetrieveCoreMemoryBlockResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -224,6 +259,11 @@ partial void ProcessRetrieveCoreMemoryBlockResponseContent(
__attempt < __maxAttempts &&
global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -240,14 +280,15 @@ partial void ProcessRetrieveCoreMemoryBlockResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -287,6 +328,8 @@ partial void ProcessRetrieveCoreMemoryBlockResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -307,6 +350,8 @@ partial void ProcessRetrieveCoreMemoryBlockResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -369,9 +414,13 @@ partial void ProcessRetrieveCoreMemoryBlockResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Letta.BlockResponse.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Letta.BlockResponse.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -399,9 +448,13 @@ partial void ProcessRetrieveCoreMemoryBlockResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Letta.BlockResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Letta.BlockResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.RunToolForAgent.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.RunToolForAgent.g.cs
index d8735fd1..e9bdd829 100644
--- a/src/libs/Letta/Generated/Letta.AgentsClient.RunToolForAgent.g.cs
+++ b/src/libs/Letta/Generated/Letta.AgentsClient.RunToolForAgent.g.cs
@@ -76,6 +76,39 @@ partial void ProcessRunToolForAgentResponseContent(
string agentId,
string toolName,
+ global::Letta.LettaSchemasMcpServerToolExecuteRequest request,
+ global::Letta.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await RunToolForAgentAsResponseAsync(
+ agentId: agentId,
+ toolName: toolName,
+
+ request: request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Run Tool For Agent
+ /// Trigger a tool by name on a specific agent, providing the necessary arguments.
+ /// This endpoint executes a tool that is attached to the agent, using the agent's
+ /// state and environment variables for execution context.
+ ///
+ ///
+ /// The ID of the agent in the format 'agent-<uuid4>'
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> RunToolForAgentAsResponseAsync(
+ string agentId,
+ string toolName,
+
global::Letta.LettaSchemasMcpServerToolExecuteRequest request,
global::Letta.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
@@ -112,6 +145,7 @@ partial void ProcessRunToolForAgentResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Letta.PathBuilder(
path: $"/v1/agents/{agentId}/tools/{toolName}/run",
baseUri: ResolveBaseUri(
@@ -195,6 +229,8 @@ partial void ProcessRunToolForAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -205,6 +241,11 @@ partial void ProcessRunToolForAgentResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -222,6 +263,8 @@ partial void ProcessRunToolForAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -231,8 +274,7 @@ partial void ProcessRunToolForAgentResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -241,6 +283,11 @@ partial void ProcessRunToolForAgentResponseContent(
__attempt < __maxAttempts &&
global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -257,14 +304,15 @@ partial void ProcessRunToolForAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -304,6 +352,8 @@ partial void ProcessRunToolForAgentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -324,6 +374,8 @@ partial void ProcessRunToolForAgentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -386,9 +438,13 @@ partial void ProcessRunToolForAgentResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Letta.ToolExecutionResult.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Letta.ToolExecutionResult.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -416,9 +472,13 @@ partial void ProcessRunToolForAgentResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Letta.ToolExecutionResult.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Letta.ToolExecutionResult.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.SearchArchivalMemory.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.SearchArchivalMemory.g.cs
index ebcaeb29..c99af759 100644
--- a/src/libs/Letta/Generated/Letta.AgentsClient.SearchArchivalMemory.g.cs
+++ b/src/libs/Letta/Generated/Letta.AgentsClient.SearchArchivalMemory.g.cs
@@ -108,6 +108,63 @@ partial void ProcessSearchArchivalMemoryResponseContent(
global::System.DateTime? endDatetime = default,
global::Letta.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await SearchArchivalMemoryAsResponseAsync(
+ agentId: agentId,
+ query: query,
+ tags: tags,
+ tagMatchMode: tagMatchMode,
+ topK: topK,
+ startDatetime: startDatetime,
+ endDatetime: endDatetime,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Search Archival Memory
+ /// Search archival memory using semantic (embedding-based) search with optional temporal filtering.
+ /// This endpoint allows manual triggering of archival memory searches, enabling users to query
+ /// an agent's archival memory store directly via the API. The search uses the same functionality
+ /// as the agent's archival_memory_search tool but is accessible for external API usage.
+ ///
+ ///
+ /// The ID of the agent in the format 'agent-<uuid4>'
+ ///
+ ///
+ /// String to search for using semantic similarity
+ ///
+ ///
+ /// Optional list of tags to filter search results
+ ///
+ ///
+ /// How to match tags - 'any' to match passages with any of the tags, 'all' to match only passages with all tags
+ /// Default Value: any
+ ///
+ ///
+ /// Maximum number of results to return. Uses system default if not specified
+ ///
+ ///
+ /// Filter results to passages created after this datetime
+ ///
+ ///
+ /// Filter results to passages created before this datetime
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> SearchArchivalMemoryAsResponseAsync(
+ string agentId,
+ string query,
+ global::System.Collections.Generic.IList? tags = default,
+ global::Letta.SearchArchivalMemoryTagMatchMode? tagMatchMode = default,
+ int? topK = default,
+ global::System.DateTime? startDatetime = default,
+ global::System.DateTime? endDatetime = default,
+ global::Letta.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -143,18 +200,19 @@ partial void ProcessSearchArchivalMemoryResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Letta.PathBuilder(
path: $"/v1/agents/{agentId}/archival-memory/search",
baseUri: ResolveBaseUri(
servers: s_SearchArchivalMemoryServers,
- defaultBaseUrl: "https://app.letta.com/"));
+ defaultBaseUrl: "https://app.letta.com/"));
__pathBuilder
.AddRequiredParameter("query", query)
.AddOptionalParameter("tags", tags?.ToString())
.AddOptionalParameter("tag_match_mode", tagMatchMode?.ToValueString())
.AddOptionalParameter("top_k", topK?.ToString())
.AddOptionalParameter("start_datetime", startDatetime?.ToString())
- .AddOptionalParameter("end_datetime", endDatetime?.ToString())
+ .AddOptionalParameter("end_datetime", endDatetime?.ToString())
;
var __path = __pathBuilder.ToString();
__path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters(
@@ -232,6 +290,8 @@ partial void ProcessSearchArchivalMemoryResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -242,6 +302,11 @@ partial void ProcessSearchArchivalMemoryResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -259,6 +324,8 @@ partial void ProcessSearchArchivalMemoryResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -268,8 +335,7 @@ partial void ProcessSearchArchivalMemoryResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -278,6 +344,11 @@ partial void ProcessSearchArchivalMemoryResponseContent(
__attempt < __maxAttempts &&
global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -294,14 +365,15 @@ partial void ProcessSearchArchivalMemoryResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -341,6 +413,8 @@ partial void ProcessSearchArchivalMemoryResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -361,6 +435,8 @@ partial void ProcessSearchArchivalMemoryResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -423,9 +499,13 @@ partial void ProcessSearchArchivalMemoryResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Letta.ArchivalMemorySearchResponse.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Letta.ArchivalMemorySearchResponse.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -453,9 +533,13 @@ partial void ProcessSearchArchivalMemoryResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Letta.ArchivalMemorySearchResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Letta.ArchivalMemorySearchResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Letta.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.SearchMessages.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.SearchMessages.g.cs
index 9b57d660..478c8ec5 100644
--- a/src/libs/Letta/Generated/Letta.AgentsClient.SearchMessages.g.cs
+++ b/src/libs/Letta/Generated/Letta.AgentsClient.SearchMessages.g.cs
@@ -65,6 +65,30 @@ partial void ProcessSearchMessagesResponseContent(
///
public async global::System.Threading.Tasks.Task> SearchMessagesAsync(
+ global::Letta.MessageSearchRequest request,
+ global::Letta.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await SearchMessagesAsResponseAsync(
+
+ request: request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Search Messages
+ /// Search messages across the entire organization with optional project and template filtering. Returns messages with FTS/vector ranks and total RRF score.
+ /// This is a cloud-only feature.
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task>> SearchMessagesAsResponseAsync(
+
global::Letta.MessageSearchRequest request,
global::Letta.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
@@ -99,6 +123,7 @@ partial void ProcessSearchMessagesResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Letta.PathBuilder(
path: "/v1/agents/messages/search",
baseUri: ResolveBaseUri(
@@ -180,6 +205,8 @@ partial void ProcessSearchMessagesResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -190,6 +217,11 @@ partial void ProcessSearchMessagesResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -207,6 +239,8 @@ partial void ProcessSearchMessagesResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -216,8 +250,7 @@ partial void ProcessSearchMessagesResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -226,6 +259,11 @@ partial void ProcessSearchMessagesResponseContent(
__attempt < __maxAttempts &&
global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -242,14 +280,15 @@ partial void ProcessSearchMessagesResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -289,6 +328,8 @@ partial void ProcessSearchMessagesResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -309,6 +350,8 @@ partial void ProcessSearchMessagesResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -371,9 +414,13 @@ partial void ProcessSearchMessagesResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList