diff --git a/src/libs/Vectara/Generated/Vectara.AgentAnalyticsClient.GetTrace.g.cs b/src/libs/Vectara/Generated/Vectara.AgentAnalyticsClient.GetTrace.g.cs index ec549e1e..b43308dd 100644 --- a/src/libs/Vectara/Generated/Vectara.AgentAnalyticsClient.GetTrace.g.cs +++ b/src/libs/Vectara/Generated/Vectara.AgentAnalyticsClient.GetTrace.g.cs @@ -79,6 +79,35 @@ partial void ProcessGetTraceResponseContent( int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetTraceAsResponseAsync( + traceId: traceId, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get agent trace
+ /// Retrieve the summary of a specific agent trace by its trace ID. + ///
+ /// + /// + /// + /// Example: 0af7651916cd43dd8448eb211c80319c + /// + /// 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> GetTraceAsResponseAsync( + string traceId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -110,6 +139,7 @@ partial void ProcessGetTraceResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/agent_analytics/traces/{traceId}", baseUri: HttpClient.BaseAddress); @@ -195,6 +225,8 @@ partial void ProcessGetTraceResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -208,6 +240,11 @@ partial void ProcessGetTraceResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -225,6 +262,8 @@ partial void ProcessGetTraceResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -234,8 +273,7 @@ partial void ProcessGetTraceResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -244,6 +282,11 @@ partial void ProcessGetTraceResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -260,14 +303,15 @@ partial void ProcessGetTraceResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -307,6 +351,8 @@ partial void ProcessGetTraceResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -327,6 +373,8 @@ partial void ProcessGetTraceResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow accessing this trace. @@ -427,9 +475,13 @@ partial void ProcessGetTraceResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.AgentTrace.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.AgentTrace.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -457,9 +509,13 @@ partial void ProcessGetTraceResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.AgentTrace.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.AgentTrace.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.AgentAnalyticsClient.GetTraceSpan.g.cs b/src/libs/Vectara/Generated/Vectara.AgentAnalyticsClient.GetTraceSpan.g.cs index 860ccbf2..5b92ce1f 100644 --- a/src/libs/Vectara/Generated/Vectara.AgentAnalyticsClient.GetTraceSpan.g.cs +++ b/src/libs/Vectara/Generated/Vectara.AgentAnalyticsClient.GetTraceSpan.g.cs @@ -87,6 +87,41 @@ partial void ProcessGetTraceSpanResponseContent( bool? includeContent = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetTraceSpanAsResponseAsync( + traceId: traceId, + spanId: spanId, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + includeContent: includeContent, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get span in a trace
+ /// Retrieve the details of a specific span within a trace. + ///
+ /// + /// + /// + /// + /// + /// 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> GetTraceSpanAsResponseAsync( + string traceId, + string spanId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + bool? includeContent = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -120,11 +155,12 @@ partial void ProcessGetTraceSpanResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/agent_analytics/traces/{traceId}/spans/{spanId}", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder - .AddOptionalParameter("include_content", includeContent?.ToString().ToLowerInvariant()) + .AddOptionalParameter("include_content", includeContent?.ToString().ToLowerInvariant()) ; var __path = __pathBuilder.ToString(); __path = global::Vectara.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -210,6 +246,8 @@ partial void ProcessGetTraceSpanResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -223,6 +261,11 @@ partial void ProcessGetTraceSpanResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -240,6 +283,8 @@ partial void ProcessGetTraceSpanResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -249,8 +294,7 @@ partial void ProcessGetTraceSpanResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -259,6 +303,11 @@ partial void ProcessGetTraceSpanResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -275,14 +324,15 @@ partial void ProcessGetTraceSpanResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -322,6 +372,8 @@ partial void ProcessGetTraceSpanResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -342,6 +394,8 @@ partial void ProcessGetTraceSpanResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow accessing this span. @@ -442,9 +496,13 @@ partial void ProcessGetTraceSpanResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.AgentTraceSpan.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.AgentTraceSpan.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -472,9 +530,13 @@ partial void ProcessGetTraceSpanResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.AgentTraceSpan.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.AgentTraceSpan.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.AgentAnalyticsClient.ListTraceSpans.g.cs b/src/libs/Vectara/Generated/Vectara.AgentAnalyticsClient.ListTraceSpans.g.cs index 428d073c..af4c9a08 100644 --- a/src/libs/Vectara/Generated/Vectara.AgentAnalyticsClient.ListTraceSpans.g.cs +++ b/src/libs/Vectara/Generated/Vectara.AgentAnalyticsClient.ListTraceSpans.g.cs @@ -97,6 +97,49 @@ partial void ProcessListTraceSpansResponseContent( string? pageKey = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListTraceSpansAsResponseAsync( + traceId: traceId, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + includeContent: includeContent, + operation: operation, + limit: limit, + pageKey: pageKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List spans in a trace
+ /// Retrieve the flat list of spans for a given trace, each with its parent_span_id for reconstructing the tree. + ///
+ /// + /// + /// + /// + /// Default Value: false + /// + /// + /// + /// Default Value: 100 + /// + /// + /// 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> ListTraceSpansAsResponseAsync( + string traceId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + bool? includeContent = default, + global::Vectara.ListTraceSpansOperation? operation = default, + int? limit = default, + string? pageKey = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -132,14 +175,15 @@ partial void ProcessListTraceSpansResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/agent_analytics/traces/{traceId}/spans", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("include_content", includeContent?.ToString().ToLowerInvariant()) .AddOptionalParameter("operation", operation?.ToValueString()) .AddOptionalParameter("limit", limit?.ToString()) - .AddOptionalParameter("page_key", pageKey) + .AddOptionalParameter("page_key", pageKey) ; var __path = __pathBuilder.ToString(); __path = global::Vectara.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -227,6 +271,8 @@ partial void ProcessListTraceSpansResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -240,6 +286,11 @@ partial void ProcessListTraceSpansResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -257,6 +308,8 @@ partial void ProcessListTraceSpansResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -266,8 +319,7 @@ partial void ProcessListTraceSpansResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -276,6 +328,11 @@ partial void ProcessListTraceSpansResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -292,14 +349,15 @@ partial void ProcessListTraceSpansResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -339,6 +397,8 @@ partial void ProcessListTraceSpansResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -359,6 +419,8 @@ partial void ProcessListTraceSpansResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow accessing this trace. @@ -459,9 +521,13 @@ partial void ProcessListTraceSpansResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.ListAgentTraceSpansResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.ListAgentTraceSpansResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -489,9 +555,13 @@ partial void ProcessListTraceSpansResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.ListAgentTraceSpansResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.ListAgentTraceSpansResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.AgentAnalyticsClient.ListTraces.g.cs b/src/libs/Vectara/Generated/Vectara.AgentAnalyticsClient.ListTraces.g.cs index be4c9360..873ccb04 100644 --- a/src/libs/Vectara/Generated/Vectara.AgentAnalyticsClient.ListTraces.g.cs +++ b/src/libs/Vectara/Generated/Vectara.AgentAnalyticsClient.ListTraces.g.cs @@ -127,6 +127,71 @@ partial void ProcessListTracesResponseContent( string? pageKey = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListTracesAsResponseAsync( + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + agentKey: agentKey, + sessionKey: sessionKey, + status: status, + errorType: errorType, + operation: operation, + toolName: toolName, + toolErrorType: toolErrorType, + startedAfter: startedAfter, + startedBefore: startedBefore, + minDurationMs: minDurationMs, + maxDurationMs: maxDurationMs, + limit: limit, + pageKey: pageKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List agent traces
+ /// List agent traces with optional filtering by agent, session, status, and time range. + ///
+ /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// Default Value: 10 + /// + /// + /// 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> ListTracesAsResponseAsync( + int? requestTimeout = default, + int? requestTimeoutMillis = default, + string? agentKey = default, + string? sessionKey = default, + global::Vectara.ListTracesStatus? status = default, + global::Vectara.ListTracesErrorType? errorType = default, + global::Vectara.ListTracesOperation? operation = default, + string? toolName = default, + global::Vectara.ListTracesToolErrorType? toolErrorType = default, + global::System.DateTime? startedAfter = default, + global::System.DateTime? startedBefore = default, + long? minDurationMs = default, + long? maxDurationMs = default, + int? limit = default, + string? pageKey = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -170,9 +235,10 @@ partial void ProcessListTracesResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: "/v2/agent_analytics/traces", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("agent_key", agentKey) .AddOptionalParameter("session_key", sessionKey) @@ -186,7 +252,7 @@ partial void ProcessListTracesResponseContent( .AddOptionalParameter("min_duration_ms", minDurationMs?.ToString()) .AddOptionalParameter("max_duration_ms", maxDurationMs?.ToString()) .AddOptionalParameter("limit", limit?.ToString()) - .AddOptionalParameter("page_key", pageKey) + .AddOptionalParameter("page_key", pageKey) ; var __path = __pathBuilder.ToString(); __path = global::Vectara.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -282,6 +348,8 @@ partial void ProcessListTracesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -295,6 +363,11 @@ partial void ProcessListTracesResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -312,6 +385,8 @@ partial void ProcessListTracesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -321,8 +396,7 @@ partial void ProcessListTracesResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -331,6 +405,11 @@ partial void ProcessListTracesResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -347,14 +426,15 @@ partial void ProcessListTracesResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -394,6 +474,8 @@ partial void ProcessListTracesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -414,6 +496,8 @@ partial void ProcessListTracesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow listing traces. @@ -476,9 +560,13 @@ partial void ProcessListTracesResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.ListAgentTracesResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.ListAgentTracesResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -506,9 +594,13 @@ partial void ProcessListTracesResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.ListAgentTracesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.ListAgentTracesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.AgentAnalyticsClient.g.cs b/src/libs/Vectara/Generated/Vectara.AgentAnalyticsClient.g.cs index 4eb291fe..18814e47 100644 --- a/src/libs/Vectara/Generated/Vectara.AgentAnalyticsClient.g.cs +++ b/src/libs/Vectara/Generated/Vectara.AgentAnalyticsClient.g.cs @@ -75,10 +75,10 @@ public AgentAnalyticsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public AgentAnalyticsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Vectara.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Vectara.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Vectara/Generated/Vectara.AgentArtifactsClient.Get3.g.cs b/src/libs/Vectara/Generated/Vectara.AgentArtifactsClient.Get3.g.cs index 7e376e5e..211a9a0e 100644 --- a/src/libs/Vectara/Generated/Vectara.AgentArtifactsClient.Get3.g.cs +++ b/src/libs/Vectara/Generated/Vectara.AgentArtifactsClient.Get3.g.cs @@ -93,6 +93,47 @@ partial void ProcessGet3ResponseContent( int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await Get3AsResponseAsync( + agentKey: agentKey, + sessionKey: sessionKey, + artifactId: artifactId, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get session artifact
+ /// Retrieve a specific artifact by its unique `artifact_id`, including metadata and base64-encoded file content. + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// + /// + /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat + /// + /// + /// Example: art_report_pdf_a3f2 + /// + /// 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> Get3AsResponseAsync( + string agentKey, + string sessionKey, + string artifactId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -126,6 +167,7 @@ partial void ProcessGet3ResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/agents/{agentKey}/sessions/{sessionKey}/artifacts/{artifactId}", baseUri: HttpClient.BaseAddress); @@ -213,6 +255,8 @@ partial void ProcessGet3ResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -226,6 +270,11 @@ partial void ProcessGet3ResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -243,6 +292,8 @@ partial void ProcessGet3ResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -252,8 +303,7 @@ partial void ProcessGet3ResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -262,6 +312,11 @@ partial void ProcessGet3ResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -278,14 +333,15 @@ partial void ProcessGet3ResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -325,6 +381,8 @@ partial void ProcessGet3ResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -345,6 +403,8 @@ partial void ProcessGet3ResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow accessing this artifact. @@ -445,9 +505,13 @@ partial void ProcessGet3ResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.SessionArtifact.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.SessionArtifact.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -475,9 +539,13 @@ partial void ProcessGet3ResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.SessionArtifact.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.SessionArtifact.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.AgentArtifactsClient.List3.g.cs b/src/libs/Vectara/Generated/Vectara.AgentArtifactsClient.List3.g.cs index 8bebe1ab..3f384ab9 100644 --- a/src/libs/Vectara/Generated/Vectara.AgentArtifactsClient.List3.g.cs +++ b/src/libs/Vectara/Generated/Vectara.AgentArtifactsClient.List3.g.cs @@ -109,6 +109,60 @@ partial void ProcessList3ResponseContent( global::Vectara.ListSessionArtifactsOrderBy? orderBy = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await List3AsResponseAsync( + agentKey: agentKey, + sessionKey: sessionKey, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + limit: limit, + pageKey: pageKey, + sortBy: sortBy, + orderBy: orderBy, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List session artifacts
+ /// List all artifacts stored in a specific agent session, with cursor-based pagination. Artifacts are files either uploaded by the user, or generated within a session. This endpoint shows you what files exist in a session, but does not include the file content. + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// + /// + /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat + /// + /// + /// Default Value: 10 + /// + /// + /// + /// Default Value: created_at + /// + /// + /// Default Value: desc + /// + /// 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> List3AsResponseAsync( + string agentKey, + string sessionKey, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + int? limit = default, + string? pageKey = default, + global::Vectara.ListSessionArtifactsSortBy? sortBy = default, + global::Vectara.ListSessionArtifactsOrderBy? orderBy = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -145,14 +199,15 @@ partial void ProcessList3ResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/agents/{agentKey}/sessions/{sessionKey}/artifacts", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("page_key", pageKey) .AddOptionalParameter("sort_by", sortBy?.ToValueString()) - .AddOptionalParameter("order_by", orderBy?.ToValueString()) + .AddOptionalParameter("order_by", orderBy?.ToValueString()) ; var __path = __pathBuilder.ToString(); __path = global::Vectara.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -241,6 +296,8 @@ partial void ProcessList3ResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -254,6 +311,11 @@ partial void ProcessList3ResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -271,6 +333,8 @@ partial void ProcessList3ResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -280,8 +344,7 @@ partial void ProcessList3ResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -290,6 +353,11 @@ partial void ProcessList3ResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -306,14 +374,15 @@ partial void ProcessList3ResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -353,6 +422,8 @@ partial void ProcessList3ResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -373,6 +444,8 @@ partial void ProcessList3ResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow listing artifacts in this session. @@ -473,9 +546,13 @@ partial void ProcessList3ResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.ListSessionArtifactsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.ListSessionArtifactsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -503,9 +580,13 @@ partial void ProcessList3ResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.ListSessionArtifactsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.ListSessionArtifactsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.AgentArtifactsClient.g.cs b/src/libs/Vectara/Generated/Vectara.AgentArtifactsClient.g.cs index 7533014c..f4d4daf5 100644 --- a/src/libs/Vectara/Generated/Vectara.AgentArtifactsClient.g.cs +++ b/src/libs/Vectara/Generated/Vectara.AgentArtifactsClient.g.cs @@ -75,10 +75,10 @@ public AgentArtifactsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public AgentArtifactsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Vectara.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Vectara.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Vectara/Generated/Vectara.AgentEventsClient.Create2.g.cs b/src/libs/Vectara/Generated/Vectara.AgentEventsClient.Create2.g.cs index 452f3c84..6769fc3a 100644 --- a/src/libs/Vectara/Generated/Vectara.AgentEventsClient.Create2.g.cs +++ b/src/libs/Vectara/Generated/Vectara.AgentEventsClient.Create2.g.cs @@ -87,6 +87,47 @@ partial void ProcessCreate2ResponseContent( string agentKey, string sessionKey, + global::Vectara.CreateInputRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await Create2AsResponseAsync( + agentKey: agentKey, + sessionKey: sessionKey, + + request: request, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Interact with an agent
+ /// Create a new input to an agent to interact with it. + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// + /// + /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat + /// + /// + /// 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> Create2AsResponseAsync( + string agentKey, + string sessionKey, + global::Vectara.CreateInputRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, @@ -125,6 +166,7 @@ partial void ProcessCreate2ResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/agents/{agentKey}/sessions/{sessionKey}/events", baseUri: HttpClient.BaseAddress); @@ -218,6 +260,8 @@ partial void ProcessCreate2ResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -231,6 +275,11 @@ partial void ProcessCreate2ResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -248,6 +297,8 @@ partial void ProcessCreate2ResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -257,8 +308,7 @@ partial void ProcessCreate2ResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -267,6 +317,11 @@ partial void ProcessCreate2ResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -283,14 +338,15 @@ partial void ProcessCreate2ResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -330,6 +386,8 @@ partial void ProcessCreate2ResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -350,6 +408,8 @@ partial void ProcessCreate2ResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Input event creation request was malformed. @@ -602,9 +662,13 @@ partial void ProcessCreate2ResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.AgentResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.AgentResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -632,9 +696,13 @@ partial void ProcessCreate2ResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.AgentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.AgentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.AgentEventsClient.Create2AsStream.g.cs b/src/libs/Vectara/Generated/Vectara.AgentEventsClient.Create2AsStream.g.cs index 064c02a5..1c123aca 100644 --- a/src/libs/Vectara/Generated/Vectara.AgentEventsClient.Create2AsStream.g.cs +++ b/src/libs/Vectara/Generated/Vectara.AgentEventsClient.Create2AsStream.g.cs @@ -120,6 +120,7 @@ partial void ProcessCreate2AsStreamResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/agents/{agentKey}/sessions/{sessionKey}/events", baseUri: HttpClient.BaseAddress); @@ -213,6 +214,8 @@ partial void ProcessCreate2AsStreamResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -226,6 +229,11 @@ partial void ProcessCreate2AsStreamResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -243,6 +251,8 @@ partial void ProcessCreate2AsStreamResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -252,8 +262,7 @@ partial void ProcessCreate2AsStreamResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -262,6 +271,11 @@ partial void ProcessCreate2AsStreamResponse( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -278,14 +292,15 @@ partial void ProcessCreate2AsStreamResponse( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -325,6 +340,8 @@ partial void ProcessCreate2AsStreamResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -345,6 +362,8 @@ partial void ProcessCreate2AsStreamResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } diff --git a/src/libs/Vectara/Generated/Vectara.AgentEventsClient.Delete2.g.cs b/src/libs/Vectara/Generated/Vectara.AgentEventsClient.Delete2.g.cs index ebfadca0..420d8f35 100644 --- a/src/libs/Vectara/Generated/Vectara.AgentEventsClient.Delete2.g.cs +++ b/src/libs/Vectara/Generated/Vectara.AgentEventsClient.Delete2.g.cs @@ -86,6 +86,43 @@ partial void ProcessDelete2Response( int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await Delete2AsResponseAsync( + agentKey: agentKey, + sessionKey: sessionKey, + eventId: eventId, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Delete event
+ /// Permanently delete an event from a session. Removes the event from both the metadata database and the encrypted event store. + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// + /// + /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat + /// + /// + /// 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 Delete2AsResponseAsync( + string agentKey, + string sessionKey, + string eventId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -119,6 +156,7 @@ partial void ProcessDelete2Response( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/agents/{agentKey}/sessions/{sessionKey}/events/{eventId}", baseUri: HttpClient.BaseAddress); @@ -206,6 +244,8 @@ partial void ProcessDelete2Response( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -219,6 +259,11 @@ partial void ProcessDelete2Response( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -236,6 +281,8 @@ partial void ProcessDelete2Response( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -245,8 +292,7 @@ partial void ProcessDelete2Response( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -255,6 +301,11 @@ partial void ProcessDelete2Response( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -271,14 +322,15 @@ partial void ProcessDelete2Response( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -318,6 +370,8 @@ partial void ProcessDelete2Response( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -338,6 +392,8 @@ partial void ProcessDelete2Response( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Agent, session, or event not found. @@ -396,6 +452,10 @@ partial void ProcessDelete2Response( { __response.EnsureSuccessStatusCode(); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -417,6 +477,10 @@ partial void ProcessDelete2Response( try { __response.EnsureSuccessStatusCode(); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.AgentEventsClient.Get2.g.cs b/src/libs/Vectara/Generated/Vectara.AgentEventsClient.Get2.g.cs index affee236..7dc968c9 100644 --- a/src/libs/Vectara/Generated/Vectara.AgentEventsClient.Get2.g.cs +++ b/src/libs/Vectara/Generated/Vectara.AgentEventsClient.Get2.g.cs @@ -93,6 +93,47 @@ partial void ProcessGet2ResponseContent( int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await Get2AsResponseAsync( + agentKey: agentKey, + sessionKey: sessionKey, + eventId: eventId, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get event in agent session
+ /// Retrieve the details of a specific event within an agent session. + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// + /// + /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat + /// + /// + /// Example: aev_user_001 + /// + /// 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> Get2AsResponseAsync( + string agentKey, + string sessionKey, + string eventId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -126,6 +167,7 @@ partial void ProcessGet2ResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/agents/{agentKey}/sessions/{sessionKey}/events/{eventId}", baseUri: HttpClient.BaseAddress); @@ -213,6 +255,8 @@ partial void ProcessGet2ResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -226,6 +270,11 @@ partial void ProcessGet2ResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -243,6 +292,8 @@ partial void ProcessGet2ResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -252,8 +303,7 @@ partial void ProcessGet2ResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -262,6 +312,11 @@ partial void ProcessGet2ResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -278,14 +333,15 @@ partial void ProcessGet2ResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -325,6 +381,8 @@ partial void ProcessGet2ResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -345,6 +403,8 @@ partial void ProcessGet2ResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow accessing this event. @@ -445,9 +505,13 @@ partial void ProcessGet2ResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.AgentEvent.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.AgentEvent.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -475,9 +539,13 @@ partial void ProcessGet2ResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.AgentEvent.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.AgentEvent.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.AgentEventsClient.Hide.g.cs b/src/libs/Vectara/Generated/Vectara.AgentEventsClient.Hide.g.cs index 3c917009..0893c006 100644 --- a/src/libs/Vectara/Generated/Vectara.AgentEventsClient.Hide.g.cs +++ b/src/libs/Vectara/Generated/Vectara.AgentEventsClient.Hide.g.cs @@ -91,6 +91,45 @@ partial void ProcessHideResponseContent( int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await HideAsResponseAsync( + agentKey: agentKey, + sessionKey: sessionKey, + eventId: eventId, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Hide event
+ /// Manually hide an event in a session. Sets hide_reason to 'manual'. + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// + /// + /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat + /// + /// + /// 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> HideAsResponseAsync( + string agentKey, + string sessionKey, + string eventId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -124,6 +163,7 @@ partial void ProcessHideResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/agents/{agentKey}/sessions/{sessionKey}/events/{eventId}/hide", baseUri: HttpClient.BaseAddress); @@ -211,6 +251,8 @@ partial void ProcessHideResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -224,6 +266,11 @@ partial void ProcessHideResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -241,6 +288,8 @@ partial void ProcessHideResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -250,8 +299,7 @@ partial void ProcessHideResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -260,6 +308,11 @@ partial void ProcessHideResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -276,14 +329,15 @@ partial void ProcessHideResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -323,6 +377,8 @@ partial void ProcessHideResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -343,6 +399,8 @@ partial void ProcessHideResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Agent, session, or event not found. @@ -405,9 +463,13 @@ partial void ProcessHideResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.AgentEvent.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.AgentEvent.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -435,9 +497,13 @@ partial void ProcessHideResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.AgentEvent.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.AgentEvent.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.AgentEventsClient.List2.g.cs b/src/libs/Vectara/Generated/Vectara.AgentEventsClient.List2.g.cs index 82c3a9d0..77a6c709 100644 --- a/src/libs/Vectara/Generated/Vectara.AgentEventsClient.List2.g.cs +++ b/src/libs/Vectara/Generated/Vectara.AgentEventsClient.List2.g.cs @@ -103,6 +103,55 @@ partial void ProcessList2ResponseContent( bool? includeHidden = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await List2AsResponseAsync( + agentKey: agentKey, + sessionKey: sessionKey, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + limit: limit, + pageKey: pageKey, + includeHidden: includeHidden, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List events in agent session
+ /// List all events in a specific agent session, with optional pagination. + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// + /// + /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat + /// + /// + /// Default Value: 10 + /// + /// + /// + /// 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> List2AsResponseAsync( + string agentKey, + string sessionKey, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + int? limit = default, + string? pageKey = default, + bool? includeHidden = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -138,13 +187,14 @@ partial void ProcessList2ResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/agents/{agentKey}/sessions/{sessionKey}/events", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("page_key", pageKey) - .AddOptionalParameter("include_hidden", includeHidden?.ToString().ToLowerInvariant()) + .AddOptionalParameter("include_hidden", includeHidden?.ToString().ToLowerInvariant()) ; var __path = __pathBuilder.ToString(); __path = global::Vectara.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -232,6 +282,8 @@ partial void ProcessList2ResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -245,6 +297,11 @@ partial void ProcessList2ResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -262,6 +319,8 @@ partial void ProcessList2ResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -271,8 +330,7 @@ partial void ProcessList2ResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -281,6 +339,11 @@ partial void ProcessList2ResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -297,14 +360,15 @@ partial void ProcessList2ResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -344,6 +408,8 @@ partial void ProcessList2ResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -364,6 +430,8 @@ partial void ProcessList2ResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow listing events in this session. @@ -464,9 +532,13 @@ partial void ProcessList2ResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.ListAgentEventsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.ListAgentEventsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -494,9 +566,13 @@ partial void ProcessList2ResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.ListAgentEventsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.ListAgentEventsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.AgentEventsClient.Unhide.g.cs b/src/libs/Vectara/Generated/Vectara.AgentEventsClient.Unhide.g.cs index 73b200c9..2525dd47 100644 --- a/src/libs/Vectara/Generated/Vectara.AgentEventsClient.Unhide.g.cs +++ b/src/libs/Vectara/Generated/Vectara.AgentEventsClient.Unhide.g.cs @@ -91,6 +91,45 @@ partial void ProcessUnhideResponseContent( int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UnhideAsResponseAsync( + agentKey: agentKey, + sessionKey: sessionKey, + eventId: eventId, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Unhide event
+ /// Unhide a hidden event in a session. Clears the hide_reason. + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// + /// + /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat + /// + /// + /// 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> UnhideAsResponseAsync( + string agentKey, + string sessionKey, + string eventId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -124,6 +163,7 @@ partial void ProcessUnhideResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/agents/{agentKey}/sessions/{sessionKey}/events/{eventId}/unhide", baseUri: HttpClient.BaseAddress); @@ -211,6 +251,8 @@ partial void ProcessUnhideResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -224,6 +266,11 @@ partial void ProcessUnhideResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -241,6 +288,8 @@ partial void ProcessUnhideResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -250,8 +299,7 @@ partial void ProcessUnhideResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -260,6 +308,11 @@ partial void ProcessUnhideResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -276,14 +329,15 @@ partial void ProcessUnhideResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -323,6 +377,8 @@ partial void ProcessUnhideResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -343,6 +399,8 @@ partial void ProcessUnhideResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Agent, session, or event not found. @@ -405,9 +463,13 @@ partial void ProcessUnhideResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.AgentEvent.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.AgentEvent.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -435,9 +497,13 @@ partial void ProcessUnhideResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.AgentEvent.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.AgentEvent.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.AgentEventsClient.g.cs b/src/libs/Vectara/Generated/Vectara.AgentEventsClient.g.cs index 2e5e26fd..708fefa6 100644 --- a/src/libs/Vectara/Generated/Vectara.AgentEventsClient.g.cs +++ b/src/libs/Vectara/Generated/Vectara.AgentEventsClient.g.cs @@ -75,10 +75,10 @@ public AgentEventsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public AgentEventsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Vectara.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Vectara.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Vectara/Generated/Vectara.AgentSchedulesClient.Create.g.cs b/src/libs/Vectara/Generated/Vectara.AgentSchedulesClient.Create.g.cs index 130a775c..299d0355 100644 --- a/src/libs/Vectara/Generated/Vectara.AgentSchedulesClient.Create.g.cs +++ b/src/libs/Vectara/Generated/Vectara.AgentSchedulesClient.Create.g.cs @@ -100,6 +100,61 @@ partial void ProcessCreateResponseContent( public async global::System.Threading.Tasks.Task CreateAsync( string agentKey, + global::Vectara.CreateAgentScheduleRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateAsResponseAsync( + agentKey: agentKey, + + request: request, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create agent schedule
+ /// Create a new schedule for automatically executing an agent at specified intervals. Each execution creates a new session with the configured message and metadata.
+ /// Schedules enable automated agent workflows such as daily reports, periodic monitoring, or regular data processing. The schedule will create sessions tagged with metadata to identify them as scheduled executions.
+ /// ## Example request
+ /// ```json
+ /// \$ curl -X POST https://api.vectara.io/v2/agents/support-agent/schedules \
+ /// -H "Authorization: Bearer YOUR_API_KEY" \c
+ /// -H "Content-Type: application/json" \
+ /// -d '{
+ /// "key": "daily-report",
+ /// "name": "Daily Summary Report",
+ /// "message": [{"type": "text", "content": "Generate a summary of today's activities"}],
+ /// "schedule": {
+ /// "type": "interval",
+ /// "interval": "PT24H"
+ /// },
+ /// "session_metadata": {
+ /// "report_type": "daily"
+ /// }
+ /// }'
+ /// ```
+ /// A successful response includes the unique schedule key, configuration, and creation timestamp. + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// + /// + /// 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> CreateAsResponseAsync( + string agentKey, + global::Vectara.CreateAgentScheduleRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, @@ -139,6 +194,7 @@ partial void ProcessCreateResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/agents/{agentKey}/schedules", baseUri: HttpClient.BaseAddress); @@ -231,6 +287,8 @@ partial void ProcessCreateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -244,6 +302,11 @@ partial void ProcessCreateResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -261,6 +324,8 @@ partial void ProcessCreateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -270,8 +335,7 @@ partial void ProcessCreateResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -280,6 +344,11 @@ partial void ProcessCreateResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -296,14 +365,15 @@ partial void ProcessCreateResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -343,6 +413,8 @@ partial void ProcessCreateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -363,6 +435,8 @@ partial void ProcessCreateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Schedule creation request was malformed or invalid. @@ -539,9 +613,13 @@ partial void ProcessCreateResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.AgentSchedule.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.AgentSchedule.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -569,9 +647,13 @@ partial void ProcessCreateResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.AgentSchedule.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.AgentSchedule.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.AgentSchedulesClient.Delete.g.cs b/src/libs/Vectara/Generated/Vectara.AgentSchedulesClient.Delete.g.cs index 79f69d1e..6aaafbff 100644 --- a/src/libs/Vectara/Generated/Vectara.AgentSchedulesClient.Delete.g.cs +++ b/src/libs/Vectara/Generated/Vectara.AgentSchedulesClient.Delete.g.cs @@ -84,6 +84,42 @@ partial void ProcessDeleteResponse( int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await DeleteAsResponseAsync( + agentKey: agentKey, + scheduleKey: scheduleKey, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Delete agent schedule
+ /// Delete an agent schedule. This stops all future executions of the schedule.
+ /// Sessions that were previously created by this schedule are not deleted and remain accessible. + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// + /// + /// A unique key that identifies an agent schedule. Uses "key" terminology (instead of "id")
+ /// for consistency with other Vectara API resources (AgentKey, SessionKey, CorpusKey, etc.).
+ /// Example: daily-report + /// + /// 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 DeleteAsResponseAsync( + string agentKey, + string scheduleKey, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -116,6 +152,7 @@ partial void ProcessDeleteResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/agents/{agentKey}/schedules/{scheduleKey}", baseUri: HttpClient.BaseAddress); @@ -202,6 +239,8 @@ partial void ProcessDeleteResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -215,6 +254,11 @@ partial void ProcessDeleteResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -232,6 +276,8 @@ partial void ProcessDeleteResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -241,8 +287,7 @@ partial void ProcessDeleteResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -251,6 +296,11 @@ partial void ProcessDeleteResponse( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -267,14 +317,15 @@ partial void ProcessDeleteResponse( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -314,6 +365,8 @@ partial void ProcessDeleteResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -334,6 +387,8 @@ partial void ProcessDeleteResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow deleting this schedule. @@ -430,6 +485,10 @@ partial void ProcessDeleteResponse( { __response.EnsureSuccessStatusCode(); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -451,6 +510,10 @@ partial void ProcessDeleteResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.AgentSchedulesClient.Get.g.cs b/src/libs/Vectara/Generated/Vectara.AgentSchedulesClient.Get.g.cs index fed2e948..3c00ddd5 100644 --- a/src/libs/Vectara/Generated/Vectara.AgentSchedulesClient.Get.g.cs +++ b/src/libs/Vectara/Generated/Vectara.AgentSchedulesClient.Get.g.cs @@ -88,6 +88,43 @@ partial void ProcessGetResponseContent( int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetAsResponseAsync( + agentKey: agentKey, + scheduleKey: scheduleKey, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get agent schedule
+ /// Retrieve the full details of a specific agent schedule using its unique schedule key. The response includes the schedule's configuration, execution history, and timestamps. + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// + /// + /// A unique key that identifies an agent schedule. Uses "key" terminology (instead of "id")
+ /// for consistency with other Vectara API resources (AgentKey, SessionKey, CorpusKey, etc.).
+ /// Example: daily-report + /// + /// 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> GetAsResponseAsync( + string agentKey, + string scheduleKey, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -120,6 +157,7 @@ partial void ProcessGetResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/agents/{agentKey}/schedules/{scheduleKey}", baseUri: HttpClient.BaseAddress); @@ -206,6 +244,8 @@ partial void ProcessGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -219,6 +259,11 @@ partial void ProcessGetResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -236,6 +281,8 @@ partial void ProcessGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -245,8 +292,7 @@ partial void ProcessGetResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -255,6 +301,11 @@ partial void ProcessGetResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -271,14 +322,15 @@ partial void ProcessGetResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -318,6 +370,8 @@ partial void ProcessGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -338,6 +392,8 @@ partial void ProcessGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow accessing this schedule. @@ -438,9 +494,13 @@ partial void ProcessGetResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.AgentSchedule.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.AgentSchedule.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -468,9 +528,13 @@ partial void ProcessGetResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.AgentSchedule.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.AgentSchedule.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.AgentSchedulesClient.List.g.cs b/src/libs/Vectara/Generated/Vectara.AgentSchedulesClient.List.g.cs index a5a8d75b..d685b79d 100644 --- a/src/libs/Vectara/Generated/Vectara.AgentSchedulesClient.List.g.cs +++ b/src/libs/Vectara/Generated/Vectara.AgentSchedulesClient.List.g.cs @@ -90,6 +90,44 @@ partial void ProcessListResponseContent( string? pageKey = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListAsResponseAsync( + agentKey: agentKey, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + limit: limit, + pageKey: pageKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List agent schedules
+ /// List all schedules for the specified agent. This endpoint returns high-level information about each schedule including execution status and next scheduled execution time. + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// + /// + /// Default Value: 10 + /// + /// + /// 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> ListAsResponseAsync( + string agentKey, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + int? limit = default, + string? pageKey = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -123,12 +161,13 @@ partial void ProcessListResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/agents/{agentKey}/schedules", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("limit", limit?.ToString()) - .AddOptionalParameter("page_key", pageKey) + .AddOptionalParameter("page_key", pageKey) ; var __path = __pathBuilder.ToString(); __path = global::Vectara.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -214,6 +253,8 @@ partial void ProcessListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -227,6 +268,11 @@ partial void ProcessListResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -244,6 +290,8 @@ partial void ProcessListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -253,8 +301,7 @@ partial void ProcessListResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -263,6 +310,11 @@ partial void ProcessListResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -279,14 +331,15 @@ partial void ProcessListResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -326,6 +379,8 @@ partial void ProcessListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -346,6 +401,8 @@ partial void ProcessListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow listing agent schedules. @@ -446,9 +503,13 @@ partial void ProcessListResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.ListAgentSchedulesResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.ListAgentSchedulesResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -476,9 +537,13 @@ partial void ProcessListResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.ListAgentSchedulesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.ListAgentSchedulesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.AgentSchedulesClient.ListExecutions.g.cs b/src/libs/Vectara/Generated/Vectara.AgentSchedulesClient.ListExecutions.g.cs index 2cbaf6ea..cc1c9282 100644 --- a/src/libs/Vectara/Generated/Vectara.AgentSchedulesClient.ListExecutions.g.cs +++ b/src/libs/Vectara/Generated/Vectara.AgentSchedulesClient.ListExecutions.g.cs @@ -98,6 +98,51 @@ partial void ProcessListExecutionsResponseContent( string? pageKey = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListExecutionsAsResponseAsync( + agentKey: agentKey, + scheduleKey: scheduleKey, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + limit: limit, + pageKey: pageKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List agent schedule executions
+ /// List all execution attempts for a schedule, ordered by most recent first. + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// + /// + /// A unique key that identifies an agent schedule. Uses "key" terminology (instead of "id")
+ /// for consistency with other Vectara API resources (AgentKey, SessionKey, CorpusKey, etc.).
+ /// Example: daily-report + /// + /// + /// Default Value: 10 + /// + /// + /// 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> ListExecutionsAsResponseAsync( + string agentKey, + string scheduleKey, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + int? limit = default, + string? pageKey = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -132,12 +177,13 @@ partial void ProcessListExecutionsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/agents/{agentKey}/schedules/{scheduleKey}/executions", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("limit", limit?.ToString()) - .AddOptionalParameter("page_key", pageKey) + .AddOptionalParameter("page_key", pageKey) ; var __path = __pathBuilder.ToString(); __path = global::Vectara.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -224,6 +270,8 @@ partial void ProcessListExecutionsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -237,6 +285,11 @@ partial void ProcessListExecutionsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -254,6 +307,8 @@ partial void ProcessListExecutionsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -263,8 +318,7 @@ partial void ProcessListExecutionsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -273,6 +327,11 @@ partial void ProcessListExecutionsResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -289,14 +348,15 @@ partial void ProcessListExecutionsResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -336,6 +396,8 @@ partial void ProcessListExecutionsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -356,6 +418,8 @@ partial void ProcessListExecutionsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -380,9 +444,13 @@ partial void ProcessListExecutionsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.ListAgentScheduleExecutionsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.ListAgentScheduleExecutionsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -410,9 +478,13 @@ partial void ProcessListExecutionsResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.ListAgentScheduleExecutionsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.ListAgentScheduleExecutionsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.AgentSchedulesClient.Update.g.cs b/src/libs/Vectara/Generated/Vectara.AgentSchedulesClient.Update.g.cs index e91ee796..1f121fa4 100644 --- a/src/libs/Vectara/Generated/Vectara.AgentSchedulesClient.Update.g.cs +++ b/src/libs/Vectara/Generated/Vectara.AgentSchedulesClient.Update.g.cs @@ -89,6 +89,49 @@ partial void ProcessUpdateResponseContent( string agentKey, string scheduleKey, + global::Vectara.UpdateAgentScheduleRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdateAsResponseAsync( + agentKey: agentKey, + scheduleKey: scheduleKey, + + request: request, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update agent schedule
+ /// Update an existing agent schedule. All fields are optional - only provided fields will be updated (PATCH semantics).
+ /// You can pause/resume a schedule by setting the `enabled` field to `false`/`true`. Updating the schedule configuration (interval or cron) will reschedule future executions but will not affect executions currently in progress. + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// + /// + /// A unique key that identifies an agent schedule. Uses "key" terminology (instead of "id")
+ /// for consistency with other Vectara API resources (AgentKey, SessionKey, CorpusKey, etc.).
+ /// Example: daily-report + /// + /// + /// 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> UpdateAsResponseAsync( + string agentKey, + string scheduleKey, + global::Vectara.UpdateAgentScheduleRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, @@ -129,6 +172,7 @@ partial void ProcessUpdateResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/agents/{agentKey}/schedules/{scheduleKey}", baseUri: HttpClient.BaseAddress); @@ -222,6 +266,8 @@ partial void ProcessUpdateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -235,6 +281,11 @@ partial void ProcessUpdateResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -252,6 +303,8 @@ partial void ProcessUpdateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -261,8 +314,7 @@ partial void ProcessUpdateResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -271,6 +323,11 @@ partial void ProcessUpdateResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -287,14 +344,15 @@ partial void ProcessUpdateResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -334,6 +392,8 @@ partial void ProcessUpdateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -354,6 +414,8 @@ partial void ProcessUpdateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Update request was malformed or invalid. @@ -492,9 +554,13 @@ partial void ProcessUpdateResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.AgentSchedule.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.AgentSchedule.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -522,9 +588,13 @@ partial void ProcessUpdateResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.AgentSchedule.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.AgentSchedule.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.AgentSchedulesClient.g.cs b/src/libs/Vectara/Generated/Vectara.AgentSchedulesClient.g.cs index 92f6210d..5c30ed24 100644 --- a/src/libs/Vectara/Generated/Vectara.AgentSchedulesClient.g.cs +++ b/src/libs/Vectara/Generated/Vectara.AgentSchedulesClient.g.cs @@ -75,10 +75,10 @@ public AgentSchedulesClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public AgentSchedulesClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Vectara.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Vectara.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Vectara/Generated/Vectara.AgentSessionsClient.Create.g.cs b/src/libs/Vectara/Generated/Vectara.AgentSessionsClient.Create.g.cs index 56db6d1c..e50e6f70 100644 --- a/src/libs/Vectara/Generated/Vectara.AgentSessionsClient.Create.g.cs +++ b/src/libs/Vectara/Generated/Vectara.AgentSessionsClient.Create.g.cs @@ -97,6 +97,58 @@ partial void ProcessCreateResponseContent( public async global::System.Threading.Tasks.Task CreateAsync( string agentKey, + global::Vectara.CreateAgentSessionRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateAsResponseAsync( + agentKey: agentKey, + + request: request, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create agent session
+ /// Create a new session for interacting with an agent. A session is the conversation container that maintains state across all messages, events, tool use, and agent responses.
+ /// This endpoint initializes the session and enables you to configure its initial properties, including optional metadata. Metadata can influence agent behavior, personalize responses, or apply access controls. Instructions and tools can also reference metadata using `${\session.metadata.field}` or `$\ref` syntax.
+ /// A session also serves as the workspace for artifacts, enabling file uploads and multi-step workflows. For more information, see [Working with artifacts in sessions](https://docs.vectara.com/docs/agent-os/sessions#working-with-artifacts-in-sessions).
+ /// ## Example request
+ /// ```json
+ /// \$ curl -X POST https://api.vectara.io/v2/agents/support-agent/sessions \
+ /// -H "Authorization: Bearer YOUR_API_KEY" \
+ /// -H "Content-Type: application/json" \
+ /// -d '{
+ /// "key": "user_12345_session",
+ /// "name": "Customer Support Session",
+ /// "metadata": {
+ /// "user_role": "premium",
+ /// "language": "en"
+ /// }
+ /// }'
+ /// ```
+ /// A successful response includes the unique session key, configuration metadata, and timestamps for creation and last update. + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// + /// + /// 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> CreateAsResponseAsync( + string agentKey, + global::Vectara.CreateAgentSessionRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, @@ -136,6 +188,7 @@ partial void ProcessCreateResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/agents/{agentKey}/sessions", baseUri: HttpClient.BaseAddress); @@ -228,6 +281,8 @@ partial void ProcessCreateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -241,6 +296,11 @@ partial void ProcessCreateResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -258,6 +318,8 @@ partial void ProcessCreateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -267,8 +329,7 @@ partial void ProcessCreateResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -277,6 +338,11 @@ partial void ProcessCreateResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -293,14 +359,15 @@ partial void ProcessCreateResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -340,6 +407,8 @@ partial void ProcessCreateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -360,6 +429,8 @@ partial void ProcessCreateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Session creation request was malformed or references invalid agent. @@ -498,9 +569,13 @@ partial void ProcessCreateResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.AgentSession.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.AgentSession.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -528,9 +603,13 @@ partial void ProcessCreateResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.AgentSession.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.AgentSession.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.AgentSessionsClient.Delete.g.cs b/src/libs/Vectara/Generated/Vectara.AgentSessionsClient.Delete.g.cs index 011cd2cf..be204584 100644 --- a/src/libs/Vectara/Generated/Vectara.AgentSessionsClient.Delete.g.cs +++ b/src/libs/Vectara/Generated/Vectara.AgentSessionsClient.Delete.g.cs @@ -82,6 +82,40 @@ partial void ProcessDeleteResponse( int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await DeleteAsResponseAsync( + agentKey: agentKey, + sessionKey: sessionKey, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Delete agent session
+ /// Permanently delete an agent session. This action cannot be undone. + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// + /// + /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat + /// + /// 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 DeleteAsResponseAsync( + string agentKey, + string sessionKey, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -114,6 +148,7 @@ partial void ProcessDeleteResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/agents/{agentKey}/sessions/{sessionKey}", baseUri: HttpClient.BaseAddress); @@ -200,6 +235,8 @@ partial void ProcessDeleteResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -213,6 +250,11 @@ partial void ProcessDeleteResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -230,6 +272,8 @@ partial void ProcessDeleteResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -239,8 +283,7 @@ partial void ProcessDeleteResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -249,6 +292,11 @@ partial void ProcessDeleteResponse( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -265,14 +313,15 @@ partial void ProcessDeleteResponse( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -312,6 +361,8 @@ partial void ProcessDeleteResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -332,6 +383,8 @@ partial void ProcessDeleteResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow deleting this agent session. @@ -428,6 +481,10 @@ partial void ProcessDeleteResponse( { __response.EnsureSuccessStatusCode(); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -449,6 +506,10 @@ partial void ProcessDeleteResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.AgentSessionsClient.Get.g.cs b/src/libs/Vectara/Generated/Vectara.AgentSessionsClient.Get.g.cs index 67536f41..d9a2e41e 100644 --- a/src/libs/Vectara/Generated/Vectara.AgentSessionsClient.Get.g.cs +++ b/src/libs/Vectara/Generated/Vectara.AgentSessionsClient.Get.g.cs @@ -87,6 +87,42 @@ partial void ProcessGetResponseContent( int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetAsResponseAsync( + agentKey: agentKey, + sessionKey: sessionKey, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get agent session
+ /// Retrieve the full details of a specific agent session using its unique session key. The response includes the session's configuration, metadata, timestamps, and other stored properties. Use this endpoint to inspect the current state of a session or verify its configuration. + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// + /// + /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat + /// + /// 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> GetAsResponseAsync( + string agentKey, + string sessionKey, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -119,6 +155,7 @@ partial void ProcessGetResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/agents/{agentKey}/sessions/{sessionKey}", baseUri: HttpClient.BaseAddress); @@ -205,6 +242,8 @@ partial void ProcessGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -218,6 +257,11 @@ partial void ProcessGetResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -235,6 +279,8 @@ partial void ProcessGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -244,8 +290,7 @@ partial void ProcessGetResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -254,6 +299,11 @@ partial void ProcessGetResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -270,14 +320,15 @@ partial void ProcessGetResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -317,6 +368,8 @@ partial void ProcessGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -337,6 +390,8 @@ partial void ProcessGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow accessing this agent session. @@ -437,9 +492,13 @@ partial void ProcessGetResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.AgentSession.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.AgentSession.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -467,9 +526,13 @@ partial void ProcessGetResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.AgentSession.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.AgentSession.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.AgentSessionsClient.List.g.cs b/src/libs/Vectara/Generated/Vectara.AgentSessionsClient.List.g.cs index 9caea967..932f0261 100644 --- a/src/libs/Vectara/Generated/Vectara.AgentSessionsClient.List.g.cs +++ b/src/libs/Vectara/Generated/Vectara.AgentSessionsClient.List.g.cs @@ -96,6 +96,49 @@ partial void ProcessListResponseContent( string? pageKey = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListAsResponseAsync( + agentKey: agentKey, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + filter: filter, + limit: limit, + pageKey: pageKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List agent sessions
+ /// List all agent sessions for the specified agent. This endpoint returns high-level information about each session, with optional filtering and pagination. Use this operation to browse existing sessions or to locate a specific session key for further inspection or updates. + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// + /// + /// Example: support.* + /// + /// + /// Default Value: 10 + /// + /// + /// 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> ListAsResponseAsync( + string agentKey, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + string? filter = default, + int? limit = default, + string? pageKey = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -130,13 +173,14 @@ partial void ProcessListResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/agents/{agentKey}/sessions", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("filter", filter) .AddOptionalParameter("limit", limit?.ToString()) - .AddOptionalParameter("page_key", pageKey) + .AddOptionalParameter("page_key", pageKey) ; var __path = __pathBuilder.ToString(); __path = global::Vectara.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -223,6 +267,8 @@ partial void ProcessListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -236,6 +282,11 @@ partial void ProcessListResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -253,6 +304,8 @@ partial void ProcessListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -262,8 +315,7 @@ partial void ProcessListResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -272,6 +324,11 @@ partial void ProcessListResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -288,14 +345,15 @@ partial void ProcessListResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -335,6 +393,8 @@ partial void ProcessListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -355,6 +415,8 @@ partial void ProcessListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow listing agent sessions. @@ -455,9 +517,13 @@ partial void ProcessListResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.ListAgentSessionsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.ListAgentSessionsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -485,9 +551,13 @@ partial void ProcessListResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.ListAgentSessionsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.ListAgentSessionsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.AgentSessionsClient.Update.g.cs b/src/libs/Vectara/Generated/Vectara.AgentSessionsClient.Update.g.cs index bdf89a67..9d89e1bb 100644 --- a/src/libs/Vectara/Generated/Vectara.AgentSessionsClient.Update.g.cs +++ b/src/libs/Vectara/Generated/Vectara.AgentSessionsClient.Update.g.cs @@ -88,6 +88,48 @@ partial void ProcessUpdateResponseContent( string agentKey, string sessionKey, + global::Vectara.UpdateAgentSessionRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdateAsResponseAsync( + agentKey: agentKey, + sessionKey: sessionKey, + + request: request, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update agent session
+ /// Update the configuration of an existing agent session. This endpoint enables you to modify fields such as the name, description, or metadata.
+ /// Updated metadata immediately influences agent behavior and becomes available to instructions and tools for the remainder of the session. For more details about configuring the agent session, see [Create agent session](https://docs.vectara.com/docs/rest-api/create-agent-session). + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// + /// + /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat + /// + /// + /// 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> UpdateAsResponseAsync( + string agentKey, + string sessionKey, + global::Vectara.UpdateAgentSessionRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, @@ -128,6 +170,7 @@ partial void ProcessUpdateResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/agents/{agentKey}/sessions/{sessionKey}", baseUri: HttpClient.BaseAddress); @@ -221,6 +264,8 @@ partial void ProcessUpdateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -234,6 +279,11 @@ partial void ProcessUpdateResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -251,6 +301,8 @@ partial void ProcessUpdateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -260,8 +312,7 @@ partial void ProcessUpdateResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -270,6 +321,11 @@ partial void ProcessUpdateResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -286,14 +342,15 @@ partial void ProcessUpdateResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -333,6 +390,8 @@ partial void ProcessUpdateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -353,6 +412,8 @@ partial void ProcessUpdateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Session update request was malformed. @@ -491,9 +552,13 @@ partial void ProcessUpdateResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.AgentSession.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.AgentSession.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -521,9 +586,13 @@ partial void ProcessUpdateResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.AgentSession.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.AgentSession.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.AgentSessionsClient.g.cs b/src/libs/Vectara/Generated/Vectara.AgentSessionsClient.g.cs index fab41cf0..82e3d2b5 100644 --- a/src/libs/Vectara/Generated/Vectara.AgentSessionsClient.g.cs +++ b/src/libs/Vectara/Generated/Vectara.AgentSessionsClient.g.cs @@ -75,10 +75,10 @@ public AgentSessionsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public AgentSessionsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Vectara.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Vectara.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Vectara/Generated/Vectara.AgentsClient.Create.g.cs b/src/libs/Vectara/Generated/Vectara.AgentsClient.Create.g.cs index fb4101e2..5610a6e0 100644 --- a/src/libs/Vectara/Generated/Vectara.AgentsClient.Create.g.cs +++ b/src/libs/Vectara/Generated/Vectara.AgentsClient.Create.g.cs @@ -96,6 +96,58 @@ partial void ProcessCreateResponseContent( /// public async global::System.Threading.Tasks.Task CreateAsync( + global::Vectara.CreateAgentRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateAsResponseAsync( + + request: request, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create agent
+ /// Create a new agent. An agent is compromised as 3 main things of functionality:
+ /// 1. The **instructions** an agent follows. Known as a system in prompt in other platforms.
+ /// 2. The **steps** an agent follows when receiving an input.
+ /// 3. The **tools** an agent can use to resolve those steps and instructions.
+ /// Instructions are tied to each step, and should be precisely crafted so that the agent can perform the desired actions when given an input.
+ /// :::tip Creating more precise instructions
+ /// Be specific to exactly what you want the agent to do. For emphasis, use CAPS if you want the agent to follow a specific format. Negative prompts also help with precision such as saying **DO NOT DO THIS**.
+ /// :::
+ /// To use an agent, create a new session (called thread or chat in other platforms), and send new inputs to the agent to get responses.
+ /// :::note
+ /// Only a single step is supported with no follow up steps. So the `first_step` will be only the only step. We will add multiple steps and step types to execute complex workflows, but many agents can work well with a single step.
+ /// :::
+ /// ## LLM configuration
+ /// Agents use LLMs for reasoning and response generation. You can configure the following:
+ /// - **Model**: Choose from available models like GPT-4o.
+ /// - **Parameters**: Adjust temperature, max tokens, and other model-specific settings.
+ /// - **Cost optimization**: Balance performance with token usage.
+ /// - **Retry configuration**: Configure automatic retry behavior for transient failures.
+ /// ## Using retries to improve user experience
+ /// When agents interact with LLMs, transient failures like network interruptions can disrupt communication between the agent and the LLM. You can configure your agent to resume disrupted communication to ensure a smooth user experience.
+ /// - `max_retries`: After an error, the agent will retry its request to the LLM this many times.
+ /// - `initial_backoff_ms`: This is how many milliseconds the agent will wait before retrying, to give the cause of the error time to resolve.
+ /// - `backoff_factor`: Every time the agent retries, it can multiply the last retry delay by this number, increasing the wait between retries. This is like giving a toddler a longer and longer timeout if it continues to misbehave.
+ /// - `max_backoff_ms`: The maximum time you want the agent to wait between retries, so the backoff_factor does not create an unreasonably long delay for your users. + ///
+ /// + /// + /// + /// 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> CreateAsResponseAsync( + global::Vectara.CreateAgentRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, @@ -134,6 +186,7 @@ partial void ProcessCreateResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: "/v2/agents", baseUri: HttpClient.BaseAddress); @@ -225,6 +278,8 @@ partial void ProcessCreateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -238,6 +293,11 @@ partial void ProcessCreateResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -255,6 +315,8 @@ partial void ProcessCreateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -264,8 +326,7 @@ partial void ProcessCreateResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -274,6 +335,11 @@ partial void ProcessCreateResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -290,14 +356,15 @@ partial void ProcessCreateResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -337,6 +404,8 @@ partial void ProcessCreateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -357,6 +426,8 @@ partial void ProcessCreateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Agent creation request was malformed or contains invalid references. @@ -457,9 +528,13 @@ partial void ProcessCreateResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.Agent.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.Agent.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -487,9 +562,13 @@ partial void ProcessCreateResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.Agent.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.Agent.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.AgentsClient.CreateConnector.g.cs b/src/libs/Vectara/Generated/Vectara.AgentsClient.CreateConnector.g.cs index 1d783fb3..4f7214ab 100644 --- a/src/libs/Vectara/Generated/Vectara.AgentsClient.CreateConnector.g.cs +++ b/src/libs/Vectara/Generated/Vectara.AgentsClient.CreateConnector.g.cs @@ -80,6 +80,41 @@ partial void ProcessCreateConnectorResponseContent( public async global::System.Threading.Tasks.Task CreateConnectorAsync( string agentKey, + global::Vectara.CreateAgentConnectorRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateConnectorAsResponseAsync( + agentKey: agentKey, + + request: request, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create agent connector
+ /// Create a new connector for an agent to receive events from external platforms like Slack. + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// + /// + /// 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> CreateConnectorAsResponseAsync( + string agentKey, + global::Vectara.CreateAgentConnectorRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, @@ -119,6 +154,7 @@ partial void ProcessCreateConnectorResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/agents/{agentKey}/connectors", baseUri: HttpClient.BaseAddress); @@ -211,6 +247,8 @@ partial void ProcessCreateConnectorResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -224,6 +262,11 @@ partial void ProcessCreateConnectorResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -241,6 +284,8 @@ partial void ProcessCreateConnectorResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -250,8 +295,7 @@ partial void ProcessCreateConnectorResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -260,6 +304,11 @@ partial void ProcessCreateConnectorResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -276,14 +325,15 @@ partial void ProcessCreateConnectorResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -323,6 +373,8 @@ partial void ProcessCreateConnectorResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -343,6 +395,8 @@ partial void ProcessCreateConnectorResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Connector creation request was malformed or contains invalid configuration. @@ -481,9 +535,13 @@ partial void ProcessCreateConnectorResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.AgentConnector.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.AgentConnector.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -511,9 +569,13 @@ partial void ProcessCreateConnectorResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.AgentConnector.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.AgentConnector.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.AgentsClient.Delete.g.cs b/src/libs/Vectara/Generated/Vectara.AgentsClient.Delete.g.cs index d47a8b91..1a3a62d5 100644 --- a/src/libs/Vectara/Generated/Vectara.AgentsClient.Delete.g.cs +++ b/src/libs/Vectara/Generated/Vectara.AgentsClient.Delete.g.cs @@ -76,6 +76,35 @@ partial void ProcessDeleteResponse( int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await DeleteAsResponseAsync( + agentKey: agentKey, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Delete agent
+ /// The Delete Agent API enables you to permanently remove an AI agent and its configuration from the Vectara platform, supporting agent lifecycle management and resource cleanup in enterprise environments.
+ /// Use this API for decommissioning outdated agents, cleaning up development and testing environments, removing agents that are no longer needed, and maintaining organized agent inventories as your AI deployments evolve. The permanent nature of deletion makes this API critical for environments where data governance and resource management are essential. + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// + /// 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 DeleteAsResponseAsync( + string agentKey, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -107,6 +136,7 @@ partial void ProcessDeleteResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/agents/{agentKey}", baseUri: HttpClient.BaseAddress); @@ -192,6 +222,8 @@ partial void ProcessDeleteResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -205,6 +237,11 @@ partial void ProcessDeleteResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -222,6 +259,8 @@ partial void ProcessDeleteResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -231,8 +270,7 @@ partial void ProcessDeleteResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -241,6 +279,11 @@ partial void ProcessDeleteResponse( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -257,14 +300,15 @@ partial void ProcessDeleteResponse( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -304,6 +348,8 @@ partial void ProcessDeleteResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -324,6 +370,8 @@ partial void ProcessDeleteResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow deleting this agent. @@ -420,6 +468,10 @@ partial void ProcessDeleteResponse( { __response.EnsureSuccessStatusCode(); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -441,6 +493,10 @@ partial void ProcessDeleteResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.AgentsClient.DeleteConnector.g.cs b/src/libs/Vectara/Generated/Vectara.AgentsClient.DeleteConnector.g.cs index 34c3a2a2..92d95497 100644 --- a/src/libs/Vectara/Generated/Vectara.AgentsClient.DeleteConnector.g.cs +++ b/src/libs/Vectara/Generated/Vectara.AgentsClient.DeleteConnector.g.cs @@ -81,6 +81,39 @@ partial void ProcessDeleteConnectorResponse( int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await DeleteConnectorAsResponseAsync( + agentKey: agentKey, + connectorId: connectorId, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Delete agent connector
+ /// Permanently delete an agent connector and all its associated configuration. This action cannot be undone. + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// + /// + /// Example: con_slack_support + /// + /// 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 DeleteConnectorAsResponseAsync( + string agentKey, + string connectorId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -113,6 +146,7 @@ partial void ProcessDeleteConnectorResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/agents/{agentKey}/connectors/{connectorId}", baseUri: HttpClient.BaseAddress); @@ -199,6 +233,8 @@ partial void ProcessDeleteConnectorResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -212,6 +248,11 @@ partial void ProcessDeleteConnectorResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -229,6 +270,8 @@ partial void ProcessDeleteConnectorResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -238,8 +281,7 @@ partial void ProcessDeleteConnectorResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -248,6 +290,11 @@ partial void ProcessDeleteConnectorResponse( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -264,14 +311,15 @@ partial void ProcessDeleteConnectorResponse( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -311,6 +359,8 @@ partial void ProcessDeleteConnectorResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -331,6 +381,8 @@ partial void ProcessDeleteConnectorResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow deleting this connector. @@ -427,6 +479,10 @@ partial void ProcessDeleteConnectorResponse( { __response.EnsureSuccessStatusCode(); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -448,6 +504,10 @@ partial void ProcessDeleteConnectorResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.AgentsClient.Get.g.cs b/src/libs/Vectara/Generated/Vectara.AgentsClient.Get.g.cs index 9f38381b..d83fa3aa 100644 --- a/src/libs/Vectara/Generated/Vectara.AgentsClient.Get.g.cs +++ b/src/libs/Vectara/Generated/Vectara.AgentsClient.Get.g.cs @@ -81,6 +81,37 @@ partial void ProcessGetResponseContent( int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetAsResponseAsync( + agentKey: agentKey, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get agent
+ /// The Get Agent API enables you to retrieve the complete configuration and operational details of a specific AI agent, providing comprehensive visibility into agent capabilities, tool integrations, behavioral instructions, and metadata.
+ /// Use this API to inspect agent configurations before creating sessions, troubleshoot agent behavior issues, clone agent configurations for new deployments, and maintain documentation of agent capabilities across your enterprise AI infrastructure. + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// + /// 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> GetAsResponseAsync( + string agentKey, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -112,6 +143,7 @@ partial void ProcessGetResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/agents/{agentKey}", baseUri: HttpClient.BaseAddress); @@ -197,6 +229,8 @@ partial void ProcessGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -210,6 +244,11 @@ partial void ProcessGetResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -227,6 +266,8 @@ partial void ProcessGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -236,8 +277,7 @@ partial void ProcessGetResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -246,6 +286,11 @@ partial void ProcessGetResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -262,14 +307,15 @@ partial void ProcessGetResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -309,6 +355,8 @@ partial void ProcessGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -329,6 +377,8 @@ partial void ProcessGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow accessing this agent. @@ -429,9 +479,13 @@ partial void ProcessGetResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.Agent.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.Agent.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -459,9 +513,13 @@ partial void ProcessGetResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.Agent.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.Agent.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.AgentsClient.GetConnector.g.cs b/src/libs/Vectara/Generated/Vectara.AgentsClient.GetConnector.g.cs index e1d20b1e..55ebc157 100644 --- a/src/libs/Vectara/Generated/Vectara.AgentsClient.GetConnector.g.cs +++ b/src/libs/Vectara/Generated/Vectara.AgentsClient.GetConnector.g.cs @@ -86,6 +86,41 @@ partial void ProcessGetConnectorResponseContent( int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetConnectorAsResponseAsync( + agentKey: agentKey, + connectorId: connectorId, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get agent connector
+ /// Retrieve the details of a specific agent connector by its ID, including its configuration and status. + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// + /// + /// Example: con_slack_support + /// + /// 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> GetConnectorAsResponseAsync( + string agentKey, + string connectorId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -118,6 +153,7 @@ partial void ProcessGetConnectorResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/agents/{agentKey}/connectors/{connectorId}", baseUri: HttpClient.BaseAddress); @@ -204,6 +240,8 @@ partial void ProcessGetConnectorResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -217,6 +255,11 @@ partial void ProcessGetConnectorResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -234,6 +277,8 @@ partial void ProcessGetConnectorResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -243,8 +288,7 @@ partial void ProcessGetConnectorResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -253,6 +297,11 @@ partial void ProcessGetConnectorResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -269,14 +318,15 @@ partial void ProcessGetConnectorResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -316,6 +366,8 @@ partial void ProcessGetConnectorResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -336,6 +388,8 @@ partial void ProcessGetConnectorResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow accessing this connector. @@ -436,9 +490,13 @@ partial void ProcessGetConnectorResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.AgentConnector.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.AgentConnector.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -466,9 +524,13 @@ partial void ProcessGetConnectorResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.AgentConnector.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.AgentConnector.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.AgentsClient.GetIdentity.g.cs b/src/libs/Vectara/Generated/Vectara.AgentsClient.GetIdentity.g.cs index bd23ed14..64b0f51f 100644 --- a/src/libs/Vectara/Generated/Vectara.AgentsClient.GetIdentity.g.cs +++ b/src/libs/Vectara/Generated/Vectara.AgentsClient.GetIdentity.g.cs @@ -82,6 +82,38 @@ partial void ProcessGetIdentityResponseContent( int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetIdentityAsResponseAsync( + agentKey: agentKey, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get agent identity
+ /// Retrieve the identity associated with an agent. The identity is the service account the agent uses when executing tools.
+ /// In `auto` mode (the default), the platform keeps the identity's roles in sync with the agent's tool configuration.
+ /// In `manual` mode, the roles are frozen and the platform will not modify them when the agent is updated. + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// + /// 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> GetIdentityAsResponseAsync( + string agentKey, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -113,6 +145,7 @@ partial void ProcessGetIdentityResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/agents/{agentKey}/identity", baseUri: HttpClient.BaseAddress); @@ -198,6 +231,8 @@ partial void ProcessGetIdentityResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -211,6 +246,11 @@ partial void ProcessGetIdentityResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -228,6 +268,8 @@ partial void ProcessGetIdentityResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -237,8 +279,7 @@ partial void ProcessGetIdentityResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -247,6 +288,11 @@ partial void ProcessGetIdentityResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -263,14 +309,15 @@ partial void ProcessGetIdentityResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -310,6 +357,8 @@ partial void ProcessGetIdentityResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -330,6 +379,8 @@ partial void ProcessGetIdentityResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow accessing this agent. @@ -430,9 +481,13 @@ partial void ProcessGetIdentityResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.AgentIdentity.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.AgentIdentity.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -460,9 +515,13 @@ partial void ProcessGetIdentityResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.AgentIdentity.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.AgentIdentity.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.AgentsClient.List.g.cs b/src/libs/Vectara/Generated/Vectara.AgentsClient.List.g.cs index b76df1dd..2c6182cb 100644 --- a/src/libs/Vectara/Generated/Vectara.AgentsClient.List.g.cs +++ b/src/libs/Vectara/Generated/Vectara.AgentsClient.List.g.cs @@ -95,6 +95,48 @@ partial void ProcessListResponseContent( string? pageKey = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListAsResponseAsync( + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + filter: filter, + enabled: enabled, + limit: limit, + pageKey: pageKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List agents
+ /// The List Agents API enables you to retrieve a paginated list of all agents available to the authenticated user. This is useful for managing and monitoring agent deployments across use cases and environments. + ///
+ /// + /// + /// + /// Example: support.* + /// + /// + /// Example: true + /// + /// + /// Default Value: 10 + /// + /// + /// 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> ListAsResponseAsync( + int? requestTimeout = default, + int? requestTimeoutMillis = default, + string? filter = default, + bool? enabled = default, + int? limit = default, + string? pageKey = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -129,14 +171,15 @@ partial void ProcessListResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: "/v2/agents", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("filter", filter) .AddOptionalParameter("enabled", enabled?.ToString().ToLowerInvariant()) .AddOptionalParameter("limit", limit?.ToString()) - .AddOptionalParameter("page_key", pageKey) + .AddOptionalParameter("page_key", pageKey) ; var __path = __pathBuilder.ToString(); __path = global::Vectara.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -223,6 +266,8 @@ partial void ProcessListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -236,6 +281,11 @@ partial void ProcessListResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -253,6 +303,8 @@ partial void ProcessListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -262,8 +314,7 @@ partial void ProcessListResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -272,6 +323,11 @@ partial void ProcessListResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -288,14 +344,15 @@ partial void ProcessListResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -335,6 +392,8 @@ partial void ProcessListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -355,6 +414,8 @@ partial void ProcessListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow listing agents. @@ -417,9 +478,13 @@ partial void ProcessListResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.ListAgentsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.ListAgentsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -447,9 +512,13 @@ partial void ProcessListResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.ListAgentsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.ListAgentsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.AgentsClient.ListConnectors.g.cs b/src/libs/Vectara/Generated/Vectara.AgentsClient.ListConnectors.g.cs index 967f222c..669126ad 100644 --- a/src/libs/Vectara/Generated/Vectara.AgentsClient.ListConnectors.g.cs +++ b/src/libs/Vectara/Generated/Vectara.AgentsClient.ListConnectors.g.cs @@ -102,6 +102,54 @@ partial void ProcessListConnectorsResponseContent( string? pageKey = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListConnectorsAsResponseAsync( + agentKey: agentKey, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + type: type, + enabled: enabled, + limit: limit, + pageKey: pageKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List agent connectors
+ /// List all connectors for a specific agent, with optional filtering and pagination. + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// + /// + /// Example: slack + /// + /// + /// Example: true + /// + /// + /// Default Value: 10 + /// + /// + /// 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> ListConnectorsAsResponseAsync( + string agentKey, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.ListAgentConnectorsType? type = default, + bool? enabled = default, + int? limit = default, + string? pageKey = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -137,14 +185,15 @@ partial void ProcessListConnectorsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/agents/{agentKey}/connectors", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("type", type?.ToValueString()) .AddOptionalParameter("enabled", enabled?.ToString().ToLowerInvariant()) .AddOptionalParameter("limit", limit?.ToString()) - .AddOptionalParameter("page_key", pageKey) + .AddOptionalParameter("page_key", pageKey) ; var __path = __pathBuilder.ToString(); __path = global::Vectara.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -232,6 +281,8 @@ partial void ProcessListConnectorsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -245,6 +296,11 @@ partial void ProcessListConnectorsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -262,6 +318,8 @@ partial void ProcessListConnectorsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -271,8 +329,7 @@ partial void ProcessListConnectorsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -281,6 +338,11 @@ partial void ProcessListConnectorsResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -297,14 +359,15 @@ partial void ProcessListConnectorsResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -344,6 +407,8 @@ partial void ProcessListConnectorsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -364,6 +429,8 @@ partial void ProcessListConnectorsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow listing connectors for this agent. @@ -464,9 +531,13 @@ partial void ProcessListConnectorsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.ListAgentConnectorsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.ListAgentConnectorsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -494,9 +565,13 @@ partial void ProcessListConnectorsResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.ListAgentConnectorsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.ListAgentConnectorsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.AgentsClient.Replace.g.cs b/src/libs/Vectara/Generated/Vectara.AgentsClient.Replace.g.cs index 1c4e7676..74322c80 100644 --- a/src/libs/Vectara/Generated/Vectara.AgentsClient.Replace.g.cs +++ b/src/libs/Vectara/Generated/Vectara.AgentsClient.Replace.g.cs @@ -80,6 +80,41 @@ partial void ProcessReplaceResponseContent( public async global::System.Threading.Tasks.Task ReplaceAsync( string agentKey, + global::Vectara.CreateAgentRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ReplaceAsResponseAsync( + agentKey: agentKey, + + request: request, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Replace agent
+ /// The Replace Agent API enables you to completely replace an existing agent configuration, including its corpora, tools, and generation presets. This endpoint performs a full replacement of the agent definition, unlike the Update Agent API which only modifies specified fields. + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// + /// + /// 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> ReplaceAsResponseAsync( + string agentKey, + global::Vectara.CreateAgentRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, @@ -119,6 +154,7 @@ partial void ProcessReplaceResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/agents/{agentKey}", baseUri: HttpClient.BaseAddress); @@ -211,6 +247,8 @@ partial void ProcessReplaceResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -224,6 +262,11 @@ partial void ProcessReplaceResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -241,6 +284,8 @@ partial void ProcessReplaceResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -250,8 +295,7 @@ partial void ProcessReplaceResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -260,6 +304,11 @@ partial void ProcessReplaceResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -276,14 +325,15 @@ partial void ProcessReplaceResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -323,6 +373,8 @@ partial void ProcessReplaceResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -343,6 +395,8 @@ partial void ProcessReplaceResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Agent replacement request was malformed or contains invalid references. @@ -481,9 +535,13 @@ partial void ProcessReplaceResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.Agent.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.Agent.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -511,9 +569,13 @@ partial void ProcessReplaceResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.Agent.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.Agent.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.AgentsClient.Update.g.cs b/src/libs/Vectara/Generated/Vectara.AgentsClient.Update.g.cs index 3f850ffc..9795ac3c 100644 --- a/src/libs/Vectara/Generated/Vectara.AgentsClient.Update.g.cs +++ b/src/libs/Vectara/Generated/Vectara.AgentsClient.Update.g.cs @@ -81,6 +81,42 @@ partial void ProcessUpdateResponseContent( public async global::System.Threading.Tasks.Task UpdateAsync( string agentKey, + global::Vectara.UpdateAgentRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdateAsResponseAsync( + agentKey: agentKey, + + request: request, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update agent
+ /// The Update Agent API enables you to modify an existing agent configuration, including tool assignments, behavioral instructions, model parameters, and operational metadata.
+ /// Use this API to evolve agent capabilities over time, adding new tools as they become available, refining behavioral instructions based on user feedback, adjusting model parameters for optimal performance, and updating metadata for better organization across your agent ecosystem. + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// + /// + /// 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> UpdateAsResponseAsync( + string agentKey, + global::Vectara.UpdateAgentRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, @@ -120,6 +156,7 @@ partial void ProcessUpdateResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/agents/{agentKey}", baseUri: HttpClient.BaseAddress); @@ -212,6 +249,8 @@ partial void ProcessUpdateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -225,6 +264,11 @@ partial void ProcessUpdateResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -242,6 +286,8 @@ partial void ProcessUpdateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -251,8 +297,7 @@ partial void ProcessUpdateResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -261,6 +306,11 @@ partial void ProcessUpdateResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -277,14 +327,15 @@ partial void ProcessUpdateResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -324,6 +375,8 @@ partial void ProcessUpdateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -344,6 +397,8 @@ partial void ProcessUpdateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Agent update request was malformed or contains invalid references. @@ -482,9 +537,13 @@ partial void ProcessUpdateResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.Agent.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.Agent.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -512,9 +571,13 @@ partial void ProcessUpdateResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.Agent.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.Agent.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.AgentsClient.UpdateConnector.g.cs b/src/libs/Vectara/Generated/Vectara.AgentsClient.UpdateConnector.g.cs index bee8cdd6..f94d520c 100644 --- a/src/libs/Vectara/Generated/Vectara.AgentsClient.UpdateConnector.g.cs +++ b/src/libs/Vectara/Generated/Vectara.AgentsClient.UpdateConnector.g.cs @@ -86,6 +86,46 @@ partial void ProcessUpdateConnectorResponseContent( string agentKey, string connectorId, + global::Vectara.UpdateAgentConnectorRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdateConnectorAsResponseAsync( + agentKey: agentKey, + connectorId: connectorId, + + request: request, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update agent connector
+ /// Update an existing agent connector's configuration, status, or other properties. + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// + /// + /// Example: con_slack_support + /// + /// + /// 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> UpdateConnectorAsResponseAsync( + string agentKey, + string connectorId, + global::Vectara.UpdateAgentConnectorRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, @@ -126,6 +166,7 @@ partial void ProcessUpdateConnectorResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/agents/{agentKey}/connectors/{connectorId}", baseUri: HttpClient.BaseAddress); @@ -219,6 +260,8 @@ partial void ProcessUpdateConnectorResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -232,6 +275,11 @@ partial void ProcessUpdateConnectorResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -249,6 +297,8 @@ partial void ProcessUpdateConnectorResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -258,8 +308,7 @@ partial void ProcessUpdateConnectorResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -268,6 +317,11 @@ partial void ProcessUpdateConnectorResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -284,14 +338,15 @@ partial void ProcessUpdateConnectorResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -331,6 +386,8 @@ partial void ProcessUpdateConnectorResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -351,6 +408,8 @@ partial void ProcessUpdateConnectorResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Connector update request was malformed or contains invalid configuration. @@ -489,9 +548,13 @@ partial void ProcessUpdateConnectorResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.AgentConnector.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.AgentConnector.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -519,9 +582,13 @@ partial void ProcessUpdateConnectorResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.AgentConnector.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.AgentConnector.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.AgentsClient.UpdateIdentity.g.cs b/src/libs/Vectara/Generated/Vectara.AgentsClient.UpdateIdentity.g.cs index 09a4c969..2f3bd299 100644 --- a/src/libs/Vectara/Generated/Vectara.AgentsClient.UpdateIdentity.g.cs +++ b/src/libs/Vectara/Generated/Vectara.AgentsClient.UpdateIdentity.g.cs @@ -82,6 +82,43 @@ partial void ProcessUpdateIdentityResponseContent( public async global::System.Threading.Tasks.Task UpdateIdentityAsync( string agentKey, + global::Vectara.UpdateAgentIdentityRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdateIdentityAsResponseAsync( + agentKey: agentKey, + + request: request, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update agent identity
+ /// Update the agent's identity role management mode and/or roles.
+ /// Setting mode to `manual` freezes the current roles. The platform will no longer recompute roles when the agent's tool configuration changes. This is useful when you need to grant the agent additional permissions beyond what its tools require.
+ /// Setting mode to `auto` resumes platform-managed roles. The platform will immediately resync the roles to match the current tool configuration. + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// + /// + /// 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> UpdateIdentityAsResponseAsync( + string agentKey, + global::Vectara.UpdateAgentIdentityRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, @@ -121,6 +158,7 @@ partial void ProcessUpdateIdentityResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/agents/{agentKey}/identity", baseUri: HttpClient.BaseAddress); @@ -213,6 +251,8 @@ partial void ProcessUpdateIdentityResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -226,6 +266,11 @@ partial void ProcessUpdateIdentityResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -243,6 +288,8 @@ partial void ProcessUpdateIdentityResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -252,8 +299,7 @@ partial void ProcessUpdateIdentityResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -262,6 +308,11 @@ partial void ProcessUpdateIdentityResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -278,14 +329,15 @@ partial void ProcessUpdateIdentityResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -325,6 +377,8 @@ partial void ProcessUpdateIdentityResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -345,6 +399,8 @@ partial void ProcessUpdateIdentityResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Invalid request. @@ -483,9 +539,13 @@ partial void ProcessUpdateIdentityResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.AgentIdentity.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.AgentIdentity.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -513,9 +573,13 @@ partial void ProcessUpdateIdentityResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.AgentIdentity.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.AgentIdentity.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.AgentsClient.g.cs b/src/libs/Vectara/Generated/Vectara.AgentsClient.g.cs index edce6ee4..ef49f1c8 100644 --- a/src/libs/Vectara/Generated/Vectara.AgentsClient.g.cs +++ b/src/libs/Vectara/Generated/Vectara.AgentsClient.g.cs @@ -75,10 +75,10 @@ public AgentsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public AgentsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Vectara.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Vectara.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Vectara/Generated/Vectara.ApiKeysClient.Create.g.cs b/src/libs/Vectara/Generated/Vectara.ApiKeysClient.Create.g.cs index 28024b12..4cabfd94 100644 --- a/src/libs/Vectara/Generated/Vectara.ApiKeysClient.Create.g.cs +++ b/src/libs/Vectara/Generated/Vectara.ApiKeysClient.Create.g.cs @@ -79,6 +79,39 @@ partial void ProcessCreateResponseContent( /// public async global::System.Threading.Tasks.Task CreateAsync( + global::Vectara.CreateApiKeyRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateAsResponseAsync( + + request: request, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create an API key
+ /// The Create API Key API lets you create new API keys, which you can bind to one or multiple corpora. You can also decide whether to designate each key for specific access like personal API keys, only querying (read-only) or both querying and indexing (read-write).
+ /// This capability is useful in scenarios where you have applications that require different levels of access to corpora data. For example, you might create a read-only API key for an application that only needs to query data.
+ /// :::note
+ /// For more information about the different types of API keys, see [API Key Management](/docs/deploy-and-scale/authentication/api-key-management).
+ /// ::: + ///
+ /// + /// + /// + /// 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> CreateAsResponseAsync( + global::Vectara.CreateApiKeyRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, @@ -117,6 +150,7 @@ partial void ProcessCreateResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: "/v2/api_keys", baseUri: HttpClient.BaseAddress); @@ -208,6 +242,8 @@ partial void ProcessCreateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -221,6 +257,11 @@ partial void ProcessCreateResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -238,6 +279,8 @@ partial void ProcessCreateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -247,8 +290,7 @@ partial void ProcessCreateResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -257,6 +299,11 @@ partial void ProcessCreateResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -273,14 +320,15 @@ partial void ProcessCreateResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -320,6 +368,8 @@ partial void ProcessCreateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -340,6 +390,8 @@ partial void ProcessCreateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // API key creation request was malformed. @@ -440,9 +492,13 @@ partial void ProcessCreateResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.ApiKey.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.ApiKey.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -470,9 +526,13 @@ partial void ProcessCreateResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.ApiKey.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.ApiKey.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.ApiKeysClient.Delete.g.cs b/src/libs/Vectara/Generated/Vectara.ApiKeysClient.Delete.g.cs index 0b19f4b1..a7dbc151 100644 --- a/src/libs/Vectara/Generated/Vectara.ApiKeysClient.Delete.g.cs +++ b/src/libs/Vectara/Generated/Vectara.ApiKeysClient.Delete.g.cs @@ -74,6 +74,33 @@ partial void ProcessDeleteResponse( int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await DeleteAsResponseAsync( + apiKeyId: apiKeyId, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Delete an API key
+ /// The Delete API Key API lets you delete one or more existing API keys.
+ /// This capability is useful for managing the lifecycle and security of
+ /// API keys such as when they are no longer needed or when a key is compromised. + ///
+ /// + /// + /// + /// 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 DeleteAsResponseAsync( + string apiKeyId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -105,6 +132,7 @@ partial void ProcessDeleteResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/api_keys/{apiKeyId}", baseUri: HttpClient.BaseAddress); @@ -190,6 +218,8 @@ partial void ProcessDeleteResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -203,6 +233,11 @@ partial void ProcessDeleteResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -220,6 +255,8 @@ partial void ProcessDeleteResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -229,8 +266,7 @@ partial void ProcessDeleteResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -239,6 +275,11 @@ partial void ProcessDeleteResponse( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -255,14 +296,15 @@ partial void ProcessDeleteResponse( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -302,6 +344,8 @@ partial void ProcessDeleteResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -322,6 +366,8 @@ partial void ProcessDeleteResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow deleting this API key. @@ -380,6 +426,10 @@ partial void ProcessDeleteResponse( { __response.EnsureSuccessStatusCode(); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -401,6 +451,10 @@ partial void ProcessDeleteResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.ApiKeysClient.Get.g.cs b/src/libs/Vectara/Generated/Vectara.ApiKeysClient.Get.g.cs index 1e0654e5..df960516 100644 --- a/src/libs/Vectara/Generated/Vectara.ApiKeysClient.Get.g.cs +++ b/src/libs/Vectara/Generated/Vectara.ApiKeysClient.Get.g.cs @@ -78,6 +78,34 @@ partial void ProcessGetResponseContent( int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetAsResponseAsync( + apiKeyId: apiKeyId, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get an API key
+ /// The Get API Key API lists all existing API keys for a customer ID. It also shows what corpora are accessed by these keys and with what permissions.
+ /// This capability can provide insights into key usage and status and help you manage the lifecycle and security of your API keys. + ///
+ /// + /// + /// + /// 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> GetAsResponseAsync( + string apiKeyId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -109,6 +137,7 @@ partial void ProcessGetResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/api_keys/{apiKeyId}", baseUri: HttpClient.BaseAddress); @@ -194,6 +223,8 @@ partial void ProcessGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -207,6 +238,11 @@ partial void ProcessGetResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -224,6 +260,8 @@ partial void ProcessGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -233,8 +271,7 @@ partial void ProcessGetResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -243,6 +280,11 @@ partial void ProcessGetResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -259,14 +301,15 @@ partial void ProcessGetResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -306,6 +349,8 @@ partial void ProcessGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -326,6 +371,8 @@ partial void ProcessGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow getting this API key. @@ -388,9 +435,13 @@ partial void ProcessGetResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.ApiKey.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.ApiKey.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -418,9 +469,13 @@ partial void ProcessGetResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.ApiKey.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.ApiKey.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.ApiKeysClient.List.g.cs b/src/libs/Vectara/Generated/Vectara.ApiKeysClient.List.g.cs index 04145c0d..45ad3044 100644 --- a/src/libs/Vectara/Generated/Vectara.ApiKeysClient.List.g.cs +++ b/src/libs/Vectara/Generated/Vectara.ApiKeysClient.List.g.cs @@ -97,6 +97,50 @@ partial void ProcessListResponseContent( global::Vectara.ApiKeyRole? apiKeyRole = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListAsResponseAsync( + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + limit: limit, + pageKey: pageKey, + corpusKey: corpusKey, + apiKeyRole: apiKeyRole, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List API keys
+ /// The List API Keys API lists all existing API keys for a customer ID. It also shows what corpora are accessed by these keys and with what permissions. This capability can provide insights into key usage and status and help you manage the lifecycle and security of your API keys. + ///
+ /// + /// + /// + /// Default Value: 10 + /// + /// + /// + /// A user-provided key for a corpus.
+ /// Example: my-corpus + /// + /// + /// Role of the API key. A serving API key can only perform query type requests on its corpora. A serving and indexing key can perform both indexing and query type requests on its corpora.
+ /// A personal API key has all the same permissions as the creator of the API key. + /// + /// 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> ListAsResponseAsync( + int? requestTimeout = default, + int? requestTimeoutMillis = default, + int? limit = default, + string? pageKey = default, + string? corpusKey = default, + global::Vectara.ApiKeyRole? apiKeyRole = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -131,14 +175,15 @@ partial void ProcessListResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: "/v2/api_keys", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("page_key", pageKey) .AddOptionalParameter("corpus_key", corpusKey) - .AddOptionalParameter("api_key_role", apiKeyRole?.ToValueString()) + .AddOptionalParameter("api_key_role", apiKeyRole?.ToValueString()) ; var __path = __pathBuilder.ToString(); __path = global::Vectara.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -225,6 +270,8 @@ partial void ProcessListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -238,6 +285,11 @@ partial void ProcessListResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -255,6 +307,8 @@ partial void ProcessListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -264,8 +318,7 @@ partial void ProcessListResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -274,6 +327,11 @@ partial void ProcessListResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -290,14 +348,15 @@ partial void ProcessListResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -337,6 +396,8 @@ partial void ProcessListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -357,6 +418,8 @@ partial void ProcessListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // API key list request was malformed. @@ -457,9 +520,13 @@ partial void ProcessListResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.ListApiKeysResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.ListApiKeysResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -487,9 +554,13 @@ partial void ProcessListResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.ListApiKeysResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.ListApiKeysResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.ApiKeysClient.Update.g.cs b/src/libs/Vectara/Generated/Vectara.ApiKeysClient.Update.g.cs index da794b86..3e543f3f 100644 --- a/src/libs/Vectara/Generated/Vectara.ApiKeysClient.Update.g.cs +++ b/src/libs/Vectara/Generated/Vectara.ApiKeysClient.Update.g.cs @@ -78,6 +78,39 @@ partial void ProcessUpdateResponseContent( public async global::System.Threading.Tasks.Task UpdateAsync( string apiKeyId, + global::Vectara.UpdateApiKeyRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdateAsResponseAsync( + apiKeyId: apiKeyId, + + request: request, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update an API key
+ /// The Update API Key API lets you enable or disable specific API keys. You can use this endpoint to temporarily disable access without deleting the key.
+ /// This capability is useful for scenarios like maintenance windows, or when your team no longer requires access to a specific corpus. + ///
+ /// + /// + /// + /// + /// 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> UpdateAsResponseAsync( + string apiKeyId, + global::Vectara.UpdateApiKeyRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, @@ -117,6 +150,7 @@ partial void ProcessUpdateResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/api_keys/{apiKeyId}", baseUri: HttpClient.BaseAddress); @@ -209,6 +243,8 @@ partial void ProcessUpdateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -222,6 +258,11 @@ partial void ProcessUpdateResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -239,6 +280,8 @@ partial void ProcessUpdateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -248,8 +291,7 @@ partial void ProcessUpdateResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -258,6 +300,11 @@ partial void ProcessUpdateResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -274,14 +321,15 @@ partial void ProcessUpdateResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -321,6 +369,8 @@ partial void ProcessUpdateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -341,6 +391,8 @@ partial void ProcessUpdateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow getting this API key. @@ -403,9 +455,13 @@ partial void ProcessUpdateResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.ApiKey.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.ApiKey.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -433,9 +489,13 @@ partial void ProcessUpdateResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.ApiKey.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.ApiKey.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.ApiKeysClient.g.cs b/src/libs/Vectara/Generated/Vectara.ApiKeysClient.g.cs index b7a54f39..b0d0a632 100644 --- a/src/libs/Vectara/Generated/Vectara.ApiKeysClient.g.cs +++ b/src/libs/Vectara/Generated/Vectara.ApiKeysClient.g.cs @@ -75,10 +75,10 @@ public ApiKeysClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public ApiKeysClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Vectara.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Vectara.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Vectara/Generated/Vectara.AppClientsClient.Create.g.cs b/src/libs/Vectara/Generated/Vectara.AppClientsClient.Create.g.cs index 340d17d0..6e0447c9 100644 --- a/src/libs/Vectara/Generated/Vectara.AppClientsClient.Create.g.cs +++ b/src/libs/Vectara/Generated/Vectara.AppClientsClient.Create.g.cs @@ -73,6 +73,35 @@ partial void ProcessCreateResponseContent( /// public async global::System.Threading.Tasks.Task CreateAsync( + global::Vectara.CreateAppClientRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateAsResponseAsync( + + request: request, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create an App Client
+ /// An App Client is used for OAuth 2.0 authentication when calling Vectara APIs. + ///
+ /// + /// + /// + /// 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> CreateAsResponseAsync( + global::Vectara.CreateAppClientRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, @@ -109,6 +138,7 @@ partial void ProcessCreateResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: "/v2/app_clients", baseUri: HttpClient.BaseAddress); @@ -200,6 +230,8 @@ partial void ProcessCreateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -213,6 +245,11 @@ partial void ProcessCreateResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -230,6 +267,8 @@ partial void ProcessCreateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -239,8 +278,7 @@ partial void ProcessCreateResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -249,6 +287,11 @@ partial void ProcessCreateResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -265,14 +308,15 @@ partial void ProcessCreateResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -312,6 +356,8 @@ partial void ProcessCreateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -332,6 +378,8 @@ partial void ProcessCreateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // App Client creation request was malformed. @@ -432,9 +480,13 @@ partial void ProcessCreateResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.AppClient.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.AppClient.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -462,9 +514,13 @@ partial void ProcessCreateResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.AppClient.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.AppClient.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.AppClientsClient.Delete.g.cs b/src/libs/Vectara/Generated/Vectara.AppClientsClient.Delete.g.cs index 0dfa8ca0..c873fa12 100644 --- a/src/libs/Vectara/Generated/Vectara.AppClientsClient.Delete.g.cs +++ b/src/libs/Vectara/Generated/Vectara.AppClientsClient.Delete.g.cs @@ -72,6 +72,31 @@ partial void ProcessDeleteResponse( int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await DeleteAsResponseAsync( + appClientId: appClientId, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Delete an App Client
+ /// Remove an application client configuration from the customer account. + ///
+ /// + /// + /// + /// 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 DeleteAsResponseAsync( + string appClientId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -103,6 +128,7 @@ partial void ProcessDeleteResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/app_clients/{appClientId}", baseUri: HttpClient.BaseAddress); @@ -188,6 +214,8 @@ partial void ProcessDeleteResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -201,6 +229,11 @@ partial void ProcessDeleteResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -218,6 +251,8 @@ partial void ProcessDeleteResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -227,8 +262,7 @@ partial void ProcessDeleteResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -237,6 +271,11 @@ partial void ProcessDeleteResponse( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -253,14 +292,15 @@ partial void ProcessDeleteResponse( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -300,6 +340,8 @@ partial void ProcessDeleteResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -320,6 +362,8 @@ partial void ProcessDeleteResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow deleting this App Client. @@ -378,6 +422,10 @@ partial void ProcessDeleteResponse( { __response.EnsureSuccessStatusCode(); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -399,6 +447,10 @@ partial void ProcessDeleteResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.AppClientsClient.Get.g.cs b/src/libs/Vectara/Generated/Vectara.AppClientsClient.Get.g.cs index 301a61dd..32b2332f 100644 --- a/src/libs/Vectara/Generated/Vectara.AppClientsClient.Get.g.cs +++ b/src/libs/Vectara/Generated/Vectara.AppClientsClient.Get.g.cs @@ -77,6 +77,33 @@ partial void ProcessGetResponseContent( int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetAsResponseAsync( + appClientId: appClientId, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get an App Client
+ /// Retrieve details of a specific application client by its ID. + ///
+ /// + /// + /// + /// 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> GetAsResponseAsync( + string appClientId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -108,6 +135,7 @@ partial void ProcessGetResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/app_clients/{appClientId}", baseUri: HttpClient.BaseAddress); @@ -193,6 +221,8 @@ partial void ProcessGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -206,6 +236,11 @@ partial void ProcessGetResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -223,6 +258,8 @@ partial void ProcessGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -232,8 +269,7 @@ partial void ProcessGetResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -242,6 +278,11 @@ partial void ProcessGetResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -258,14 +299,15 @@ partial void ProcessGetResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -305,6 +347,8 @@ partial void ProcessGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -325,6 +369,8 @@ partial void ProcessGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow getting this App Client. @@ -387,9 +433,13 @@ partial void ProcessGetResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.AppClient.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.AppClient.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -417,9 +467,13 @@ partial void ProcessGetResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.AppClient.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.AppClient.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.AppClientsClient.List.g.cs b/src/libs/Vectara/Generated/Vectara.AppClientsClient.List.g.cs index 6283ab54..04a2247c 100644 --- a/src/libs/Vectara/Generated/Vectara.AppClientsClient.List.g.cs +++ b/src/libs/Vectara/Generated/Vectara.AppClientsClient.List.g.cs @@ -87,6 +87,41 @@ partial void ProcessListResponseContent( string? pageKey = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListAsResponseAsync( + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + limit: limit, + filter: filter, + pageKey: pageKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List App Clients
+ /// Retrieve a list of application clients configured for the customer account. + ///
+ /// + /// + /// + /// Default Value: 10 + /// + /// + /// + /// 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> ListAsResponseAsync( + int? requestTimeout = default, + int? requestTimeoutMillis = default, + int? limit = default, + string? filter = default, + string? pageKey = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -120,13 +155,14 @@ partial void ProcessListResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: "/v2/app_clients", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("filter", filter) - .AddOptionalParameter("page_key", pageKey) + .AddOptionalParameter("page_key", pageKey) ; var __path = __pathBuilder.ToString(); __path = global::Vectara.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -212,6 +248,8 @@ partial void ProcessListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -225,6 +263,11 @@ partial void ProcessListResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -242,6 +285,8 @@ partial void ProcessListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -251,8 +296,7 @@ partial void ProcessListResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -261,6 +305,11 @@ partial void ProcessListResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -277,14 +326,15 @@ partial void ProcessListResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -324,6 +374,8 @@ partial void ProcessListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -344,6 +396,8 @@ partial void ProcessListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // App Clients list request was malformed. @@ -444,9 +498,13 @@ partial void ProcessListResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.ListAppClientsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.ListAppClientsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -474,9 +532,13 @@ partial void ProcessListResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.ListAppClientsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.ListAppClientsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.AppClientsClient.Update.g.cs b/src/libs/Vectara/Generated/Vectara.AppClientsClient.Update.g.cs index f0ce5f8a..6344d90b 100644 --- a/src/libs/Vectara/Generated/Vectara.AppClientsClient.Update.g.cs +++ b/src/libs/Vectara/Generated/Vectara.AppClientsClient.Update.g.cs @@ -77,6 +77,38 @@ partial void ProcessUpdateResponseContent( public async global::System.Threading.Tasks.Task UpdateAsync( string appClientId, + global::Vectara.UpdateAppClientRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdateAsResponseAsync( + appClientId: appClientId, + + request: request, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update an App Client
+ /// Update the configuration or settings of an existing application client. + ///
+ /// + /// + /// + /// + /// 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> UpdateAsResponseAsync( + string appClientId, + global::Vectara.UpdateAppClientRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, @@ -116,6 +148,7 @@ partial void ProcessUpdateResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/app_clients/{appClientId}", baseUri: HttpClient.BaseAddress); @@ -208,6 +241,8 @@ partial void ProcessUpdateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -221,6 +256,11 @@ partial void ProcessUpdateResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -238,6 +278,8 @@ partial void ProcessUpdateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -247,8 +289,7 @@ partial void ProcessUpdateResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -257,6 +298,11 @@ partial void ProcessUpdateResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -273,14 +319,15 @@ partial void ProcessUpdateResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -320,6 +367,8 @@ partial void ProcessUpdateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -340,6 +389,8 @@ partial void ProcessUpdateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow updating this App Client. @@ -402,9 +453,13 @@ partial void ProcessUpdateResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.AppClient.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.AppClient.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -432,9 +487,13 @@ partial void ProcessUpdateResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.AppClient.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.AppClient.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.AppClientsClient.g.cs b/src/libs/Vectara/Generated/Vectara.AppClientsClient.g.cs index 4f106822..74d01da1 100644 --- a/src/libs/Vectara/Generated/Vectara.AppClientsClient.g.cs +++ b/src/libs/Vectara/Generated/Vectara.AppClientsClient.g.cs @@ -75,10 +75,10 @@ public AppClientsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public AppClientsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Vectara.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Vectara.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Vectara/Generated/Vectara.AuthenticationClient.GetToken.g.cs b/src/libs/Vectara/Generated/Vectara.AuthenticationClient.GetToken.g.cs index 1f3ae3c5..4a46e5c6 100644 --- a/src/libs/Vectara/Generated/Vectara.AuthenticationClient.GetToken.g.cs +++ b/src/libs/Vectara/Generated/Vectara.AuthenticationClient.GetToken.g.cs @@ -31,6 +31,29 @@ partial void ProcessGetTokenResponseContent( /// public async global::System.Threading.Tasks.Task GetTokenAsync( + global::Vectara.GetOAuthTokenRequest request, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetTokenAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Request an access token
+ /// Obtain an OAuth2 access token using client credentials + ///
+ /// + /// 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> GetTokenAsResponseAsync( + global::Vectara.GetOAuthTokenRequest request, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -59,6 +82,7 @@ partial void ProcessGetTokenResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: "/oauth/token", baseUri: HttpClient.BaseAddress); @@ -121,6 +145,8 @@ partial void ProcessGetTokenResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -131,6 +157,11 @@ partial void ProcessGetTokenResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -148,6 +179,8 @@ partial void ProcessGetTokenResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -157,8 +190,7 @@ partial void ProcessGetTokenResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -167,6 +199,11 @@ partial void ProcessGetTokenResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -183,14 +220,15 @@ partial void ProcessGetTokenResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -230,6 +268,8 @@ partial void ProcessGetTokenResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -250,6 +290,8 @@ partial void ProcessGetTokenResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -274,9 +316,13 @@ partial void ProcessGetTokenResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.GetTokenResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.GetTokenResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -304,9 +350,13 @@ partial void ProcessGetTokenResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.GetTokenResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.GetTokenResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.AuthenticationClient.g.cs b/src/libs/Vectara/Generated/Vectara.AuthenticationClient.g.cs index 3b3b53fa..e83af961 100644 --- a/src/libs/Vectara/Generated/Vectara.AuthenticationClient.g.cs +++ b/src/libs/Vectara/Generated/Vectara.AuthenticationClient.g.cs @@ -76,10 +76,10 @@ public AuthenticationClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public AuthenticationClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Vectara.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Vectara.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Vectara/Generated/Vectara.AutoSDKHttpResponse.g.cs b/src/libs/Vectara/Generated/Vectara.AutoSDKHttpResponse.g.cs new file mode 100644 index 00000000..d1855921 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.AutoSDKHttpResponse.g.cs @@ -0,0 +1,121 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// Represents a successful HTTP response with status code and headers. + /// + public partial class AutoSDKHttpResponse + { + /// + /// Initializes a new instance of the class. + /// + public AutoSDKHttpResponse( + global::System.Net.HttpStatusCode statusCode, + global::System.Collections.Generic.Dictionary> headers) + : this( + statusCode: statusCode, + headers: headers, + requestUri: null) + { + } + + /// + /// Initializes a new instance of the class. + /// + public AutoSDKHttpResponse( + global::System.Net.HttpStatusCode statusCode, + global::System.Collections.Generic.Dictionary> headers, + global::System.Uri? requestUri) + { + StatusCode = statusCode; + Headers = headers ?? throw new global::System.ArgumentNullException(nameof(headers)); + RequestUri = requestUri; + } + + /// + /// Gets the HTTP status code. + /// + public global::System.Net.HttpStatusCode StatusCode { get; } + /// + /// Gets the response headers. + /// + public global::System.Collections.Generic.Dictionary> Headers { get; } + /// + /// Gets the final request URI associated with the response. + /// + public global::System.Uri? RequestUri { get; } + + internal static global::System.Collections.Generic.Dictionary> CreateHeaders( + global::System.Net.Http.HttpResponseMessage response) + { + response = response ?? throw new global::System.ArgumentNullException(nameof(response)); + + var headers = global::System.Linq.Enumerable.ToDictionary( + response.Headers, + static header => header.Key, + static header => (global::System.Collections.Generic.IEnumerable)global::System.Linq.Enumerable.ToArray(header.Value), + global::System.StringComparer.OrdinalIgnoreCase); + + if (response.Content?.Headers == null) + { + return headers; + } + + foreach (var header in response.Content.Headers) + { + if (headers.TryGetValue(header.Key, out var existingValues)) + { + headers[header.Key] = global::System.Linq.Enumerable.ToArray( + global::System.Linq.Enumerable.Concat(existingValues, header.Value)); + } + else + { + headers[header.Key] = global::System.Linq.Enumerable.ToArray(header.Value); + } + } + + return headers; + } + } + + /// + /// Represents a successful HTTP response with status code, headers, and body. + /// + public partial class AutoSDKHttpResponse : AutoSDKHttpResponse + { + /// + /// Initializes a new instance of the class. + /// + public AutoSDKHttpResponse( + global::System.Net.HttpStatusCode statusCode, + global::System.Collections.Generic.Dictionary> headers, + T body) + : this( + statusCode: statusCode, + headers: headers, + requestUri: null, + body: body) + { + } + + /// + /// Initializes a new instance of the class. + /// + public AutoSDKHttpResponse( + global::System.Net.HttpStatusCode statusCode, + global::System.Collections.Generic.Dictionary> headers, + global::System.Uri? requestUri, + T body) + : base(statusCode, headers, requestUri) + { + Body = body; + } + + /// + /// Gets the response body. + /// + public T Body { get; } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.CorporaClient.ComputeSize.g.cs b/src/libs/Vectara/Generated/Vectara.CorporaClient.ComputeSize.g.cs index 34e37cd0..633f2e93 100644 --- a/src/libs/Vectara/Generated/Vectara.CorporaClient.ComputeSize.g.cs +++ b/src/libs/Vectara/Generated/Vectara.CorporaClient.ComputeSize.g.cs @@ -80,6 +80,36 @@ partial void ProcessComputeSizeResponseContent( int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ComputeSizeAsResponseAsync( + corpusKey: corpusKey, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Compute the current size of a corpus
+ /// Compute the current size of a corpus, including number of documents, parts, and characters. The `corpus_key` uniquely identifies the corpus. + ///
+ /// + /// + /// + /// A user-provided key for a corpus.
+ /// Example: my-corpus + /// + /// 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> ComputeSizeAsResponseAsync( + string corpusKey, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -111,6 +141,7 @@ partial void ProcessComputeSizeResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/corpora/{corpusKey}/compute_size", baseUri: HttpClient.BaseAddress); @@ -196,6 +227,8 @@ partial void ProcessComputeSizeResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -209,6 +242,11 @@ partial void ProcessComputeSizeResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -226,6 +264,8 @@ partial void ProcessComputeSizeResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -235,8 +275,7 @@ partial void ProcessComputeSizeResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -245,6 +284,11 @@ partial void ProcessComputeSizeResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -261,14 +305,15 @@ partial void ProcessComputeSizeResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -308,6 +353,8 @@ partial void ProcessComputeSizeResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -328,6 +375,8 @@ partial void ProcessComputeSizeResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow computing size for this corpus. @@ -428,9 +477,13 @@ partial void ProcessComputeSizeResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.ComputeCorpusSizeResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.ComputeCorpusSizeResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -458,9 +511,13 @@ partial void ProcessComputeSizeResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.ComputeCorpusSizeResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.ComputeCorpusSizeResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.CorporaClient.Create.g.cs b/src/libs/Vectara/Generated/Vectara.CorporaClient.Create.g.cs index 58ef71e7..f909acd4 100644 --- a/src/libs/Vectara/Generated/Vectara.CorporaClient.Create.g.cs +++ b/src/libs/Vectara/Generated/Vectara.CorporaClient.Create.g.cs @@ -91,6 +91,51 @@ partial void ProcessCreateResponseContent( /// public async global::System.Threading.Tasks.Task CreateAsync( + global::Vectara.CreateCorpusRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateAsResponseAsync( + + request: request, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create a corpus
+ /// The Create Corpus API lets you create a corpus to store and manage your documents. A corpus is a container for documents and their associated metadata. When creating a corpus, you can specify various settings such as the corpus key, name, description, encoder, and filter attributes.
+ /// ## Corpus object
+ /// When you create a `corpus` object, the `corpus_key` property is required to uniquely identify the corpus. The `name` parameter is optional and defaults to the value of `key`. The optional `description` properties lets you provide additional information about the corpus. When creating a new corpus, you also have the flexibility to specify a custom `corpus_key` that follows a naming convention of your choice. This allows you to assign easily identifiable keys to your corpora, making it easier to manage and reference them in your application.
+ /// You can specify whether to treat queries or documents in the corpus as questions or answers using the `queries_are_answers` and `documents_are_questions` boolean properties. These settings affect the semantics of the encoder used at query time and indexing time.
+ /// ## Add metadata as filter attributes
+ /// When creating a corpus with this endpoint or the Vectara Console, you define metadata fields using the `filter_attributes` object. This ensures the corpus supports filtering on specific metadata attributes, either at the document level or the part level.
+ /// Filter attributes enable you to attach metadata to your data at the document (`doc`) or `part` level, which you can use later in filter expressions to narrow the scope of your queries. A filter attribute must specify a unique `name` (up to 64 characters long), and a `level` which indicates whether it exists in the `doc` or `part` level metadata. At indexing time, metadata with this name is extracted and made available for filter expressions to operate on. [Learn more](https://docs.vectara.com/docs/build/prepare-data/metadata-filters)
+ /// ### Doc and part filter levels
+ /// The `doc` attribute applies to the entire document. Use this for metadata that is consistent across the whole document, such as author, publication date, and document ID.
+ /// The `part` attribute applies to specific sections or chunks within a document. Use for metadata that may vary within different parts of the document, such as sections, page numbers, and sentiment scores.
+ /// If `indexed` is true, the system will build an index on the extracted values to further improve the performance of filter expressions involving the attribute.
+ /// Filter attributes must specify a `type`, which is validated when documents are indexed. The four supported types are `integer`, which stores signed whole-number values up to eight bytes in length; `real`, for storing floating point values in [IEEE 754 8-byte format]; `text` for storing textual strings in [UTF-8 encoding], and `boolean` for storing true/false values.
+ /// After you define filter attributes, you can use them within your queries. For example:
+ /// * Document-level attribute: `doc.publication_year > 2020`
+ /// * Part-level attribute: `part.sentiment_score > 0.7`
+ /// ## Custom dimensions
+ /// Custom dimensions let you add additional context to your data that contain user-defined values in addition to what Vectara automatically extracts and stores from the text. For example, *upvotes* can be a custom dimension. For example, see [Add custom dimensions to boost content](/docs/tutorials/add-custom-dimensions)." + ///
+ /// + /// + /// + /// 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> CreateAsResponseAsync( + global::Vectara.CreateCorpusRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, @@ -129,6 +174,7 @@ partial void ProcessCreateResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: "/v2/corpora", baseUri: HttpClient.BaseAddress); @@ -220,6 +266,8 @@ partial void ProcessCreateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -233,6 +281,11 @@ partial void ProcessCreateResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -250,6 +303,8 @@ partial void ProcessCreateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -259,8 +314,7 @@ partial void ProcessCreateResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -269,6 +323,11 @@ partial void ProcessCreateResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -285,14 +344,15 @@ partial void ProcessCreateResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -332,6 +392,8 @@ partial void ProcessCreateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -352,6 +414,8 @@ partial void ProcessCreateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Invalid request body in the create corpus request. @@ -490,9 +554,13 @@ partial void ProcessCreateResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.Corpus.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.Corpus.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -520,9 +588,13 @@ partial void ProcessCreateResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.Corpus.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.Corpus.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.CorporaClient.Delete.g.cs b/src/libs/Vectara/Generated/Vectara.CorporaClient.Delete.g.cs index 20a992d2..db9a2844 100644 --- a/src/libs/Vectara/Generated/Vectara.CorporaClient.Delete.g.cs +++ b/src/libs/Vectara/Generated/Vectara.CorporaClient.Delete.g.cs @@ -79,6 +79,38 @@ partial void ProcessDeleteResponse( int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await DeleteAsResponseAsync( + corpusKey: corpusKey, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Delete a corpus and all its data
+ /// Permanently delete a corpus and all its associated data. The `corpus_key` uniquely identifies the corpus.
+ /// Upon successful completion, space quota consumed by the corpus will be freed, and the corpus will no longer be useable for future indexing or querying.
+ /// :::note
+ /// The corpus_key assigned to the corpus will be released and can be reused.
+ /// ::: + ///
+ /// + /// + /// + /// A user-provided key for a corpus.
+ /// Example: my-corpus + /// + /// 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 DeleteAsResponseAsync( + string corpusKey, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -110,6 +142,7 @@ partial void ProcessDeleteResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/corpora/{corpusKey}", baseUri: HttpClient.BaseAddress); @@ -195,6 +228,8 @@ partial void ProcessDeleteResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -208,6 +243,11 @@ partial void ProcessDeleteResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -225,6 +265,8 @@ partial void ProcessDeleteResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -234,8 +276,7 @@ partial void ProcessDeleteResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -244,6 +285,11 @@ partial void ProcessDeleteResponse( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -260,14 +306,15 @@ partial void ProcessDeleteResponse( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -307,6 +354,8 @@ partial void ProcessDeleteResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -327,6 +376,8 @@ partial void ProcessDeleteResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow deleting the corpus. @@ -423,6 +474,10 @@ partial void ProcessDeleteResponse( { __response.EnsureSuccessStatusCode(); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -444,6 +499,10 @@ partial void ProcessDeleteResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.CorporaClient.Get.g.cs b/src/libs/Vectara/Generated/Vectara.CorporaClient.Get.g.cs index 04cb21b3..82a1f1f1 100644 --- a/src/libs/Vectara/Generated/Vectara.CorporaClient.Get.g.cs +++ b/src/libs/Vectara/Generated/Vectara.CorporaClient.Get.g.cs @@ -86,6 +86,42 @@ partial void ProcessGetResponseContent( int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetAsResponseAsync( + corpusKey: corpusKey, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Retrieve metadata about a corpus
+ /// The Get Corpus API lets you view metadata about a specific corpus. This is useful for getting information about a corpus without performing a search. This operation does not search the corpus contents. Specify the `corpus_key` to identify the corpus whose metadata you want to retrieve.
+ /// This endpoint helps administrators understand the access control details and monitor the size of corpora to understand information like the amount of quota consumed. You can also use this information for optimizing search and storage utilization.
+ /// For example, you can track the read and write activity of a specific corpus which can help you change your security strategy proactively. You noticed a corpus with an API key with read/write access that is only being used for high volume reads. You may decide to switch to a read-only key.
+ /// In another case, you might respond to a security incident by disabling a specific corpus because of information returned by this endpoint.
+ /// ## Get the number of documents or document parts in a corpus
+ /// Tracking the usage of documents in a corpus enables adminstrators to manage resource allocation efficiently. Monitoring corpus metrics also helps data usage stay within allocated quotas and identify trends in document growth and document segmentation.
+ /// The `limit` object in the response provides comprehensive information about the current usage and limits of a corpus including the number of stored documents, document parts, and character count. + ///
+ /// + /// + /// + /// A user-provided key for a corpus.
+ /// Example: my-corpus + /// + /// 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> GetAsResponseAsync( + string corpusKey, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -117,6 +153,7 @@ partial void ProcessGetResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/corpora/{corpusKey}", baseUri: HttpClient.BaseAddress); @@ -202,6 +239,8 @@ partial void ProcessGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -215,6 +254,11 @@ partial void ProcessGetResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -232,6 +276,8 @@ partial void ProcessGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -241,8 +287,7 @@ partial void ProcessGetResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -251,6 +296,11 @@ partial void ProcessGetResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -267,14 +317,15 @@ partial void ProcessGetResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -314,6 +365,8 @@ partial void ProcessGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -334,6 +387,8 @@ partial void ProcessGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow retrieving the corpus. @@ -434,9 +489,13 @@ partial void ProcessGetResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.Corpus.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.Corpus.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -464,9 +523,13 @@ partial void ProcessGetResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.Corpus.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.Corpus.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.CorporaClient.GetFilterAttributeStats.g.cs b/src/libs/Vectara/Generated/Vectara.CorporaClient.GetFilterAttributeStats.g.cs index c1f2c2b7..b46ff309 100644 --- a/src/libs/Vectara/Generated/Vectara.CorporaClient.GetFilterAttributeStats.g.cs +++ b/src/libs/Vectara/Generated/Vectara.CorporaClient.GetFilterAttributeStats.g.cs @@ -103,6 +103,56 @@ partial void ProcessGetFilterAttributeStatsResponseContent( int? maxValues = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetFilterAttributeStatsAsResponseAsync( + corpusKey: corpusKey, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + fields: fields, + metadataFilter: metadataFilter, + maxValues: maxValues, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get filter attribute statistics for corpus metadata
+ /// Retrieve statistics and value distributions for filter attributes in a corpus. This endpoint provides insights into the metadata structure and content distribution, enabling users to understand available filter values and build effective metadata queries.
+ /// This endpoint analyzes document and part metadata fields defined as filter attributes and returns:
+ /// - **Value distributions**: Top occurring values with their counts
+ /// - **Statistics**: Min, max, average, and sum for numeric fields
+ /// By default, statistics are computed across all filter attributes at both document and part levels. You can optionally:
+ /// - Request statistics for specific fields only
+ /// - Apply metadata filters to analyze a subset of the corpus
+ /// - Limit the number of distinct values returned per field
+ /// **Performance and Caching**: Results may be cached for improved performance, with cache duration varying by corpus size. Cached results can take up to 1 hour to refresh for large corpora. Smaller corpora with faster query times have shorter cache durations (2-15 minutes) to ensure fresher data.
+ /// The `corpus_key` uniquely identifies the corpus. For more information, see [Create a corpus](https://docs.vectara.com/docs/rest-api/create-corpus). + ///
+ /// + /// + /// + /// A user-provided key for a corpus.
+ /// Example: my-corpus + /// + /// + /// + /// + /// Default Value: 100 + /// + /// 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> GetFilterAttributeStatsAsResponseAsync( + string corpusKey, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + string? fields = default, + string? metadataFilter = default, + int? maxValues = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -137,13 +187,14 @@ partial void ProcessGetFilterAttributeStatsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/corpora/{corpusKey}/filter_attribute_stats", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("fields", fields) .AddOptionalParameter("metadata_filter", metadataFilter) - .AddOptionalParameter("max_values", maxValues?.ToString()) + .AddOptionalParameter("max_values", maxValues?.ToString()) ; var __path = __pathBuilder.ToString(); __path = global::Vectara.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -230,6 +281,8 @@ partial void ProcessGetFilterAttributeStatsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -243,6 +296,11 @@ partial void ProcessGetFilterAttributeStatsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -260,6 +318,8 @@ partial void ProcessGetFilterAttributeStatsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -269,8 +329,7 @@ partial void ProcessGetFilterAttributeStatsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +338,11 @@ partial void ProcessGetFilterAttributeStatsResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -295,14 +359,15 @@ partial void ProcessGetFilterAttributeStatsResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -342,6 +407,8 @@ partial void ProcessGetFilterAttributeStatsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -362,6 +429,8 @@ partial void ProcessGetFilterAttributeStatsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Bad request - invalid parameters or corpus does not support filter attribute statistics (not backed by OpenSearch). @@ -500,9 +569,13 @@ partial void ProcessGetFilterAttributeStatsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.GetFilterAttributeStatsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.GetFilterAttributeStatsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -530,9 +603,13 @@ partial void ProcessGetFilterAttributeStatsResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.GetFilterAttributeStatsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.GetFilterAttributeStatsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.CorporaClient.List.g.cs b/src/libs/Vectara/Generated/Vectara.CorporaClient.List.g.cs index 3568cd2f..ce1c6a0b 100644 --- a/src/libs/Vectara/Generated/Vectara.CorporaClient.List.g.cs +++ b/src/libs/Vectara/Generated/Vectara.CorporaClient.List.g.cs @@ -92,6 +92,45 @@ partial void ProcessListResponseContent( string? pageKey = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListAsResponseAsync( + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + limit: limit, + filter: filter, + corpusId: corpusId, + pageKey: pageKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List corpora
+ /// The List Corpora API lets you retrieve a list of corpora in your account. This endpoint returns a paginated list of corpora objects, which contain basic information about each corpus. The returned corpus objects contain less detail compared to those retrieved the direct corpus retrieval operation.
+ /// You can specify optional parameters to control the pagination and filtering of the results. The limit parameter determines the maximum number of corpora to return, with a default value of 10 and a maximum value of 100. + ///
+ /// + /// + /// + /// Default Value: 10 + /// + /// + /// + /// + /// 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> ListAsResponseAsync( + int? requestTimeout = default, + int? requestTimeoutMillis = default, + int? limit = default, + string? filter = default, + global::System.Collections.Generic.IList? corpusId = default, + string? pageKey = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -126,14 +165,15 @@ partial void ProcessListResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: "/v2/corpora", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("filter", filter) .AddOptionalParameter("corpus_id", corpusId, delimiter: ",", explode: true) - .AddOptionalParameter("page_key", pageKey) + .AddOptionalParameter("page_key", pageKey) ; var __path = __pathBuilder.ToString(); __path = global::Vectara.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -220,6 +260,8 @@ partial void ProcessListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -233,6 +275,11 @@ partial void ProcessListResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -250,6 +297,8 @@ partial void ProcessListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -259,8 +308,7 @@ partial void ProcessListResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -269,6 +317,11 @@ partial void ProcessListResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -285,14 +338,15 @@ partial void ProcessListResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -332,6 +386,8 @@ partial void ProcessListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -352,6 +408,8 @@ partial void ProcessListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow listing corpora. @@ -414,9 +472,13 @@ partial void ProcessListResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.ListCorporaResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.ListCorporaResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -444,9 +506,13 @@ partial void ProcessListResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.ListCorporaResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.ListCorporaResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.CorporaClient.Query.g.cs b/src/libs/Vectara/Generated/Vectara.CorporaClient.Query.g.cs index c4e2ad91..c5d4cb3b 100644 --- a/src/libs/Vectara/Generated/Vectara.CorporaClient.Query.g.cs +++ b/src/libs/Vectara/Generated/Vectara.CorporaClient.Query.g.cs @@ -201,6 +201,162 @@ partial void ProcessQueryResponseContent( public async global::System.Threading.Tasks.Task QueryAsync( string corpusKey, + global::Vectara.QueryCorpusRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await QueryAsResponseAsync( + corpusKey: corpusKey, + + request: request, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Advanced Single Corpus Query
+ /// Perform an advanced query on a specific corpus to find relevant results, generate summaries, highlight relevant snippets, and use Retrieval Augmented Generation.
+ /// This endpoint expands on the simple GET version by allowing full customization of:
+ /// - **Search parameters**: Control pagination (`offset`, `limit`), apply metadata filters, and specify lexical interpolation to balance neural and keyword-based retrieval.
+ /// - **Hybrid search**: Adjust the `lexical_interpolation` value between `0.0` (purely neural) and `1.0` (purely lexical). Typical best results are between `0.01` and `0.1`.
+ /// - **Reranking**: Apply advanced rerankers such as Multilingual, MMR, Chain, or User Defined Function rerankers to improve result relevance.
+ /// - **Generation (RAG)**: Include a `generation` object to enable grounded summarization with your own data, citations, and factual consistency scoring.
+ /// - **Streaming**: Optionally stream results or generated summaries in real time with `stream_response`.
+ /// Each query must include the `corpus_key` path parameter that identifies the target corpus. The response contains one or more subdocuments representing the most relevant passages, along with any generated summaries or citations.
+ /// **Typical use cases**
+ /// - Perform a semantically rich search over a large, domain-specific corpus.
+ /// - Retrieve relevant text passages and apply reranking for better result diversity.
+ /// - Generate contextually grounded answers or summaries using Retrieval Augmented Generation.
+ /// ## Basic query
+ /// This basic query example has a minimal configuration:
+ /// ```json
+ /// {
+ /// "query": "What are black holes?",
+ /// "search": {
+ /// "corpora": [{
+ /// "corpus_key": "my-corpus"
+ /// }],
+ /// },
+ /// "generation": {
+ /// "generation_preset_name": "mockingbird-2.0",
+ /// "max_used_search_results": 20
+ /// }
+ /// }
+ /// ```
+ /// ## Request body parameters
+ /// The request body is a JSON object containing the `query`, `search`, and optional `generation` objects.
+ /// `query` (string, required) - (Required) The search query text.
+ /// `search` (string, required) - (Required) An object that controls the retrieval and reranking process.
+ /// `search.corpora` - An array specifying which corpus to search. For this endpoint, the array will contain a single object.
+ /// * `corpus_key` (string, required): The unique ID of the corpus to search.
+ /// * `metadata_filter` (string, optional): A SQL-like filter to narrow results. For syntax and examples, see the Filters guide.
+ /// * `lexical_interpolation` (float, optional): A value between 0.0 (pure neural search) and 1.0 (pure keyword search) to enable hybrid search. A recommended starting point is 0.025.
+ /// * `custom_dimensions` (object, optional): An object to boost or bury results based on custom dimensions. See the Custom Dimensions guide for details.
+ /// `search.limit` (integer, optional) - The maximum number of results to retrieve before reranking. **Default**: 10
+ /// `search.offset` (integer, optional) - The number of results to skip for pagination. **Default**: 0
+ /// `search.context_configuration` (object, optional) - Configuration for surrounding context to include with each search result.
+ /// * `sentences_before` (integer): Number of sentences to include before the matching text.
+ /// * `sentences_after` (integer): Number of sentences to include after the matching text.
+ /// * `characters_before` (integer): Number of characters to include before the matching text.
+ /// * `characters_after` (integer): Number of characters to include after the matching text.
+ /// * `start_tag` (string): HTML-style tag to wrap the beginning of the retrieved context (e.g., `<b>`).
+ /// * `end_tag` (string): HTML-style tag to wrap the end of the retrieved context (e.g., `</b>`).
+ /// :::note
+ /// You can only use sentences before/after OR characters before/after, but not both.
+ /// :::
+ /// Example:
+ /// ```json
+ /// {
+ /// "context_configuration": {
+ /// "sentences_before": 2,
+ /// "sentences_after": 2,
+ /// "start_tag": "<mark>",
+ /// "end_tag": "</mark>"
+ /// }
+ /// }
+ /// ```
+ /// `search.reranker` (object, optional) - Configures a reranker to improve result quality by reordering search results to place the most relevant content first. For more details, see [Reranking overview](/docs/search-and-retrieval/rerankers/reranking-overview).
+ /// * `type` (string): The reranker type. Options include customer_reranker (default multilingual reranker), mmr (for result diversity), or none.
+ /// * `reranker_name` (string): The specific reranker model to use (e.g., Rerank_Multilingual_v1).
+ /// * `limit` (integer): Maximum number of results to return after reranking.
+ /// * `cutoff` (float): Minimum relevance score (between 0.0 and 1.0) for a result to be included. A typical range is 0.3-0.7.
+ /// * `include_context` (boolean): If true, uses surrounding context text for more accurate reranking.
+ /// **Example:**
+ /// ```json
+ /// {
+ /// "reranker": {
+ /// "type": "customer_reranker",
+ /// "reranker_name": "Rerank_Multilingual_v1",
+ /// "limit": 50,
+ /// }
+ /// }
+ /// ```
+ /// `generation` (object, optional) - An object that controls how the agent creates natural language responses. If this object is excluded, summarization is disabled.
+ /// `generation.generation_preset_name` (string, optional) - The name of the pre-configured prompt and LLM bundle.
+ /// **Recommended Presets:**
+ /// * `mockingbird-2.0`: Vectara's cutting-edge LLM for RAG.
+ /// * `vectara-summary-ext-24-05-med-omni`: (gpt-4o, optimized for citations)
+ /// * `vectara-summary-ext-24-05-large`: (gpt-4.0-turbo, optimized for citations)
+ /// * `vectara-summary-ext-24-05-sml`: (gpt-3.5-turbo, optimized for citations)
+ /// **For Tabular data:**
+ /// `vectara-summary-table-query-ext-dec-2024-gpt-4o`
+ /// `generation.prompt_template` (string, optional) - A custom prompt template in JSON format that defines the system and user messages for the LLM. Use this to customize the behavior of the model beyond the preset. The template can include Velocity templates with variables such as `$vectaraQueryResults` to reference retrieved search results. For more information, see [Custom prompts](/docs/prompts/vectara-prompt-engine).
+ /// `generation.max_used_search_results` (integer, optional) - The maximum number of top search results to send for summarization. The number of top search results to send to the LLM for summarization. Increasing this can create a more comprehensive summary but may increase response time. **Default limit**: 25.
+ /// :::caution
+ /// Setting this value too high may prevent the model from generating a response.
+ /// :::
+ /// `generation.response_language` (string, optional) - The language code for the response (e.g. `eng`, `spa`, `deu`). Set this to `auto` to have Vectara guess the language, but we recommend specifying your preferred language for best results.
+ /// `generation.citations` (object, optional) - Configuration for including citations in the generated summary.
+ /// * `style` (string): Citation style. Options are `markdown`, `html`, or `none`.
+ /// * `url_pattern` (string): A URL template for citation links, where `{doc.id}` will be replaced with the document ID.
+ /// * `text_pattern` (string): A text template for citation display, where `{doc.title}` will be replaced with the document title.
+ /// **Example:**
+ /// ```json
+ /// {
+ /// "citations": {
+ /// "style": "markdown",
+ /// "url_pattern": "https://docs.example.com/documents/{doc.id}",
+ /// "text_pattern": "{doc.title}"
+ /// }
+ /// }
+ /// ```
+ /// `generation.model_parameters` (object, optional) - Custom parameters for the underlying LLM that overwrites the defaults of `generation_preset_name`.
+ /// * `temperature` (float): Controls randomness in the output. Higher values (e.g., 0.8) produce more creative results, while lower values (e.g., 0.2) yield more focused and deterministic outputs.
+ /// * `max_tokens` (integer): The maximum number of tokens to generate in the response.
+ /// * `frequency_penalty` (float): Decreases the use of repeating words, reducing repetition. **Default**: `0.0` to `1.0`.
+ /// * `presence_penalty` (float): Increases the chance for the model to introduce new topics. **Default**: `0.0` to `1.0`.
+ /// **Example:**
+ /// ```json
+ /// {
+ /// "model_parameters": {
+ /// "temperature": 0.7,
+ /// "max_tokens": 500,
+ /// "frequency_penalty": 0.5,
+ /// "presence_penalty": 0.3
+ /// }
+ /// }
+ /// ```
+ /// `generation.enable_factual_consistency_score` (boolean): If true, includes a factual consistency score in the response to indicate how well the generated summary aligns with the retrieved documents. + ///
+ /// + /// + /// + /// A user-provided key for a corpus.
+ /// Example: my-corpus + /// + /// + /// 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> QueryAsResponseAsync( + string corpusKey, + global::Vectara.QueryCorpusRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, @@ -240,6 +396,7 @@ partial void ProcessQueryResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/corpora/{corpusKey}/query", baseUri: HttpClient.BaseAddress); @@ -332,6 +489,8 @@ partial void ProcessQueryResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -345,6 +504,11 @@ partial void ProcessQueryResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -362,6 +526,8 @@ partial void ProcessQueryResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -371,8 +537,7 @@ partial void ProcessQueryResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -381,6 +546,11 @@ partial void ProcessQueryResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -397,14 +567,15 @@ partial void ProcessQueryResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -444,6 +615,8 @@ partial void ProcessQueryResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -464,6 +637,8 @@ partial void ProcessQueryResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Query request was malformed. @@ -602,9 +777,13 @@ partial void ProcessQueryResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.QueryFullResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.QueryFullResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -632,9 +811,13 @@ partial void ProcessQueryResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.QueryFullResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.QueryFullResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.CorporaClient.QueryAsStream.g.cs b/src/libs/Vectara/Generated/Vectara.CorporaClient.QueryAsStream.g.cs index c732ec03..b5b5abd9 100644 --- a/src/libs/Vectara/Generated/Vectara.CorporaClient.QueryAsStream.g.cs +++ b/src/libs/Vectara/Generated/Vectara.CorporaClient.QueryAsStream.g.cs @@ -235,6 +235,7 @@ partial void ProcessQueryAsStreamResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/corpora/{corpusKey}/query", baseUri: HttpClient.BaseAddress); @@ -327,6 +328,8 @@ partial void ProcessQueryAsStreamResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -340,6 +343,11 @@ partial void ProcessQueryAsStreamResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -357,6 +365,8 @@ partial void ProcessQueryAsStreamResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -366,8 +376,7 @@ partial void ProcessQueryAsStreamResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -376,6 +385,11 @@ partial void ProcessQueryAsStreamResponse( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -392,14 +406,15 @@ partial void ProcessQueryAsStreamResponse( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -439,6 +454,8 @@ partial void ProcessQueryAsStreamResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -459,6 +476,8 @@ partial void ProcessQueryAsStreamResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } diff --git a/src/libs/Vectara/Generated/Vectara.CorporaClient.ReplaceFilterAttributes.g.cs b/src/libs/Vectara/Generated/Vectara.CorporaClient.ReplaceFilterAttributes.g.cs index eb9177ea..3776c8dc 100644 --- a/src/libs/Vectara/Generated/Vectara.CorporaClient.ReplaceFilterAttributes.g.cs +++ b/src/libs/Vectara/Generated/Vectara.CorporaClient.ReplaceFilterAttributes.g.cs @@ -81,6 +81,42 @@ partial void ProcessReplaceFilterAttributesResponseContent( public async global::System.Threading.Tasks.Task ReplaceFilterAttributesAsync( string corpusKey, + global::Vectara.ReplaceFilterAttributesRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ReplaceFilterAttributesAsResponseAsync( + corpusKey: corpusKey, + + request: request, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Replace the filter attributes of a corpus
+ /// Replace the filter attributes of a corpus. This does not happen immediately, as this operation creates a job that completes asynchronously. These new filter attributes will not work until the job completes.
+ /// You can monitor the status of the filter change using the returned job ID. The `corpus_key` uniquely identifies the corpus. + ///
+ /// + /// + /// + /// A user-provided key for a corpus.
+ /// Example: my-corpus + /// + /// + /// 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> ReplaceFilterAttributesAsResponseAsync( + string corpusKey, + global::Vectara.ReplaceFilterAttributesRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, @@ -120,6 +156,7 @@ partial void ProcessReplaceFilterAttributesResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/corpora/{corpusKey}/replace_filter_attributes", baseUri: HttpClient.BaseAddress); @@ -212,6 +249,8 @@ partial void ProcessReplaceFilterAttributesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -225,6 +264,11 @@ partial void ProcessReplaceFilterAttributesResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -242,6 +286,8 @@ partial void ProcessReplaceFilterAttributesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -251,8 +297,7 @@ partial void ProcessReplaceFilterAttributesResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -261,6 +306,11 @@ partial void ProcessReplaceFilterAttributesResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -277,14 +327,15 @@ partial void ProcessReplaceFilterAttributesResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -324,6 +375,8 @@ partial void ProcessReplaceFilterAttributesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -344,6 +397,8 @@ partial void ProcessReplaceFilterAttributesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow replacing filter attributes. @@ -444,9 +499,13 @@ partial void ProcessReplaceFilterAttributesResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.ReplaceFilterAttributesResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.ReplaceFilterAttributesResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -474,9 +533,13 @@ partial void ProcessReplaceFilterAttributesResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.ReplaceFilterAttributesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.ReplaceFilterAttributesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.CorporaClient.Reset.g.cs b/src/libs/Vectara/Generated/Vectara.CorporaClient.Reset.g.cs index 8226ca4a..1ba621dd 100644 --- a/src/libs/Vectara/Generated/Vectara.CorporaClient.Reset.g.cs +++ b/src/libs/Vectara/Generated/Vectara.CorporaClient.Reset.g.cs @@ -75,6 +75,34 @@ partial void ProcessResetResponse( int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await ResetAsResponseAsync( + corpusKey: corpusKey, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Remove all documents and data in a corpus
+ /// Resets a corpus, which removes all documents and data from the specified corpus, while keeping the corpus itself. The `corpus_key` uniquely identifies the corpus. For more information, see [Create a corpus](https://docs.vectara.com/docs/rest-api/create-corpus). + ///
+ /// + /// + /// + /// A user-provided key for a corpus.
+ /// Example: my-corpus + /// + /// 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 ResetAsResponseAsync( + string corpusKey, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -106,6 +134,7 @@ partial void ProcessResetResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/corpora/{corpusKey}/reset", baseUri: HttpClient.BaseAddress); @@ -191,6 +220,8 @@ partial void ProcessResetResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -204,6 +235,11 @@ partial void ProcessResetResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -221,6 +257,8 @@ partial void ProcessResetResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -230,8 +268,7 @@ partial void ProcessResetResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -240,6 +277,11 @@ partial void ProcessResetResponse( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -256,14 +298,15 @@ partial void ProcessResetResponse( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -303,6 +346,8 @@ partial void ProcessResetResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -323,6 +368,8 @@ partial void ProcessResetResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow resetting the corpus. @@ -419,6 +466,10 @@ partial void ProcessResetResponse( { __response.EnsureSuccessStatusCode(); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -440,6 +491,10 @@ partial void ProcessResetResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.CorporaClient.Search.g.cs b/src/libs/Vectara/Generated/Vectara.CorporaClient.Search.g.cs index 36264dc9..e306419c 100644 --- a/src/libs/Vectara/Generated/Vectara.CorporaClient.Search.g.cs +++ b/src/libs/Vectara/Generated/Vectara.CorporaClient.Search.g.cs @@ -113,6 +113,64 @@ partial void ProcessSearchResponseContent( bool? intelligentQueryRewriting = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await SearchAsResponseAsync( + corpusKey: corpusKey, + query: query, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + limit: limit, + offset: offset, + saveHistory: saveHistory, + intelligentQueryRewriting: intelligentQueryRewriting, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Simple Single Corpus Query
+ /// The [**Query APIs**](/docs/rest-api/queries) enable Retrieval Augmented Generation (RAG), allowing you to search your data and generate AI-powered summaries. Vectara provides three query types to match different search needs:
+ /// * [**Single corpus query**](/docs/rest-api/search-corpus): For a simple search within a single data source.
+ /// * [**Advanced single corpus query**](/docs/rest-api/query-corpus): For full-featured search and RAG within one corpus, supporting advanced features like table summarization, metadata filtering, and reranking.
+ /// * [**Multiple corpora query**](/docs/rest-api/query): For searching across one or more corpora with full RAG capabilities.
+ /// Search a single corpus with a straightforward query request, specifying the corpus key and query parameters.
+ /// * Specify the unique `corpus_key` identifying the corpus to query. The `corpus_key` is created in the Vectara Console or the [Create Corpus API](https://docs.vectara.com/docs/rest-api/create-corpus), and the corpus key is part of that process. When creating a new corpus, you have the option to assign a custom `corpus_key` following your preferred naming convention. This key serves as a unique identifier for the corpus, allowing it to be referenced in search requests.
+ /// * Enter the search `query` string for the corpus, which is the question you want to ask.
+ /// * Set the maximum number of results (`limit`) to return. **Default**: 10, **minimum**: 1 + ///
+ /// + /// + /// + /// A user-provided key for a corpus.
+ /// Example: my-corpus + /// + /// + /// + /// Default Value: 10 + /// + /// + /// Default Value: 0 + /// + /// + /// + /// 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> SearchAsResponseAsync( + string corpusKey, + string query, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + int? limit = default, + int? offset = default, + bool? saveHistory = default, + bool? intelligentQueryRewriting = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -149,15 +207,16 @@ partial void ProcessSearchResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/corpora/{corpusKey}/query", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddRequiredParameter("query", query) .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("offset", offset?.ToString()) .AddOptionalParameter("save_history", saveHistory?.ToString().ToLowerInvariant()) - .AddOptionalParameter("intelligent_query_rewriting", intelligentQueryRewriting?.ToString().ToLowerInvariant()) + .AddOptionalParameter("intelligent_query_rewriting", intelligentQueryRewriting?.ToString().ToLowerInvariant()) ; var __path = __pathBuilder.ToString(); __path = global::Vectara.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -246,6 +305,8 @@ partial void ProcessSearchResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -259,6 +320,11 @@ partial void ProcessSearchResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -276,6 +342,8 @@ partial void ProcessSearchResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -285,8 +353,7 @@ partial void ProcessSearchResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -295,6 +362,11 @@ partial void ProcessSearchResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -311,14 +383,15 @@ partial void ProcessSearchResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -358,6 +431,8 @@ partial void ProcessSearchResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -378,6 +453,8 @@ partial void ProcessSearchResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Query request was malformed. @@ -516,9 +593,13 @@ partial void ProcessSearchResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.QueryFullResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.QueryFullResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -546,9 +627,13 @@ partial void ProcessSearchResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.QueryFullResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.QueryFullResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.CorporaClient.Update.g.cs b/src/libs/Vectara/Generated/Vectara.CorporaClient.Update.g.cs index 7cbf8238..8b0faa9e 100644 --- a/src/libs/Vectara/Generated/Vectara.CorporaClient.Update.g.cs +++ b/src/libs/Vectara/Generated/Vectara.CorporaClient.Update.g.cs @@ -81,6 +81,42 @@ partial void ProcessUpdateResponseContent( public async global::System.Threading.Tasks.Task UpdateAsync( string corpusKey, + global::Vectara.UpdateCorpusRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdateAsResponseAsync( + corpusKey: corpusKey, + + request: request, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update a corpus
+ /// The Update Corpus API lets you enable, disable, or update the name and description of a corpus. This is useful to manage the availability of data within the system, such as when you need to take the corpus offline without having to delete the corpus.
+ /// This lets you utilize automated scripts to programmatically control the availability of corpora based on certain conditions. For example, quickly disable a corpus for maintenance updates or in response to security incidents. + ///
+ /// + /// + /// + /// A user-provided key for a corpus.
+ /// Example: my-corpus + /// + /// + /// 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> UpdateAsResponseAsync( + string corpusKey, + global::Vectara.UpdateCorpusRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, @@ -120,6 +156,7 @@ partial void ProcessUpdateResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/corpora/{corpusKey}", baseUri: HttpClient.BaseAddress); @@ -212,6 +249,8 @@ partial void ProcessUpdateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -225,6 +264,11 @@ partial void ProcessUpdateResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -242,6 +286,8 @@ partial void ProcessUpdateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -251,8 +297,7 @@ partial void ProcessUpdateResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -261,6 +306,11 @@ partial void ProcessUpdateResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -277,14 +327,15 @@ partial void ProcessUpdateResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -324,6 +375,8 @@ partial void ProcessUpdateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -344,6 +397,8 @@ partial void ProcessUpdateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow updating the corpus. @@ -444,9 +499,13 @@ partial void ProcessUpdateResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.Corpus.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.Corpus.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -474,9 +533,13 @@ partial void ProcessUpdateResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.Corpus.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.Corpus.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.CorporaClient.g.cs b/src/libs/Vectara/Generated/Vectara.CorporaClient.g.cs index 549efbf9..d2398a5a 100644 --- a/src/libs/Vectara/Generated/Vectara.CorporaClient.g.cs +++ b/src/libs/Vectara/Generated/Vectara.CorporaClient.g.cs @@ -75,10 +75,10 @@ public CorporaClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public CorporaClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Vectara.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Vectara.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Vectara/Generated/Vectara.DocumentsClient.BulkDelete.g.cs b/src/libs/Vectara/Generated/Vectara.DocumentsClient.BulkDelete.g.cs index 9c0d046d..ff8b0b4d 100644 --- a/src/libs/Vectara/Generated/Vectara.DocumentsClient.BulkDelete.g.cs +++ b/src/libs/Vectara/Generated/Vectara.DocumentsClient.BulkDelete.g.cs @@ -99,6 +99,52 @@ partial void ProcessBulkDeleteResponseContent( bool? async = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await BulkDeleteAsResponseAsync( + corpusKey: corpusKey, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + metadataFilter: metadataFilter, + documentIds: documentIds, + async: async, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Bulk delete documents from a corpus
+ /// Initiates an asynchronous bulk delete operation for documents in a corpus.
+ /// This operation accepts a metadata filter, a list of specific document IDs, or both.
+ /// **Important**: This is a best-effort operation.
+ /// See the response schema documentation for details on the behavior differences between `metadata_filter` and `document_ids` parameters.
+ /// The operation runs as a background workflow.
+ /// Use the returned `job_id` to track progress via the Jobs API. + ///
+ /// + /// + /// + /// A user-provided key for a corpus.
+ /// Example: my-corpus + /// + /// + /// + /// + /// 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> BulkDeleteAsResponseAsync( + string corpusKey, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + string? metadataFilter = default, + string? documentIds = default, + bool? async = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -133,13 +179,14 @@ partial void ProcessBulkDeleteResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/corpora/{corpusKey}/documents", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("metadata_filter", metadataFilter) .AddOptionalParameter("document_ids", documentIds) - .AddOptionalParameter("async", async?.ToString().ToLowerInvariant()) + .AddOptionalParameter("async", async?.ToString().ToLowerInvariant()) ; var __path = __pathBuilder.ToString(); __path = global::Vectara.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -226,6 +273,8 @@ partial void ProcessBulkDeleteResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -239,6 +288,11 @@ partial void ProcessBulkDeleteResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -256,6 +310,8 @@ partial void ProcessBulkDeleteResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -265,8 +321,7 @@ partial void ProcessBulkDeleteResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -275,6 +330,11 @@ partial void ProcessBulkDeleteResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -291,14 +351,15 @@ partial void ProcessBulkDeleteResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -338,6 +399,8 @@ partial void ProcessBulkDeleteResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -358,6 +421,8 @@ partial void ProcessBulkDeleteResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Invalid request. @@ -534,9 +599,13 @@ partial void ProcessBulkDeleteResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.BulkDeleteDocumentsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.BulkDeleteDocumentsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -564,9 +633,13 @@ partial void ProcessBulkDeleteResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.BulkDeleteDocumentsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.BulkDeleteDocumentsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.DocumentsClient.Create.g.cs b/src/libs/Vectara/Generated/Vectara.DocumentsClient.Create.g.cs index 7ba8eb3a..527d5c2f 100644 --- a/src/libs/Vectara/Generated/Vectara.DocumentsClient.Create.g.cs +++ b/src/libs/Vectara/Generated/Vectara.DocumentsClient.Create.g.cs @@ -106,6 +106,67 @@ partial void ProcessCreateResponseContent( public async global::System.Threading.Tasks.Task CreateAsync( string corpusKey, + global::Vectara.CreateDocumentRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.CreateCorpusDocumentWaitFor? waitFor = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateAsResponseAsync( + corpusKey: corpusKey, + + request: request, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + waitFor: waitFor, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Add a document to a corpus
+ /// Add a document to a corpus for indexing, making its content available for search, retrieval, and generation. This endpoint supports two ingestion modes: **structured** documents and **core** documents. These modes offer different levels of control over document structure and chunking.
+ /// Each document becomes part of a corpus. You can use this API directly or with [Vectara Ingest](https://github.com/vectara/vectara-ingest) or the [File Upload API](/docs/rest-api/upload-file).
+ /// ## Structured documents
+ /// Structured documents provide a natural hierarchy where Vectar handles chunking and metadata automatically. Structured documents are ideal when you want to index documents that have logical organization (titles, sections, paragraphs, and optionally tables or images) but prefer Vectara to manage how the content is split into search-optimized units.
+ /// Each structured document contains:
+ /// - A unique `id` and optional `title`, `description`, and `metadata`.
+ /// - An array of `sections`, each with its own title, text, and optional nested sections, tables, or images.
+ /// - Optional `custom_dimensions` that can influence ranking during search.
+ /// When indexed, Vectara partitions the text into document parts automatically using an intelligent sentence- or character-based chunking strategy. This lets you ingest data with minimal pre-processing while maintaining semantic integrity across context boundaries.
+ /// Structured documents are recommended for content with well-defined sections such as reports, articles, FAQs, or documentation.
+ /// ## Core documents
+ /// Core documents offer fine-grained, explicit control of every part of a document that becomes searchable. Instead of providing a hierarchical structure, you specify each **document part** directly as unit that maps 1:1 to a search result or embedding.
+ /// A core document includes:
+ /// - A unique `id` and optional `metadata`.
+ /// - A list of `document_parts`, where each part includes `text`, optional `context`, `metadata`, and `custom_dimensions`.
+ /// - Optional `tables` and `images`, allowing you to represent complex structured data like spreadsheets or charts.
+ /// Core documents are designed for advanced use cases such as precise chunk-level optimization or experimental corpus structures, and applications where metadata-driven retrieval or ranking must be explicitly controlled.
+ /// ## Chunking strategies
+ /// By default, Vectara uses **sentence-based chunking**, which provides optimal retrieval accuracy for most datasets.
+ /// For larger documents or performance-tuned ingestion, you can explicitly set a `chunking_strategy`:
+ /// - `sentence_chunking_strategy` — creates one chunk per sentence (default).
+ /// - `max_chars_chunking_strategy` — creates larger chunks up to a specified character limit (`max_chars_per_chunk`), balancing retrieval speed with contextual coherence. + ///
+ /// + /// + /// + /// A user-provided key for a corpus.
+ /// Example: my-corpus + /// + /// + /// Default Value: searchable + /// + /// + /// 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> CreateAsResponseAsync( + string corpusKey, + global::Vectara.CreateDocumentRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, @@ -145,11 +206,12 @@ partial void ProcessCreateResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/corpora/{corpusKey}/documents", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder - .AddOptionalParameter("wait_for", waitFor?.ToValueString()) + .AddOptionalParameter("wait_for", waitFor?.ToValueString()) ; var __path = __pathBuilder.ToString(); __path = global::Vectara.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -241,6 +303,8 @@ partial void ProcessCreateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -254,6 +318,11 @@ partial void ProcessCreateResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -271,6 +340,8 @@ partial void ProcessCreateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -280,8 +351,7 @@ partial void ProcessCreateResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -290,6 +360,11 @@ partial void ProcessCreateResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -306,14 +381,15 @@ partial void ProcessCreateResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -353,6 +429,8 @@ partial void ProcessCreateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -373,6 +451,8 @@ partial void ProcessCreateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Document creation request was malformed. @@ -549,9 +629,13 @@ partial void ProcessCreateResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.Document.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.Document.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -579,9 +663,13 @@ partial void ProcessCreateResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.Document.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.Document.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.DocumentsClient.Delete.g.cs b/src/libs/Vectara/Generated/Vectara.DocumentsClient.Delete.g.cs index d0263b74..4c210832 100644 --- a/src/libs/Vectara/Generated/Vectara.DocumentsClient.Delete.g.cs +++ b/src/libs/Vectara/Generated/Vectara.DocumentsClient.Delete.g.cs @@ -79,6 +79,37 @@ partial void ProcessDeleteResponse( int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await DeleteAsResponseAsync( + corpusKey: corpusKey, + documentId: documentId, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Delete a document
+ /// Permanently delete a document identified by its unique `document_id` from a specific corpus. This operation cannot be undone, so use it with caution. + ///
+ /// + /// + /// + /// A user-provided key for a corpus.
+ /// Example: my-corpus + /// + /// + /// 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 DeleteAsResponseAsync( + string corpusKey, + string documentId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -111,6 +142,7 @@ partial void ProcessDeleteResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/corpora/{corpusKey}/documents/{documentId}", baseUri: HttpClient.BaseAddress); @@ -197,6 +229,8 @@ partial void ProcessDeleteResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -210,6 +244,11 @@ partial void ProcessDeleteResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -227,6 +266,8 @@ partial void ProcessDeleteResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -236,8 +277,7 @@ partial void ProcessDeleteResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -246,6 +286,11 @@ partial void ProcessDeleteResponse( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -262,14 +307,15 @@ partial void ProcessDeleteResponse( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -309,6 +355,8 @@ partial void ProcessDeleteResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -329,6 +377,8 @@ partial void ProcessDeleteResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow deleting a document in the corpus. @@ -425,6 +475,10 @@ partial void ProcessDeleteResponse( { __response.EnsureSuccessStatusCode(); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -446,6 +500,10 @@ partial void ProcessDeleteResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.DocumentsClient.Get.g.cs b/src/libs/Vectara/Generated/Vectara.DocumentsClient.Get.g.cs index 80bad727..b32e0efa 100644 --- a/src/libs/Vectara/Generated/Vectara.DocumentsClient.Get.g.cs +++ b/src/libs/Vectara/Generated/Vectara.DocumentsClient.Get.g.cs @@ -85,6 +85,40 @@ partial void ProcessGetResponseContent( int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetAsResponseAsync( + corpusKey: corpusKey, + documentId: documentId, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Retrieve a document
+ /// The Retrieve Document API enables you to fetch the content and metadata of a specific document from a corpus, identified by its unique `document_id` from a specific corpus. Use this endpoint to view the full details of a document, including its text, metadata, and associated tables, if table extraction is enabled.
+ /// This information is particularly useful when you need to analyze the details of a specific document or integrate document content into your application workflows. + ///
+ /// + /// + /// + /// A user-provided key for a corpus.
+ /// Example: my-corpus + /// + /// + /// 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> GetAsResponseAsync( + string corpusKey, + string documentId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -117,6 +151,7 @@ partial void ProcessGetResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/corpora/{corpusKey}/documents/{documentId}", baseUri: HttpClient.BaseAddress); @@ -203,6 +238,8 @@ partial void ProcessGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -216,6 +253,11 @@ partial void ProcessGetResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -233,6 +275,8 @@ partial void ProcessGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -242,8 +286,7 @@ partial void ProcessGetResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -252,6 +295,11 @@ partial void ProcessGetResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -268,14 +316,15 @@ partial void ProcessGetResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -315,6 +364,8 @@ partial void ProcessGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -335,6 +386,8 @@ partial void ProcessGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow retrieving a document from the corpus. @@ -435,9 +488,13 @@ partial void ProcessGetResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.Document.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.Document.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -465,9 +522,13 @@ partial void ProcessGetResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.Document.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.Document.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.DocumentsClient.GetImage.g.cs b/src/libs/Vectara/Generated/Vectara.DocumentsClient.GetImage.g.cs index 9a2b9940..abfe4bb9 100644 --- a/src/libs/Vectara/Generated/Vectara.DocumentsClient.GetImage.g.cs +++ b/src/libs/Vectara/Generated/Vectara.DocumentsClient.GetImage.g.cs @@ -88,6 +88,42 @@ partial void ProcessGetImageResponseContent( int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetImageAsResponseAsync( + corpusKey: corpusKey, + documentId: documentId, + imageId: imageId, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Retrieve an image from a document
+ /// Returns a specific image that is embedded within a document. The `image_id` uniquely identifies the image within the document. Use this endpoint to fetch the raw image data and associated metadata. + ///
+ /// + /// + /// + /// A user-provided key for a corpus.
+ /// Example: my-corpus + /// + /// + /// + /// 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> GetImageAsResponseAsync( + string corpusKey, + string documentId, + string imageId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -121,6 +157,7 @@ partial void ProcessGetImageResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/corpora/{corpusKey}/documents/{documentId}/images/{imageId}", baseUri: HttpClient.BaseAddress); @@ -208,6 +245,8 @@ partial void ProcessGetImageResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -221,6 +260,11 @@ partial void ProcessGetImageResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -238,6 +282,8 @@ partial void ProcessGetImageResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -247,8 +293,7 @@ partial void ProcessGetImageResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -257,6 +302,11 @@ partial void ProcessGetImageResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -273,14 +323,15 @@ partial void ProcessGetImageResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -320,6 +371,8 @@ partial void ProcessGetImageResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -340,6 +393,8 @@ partial void ProcessGetImageResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow retrieving the image. @@ -440,9 +495,13 @@ partial void ProcessGetImageResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.Image.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.Image.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -470,9 +529,13 @@ partial void ProcessGetImageResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.Image.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.Image.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.DocumentsClient.List.g.cs b/src/libs/Vectara/Generated/Vectara.DocumentsClient.List.g.cs index 258514bf..f76cbbf4 100644 --- a/src/libs/Vectara/Generated/Vectara.DocumentsClient.List.g.cs +++ b/src/libs/Vectara/Generated/Vectara.DocumentsClient.List.g.cs @@ -97,6 +97,50 @@ partial void ProcessListResponseContent( string? pageKey = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListAsResponseAsync( + corpusKey: corpusKey, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + limit: limit, + metadataFilter: metadataFilter, + pageKey: pageKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List the documents in the corpus
+ /// The List Documents API enables you to retrieve a list of documents stored in a specific corpus. This endpoint provides an overview of document metadata, including document IDs, tables (if table extraction is enabled), and pagination details.
+ /// Use this API for viewing documents indexed so far and helping you decide to remove documents that are no longer needed. It helps you manage the document lifecycle in your environment.
+ /// This information enables you to catalog and inventory large amounts of data while also retrieving lists of documents for further analysis. For example, developers can utilize the metadata to to build custom search and filtering capabilities into their applications. If you enabled tabled extraction, this endpoint also returns the tables that this document contains.
+ /// Currently Document Admin APIs do not allow you to access the text of your documents. + ///
+ /// + /// + /// + /// A user-provided key for a corpus.
+ /// Example: my-corpus + /// + /// + /// Default Value: 10 + /// + /// + /// + /// 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> ListAsResponseAsync( + string corpusKey, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + int? limit = default, + string? metadataFilter = default, + string? pageKey = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -131,13 +175,14 @@ partial void ProcessListResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/corpora/{corpusKey}/documents", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("metadata_filter", metadataFilter) - .AddOptionalParameter("page_key", pageKey) + .AddOptionalParameter("page_key", pageKey) ; var __path = __pathBuilder.ToString(); __path = global::Vectara.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -224,6 +269,8 @@ partial void ProcessListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -237,6 +284,11 @@ partial void ProcessListResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -254,6 +306,8 @@ partial void ProcessListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -263,8 +317,7 @@ partial void ProcessListResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -273,6 +326,11 @@ partial void ProcessListResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -289,14 +347,15 @@ partial void ProcessListResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -336,6 +395,8 @@ partial void ProcessListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -356,6 +417,8 @@ partial void ProcessListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow listing documents in the corpus. @@ -456,9 +519,13 @@ partial void ProcessListResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.ListDocumentsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.ListDocumentsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -486,9 +553,13 @@ partial void ProcessListResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.ListDocumentsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.ListDocumentsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.DocumentsClient.Summarize.g.cs b/src/libs/Vectara/Generated/Vectara.DocumentsClient.Summarize.g.cs index dab4ec69..1a9f8168 100644 --- a/src/libs/Vectara/Generated/Vectara.DocumentsClient.Summarize.g.cs +++ b/src/libs/Vectara/Generated/Vectara.DocumentsClient.Summarize.g.cs @@ -126,6 +126,86 @@ partial void ProcessSummarizeResponseContent( string corpusKey, string documentId, + global::Vectara.SummarizeDocumentRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await SummarizeAsResponseAsync( + corpusKey: corpusKey, + documentId: documentId, + + request: request, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Summarize a document
+ /// Organizations often struggle with extracting relevant insights from extensive documentation, such as vendor quotes, financial statements, and technical reports. Manually reviewing these documents is both time-consuming and prone to errors.
+ /// The tech preview of the Documentation Summarization API enables users to generate concise summaries that capture essential insights from single documents without having to process entire documents manually. Efficiently process large documents, extract key insights, and interact with real-time data summaries.
+ /// * Enable streaming for large documents to receive summaries incrementally.
+ /// * Customize `prompt_template` to fine-tune summary output for specific domains.
+ /// * Use standard responses for small documents where streaming is unnecessary.
+ /// * Monitor streaming events to track the progress of real-time summarization.
+ /// :::note
+ /// The documentation length is limited by the context window of your selected LLM.
+ /// :::
+ /// ## Response formats
+ /// The API supports two response modes:
+ /// * **Standard**: Provides a complete summary in one response.
+ /// * **Streaming** Provides incremental responses using Server-Sent Events (SSE).
+ /// ### Non-streaming response
+ /// In standard mode, the API returns a structured response containing the complete summary of the document. The summary field contains the generated text, enabling users to extract essential information quickly.
+ /// ### Streaming response
+ /// For streaming responses, the API returns Server-Sent Events (SSE). The first event begins streaming partial results as soon as they are available, while the final event marks the end of the summarization process.
+ /// The streamed response consists of multiple events:
+ /// * `generation_info`: Contains the `rendered_prompt` which is the compiled prompt sent to the LLM for document summarization.
+ /// * `generation_chunk`: Returns partial chunk of the generated summary.
+ /// * `generation_end`: Marks the completion of the summary generation.
+ /// * `error`: Returns an error message if summarization fails.
+ /// * `end`: Indicates the end of the streaming session.
+ /// ## Prompt template example
+ /// When crafting a prompt, you can access your document with the `$vectaraDocument` field. This example shows a simple prompt:
+ /// ```json
+ /// {
+ /// "role": "user",
+ /// "content": "Summarize the document: \$vectaraDocument.json()"
+ /// }
+ /// ```
+ /// The document also has the following methods to support custom prompts.
+ /// * `$vectaraDocument.json()`: Provides a JSON representation of the whole document.
+ /// * `$vectaraDocument.id()`: Specifies the unique identifier of the document (`document_id`)
+ /// * `$vectaraDocument.metadata()`: Specifies metadata from the document.
+ /// For example,
+ /// `$vectaraDocument.metadata().get("key")` retrieves a specific metadata value by key.
+ /// * `$vectaraDocument.parts()`: Returns an array of document parts which you can look through.
+ /// For example, `#foreach ($part in $vectaraDocument.parts())`.
+ /// * `$part.text()`: Retrieves the text of the part.
+ /// * `$part.metadata()`: Retrieves metadata of a part.
+ /// * `$part.hasTable()`: Determines if the part contains a table.
+ /// * `$part.table()`: Provides access to the table within the part. For example, use `$part.table().json()` to retrieve the table in JSON format. + ///
+ /// + /// + /// + /// A user-provided key for a corpus.
+ /// Example: my-corpus + /// + /// + /// + /// 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> SummarizeAsResponseAsync( + string corpusKey, + string documentId, + global::Vectara.SummarizeDocumentRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, @@ -166,6 +246,7 @@ partial void ProcessSummarizeResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/corpora/{corpusKey}/documents/{documentId}/summarize", baseUri: HttpClient.BaseAddress); @@ -259,6 +340,8 @@ partial void ProcessSummarizeResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -272,6 +355,11 @@ partial void ProcessSummarizeResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -289,6 +377,8 @@ partial void ProcessSummarizeResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -298,8 +388,7 @@ partial void ProcessSummarizeResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -308,6 +397,11 @@ partial void ProcessSummarizeResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -324,14 +418,15 @@ partial void ProcessSummarizeResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -371,6 +466,8 @@ partial void ProcessSummarizeResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -391,6 +488,8 @@ partial void ProcessSummarizeResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow summarizing a document in the corpus. @@ -491,9 +590,13 @@ partial void ProcessSummarizeResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.SummarizeDocumentResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.SummarizeDocumentResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -521,9 +624,13 @@ partial void ProcessSummarizeResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.SummarizeDocumentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.SummarizeDocumentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.DocumentsClient.SummarizeAsStream.g.cs b/src/libs/Vectara/Generated/Vectara.DocumentsClient.SummarizeAsStream.g.cs index d2de6853..e4635f32 100644 --- a/src/libs/Vectara/Generated/Vectara.DocumentsClient.SummarizeAsStream.g.cs +++ b/src/libs/Vectara/Generated/Vectara.DocumentsClient.SummarizeAsStream.g.cs @@ -161,6 +161,7 @@ partial void ProcessSummarizeAsStreamResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/corpora/{corpusKey}/documents/{documentId}/summarize", baseUri: HttpClient.BaseAddress); @@ -254,6 +255,8 @@ partial void ProcessSummarizeAsStreamResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -267,6 +270,11 @@ partial void ProcessSummarizeAsStreamResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -284,6 +292,8 @@ partial void ProcessSummarizeAsStreamResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -293,8 +303,7 @@ partial void ProcessSummarizeAsStreamResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -303,6 +312,11 @@ partial void ProcessSummarizeAsStreamResponse( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -319,14 +333,15 @@ partial void ProcessSummarizeAsStreamResponse( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -366,6 +381,8 @@ partial void ProcessSummarizeAsStreamResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -386,6 +403,8 @@ partial void ProcessSummarizeAsStreamResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } diff --git a/src/libs/Vectara/Generated/Vectara.DocumentsClient.Update.g.cs b/src/libs/Vectara/Generated/Vectara.DocumentsClient.Update.g.cs index 1ead2456..7204c920 100644 --- a/src/libs/Vectara/Generated/Vectara.DocumentsClient.Update.g.cs +++ b/src/libs/Vectara/Generated/Vectara.DocumentsClient.Update.g.cs @@ -84,6 +84,44 @@ partial void ProcessUpdateResponseContent( string corpusKey, string documentId, + global::Vectara.UpdateDocumentRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdateAsResponseAsync( + corpusKey: corpusKey, + documentId: documentId, + + request: request, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update document, merging the metadata.
+ /// Updates document identified by its unique `document_id` from a specific corpus. The request body metadata is merged with the existing metadata, adding or modifying only the specified fields. + ///
+ /// + /// + /// + /// A user-provided key for a corpus.
+ /// Example: my-corpus + /// + /// + /// + /// 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> UpdateAsResponseAsync( + string corpusKey, + string documentId, + global::Vectara.UpdateDocumentRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, @@ -124,6 +162,7 @@ partial void ProcessUpdateResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/corpora/{corpusKey}/documents/{documentId}", baseUri: HttpClient.BaseAddress); @@ -217,6 +256,8 @@ partial void ProcessUpdateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -230,6 +271,11 @@ partial void ProcessUpdateResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -247,6 +293,8 @@ partial void ProcessUpdateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -256,8 +304,7 @@ partial void ProcessUpdateResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -266,6 +313,11 @@ partial void ProcessUpdateResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -282,14 +334,15 @@ partial void ProcessUpdateResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -329,6 +382,8 @@ partial void ProcessUpdateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -349,6 +404,8 @@ partial void ProcessUpdateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow updating a document in the corpus. @@ -487,9 +544,13 @@ partial void ProcessUpdateResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.Document.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.Document.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -517,9 +578,13 @@ partial void ProcessUpdateResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.Document.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.Document.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.DocumentsClient.UpdateMetadata.g.cs b/src/libs/Vectara/Generated/Vectara.DocumentsClient.UpdateMetadata.g.cs index 0befb615..6300c1bf 100644 --- a/src/libs/Vectara/Generated/Vectara.DocumentsClient.UpdateMetadata.g.cs +++ b/src/libs/Vectara/Generated/Vectara.DocumentsClient.UpdateMetadata.g.cs @@ -84,6 +84,44 @@ partial void ProcessUpdateMetadataResponseContent( string corpusKey, string documentId, + global::Vectara.UpdateDocumentRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdateMetadataAsResponseAsync( + corpusKey: corpusKey, + documentId: documentId, + + request: request, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Replace the document metadata.
+ /// Replaces metadata of a document identified by its unique `document_id` from a specific corpus. + ///
+ /// + /// + /// + /// A user-provided key for a corpus.
+ /// Example: my-corpus + /// + /// + /// + /// 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> UpdateMetadataAsResponseAsync( + string corpusKey, + string documentId, + global::Vectara.UpdateDocumentRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, @@ -124,6 +162,7 @@ partial void ProcessUpdateMetadataResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/corpora/{corpusKey}/documents/{documentId}/metadata", baseUri: HttpClient.BaseAddress); @@ -217,6 +256,8 @@ partial void ProcessUpdateMetadataResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -230,6 +271,11 @@ partial void ProcessUpdateMetadataResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -247,6 +293,8 @@ partial void ProcessUpdateMetadataResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -256,8 +304,7 @@ partial void ProcessUpdateMetadataResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -266,6 +313,11 @@ partial void ProcessUpdateMetadataResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -282,14 +334,15 @@ partial void ProcessUpdateMetadataResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -329,6 +382,8 @@ partial void ProcessUpdateMetadataResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -349,6 +404,8 @@ partial void ProcessUpdateMetadataResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow updating a document in the corpus. @@ -487,9 +544,13 @@ partial void ProcessUpdateMetadataResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.Document.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.Document.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -517,9 +578,13 @@ partial void ProcessUpdateMetadataResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.Document.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.Document.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.DocumentsClient.g.cs b/src/libs/Vectara/Generated/Vectara.DocumentsClient.g.cs index 6edbd31b..2c299804 100644 --- a/src/libs/Vectara/Generated/Vectara.DocumentsClient.g.cs +++ b/src/libs/Vectara/Generated/Vectara.DocumentsClient.g.cs @@ -75,10 +75,10 @@ public DocumentsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public DocumentsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Vectara.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Vectara.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Vectara/Generated/Vectara.EncodersClient.Create.g.cs b/src/libs/Vectara/Generated/Vectara.EncodersClient.Create.g.cs index d5fde98f..c7aa6534 100644 --- a/src/libs/Vectara/Generated/Vectara.EncodersClient.Create.g.cs +++ b/src/libs/Vectara/Generated/Vectara.EncodersClient.Create.g.cs @@ -73,6 +73,35 @@ partial void ProcessCreateResponseContent( /// public async global::System.Threading.Tasks.Task CreateAsync( + global::Vectara.CreateEncoderRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateAsResponseAsync( + + request: request, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create an encoder
+ /// Create a new encoder. + ///
+ /// + /// + /// + /// 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> CreateAsResponseAsync( + global::Vectara.CreateEncoderRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, @@ -109,6 +138,7 @@ partial void ProcessCreateResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: "/v2/encoders", baseUri: HttpClient.BaseAddress); @@ -200,6 +230,8 @@ partial void ProcessCreateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -213,6 +245,11 @@ partial void ProcessCreateResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -230,6 +267,8 @@ partial void ProcessCreateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -239,8 +278,7 @@ partial void ProcessCreateResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -249,6 +287,11 @@ partial void ProcessCreateResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -265,14 +308,15 @@ partial void ProcessCreateResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -312,6 +356,8 @@ partial void ProcessCreateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -332,6 +378,8 @@ partial void ProcessCreateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Encoder creation request was malformed. @@ -432,9 +480,13 @@ partial void ProcessCreateResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.Encoder.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.Encoder.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -462,9 +514,13 @@ partial void ProcessCreateResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.Encoder.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.Encoder.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.EncodersClient.List.g.cs b/src/libs/Vectara/Generated/Vectara.EncodersClient.List.g.cs index a018f809..9507e28a 100644 --- a/src/libs/Vectara/Generated/Vectara.EncodersClient.List.g.cs +++ b/src/libs/Vectara/Generated/Vectara.EncodersClient.List.g.cs @@ -89,6 +89,43 @@ partial void ProcessListResponseContent( string? pageKey = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListAsResponseAsync( + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + filter: filter, + limit: limit, + pageKey: pageKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List encoders
+ /// The List Encoders API retrieves a list of available encoders used for embedding documents and queries. + ///
+ /// + /// + /// + /// Example: vectara.* + /// + /// + /// Default Value: 10 + /// + /// + /// 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> ListAsResponseAsync( + int? requestTimeout = default, + int? requestTimeoutMillis = default, + string? filter = default, + int? limit = default, + string? pageKey = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -122,13 +159,14 @@ partial void ProcessListResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: "/v2/encoders", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("filter", filter) .AddOptionalParameter("limit", limit?.ToString()) - .AddOptionalParameter("page_key", pageKey) + .AddOptionalParameter("page_key", pageKey) ; var __path = __pathBuilder.ToString(); __path = global::Vectara.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -214,6 +252,8 @@ partial void ProcessListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -227,6 +267,11 @@ partial void ProcessListResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -244,6 +289,8 @@ partial void ProcessListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -253,8 +300,7 @@ partial void ProcessListResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -263,6 +309,11 @@ partial void ProcessListResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -279,14 +330,15 @@ partial void ProcessListResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -326,6 +378,8 @@ partial void ProcessListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -346,6 +400,8 @@ partial void ProcessListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow listing encoders. @@ -408,9 +464,13 @@ partial void ProcessListResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.ListEncodersResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.ListEncodersResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -438,9 +498,13 @@ partial void ProcessListResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.ListEncodersResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.ListEncodersResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.EncodersClient.g.cs b/src/libs/Vectara/Generated/Vectara.EncodersClient.g.cs index 3620ae59..1bf4f8d9 100644 --- a/src/libs/Vectara/Generated/Vectara.EncodersClient.g.cs +++ b/src/libs/Vectara/Generated/Vectara.EncodersClient.g.cs @@ -75,10 +75,10 @@ public EncodersClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public EncodersClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Vectara.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Vectara.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Vectara/Generated/Vectara.FactualConsistencyClient.Evaluate.g.cs b/src/libs/Vectara/Generated/Vectara.FactualConsistencyClient.Evaluate.g.cs index ab5bd509..92927930 100644 --- a/src/libs/Vectara/Generated/Vectara.FactualConsistencyClient.Evaluate.g.cs +++ b/src/libs/Vectara/Generated/Vectara.FactualConsistencyClient.Evaluate.g.cs @@ -103,6 +103,65 @@ partial void ProcessEvaluateResponseContent( /// public async global::System.Threading.Tasks.Task EvaluateAsync( + global::Vectara.EvaluateFactualConsistencyRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await EvaluateAsResponseAsync( + + request: request, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Evaluate factual consistency
+ /// Evaluate the factual consistency of a generated text (like a summary) against source documents. This determines how accurately the generated text reflects the information in the source documents, helping identify potential hallucinations or misrepresentations.
+ /// Use this API to programmatically validate generated content against trusted source materials—an essential capability for applications in high-integrity environments such as legal, healthcare, scientific publishing, and enterprise knowledge systems.
+ /// The request body must include the following parameters:
+ /// * `model_parameters:` Optionally specifies the evaluation model to use. Default is `hhem_v2.2`.
+ /// * `generated_text`: The output text you want to evaluate, such as a model-generated summary, answer, or response.
+ /// * `source_texts`: An array of source documents or passages used to verify the accuracy of the generated text.
+ /// * `language`: The ISO 639-3 code representing the language of the provided texts (`eng` for English, `fra` for French).
+ /// ### Example request
+ /// This example evaluates whether a generated statement about the Eiffel Tower is factually accurate based on two reference documents.
+ /// ```json
+ /// {
+ /// "generated_text": "The Eiffel Tower is located in Berlin.",
+ /// "source_texts": [
+ /// "The Eiffel Tower is a famous landmark located in Paris, France.",
+ /// "It was built in 1889 and remains one of the most visited monuments in the world."
+ /// ],
+ /// "language": "eng"
+ /// }
+ /// ```
+ /// ### Example response
+ /// The response includes a factual consistency score and probability estimates.
+ /// ```json
+ /// {
+ /// "score": 0.23,
+ /// "p_consistent": 0.12,
+ /// "p_inconsistent": 0.88
+ /// }
+ /// ```
+ /// * `score`: A normalized value between `0.0` and `1.0` that reflects the overall factual alignment between the generated text and the source texts. Higher scores indicate stronger consistency.
+ /// * `p_consistent`: The estimated probability that the generated text is factually consistent with the sources.
+ /// * `p_inconsistent`: The estimated probability that the generated text contains factual inaccuracies relative to the source documents. + ///
+ /// + /// + /// + /// 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> EvaluateAsResponseAsync( + global::Vectara.EvaluateFactualConsistencyRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, @@ -141,6 +200,7 @@ partial void ProcessEvaluateResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: "/v2/evaluate_factual_consistency", baseUri: HttpClient.BaseAddress); @@ -232,6 +292,8 @@ partial void ProcessEvaluateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -245,6 +307,11 @@ partial void ProcessEvaluateResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -262,6 +329,8 @@ partial void ProcessEvaluateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -271,8 +340,7 @@ partial void ProcessEvaluateResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -281,6 +349,11 @@ partial void ProcessEvaluateResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -297,14 +370,15 @@ partial void ProcessEvaluateResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -344,6 +418,8 @@ partial void ProcessEvaluateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -364,6 +440,8 @@ partial void ProcessEvaluateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Invalid request body. @@ -502,9 +580,13 @@ partial void ProcessEvaluateResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.EvaluateFactualConsistencyResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.EvaluateFactualConsistencyResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -532,9 +614,13 @@ partial void ProcessEvaluateResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.EvaluateFactualConsistencyResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.EvaluateFactualConsistencyResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.FactualConsistencyClient.g.cs b/src/libs/Vectara/Generated/Vectara.FactualConsistencyClient.g.cs index 2e485271..74e19c08 100644 --- a/src/libs/Vectara/Generated/Vectara.FactualConsistencyClient.g.cs +++ b/src/libs/Vectara/Generated/Vectara.FactualConsistencyClient.g.cs @@ -75,10 +75,10 @@ public FactualConsistencyClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public FactualConsistencyClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Vectara.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Vectara.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Vectara/Generated/Vectara.GenerationPresetsClient.Create.g.cs b/src/libs/Vectara/Generated/Vectara.GenerationPresetsClient.Create.g.cs index 828a701a..9e2fd9eb 100644 --- a/src/libs/Vectara/Generated/Vectara.GenerationPresetsClient.Create.g.cs +++ b/src/libs/Vectara/Generated/Vectara.GenerationPresetsClient.Create.g.cs @@ -74,6 +74,36 @@ partial void ProcessCreateResponseContent( /// public async global::System.Threading.Tasks.Task CreateAsync( + global::Vectara.CreateGenerationPresetRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateAsResponseAsync( + + request: request, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create a generation preset
+ /// Create a custom generation preset for use in query and chat requests. A generation preset bundles a prompt template, an LLM, and model parameters into a reusable configuration.
+ /// The created preset can be referenced by name using the `generation_preset_name` field in query or chat requests. + ///
+ /// + /// + /// + /// 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> CreateAsResponseAsync( + global::Vectara.CreateGenerationPresetRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, @@ -110,6 +140,7 @@ partial void ProcessCreateResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: "/v2/generation_presets", baseUri: HttpClient.BaseAddress); @@ -201,6 +232,8 @@ partial void ProcessCreateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -214,6 +247,11 @@ partial void ProcessCreateResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -231,6 +269,8 @@ partial void ProcessCreateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -240,8 +280,7 @@ partial void ProcessCreateResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -250,6 +289,11 @@ partial void ProcessCreateResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -266,14 +310,15 @@ partial void ProcessCreateResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -313,6 +358,8 @@ partial void ProcessCreateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -333,6 +380,8 @@ partial void ProcessCreateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Invalid request parameters. @@ -433,9 +482,13 @@ partial void ProcessCreateResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.GenerationPreset.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.GenerationPreset.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -463,9 +516,13 @@ partial void ProcessCreateResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.GenerationPreset.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.GenerationPreset.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.GenerationPresetsClient.Delete.g.cs b/src/libs/Vectara/Generated/Vectara.GenerationPresetsClient.Delete.g.cs index 093435c0..528645db 100644 --- a/src/libs/Vectara/Generated/Vectara.GenerationPresetsClient.Delete.g.cs +++ b/src/libs/Vectara/Generated/Vectara.GenerationPresetsClient.Delete.g.cs @@ -73,6 +73,32 @@ partial void ProcessDeleteResponse( int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await DeleteAsResponseAsync( + generationPresetId: generationPresetId, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Delete a generation preset
+ /// Delete an existing custom generation preset.
+ /// The preset must have been created by the customer (platform presets cannot be deleted). + ///
+ /// + /// + /// + /// 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 DeleteAsResponseAsync( + string generationPresetId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -104,6 +130,7 @@ partial void ProcessDeleteResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/generation_presets/{generationPresetId}", baseUri: HttpClient.BaseAddress); @@ -189,6 +216,8 @@ partial void ProcessDeleteResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -202,6 +231,11 @@ partial void ProcessDeleteResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -219,6 +253,8 @@ partial void ProcessDeleteResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -228,8 +264,7 @@ partial void ProcessDeleteResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -238,6 +273,11 @@ partial void ProcessDeleteResponse( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -254,14 +294,15 @@ partial void ProcessDeleteResponse( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -301,6 +342,8 @@ partial void ProcessDeleteResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -321,6 +364,8 @@ partial void ProcessDeleteResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Invalid request parameters. @@ -455,6 +500,10 @@ partial void ProcessDeleteResponse( { __response.EnsureSuccessStatusCode(); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -476,6 +525,10 @@ partial void ProcessDeleteResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.GenerationPresetsClient.List.g.cs b/src/libs/Vectara/Generated/Vectara.GenerationPresetsClient.List.g.cs index 1bfd90aa..ea618ebf 100644 --- a/src/libs/Vectara/Generated/Vectara.GenerationPresetsClient.List.g.cs +++ b/src/libs/Vectara/Generated/Vectara.GenerationPresetsClient.List.g.cs @@ -100,6 +100,53 @@ partial void ProcessListResponseContent( string? pageKey = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListAsResponseAsync( + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + llmName: llmName, + filter: filter, + limit: limit, + pageKey: pageKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List generation presets
+ /// Organizations often struggle to fine-tune query responses and maintain consistency across different use cases. Vectara creates and maintains predefined generation presets for our users which provides a flexible and powerful way to utilize generation parameters. Each preset includes a complete Velocity template for the prompt along with other generation parameters. Presets are typically associated with a single LLM.
+ /// The List Generation Presets API lets you view the generation presets used for [query](/docs/rest-api/queries) requests. Generation presets group several properties that configure generation for a request. These presets provide more flexibility in how generation parameters are configured, enabling more fine-tuned control over query responses.
+ /// This includes the `prompt_template`, the Large Language Model (LLM), and other generation settings like `max_tokens` and `temperature`. Users specify a generation preset in their query or chat requests using the `generation_preset_name` field.
+ /// ## Generation presets object
+ /// The `generation_presets` object contains the `name`, `description`, `llm_name`, `prompt_template`, and other fields make up the preset.
+ /// If your account has access to a preset, then `enabled` is set to `true`. A preset can also be set as a `default`.\n\n### Example generation presets response\n\n```json\n{\n \"generation_presets\": [\n {\n \"name\": \"vectara-summary-ext-24-05-med-omni\",\n \"description\": \"Generate summary with controllable citations, Uses GPT-4o with 2,048 max tokens\",\n \"llm_name\": \"gpt-4o\",\n \"prompt_template\": \"[\\n {\\\"role\\\": \\\"system\\\", \\\"content\\\": \\\"Follow these detailed step-by-step\",\n \"max_used_search_results\": 25,\n \"max_tokens\": 2048,\n \"temperature\": 0,\n \"frequency_penalty\": 0,\n \"presence_penalty\": 0,\n \"enabled\": true,\n \"default\": false\n },\n // More presets appear here\n}\n```\n" + ///
+ /// + /// + /// + /// Example: mockingbird-2.0 + /// + /// + /// Example: mockingbird.* + /// + /// + /// Default Value: 10 + /// + /// + /// 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> ListAsResponseAsync( + int? requestTimeout = default, + int? requestTimeoutMillis = default, + string? llmName = default, + string? filter = default, + int? limit = default, + string? pageKey = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -134,14 +181,15 @@ partial void ProcessListResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: "/v2/generation_presets", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("llm_name", llmName) .AddOptionalParameter("filter", filter) .AddOptionalParameter("limit", limit?.ToString()) - .AddOptionalParameter("page_key", pageKey) + .AddOptionalParameter("page_key", pageKey) ; var __path = __pathBuilder.ToString(); __path = global::Vectara.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -228,6 +276,8 @@ partial void ProcessListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -241,6 +291,11 @@ partial void ProcessListResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -258,6 +313,8 @@ partial void ProcessListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -267,8 +324,7 @@ partial void ProcessListResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -277,6 +333,11 @@ partial void ProcessListResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -293,14 +354,15 @@ partial void ProcessListResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -340,6 +402,8 @@ partial void ProcessListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -360,6 +424,8 @@ partial void ProcessListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow listing generation presets. @@ -422,9 +488,13 @@ partial void ProcessListResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.ListGenerationPresetsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.ListGenerationPresetsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -452,9 +522,13 @@ partial void ProcessListResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.ListGenerationPresetsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.ListGenerationPresetsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.GenerationPresetsClient.Replace.g.cs b/src/libs/Vectara/Generated/Vectara.GenerationPresetsClient.Replace.g.cs index 1f50527f..d2c6fd09 100644 --- a/src/libs/Vectara/Generated/Vectara.GenerationPresetsClient.Replace.g.cs +++ b/src/libs/Vectara/Generated/Vectara.GenerationPresetsClient.Replace.g.cs @@ -78,6 +78,39 @@ partial void ProcessReplaceResponseContent( public async global::System.Threading.Tasks.Task ReplaceAsync( string generationPresetId, + global::Vectara.CreateGenerationPresetRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ReplaceAsResponseAsync( + generationPresetId: generationPresetId, + + request: request, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Replace a generation preset
+ /// Replace an existing custom generation preset. This performs a full replacement of the preset configuration.
+ /// The preset must have been created by the customer (platform presets cannot be replaced). + ///
+ /// + /// + /// + /// + /// 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> ReplaceAsResponseAsync( + string generationPresetId, + global::Vectara.CreateGenerationPresetRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, @@ -115,6 +148,7 @@ partial void ProcessReplaceResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/generation_presets/{generationPresetId}", baseUri: HttpClient.BaseAddress); @@ -207,6 +241,8 @@ partial void ProcessReplaceResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -220,6 +256,11 @@ partial void ProcessReplaceResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -237,6 +278,8 @@ partial void ProcessReplaceResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -246,8 +289,7 @@ partial void ProcessReplaceResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -256,6 +298,11 @@ partial void ProcessReplaceResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -272,14 +319,15 @@ partial void ProcessReplaceResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -319,6 +367,8 @@ partial void ProcessReplaceResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -339,6 +389,8 @@ partial void ProcessReplaceResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Invalid request parameters. @@ -477,9 +529,13 @@ partial void ProcessReplaceResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.GenerationPreset.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.GenerationPreset.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -507,9 +563,13 @@ partial void ProcessReplaceResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.GenerationPreset.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.GenerationPreset.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.GenerationPresetsClient.g.cs b/src/libs/Vectara/Generated/Vectara.GenerationPresetsClient.g.cs index a4011c66..eac9f4ad 100644 --- a/src/libs/Vectara/Generated/Vectara.GenerationPresetsClient.g.cs +++ b/src/libs/Vectara/Generated/Vectara.GenerationPresetsClient.g.cs @@ -75,10 +75,10 @@ public GenerationPresetsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public GenerationPresetsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Vectara.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Vectara.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Vectara/Generated/Vectara.GlossariesClient.Create.g.cs b/src/libs/Vectara/Generated/Vectara.GlossariesClient.Create.g.cs index becbc5a7..4bec77f4 100644 --- a/src/libs/Vectara/Generated/Vectara.GlossariesClient.Create.g.cs +++ b/src/libs/Vectara/Generated/Vectara.GlossariesClient.Create.g.cs @@ -73,6 +73,35 @@ partial void ProcessCreateResponseContent( /// public async global::System.Threading.Tasks.Task CreateAsync( + global::Vectara.CreateGlossaryRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateAsResponseAsync( + + request: request, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create glossary
+ /// Create a new glossary. A glossary is a reusable mapping of terms to expanded forms that agents use to expand abbreviations and acronyms in user messages. + ///
+ /// + /// + /// + /// 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> CreateAsResponseAsync( + global::Vectara.CreateGlossaryRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, @@ -111,6 +140,7 @@ partial void ProcessCreateResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: "/v2/glossaries", baseUri: HttpClient.BaseAddress); @@ -202,6 +232,8 @@ partial void ProcessCreateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -215,6 +247,11 @@ partial void ProcessCreateResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -232,6 +269,8 @@ partial void ProcessCreateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -241,8 +280,7 @@ partial void ProcessCreateResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -251,6 +289,11 @@ partial void ProcessCreateResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -267,14 +310,15 @@ partial void ProcessCreateResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -314,6 +358,8 @@ partial void ProcessCreateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -334,6 +380,8 @@ partial void ProcessCreateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was malformed. @@ -434,9 +482,13 @@ partial void ProcessCreateResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.Glossary.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.Glossary.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -464,9 +516,13 @@ partial void ProcessCreateResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.Glossary.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.Glossary.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.GlossariesClient.Delete.g.cs b/src/libs/Vectara/Generated/Vectara.GlossariesClient.Delete.g.cs index 6f01cbb5..304cbd59 100644 --- a/src/libs/Vectara/Generated/Vectara.GlossariesClient.Delete.g.cs +++ b/src/libs/Vectara/Generated/Vectara.GlossariesClient.Delete.g.cs @@ -75,6 +75,34 @@ partial void ProcessDeleteResponse( int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await DeleteAsResponseAsync( + glossaryKey: glossaryKey, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Delete glossary
+ /// Delete a glossary and all its entries. + ///
+ /// + /// + /// + /// A user-provided key that uniquely identifies a glossary.
+ /// Example: eng-acronyms + /// + /// 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 DeleteAsResponseAsync( + string glossaryKey, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -106,6 +134,7 @@ partial void ProcessDeleteResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/glossaries/{glossaryKey}", baseUri: HttpClient.BaseAddress); @@ -191,6 +220,8 @@ partial void ProcessDeleteResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -204,6 +235,11 @@ partial void ProcessDeleteResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -221,6 +257,8 @@ partial void ProcessDeleteResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -230,8 +268,7 @@ partial void ProcessDeleteResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -240,6 +277,11 @@ partial void ProcessDeleteResponse( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -256,14 +298,15 @@ partial void ProcessDeleteResponse( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -303,6 +346,8 @@ partial void ProcessDeleteResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -323,6 +368,8 @@ partial void ProcessDeleteResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow deleting this glossary. @@ -419,6 +466,10 @@ partial void ProcessDeleteResponse( { __response.EnsureSuccessStatusCode(); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -440,6 +491,10 @@ partial void ProcessDeleteResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.GlossariesClient.DeleteEntries.g.cs b/src/libs/Vectara/Generated/Vectara.GlossariesClient.DeleteEntries.g.cs index 2870d66b..febc7796 100644 --- a/src/libs/Vectara/Generated/Vectara.GlossariesClient.DeleteEntries.g.cs +++ b/src/libs/Vectara/Generated/Vectara.GlossariesClient.DeleteEntries.g.cs @@ -75,6 +75,39 @@ partial void ProcessDeleteEntriesResponse( public async global::System.Threading.Tasks.Task DeleteEntriesAsync( string glossaryKey, + global::Vectara.DeleteGlossaryEntriesRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + await DeleteEntriesAsResponseAsync( + glossaryKey: glossaryKey, + + request: request, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Delete glossary entries
+ /// Bulk delete entries from a glossary by term. The glossary index blob is rebuilt after deletion. + ///
+ /// + /// + /// + /// A user-provided key that uniquely identifies a glossary.
+ /// Example: eng-acronyms + /// + /// + /// 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 DeleteEntriesAsResponseAsync( + string glossaryKey, + global::Vectara.DeleteGlossaryEntriesRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, @@ -114,6 +147,7 @@ partial void ProcessDeleteEntriesResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/glossaries/{glossaryKey}/entries", baseUri: HttpClient.BaseAddress); @@ -206,6 +240,8 @@ partial void ProcessDeleteEntriesResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -219,6 +255,11 @@ partial void ProcessDeleteEntriesResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -236,6 +277,8 @@ partial void ProcessDeleteEntriesResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -245,8 +288,7 @@ partial void ProcessDeleteEntriesResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -255,6 +297,11 @@ partial void ProcessDeleteEntriesResponse( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -271,14 +318,15 @@ partial void ProcessDeleteEntriesResponse( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -318,6 +366,8 @@ partial void ProcessDeleteEntriesResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -338,6 +388,8 @@ partial void ProcessDeleteEntriesResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow modifying this glossary. @@ -434,6 +486,10 @@ partial void ProcessDeleteEntriesResponse( { __response.EnsureSuccessStatusCode(); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -455,6 +511,10 @@ partial void ProcessDeleteEntriesResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.GlossariesClient.Get.g.cs b/src/libs/Vectara/Generated/Vectara.GlossariesClient.Get.g.cs index c76387b9..c2115663 100644 --- a/src/libs/Vectara/Generated/Vectara.GlossariesClient.Get.g.cs +++ b/src/libs/Vectara/Generated/Vectara.GlossariesClient.Get.g.cs @@ -80,6 +80,36 @@ partial void ProcessGetResponseContent( int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetAsResponseAsync( + glossaryKey: glossaryKey, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get glossary
+ /// Get the metadata of a specific glossary. + ///
+ /// + /// + /// + /// A user-provided key that uniquely identifies a glossary.
+ /// Example: eng-acronyms + /// + /// 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> GetAsResponseAsync( + string glossaryKey, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -111,6 +141,7 @@ partial void ProcessGetResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/glossaries/{glossaryKey}", baseUri: HttpClient.BaseAddress); @@ -196,6 +227,8 @@ partial void ProcessGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -209,6 +242,11 @@ partial void ProcessGetResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -226,6 +264,8 @@ partial void ProcessGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -235,8 +275,7 @@ partial void ProcessGetResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -245,6 +284,11 @@ partial void ProcessGetResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -261,14 +305,15 @@ partial void ProcessGetResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -308,6 +353,8 @@ partial void ProcessGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -328,6 +375,8 @@ partial void ProcessGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow accessing this glossary. @@ -428,9 +477,13 @@ partial void ProcessGetResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.Glossary.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.Glossary.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -458,9 +511,13 @@ partial void ProcessGetResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.Glossary.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.Glossary.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.GlossariesClient.List.g.cs b/src/libs/Vectara/Generated/Vectara.GlossariesClient.List.g.cs index 428f5c26..3bd9ab9c 100644 --- a/src/libs/Vectara/Generated/Vectara.GlossariesClient.List.g.cs +++ b/src/libs/Vectara/Generated/Vectara.GlossariesClient.List.g.cs @@ -89,6 +89,43 @@ partial void ProcessListResponseContent( string? pageKey = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListAsResponseAsync( + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + filter: filter, + limit: limit, + pageKey: pageKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List glossaries
+ /// List all glossaries available to the authenticated user. + ///
+ /// + /// + /// + /// Example: engineering + /// + /// + /// Default Value: 10 + /// + /// + /// 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> ListAsResponseAsync( + int? requestTimeout = default, + int? requestTimeoutMillis = default, + string? filter = default, + int? limit = default, + string? pageKey = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -122,13 +159,14 @@ partial void ProcessListResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: "/v2/glossaries", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("filter", filter) .AddOptionalParameter("limit", limit?.ToString()) - .AddOptionalParameter("page_key", pageKey) + .AddOptionalParameter("page_key", pageKey) ; var __path = __pathBuilder.ToString(); __path = global::Vectara.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -214,6 +252,8 @@ partial void ProcessListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -227,6 +267,11 @@ partial void ProcessListResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -244,6 +289,8 @@ partial void ProcessListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -253,8 +300,7 @@ partial void ProcessListResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -263,6 +309,11 @@ partial void ProcessListResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -279,14 +330,15 @@ partial void ProcessListResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -326,6 +378,8 @@ partial void ProcessListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -346,6 +400,8 @@ partial void ProcessListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow listing glossaries. @@ -408,9 +464,13 @@ partial void ProcessListResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.ListGlossariesResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.ListGlossariesResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -438,9 +498,13 @@ partial void ProcessListResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.ListGlossariesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.ListGlossariesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.GlossariesClient.ListEntries.g.cs b/src/libs/Vectara/Generated/Vectara.GlossariesClient.ListEntries.g.cs index a2ccfb9a..80f286cf 100644 --- a/src/libs/Vectara/Generated/Vectara.GlossariesClient.ListEntries.g.cs +++ b/src/libs/Vectara/Generated/Vectara.GlossariesClient.ListEntries.g.cs @@ -90,6 +90,44 @@ partial void ProcessListEntriesResponseContent( string? pageKey = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListEntriesAsResponseAsync( + glossaryKey: glossaryKey, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + limit: limit, + pageKey: pageKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List glossary entries
+ /// List the entries in a glossary. + ///
+ /// + /// + /// + /// A user-provided key that uniquely identifies a glossary.
+ /// Example: eng-acronyms + /// + /// + /// Default Value: 100 + /// + /// + /// 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> ListEntriesAsResponseAsync( + string glossaryKey, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + int? limit = default, + string? pageKey = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -123,12 +161,13 @@ partial void ProcessListEntriesResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/glossaries/{glossaryKey}/entries", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("limit", limit?.ToString()) - .AddOptionalParameter("page_key", pageKey) + .AddOptionalParameter("page_key", pageKey) ; var __path = __pathBuilder.ToString(); __path = global::Vectara.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -214,6 +253,8 @@ partial void ProcessListEntriesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -227,6 +268,11 @@ partial void ProcessListEntriesResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -244,6 +290,8 @@ partial void ProcessListEntriesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -253,8 +301,7 @@ partial void ProcessListEntriesResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -263,6 +310,11 @@ partial void ProcessListEntriesResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -279,14 +331,15 @@ partial void ProcessListEntriesResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -326,6 +379,8 @@ partial void ProcessListEntriesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -346,6 +401,8 @@ partial void ProcessListEntriesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow accessing this glossary. @@ -446,9 +503,13 @@ partial void ProcessListEntriesResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.GlossaryEntriesResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.GlossaryEntriesResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -476,9 +537,13 @@ partial void ProcessListEntriesResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.GlossaryEntriesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.GlossaryEntriesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.GlossariesClient.Update.g.cs b/src/libs/Vectara/Generated/Vectara.GlossariesClient.Update.g.cs index 97fe0b9a..63049945 100644 --- a/src/libs/Vectara/Generated/Vectara.GlossariesClient.Update.g.cs +++ b/src/libs/Vectara/Generated/Vectara.GlossariesClient.Update.g.cs @@ -80,6 +80,41 @@ partial void ProcessUpdateResponseContent( public async global::System.Threading.Tasks.Task UpdateAsync( string glossaryKey, + global::Vectara.UpdateGlossaryRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdateAsResponseAsync( + glossaryKey: glossaryKey, + + request: request, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update glossary
+ /// Update the metadata of a glossary. + ///
+ /// + /// + /// + /// A user-provided key that uniquely identifies a glossary.
+ /// Example: eng-acronyms + /// + /// + /// 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> UpdateAsResponseAsync( + string glossaryKey, + global::Vectara.UpdateGlossaryRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, @@ -119,6 +154,7 @@ partial void ProcessUpdateResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/glossaries/{glossaryKey}", baseUri: HttpClient.BaseAddress); @@ -211,6 +247,8 @@ partial void ProcessUpdateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -224,6 +262,11 @@ partial void ProcessUpdateResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -241,6 +284,8 @@ partial void ProcessUpdateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -250,8 +295,7 @@ partial void ProcessUpdateResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -260,6 +304,11 @@ partial void ProcessUpdateResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -276,14 +325,15 @@ partial void ProcessUpdateResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -323,6 +373,8 @@ partial void ProcessUpdateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -343,6 +395,8 @@ partial void ProcessUpdateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was malformed. @@ -481,9 +535,13 @@ partial void ProcessUpdateResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.Glossary.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.Glossary.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -511,9 +569,13 @@ partial void ProcessUpdateResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.Glossary.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.Glossary.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.GlossariesClient.UpsertEntries.g.cs b/src/libs/Vectara/Generated/Vectara.GlossariesClient.UpsertEntries.g.cs index 89801426..3dc1bd77 100644 --- a/src/libs/Vectara/Generated/Vectara.GlossariesClient.UpsertEntries.g.cs +++ b/src/libs/Vectara/Generated/Vectara.GlossariesClient.UpsertEntries.g.cs @@ -75,6 +75,39 @@ partial void ProcessUpsertEntriesResponse( public async global::System.Threading.Tasks.Task UpsertEntriesAsync( string glossaryKey, + global::Vectara.UpsertGlossaryEntriesRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + await UpsertEntriesAsResponseAsync( + glossaryKey: glossaryKey, + + request: request, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Upsert glossary entries
+ /// Bulk upsert entries into a glossary. Entries with existing terms are updated and new terms are inserted. The glossary index blob is rebuilt after the upsert. + ///
+ /// + /// + /// + /// A user-provided key that uniquely identifies a glossary.
+ /// Example: eng-acronyms + /// + /// + /// 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 UpsertEntriesAsResponseAsync( + string glossaryKey, + global::Vectara.UpsertGlossaryEntriesRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, @@ -114,6 +147,7 @@ partial void ProcessUpsertEntriesResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/glossaries/{glossaryKey}/entries", baseUri: HttpClient.BaseAddress); @@ -206,6 +240,8 @@ partial void ProcessUpsertEntriesResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -219,6 +255,11 @@ partial void ProcessUpsertEntriesResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -236,6 +277,8 @@ partial void ProcessUpsertEntriesResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -245,8 +288,7 @@ partial void ProcessUpsertEntriesResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -255,6 +297,11 @@ partial void ProcessUpsertEntriesResponse( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -271,14 +318,15 @@ partial void ProcessUpsertEntriesResponse( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -318,6 +366,8 @@ partial void ProcessUpsertEntriesResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -338,6 +388,8 @@ partial void ProcessUpsertEntriesResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was malformed. @@ -472,6 +524,10 @@ partial void ProcessUpsertEntriesResponse( { __response.EnsureSuccessStatusCode(); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -493,6 +549,10 @@ partial void ProcessUpsertEntriesResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.GlossariesClient.g.cs b/src/libs/Vectara/Generated/Vectara.GlossariesClient.g.cs index f9d39e85..ff77e904 100644 --- a/src/libs/Vectara/Generated/Vectara.GlossariesClient.g.cs +++ b/src/libs/Vectara/Generated/Vectara.GlossariesClient.g.cs @@ -75,10 +75,10 @@ public GlossariesClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public GlossariesClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Vectara.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Vectara.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Vectara/Generated/Vectara.HallucinationCorrectorsClient.HallucinationCorrection.g.cs b/src/libs/Vectara/Generated/Vectara.HallucinationCorrectorsClient.HallucinationCorrection.g.cs index 00b56b38..67573f70 100644 --- a/src/libs/Vectara/Generated/Vectara.HallucinationCorrectorsClient.HallucinationCorrection.g.cs +++ b/src/libs/Vectara/Generated/Vectara.HallucinationCorrectorsClient.HallucinationCorrection.g.cs @@ -78,6 +78,40 @@ partial void ProcessHallucinationCorrectionResponseContent( /// public async global::System.Threading.Tasks.Task HallucinationCorrectionAsync( + global::Vectara.HallucinationCorrectionRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await HallucinationCorrectionAsResponseAsync( + + request: request, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Corrects hallucinations in generated text based on source documents
+ /// The Hallucination Correctors API enables users to automatically detect and correct factual inaccuracies, commonly referred to as hallucinations, in generated summaries or responses. By comparing a user-provided summary against one or more source documents, the API returns a corrected version of the summary with minimal necessary edits.
+ /// Use this API to validate and improve the factual accuracy of summaries generated by LLMs in Retrieval Augmented Generation (RAG) pipelines, ensuring that the output remains grounded in trusted source content. If HCM does not detect hallucination, it preserves the original summary.
+ /// The response corrects the original summary. If the input summary is accurate, the `corrected_summary` matches the `original_summary`.
+ /// ## Interpreting empty corrections
+ /// In some cases, the `corrected_text` field in the response may be an empty string. This indicates VHC determined that the entire input text was hallucinated, and VHC recommends removing it completely.
+ /// This outcome is valid and typically occurs when none of the content in the `generated_text` is supported by the provided source documents or query. The response still includes an explanation of why VHC removed the text. + ///
+ /// + /// + /// + /// 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> HallucinationCorrectionAsResponseAsync( + global::Vectara.HallucinationCorrectionRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, @@ -116,6 +150,7 @@ partial void ProcessHallucinationCorrectionResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: "/v2/hallucination_correctors/correct_hallucinations", baseUri: HttpClient.BaseAddress); @@ -207,6 +242,8 @@ partial void ProcessHallucinationCorrectionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -220,6 +257,11 @@ partial void ProcessHallucinationCorrectionResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -237,6 +279,8 @@ partial void ProcessHallucinationCorrectionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -246,8 +290,7 @@ partial void ProcessHallucinationCorrectionResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -256,6 +299,11 @@ partial void ProcessHallucinationCorrectionResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -272,14 +320,15 @@ partial void ProcessHallucinationCorrectionResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -319,6 +368,8 @@ partial void ProcessHallucinationCorrectionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -339,6 +390,8 @@ partial void ProcessHallucinationCorrectionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Request was malformed @@ -439,9 +492,13 @@ partial void ProcessHallucinationCorrectionResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.HallucinationCorrectionResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.HallucinationCorrectionResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -469,9 +526,13 @@ partial void ProcessHallucinationCorrectionResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.HallucinationCorrectionResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.HallucinationCorrectionResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.HallucinationCorrectorsClient.List.g.cs b/src/libs/Vectara/Generated/Vectara.HallucinationCorrectorsClient.List.g.cs index 420c5b81..1b11e7e8 100644 --- a/src/libs/Vectara/Generated/Vectara.HallucinationCorrectorsClient.List.g.cs +++ b/src/libs/Vectara/Generated/Vectara.HallucinationCorrectorsClient.List.g.cs @@ -88,6 +88,42 @@ partial void ProcessListResponseContent( string? pageKey = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListAsResponseAsync( + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + filter: filter, + limit: limit, + pageKey: pageKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List hallucination correctors
+ /// The List Hallucination Correctors API enables users to list available hallucination correctors used for detecting and correcting hallucinations in AI-generated content. Vectara provides these models as part of its broader hallucination evaluation framework, and the Hallucination Correctors endpoint uses these models to propose factual corrections to summaries and other generative outputs.
+ /// Use this API to inspect available correctors, filter results, and determine which hallucination corrector to reference in downstream workflows or evaluation pipelines. + ///
+ /// + /// + /// + /// + /// Default Value: 10 + /// + /// + /// 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> ListAsResponseAsync( + int? requestTimeout = default, + int? requestTimeoutMillis = default, + string? filter = default, + int? limit = default, + string? pageKey = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -121,13 +157,14 @@ partial void ProcessListResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: "/v2/hallucination_correctors", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("filter", filter) .AddOptionalParameter("limit", limit?.ToString()) - .AddOptionalParameter("page_key", pageKey) + .AddOptionalParameter("page_key", pageKey) ; var __path = __pathBuilder.ToString(); __path = global::Vectara.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -213,6 +250,8 @@ partial void ProcessListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -226,6 +265,11 @@ partial void ProcessListResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -243,6 +287,8 @@ partial void ProcessListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -252,8 +298,7 @@ partial void ProcessListResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -262,6 +307,11 @@ partial void ProcessListResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -278,14 +328,15 @@ partial void ProcessListResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -325,6 +376,8 @@ partial void ProcessListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -345,6 +398,8 @@ partial void ProcessListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow listing hallucination correctors. @@ -407,9 +462,13 @@ partial void ProcessListResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.ListHallucinationCorrectorsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.ListHallucinationCorrectorsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -437,9 +496,13 @@ partial void ProcessListResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.ListHallucinationCorrectorsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.ListHallucinationCorrectorsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.HallucinationCorrectorsClient.g.cs b/src/libs/Vectara/Generated/Vectara.HallucinationCorrectorsClient.g.cs index 91f8a23e..c947f591 100644 --- a/src/libs/Vectara/Generated/Vectara.HallucinationCorrectorsClient.g.cs +++ b/src/libs/Vectara/Generated/Vectara.HallucinationCorrectorsClient.g.cs @@ -75,10 +75,10 @@ public HallucinationCorrectorsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public HallucinationCorrectorsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Vectara.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Vectara.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Vectara/Generated/Vectara.IAgentAnalyticsClient.GetTrace.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentAnalyticsClient.GetTrace.g.cs index f181e7cf..197a619f 100644 --- a/src/libs/Vectara/Generated/Vectara.IAgentAnalyticsClient.GetTrace.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IAgentAnalyticsClient.GetTrace.g.cs @@ -22,5 +22,23 @@ public partial interface IAgentAnalyticsClient int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get agent trace
+ /// Retrieve the summary of a specific agent trace by its trace ID. + ///
+ /// + /// + /// + /// Example: 0af7651916cd43dd8448eb211c80319c + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetTraceAsResponseAsync( + string traceId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IAgentAnalyticsClient.GetTraceSpan.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentAnalyticsClient.GetTraceSpan.g.cs index fe7fd5f9..95652d00 100644 --- a/src/libs/Vectara/Generated/Vectara.IAgentAnalyticsClient.GetTraceSpan.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IAgentAnalyticsClient.GetTraceSpan.g.cs @@ -26,5 +26,27 @@ public partial interface IAgentAnalyticsClient bool? includeContent = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get span in a trace
+ /// Retrieve the details of a specific span within a trace. + ///
+ /// + /// + /// + /// + /// + /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetTraceSpanAsResponseAsync( + string traceId, + string spanId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + bool? includeContent = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IAgentAnalyticsClient.ListTraceSpans.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentAnalyticsClient.ListTraceSpans.g.cs index e85f968b..6e51ebdd 100644 --- a/src/libs/Vectara/Generated/Vectara.IAgentAnalyticsClient.ListTraceSpans.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IAgentAnalyticsClient.ListTraceSpans.g.cs @@ -32,5 +32,33 @@ public partial interface IAgentAnalyticsClient string? pageKey = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List spans in a trace
+ /// Retrieve the flat list of spans for a given trace, each with its parent_span_id for reconstructing the tree. + ///
+ /// + /// + /// + /// + /// Default Value: false + /// + /// + /// + /// Default Value: 100 + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListTraceSpansAsResponseAsync( + string traceId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + bool? includeContent = default, + global::Vectara.ListTraceSpansOperation? operation = default, + int? limit = default, + string? pageKey = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IAgentAnalyticsClient.ListTraces.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentAnalyticsClient.ListTraces.g.cs index a5fc8f34..69d51fe3 100644 --- a/src/libs/Vectara/Generated/Vectara.IAgentAnalyticsClient.ListTraces.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IAgentAnalyticsClient.ListTraces.g.cs @@ -46,5 +46,47 @@ public partial interface IAgentAnalyticsClient string? pageKey = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List agent traces
+ /// List agent traces with optional filtering by agent, session, status, and time range. + ///
+ /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// Default Value: 10 + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListTracesAsResponseAsync( + int? requestTimeout = default, + int? requestTimeoutMillis = default, + string? agentKey = default, + string? sessionKey = default, + global::Vectara.ListTracesStatus? status = default, + global::Vectara.ListTracesErrorType? errorType = default, + global::Vectara.ListTracesOperation? operation = default, + string? toolName = default, + global::Vectara.ListTracesToolErrorType? toolErrorType = default, + global::System.DateTime? startedAfter = default, + global::System.DateTime? startedBefore = default, + long? minDurationMs = default, + long? maxDurationMs = default, + int? limit = default, + string? pageKey = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IAgentArtifactsClient.Get3.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentArtifactsClient.Get3.g.cs index 045ebd99..36716659 100644 --- a/src/libs/Vectara/Generated/Vectara.IAgentArtifactsClient.Get3.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IAgentArtifactsClient.Get3.g.cs @@ -32,5 +32,33 @@ public partial interface IAgentArtifactsClient int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get session artifact
+ /// Retrieve a specific artifact by its unique `artifact_id`, including metadata and base64-encoded file content. + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// + /// + /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat + /// + /// + /// Example: art_report_pdf_a3f2 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> Get3AsResponseAsync( + string agentKey, + string sessionKey, + string artifactId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IAgentArtifactsClient.List3.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentArtifactsClient.List3.g.cs index 407da077..679c4bce 100644 --- a/src/libs/Vectara/Generated/Vectara.IAgentArtifactsClient.List3.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IAgentArtifactsClient.List3.g.cs @@ -42,5 +42,43 @@ public partial interface IAgentArtifactsClient global::Vectara.ListSessionArtifactsOrderBy? orderBy = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List session artifacts
+ /// List all artifacts stored in a specific agent session, with cursor-based pagination. Artifacts are files either uploaded by the user, or generated within a session. This endpoint shows you what files exist in a session, but does not include the file content. + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// + /// + /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat + /// + /// + /// Default Value: 10 + /// + /// + /// + /// Default Value: created_at + /// + /// + /// Default Value: desc + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> List3AsResponseAsync( + string agentKey, + string sessionKey, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + int? limit = default, + string? pageKey = default, + global::Vectara.ListSessionArtifactsSortBy? sortBy = default, + global::Vectara.ListSessionArtifactsOrderBy? orderBy = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IAgentEventsClient.Create2.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentEventsClient.Create2.g.cs index 25c1bce9..a859f08d 100644 --- a/src/libs/Vectara/Generated/Vectara.IAgentEventsClient.Create2.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IAgentEventsClient.Create2.g.cs @@ -26,6 +26,33 @@ public partial interface IAgentEventsClient string agentKey, string sessionKey, + global::Vectara.CreateInputRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Interact with an agent
+ /// Create a new input to an agent to interact with it. + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// + /// + /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> Create2AsResponseAsync( + string agentKey, + string sessionKey, + global::Vectara.CreateInputRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, diff --git a/src/libs/Vectara/Generated/Vectara.IAgentEventsClient.Delete2.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentEventsClient.Delete2.g.cs index 272ebc55..0872a263 100644 --- a/src/libs/Vectara/Generated/Vectara.IAgentEventsClient.Delete2.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IAgentEventsClient.Delete2.g.cs @@ -30,5 +30,31 @@ public partial interface IAgentEventsClient int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete event
+ /// Permanently delete an event from a session. Removes the event from both the metadata database and the encrypted event store. + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// + /// + /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task Delete2AsResponseAsync( + string agentKey, + string sessionKey, + string eventId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IAgentEventsClient.Get2.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentEventsClient.Get2.g.cs index dd2f90d1..738557c7 100644 --- a/src/libs/Vectara/Generated/Vectara.IAgentEventsClient.Get2.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IAgentEventsClient.Get2.g.cs @@ -32,5 +32,33 @@ public partial interface IAgentEventsClient int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get event in agent session
+ /// Retrieve the details of a specific event within an agent session. + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// + /// + /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat + /// + /// + /// Example: aev_user_001 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> Get2AsResponseAsync( + string agentKey, + string sessionKey, + string eventId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IAgentEventsClient.Hide.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentEventsClient.Hide.g.cs index f1a2f2ac..ab4e2b81 100644 --- a/src/libs/Vectara/Generated/Vectara.IAgentEventsClient.Hide.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IAgentEventsClient.Hide.g.cs @@ -30,5 +30,31 @@ public partial interface IAgentEventsClient int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Hide event
+ /// Manually hide an event in a session. Sets hide_reason to 'manual'. + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// + /// + /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> HideAsResponseAsync( + string agentKey, + string sessionKey, + string eventId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IAgentEventsClient.List2.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentEventsClient.List2.g.cs index 5f4f149b..39d25725 100644 --- a/src/libs/Vectara/Generated/Vectara.IAgentEventsClient.List2.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IAgentEventsClient.List2.g.cs @@ -38,5 +38,39 @@ public partial interface IAgentEventsClient bool? includeHidden = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List events in agent session
+ /// List all events in a specific agent session, with optional pagination. + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// + /// + /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat + /// + /// + /// Default Value: 10 + /// + /// + /// + /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> List2AsResponseAsync( + string agentKey, + string sessionKey, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + int? limit = default, + string? pageKey = default, + bool? includeHidden = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IAgentEventsClient.Unhide.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentEventsClient.Unhide.g.cs index 481a80fc..0effb664 100644 --- a/src/libs/Vectara/Generated/Vectara.IAgentEventsClient.Unhide.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IAgentEventsClient.Unhide.g.cs @@ -30,5 +30,31 @@ public partial interface IAgentEventsClient int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Unhide event
+ /// Unhide a hidden event in a session. Clears the hide_reason. + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// + /// + /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UnhideAsResponseAsync( + string agentKey, + string sessionKey, + string eventId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IAgentSchedulesClient.Create.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentSchedulesClient.Create.g.cs index ae086be2..2aa00492 100644 --- a/src/libs/Vectara/Generated/Vectara.IAgentSchedulesClient.Create.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IAgentSchedulesClient.Create.g.cs @@ -76,6 +76,48 @@ public partial interface IAgentSchedulesClient /// A unique key that identifies an agent.
/// Example: customer_support /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateAsResponseAsync( + string agentKey, + + global::Vectara.CreateAgentScheduleRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create agent schedule
+ /// Create a new schedule for automatically executing an agent at specified intervals. Each execution creates a new session with the configured message and metadata.
+ /// Schedules enable automated agent workflows such as daily reports, periodic monitoring, or regular data processing. The schedule will create sessions tagged with metadata to identify them as scheduled executions.
+ /// ## Example request
+ /// ```json
+ /// \$ curl -X POST https://api.vectara.io/v2/agents/support-agent/schedules \
+ /// -H "Authorization: Bearer YOUR_API_KEY" \c
+ /// -H "Content-Type: application/json" \
+ /// -d '{
+ /// "key": "daily-report",
+ /// "name": "Daily Summary Report",
+ /// "message": [{"type": "text", "content": "Generate a summary of today's activities"}],
+ /// "schedule": {
+ /// "type": "interval",
+ /// "interval": "PT24H"
+ /// },
+ /// "session_metadata": {
+ /// "report_type": "daily"
+ /// }
+ /// }'
+ /// ```
+ /// A successful response includes the unique schedule key, configuration, and creation timestamp. + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// /// /// A unique key that identifies an agent schedule. Uses "key" terminology (instead of "id")
/// for consistency with other Vectara API resources (AgentKey, SessionKey, CorpusKey, etc.).
diff --git a/src/libs/Vectara/Generated/Vectara.IAgentSchedulesClient.Delete.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentSchedulesClient.Delete.g.cs index 0d4be009..f6b5738f 100644 --- a/src/libs/Vectara/Generated/Vectara.IAgentSchedulesClient.Delete.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IAgentSchedulesClient.Delete.g.cs @@ -30,5 +30,31 @@ public partial interface IAgentSchedulesClient int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete agent schedule
+ /// Delete an agent schedule. This stops all future executions of the schedule.
+ /// Sessions that were previously created by this schedule are not deleted and remain accessible. + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// + /// + /// A unique key that identifies an agent schedule. Uses "key" terminology (instead of "id")
+ /// for consistency with other Vectara API resources (AgentKey, SessionKey, CorpusKey, etc.).
+ /// Example: daily-report + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeleteAsResponseAsync( + string agentKey, + string scheduleKey, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IAgentSchedulesClient.Get.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentSchedulesClient.Get.g.cs index 9521da46..4c7ff8fc 100644 --- a/src/libs/Vectara/Generated/Vectara.IAgentSchedulesClient.Get.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IAgentSchedulesClient.Get.g.cs @@ -29,5 +29,30 @@ public partial interface IAgentSchedulesClient int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get agent schedule
+ /// Retrieve the full details of a specific agent schedule using its unique schedule key. The response includes the schedule's configuration, execution history, and timestamps. + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// + /// + /// A unique key that identifies an agent schedule. Uses "key" terminology (instead of "id")
+ /// for consistency with other Vectara API resources (AgentKey, SessionKey, CorpusKey, etc.).
+ /// Example: daily-report + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetAsResponseAsync( + string agentKey, + string scheduleKey, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IAgentSchedulesClient.List.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentSchedulesClient.List.g.cs index fff8dc7b..96e39c3f 100644 --- a/src/libs/Vectara/Generated/Vectara.IAgentSchedulesClient.List.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IAgentSchedulesClient.List.g.cs @@ -29,5 +29,30 @@ public partial interface IAgentSchedulesClient string? pageKey = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List agent schedules
+ /// List all schedules for the specified agent. This endpoint returns high-level information about each schedule including execution status and next scheduled execution time. + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// + /// + /// Default Value: 10 + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListAsResponseAsync( + string agentKey, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + int? limit = default, + string? pageKey = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IAgentSchedulesClient.ListExecutions.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentSchedulesClient.ListExecutions.g.cs index 10d1bd73..1e93fa64 100644 --- a/src/libs/Vectara/Generated/Vectara.IAgentSchedulesClient.ListExecutions.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IAgentSchedulesClient.ListExecutions.g.cs @@ -35,5 +35,36 @@ public partial interface IAgentSchedulesClient string? pageKey = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List agent schedule executions
+ /// List all execution attempts for a schedule, ordered by most recent first. + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// + /// + /// A unique key that identifies an agent schedule. Uses "key" terminology (instead of "id")
+ /// for consistency with other Vectara API resources (AgentKey, SessionKey, CorpusKey, etc.).
+ /// Example: daily-report + /// + /// + /// Default Value: 10 + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListExecutionsAsResponseAsync( + string agentKey, + string scheduleKey, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + int? limit = default, + string? pageKey = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IAgentSchedulesClient.Update.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentSchedulesClient.Update.g.cs index 3289d97d..40e3755d 100644 --- a/src/libs/Vectara/Generated/Vectara.IAgentSchedulesClient.Update.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IAgentSchedulesClient.Update.g.cs @@ -49,6 +49,35 @@ public partial interface IAgentSchedulesClient /// for consistency with other Vectara API resources (AgentKey, SessionKey, CorpusKey, etc.).
/// Example: daily-report /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UpdateAsResponseAsync( + string agentKey, + string scheduleKey, + + global::Vectara.UpdateAgentScheduleRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update agent schedule
+ /// Update an existing agent schedule. All fields are optional - only provided fields will be updated (PATCH semantics).
+ /// You can pause/resume a schedule by setting the `enabled` field to `false`/`true`. Updating the schedule configuration (interval or cron) will reschedule future executions but will not affect executions currently in progress. + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// + /// + /// A unique key that identifies an agent schedule. Uses "key" terminology (instead of "id")
+ /// for consistency with other Vectara API resources (AgentKey, SessionKey, CorpusKey, etc.).
+ /// Example: daily-report + /// /// /// The human-readable name of an agent schedule.
/// Example: Daily Summary Report diff --git a/src/libs/Vectara/Generated/Vectara.IAgentSessionsClient.Create.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentSessionsClient.Create.g.cs index 1def904e..47950c5d 100644 --- a/src/libs/Vectara/Generated/Vectara.IAgentSessionsClient.Create.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IAgentSessionsClient.Create.g.cs @@ -70,6 +70,45 @@ public partial interface IAgentSessionsClient /// A unique key that identifies an agent.
/// Example: customer_support /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateAsResponseAsync( + string agentKey, + + global::Vectara.CreateAgentSessionRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create agent session
+ /// Create a new session for interacting with an agent. A session is the conversation container that maintains state across all messages, events, tool use, and agent responses.
+ /// This endpoint initializes the session and enables you to configure its initial properties, including optional metadata. Metadata can influence agent behavior, personalize responses, or apply access controls. Instructions and tools can also reference metadata using `${\session.metadata.field}` or `$\ref` syntax.
+ /// A session also serves as the workspace for artifacts, enabling file uploads and multi-step workflows. For more information, see [Working with artifacts in sessions](https://docs.vectara.com/docs/agent-os/sessions#working-with-artifacts-in-sessions).
+ /// ## Example request
+ /// ```json
+ /// \$ curl -X POST https://api.vectara.io/v2/agents/support-agent/sessions \
+ /// -H "Authorization: Bearer YOUR_API_KEY" \
+ /// -H "Content-Type: application/json" \
+ /// -d '{
+ /// "key": "user_12345_session",
+ /// "name": "Customer Support Session",
+ /// "metadata": {
+ /// "user_role": "premium",
+ /// "language": "en"
+ /// }
+ /// }'
+ /// ```
+ /// A successful response includes the unique session key, configuration metadata, and timestamps for creation and last update. + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// /// /// A unique key that identifies an agent session.
/// Example: customer_support_chat diff --git a/src/libs/Vectara/Generated/Vectara.IAgentSessionsClient.Delete.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentSessionsClient.Delete.g.cs index bcb2aa48..4991a6a5 100644 --- a/src/libs/Vectara/Generated/Vectara.IAgentSessionsClient.Delete.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IAgentSessionsClient.Delete.g.cs @@ -28,5 +28,29 @@ public partial interface IAgentSessionsClient int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete agent session
+ /// Permanently delete an agent session. This action cannot be undone. + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// + /// + /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeleteAsResponseAsync( + string agentKey, + string sessionKey, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IAgentSessionsClient.Get.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentSessionsClient.Get.g.cs index da291506..dfd2eb96 100644 --- a/src/libs/Vectara/Generated/Vectara.IAgentSessionsClient.Get.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IAgentSessionsClient.Get.g.cs @@ -28,5 +28,29 @@ public partial interface IAgentSessionsClient int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get agent session
+ /// Retrieve the full details of a specific agent session using its unique session key. The response includes the session's configuration, metadata, timestamps, and other stored properties. Use this endpoint to inspect the current state of a session or verify its configuration. + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// + /// + /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetAsResponseAsync( + string agentKey, + string sessionKey, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IAgentSessionsClient.List.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentSessionsClient.List.g.cs index 089a012e..d9c69baa 100644 --- a/src/libs/Vectara/Generated/Vectara.IAgentSessionsClient.List.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IAgentSessionsClient.List.g.cs @@ -33,5 +33,34 @@ public partial interface IAgentSessionsClient string? pageKey = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List agent sessions
+ /// List all agent sessions for the specified agent. This endpoint returns high-level information about each session, with optional filtering and pagination. Use this operation to browse existing sessions or to locate a specific session key for further inspection or updates. + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// + /// + /// Example: support.* + /// + /// + /// Default Value: 10 + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListAsResponseAsync( + string agentKey, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + string? filter = default, + int? limit = default, + string? pageKey = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IAgentSessionsClient.Update.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentSessionsClient.Update.g.cs index 98d8137a..061e3f22 100644 --- a/src/libs/Vectara/Generated/Vectara.IAgentSessionsClient.Update.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IAgentSessionsClient.Update.g.cs @@ -47,6 +47,34 @@ public partial interface IAgentSessionsClient /// A unique key that identifies an agent session.
/// Example: customer_support_chat /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UpdateAsResponseAsync( + string agentKey, + string sessionKey, + + global::Vectara.UpdateAgentSessionRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update agent session
+ /// Update the configuration of an existing agent session. This endpoint enables you to modify fields such as the name, description, or metadata.
+ /// Updated metadata immediately influences agent behavior and becomes available to instructions and tools for the remainder of the session. For more details about configuring the agent session, see [Create agent session](https://docs.vectara.com/docs/rest-api/create-agent-session). + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// + /// + /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat + /// /// /// Human-readable name for the session.
/// Example: Updated Session Name diff --git a/src/libs/Vectara/Generated/Vectara.IAgentsClient.Create.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentsClient.Create.g.cs index ddbdf909..62ba658e 100644 --- a/src/libs/Vectara/Generated/Vectara.IAgentsClient.Create.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IAgentsClient.Create.g.cs @@ -73,6 +73,46 @@ public partial interface IAgentsClient /// /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateAsResponseAsync( + + global::Vectara.CreateAgentRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create agent
+ /// Create a new agent. An agent is compromised as 3 main things of functionality:
+ /// 1. The **instructions** an agent follows. Known as a system in prompt in other platforms.
+ /// 2. The **steps** an agent follows when receiving an input.
+ /// 3. The **tools** an agent can use to resolve those steps and instructions.
+ /// Instructions are tied to each step, and should be precisely crafted so that the agent can perform the desired actions when given an input.
+ /// :::tip Creating more precise instructions
+ /// Be specific to exactly what you want the agent to do. For emphasis, use CAPS if you want the agent to follow a specific format. Negative prompts also help with precision such as saying **DO NOT DO THIS**.
+ /// :::
+ /// To use an agent, create a new session (called thread or chat in other platforms), and send new inputs to the agent to get responses.
+ /// :::note
+ /// Only a single step is supported with no follow up steps. So the `first_step` will be only the only step. We will add multiple steps and step types to execute complex workflows, but many agents can work well with a single step.
+ /// :::
+ /// ## LLM configuration
+ /// Agents use LLMs for reasoning and response generation. You can configure the following:
+ /// - **Model**: Choose from available models like GPT-4o.
+ /// - **Parameters**: Adjust temperature, max tokens, and other model-specific settings.
+ /// - **Cost optimization**: Balance performance with token usage.
+ /// - **Retry configuration**: Configure automatic retry behavior for transient failures.
+ /// ## Using retries to improve user experience
+ /// When agents interact with LLMs, transient failures like network interruptions can disrupt communication between the agent and the LLM. You can configure your agent to resume disrupted communication to ensure a smooth user experience.
+ /// - `max_retries`: After an error, the agent will retry its request to the LLM this many times.
+ /// - `initial_backoff_ms`: This is how many milliseconds the agent will wait before retrying, to give the cause of the error time to resolve.
+ /// - `backoff_factor`: Every time the agent retries, it can multiply the last retry delay by this number, increasing the wait between retries. This is like giving a toddler a longer and longer timeout if it continues to misbehave.
+ /// - `max_backoff_ms`: The maximum time you want the agent to wait between retries, so the backoff_factor does not create an unreasonably long delay for your users. + ///
+ /// + /// /// /// A unique key that identifies an agent.
/// Example: customer_support diff --git a/src/libs/Vectara/Generated/Vectara.IAgentsClient.CreateConnector.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentsClient.CreateConnector.g.cs index 0e7705e1..3316d136 100644 --- a/src/libs/Vectara/Generated/Vectara.IAgentsClient.CreateConnector.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IAgentsClient.CreateConnector.g.cs @@ -36,6 +36,28 @@ public partial interface IAgentsClient /// A unique key that identifies an agent.
/// Example: customer_support /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateConnectorAsResponseAsync( + string agentKey, + + global::Vectara.CreateAgentConnectorRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create agent connector
+ /// Create a new connector for an agent to receive events from external platforms like Slack. + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// /// /// The human-readable name of the connector.
/// Example: Customer Support Slack Channel diff --git a/src/libs/Vectara/Generated/Vectara.IAgentsClient.Delete.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentsClient.Delete.g.cs index c8f91e86..66c83d71 100644 --- a/src/libs/Vectara/Generated/Vectara.IAgentsClient.Delete.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IAgentsClient.Delete.g.cs @@ -24,5 +24,25 @@ public partial interface IAgentsClient int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete agent
+ /// The Delete Agent API enables you to permanently remove an AI agent and its configuration from the Vectara platform, supporting agent lifecycle management and resource cleanup in enterprise environments.
+ /// Use this API for decommissioning outdated agents, cleaning up development and testing environments, removing agents that are no longer needed, and maintaining organized agent inventories as your AI deployments evolve. The permanent nature of deletion makes this API critical for environments where data governance and resource management are essential. + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeleteAsResponseAsync( + string agentKey, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IAgentsClient.DeleteConnector.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentsClient.DeleteConnector.g.cs index f3280108..9cbf23b1 100644 --- a/src/libs/Vectara/Generated/Vectara.IAgentsClient.DeleteConnector.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IAgentsClient.DeleteConnector.g.cs @@ -27,5 +27,28 @@ public partial interface IAgentsClient int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete agent connector
+ /// Permanently delete an agent connector and all its associated configuration. This action cannot be undone. + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// + /// + /// Example: con_slack_support + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeleteConnectorAsResponseAsync( + string agentKey, + string connectorId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IAgentsClient.Get.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentsClient.Get.g.cs index 62f73f7f..5d4395d5 100644 --- a/src/libs/Vectara/Generated/Vectara.IAgentsClient.Get.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IAgentsClient.Get.g.cs @@ -24,5 +24,25 @@ public partial interface IAgentsClient int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get agent
+ /// The Get Agent API enables you to retrieve the complete configuration and operational details of a specific AI agent, providing comprehensive visibility into agent capabilities, tool integrations, behavioral instructions, and metadata.
+ /// Use this API to inspect agent configurations before creating sessions, troubleshoot agent behavior issues, clone agent configurations for new deployments, and maintain documentation of agent capabilities across your enterprise AI infrastructure. + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetAsResponseAsync( + string agentKey, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IAgentsClient.GetConnector.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentsClient.GetConnector.g.cs index 645b7222..582e382b 100644 --- a/src/libs/Vectara/Generated/Vectara.IAgentsClient.GetConnector.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IAgentsClient.GetConnector.g.cs @@ -27,5 +27,28 @@ public partial interface IAgentsClient int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get agent connector
+ /// Retrieve the details of a specific agent connector by its ID, including its configuration and status. + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// + /// + /// Example: con_slack_support + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetConnectorAsResponseAsync( + string agentKey, + string connectorId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IAgentsClient.GetIdentity.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentsClient.GetIdentity.g.cs index 8f5ed20d..df2ca39d 100644 --- a/src/libs/Vectara/Generated/Vectara.IAgentsClient.GetIdentity.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IAgentsClient.GetIdentity.g.cs @@ -25,5 +25,26 @@ public partial interface IAgentsClient int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get agent identity
+ /// Retrieve the identity associated with an agent. The identity is the service account the agent uses when executing tools.
+ /// In `auto` mode (the default), the platform keeps the identity's roles in sync with the agent's tool configuration.
+ /// In `manual` mode, the roles are frozen and the platform will not modify them when the agent is updated. + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetIdentityAsResponseAsync( + string agentKey, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IAgentsClient.List.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentsClient.List.g.cs index 02e18d90..621684b7 100644 --- a/src/libs/Vectara/Generated/Vectara.IAgentsClient.List.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IAgentsClient.List.g.cs @@ -32,5 +32,33 @@ public partial interface IAgentsClient string? pageKey = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List agents
+ /// The List Agents API enables you to retrieve a paginated list of all agents available to the authenticated user. This is useful for managing and monitoring agent deployments across use cases and environments. + ///
+ /// + /// + /// + /// Example: support.* + /// + /// + /// Example: true + /// + /// + /// Default Value: 10 + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListAsResponseAsync( + int? requestTimeout = default, + int? requestTimeoutMillis = default, + string? filter = default, + bool? enabled = default, + int? limit = default, + string? pageKey = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IAgentsClient.ListConnectors.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentsClient.ListConnectors.g.cs index 3cca0403..4e09a281 100644 --- a/src/libs/Vectara/Generated/Vectara.IAgentsClient.ListConnectors.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IAgentsClient.ListConnectors.g.cs @@ -37,5 +37,38 @@ public partial interface IAgentsClient string? pageKey = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List agent connectors
+ /// List all connectors for a specific agent, with optional filtering and pagination. + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// + /// + /// Example: slack + /// + /// + /// Example: true + /// + /// + /// Default Value: 10 + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListConnectorsAsResponseAsync( + string agentKey, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.ListAgentConnectorsType? type = default, + bool? enabled = default, + int? limit = default, + string? pageKey = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IAgentsClient.Replace.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentsClient.Replace.g.cs index 1c452e3d..c7b72077 100644 --- a/src/libs/Vectara/Generated/Vectara.IAgentsClient.Replace.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IAgentsClient.Replace.g.cs @@ -36,6 +36,28 @@ public partial interface IAgentsClient /// A unique key that identifies an agent.
/// Example: customer_support /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ReplaceAsResponseAsync( + string agentKey, + + global::Vectara.CreateAgentRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Replace agent
+ /// The Replace Agent API enables you to completely replace an existing agent configuration, including its corpora, tools, and generation presets. This endpoint performs a full replacement of the agent definition, unlike the Update Agent API which only modifies specified fields. + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// /// /// A unique key that identifies an agent.
/// Example: customer_support diff --git a/src/libs/Vectara/Generated/Vectara.IAgentsClient.Update.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentsClient.Update.g.cs index ac4755aa..4922df2a 100644 --- a/src/libs/Vectara/Generated/Vectara.IAgentsClient.Update.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IAgentsClient.Update.g.cs @@ -38,6 +38,29 @@ public partial interface IAgentsClient /// A unique key that identifies an agent.
/// Example: customer_support /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UpdateAsResponseAsync( + string agentKey, + + global::Vectara.UpdateAgentRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update agent
+ /// The Update Agent API enables you to modify an existing agent configuration, including tool assignments, behavioral instructions, model parameters, and operational metadata.
+ /// Use this API to evolve agent capabilities over time, adding new tools as they become available, refining behavioral instructions based on user feedback, adjusting model parameters for optimal performance, and updating metadata for better organization across your agent ecosystem. + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// /// /// The human-readable name of an agent.
/// Example: Customer Support Agent diff --git a/src/libs/Vectara/Generated/Vectara.IAgentsClient.UpdateConnector.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentsClient.UpdateConnector.g.cs index cac4ab88..63ede638 100644 --- a/src/libs/Vectara/Generated/Vectara.IAgentsClient.UpdateConnector.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IAgentsClient.UpdateConnector.g.cs @@ -43,6 +43,32 @@ public partial interface IAgentsClient /// /// Example: con_slack_support /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UpdateConnectorAsResponseAsync( + string agentKey, + string connectorId, + + global::Vectara.UpdateAgentConnectorRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update agent connector
+ /// Update an existing agent connector's configuration, status, or other properties. + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// + /// + /// Example: con_slack_support + /// /// /// The human-readable name of the connector.
/// Example: Updated Customer Support Slack Channel diff --git a/src/libs/Vectara/Generated/Vectara.IAgentsClient.UpdateIdentity.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentsClient.UpdateIdentity.g.cs index d7700d64..4e74852e 100644 --- a/src/libs/Vectara/Generated/Vectara.IAgentsClient.UpdateIdentity.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IAgentsClient.UpdateIdentity.g.cs @@ -40,6 +40,30 @@ public partial interface IAgentsClient /// A unique key that identifies an agent.
/// Example: customer_support /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UpdateIdentityAsResponseAsync( + string agentKey, + + global::Vectara.UpdateAgentIdentityRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update agent identity
+ /// Update the agent's identity role management mode and/or roles.
+ /// Setting mode to `manual` freezes the current roles. The platform will no longer recompute roles when the agent's tool configuration changes. This is useful when you need to grant the agent additional permissions beyond what its tools require.
+ /// Setting mode to `auto` resumes platform-managed roles. The platform will immediately resync the roles to match the current tool configuration. + ///
+ /// + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// /// /// The role management mode of the agent's identity.
/// - `auto`: The platform keeps roles in sync with the agent's tool configuration. When tools change, roles are automatically recomputed.
diff --git a/src/libs/Vectara/Generated/Vectara.IApiKeysClient.Create.g.cs b/src/libs/Vectara/Generated/Vectara.IApiKeysClient.Create.g.cs index c1fa30c2..6aab40de 100644 --- a/src/libs/Vectara/Generated/Vectara.IApiKeysClient.Create.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IApiKeysClient.Create.g.cs @@ -37,6 +37,27 @@ public partial interface IApiKeysClient /// /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateAsResponseAsync( + + global::Vectara.CreateApiKeyRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create an API key
+ /// The Create API Key API lets you create new API keys, which you can bind to one or multiple corpora. You can also decide whether to designate each key for specific access like personal API keys, only querying (read-only) or both querying and indexing (read-write).
+ /// This capability is useful in scenarios where you have applications that require different levels of access to corpora data. For example, you might create a read-only API key for an application that only needs to query data.
+ /// :::note
+ /// For more information about the different types of API keys, see [API Key Management](/docs/deploy-and-scale/authentication/api-key-management).
+ /// ::: + ///
+ /// + /// /// /// The human-readable name of the API key. /// diff --git a/src/libs/Vectara/Generated/Vectara.IApiKeysClient.Delete.g.cs b/src/libs/Vectara/Generated/Vectara.IApiKeysClient.Delete.g.cs index 795afeee..a5c3c842 100644 --- a/src/libs/Vectara/Generated/Vectara.IApiKeysClient.Delete.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IApiKeysClient.Delete.g.cs @@ -22,5 +22,23 @@ public partial interface IApiKeysClient int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete an API key
+ /// The Delete API Key API lets you delete one or more existing API keys.
+ /// This capability is useful for managing the lifecycle and security of
+ /// API keys such as when they are no longer needed or when a key is compromised. + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeleteAsResponseAsync( + string apiKeyId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IApiKeysClient.Get.g.cs b/src/libs/Vectara/Generated/Vectara.IApiKeysClient.Get.g.cs index 9fa846bb..8502b80d 100644 --- a/src/libs/Vectara/Generated/Vectara.IApiKeysClient.Get.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IApiKeysClient.Get.g.cs @@ -21,5 +21,22 @@ public partial interface IApiKeysClient int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get an API key
+ /// The Get API Key API lists all existing API keys for a customer ID. It also shows what corpora are accessed by these keys and with what permissions.
+ /// This capability can provide insights into key usage and status and help you manage the lifecycle and security of your API keys. + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetAsResponseAsync( + string apiKeyId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IApiKeysClient.List.g.cs b/src/libs/Vectara/Generated/Vectara.IApiKeysClient.List.g.cs index 59f7b547..0d8ecc20 100644 --- a/src/libs/Vectara/Generated/Vectara.IApiKeysClient.List.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IApiKeysClient.List.g.cs @@ -34,5 +34,35 @@ public partial interface IApiKeysClient global::Vectara.ApiKeyRole? apiKeyRole = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List API keys
+ /// The List API Keys API lists all existing API keys for a customer ID. It also shows what corpora are accessed by these keys and with what permissions. This capability can provide insights into key usage and status and help you manage the lifecycle and security of your API keys. + ///
+ /// + /// + /// + /// Default Value: 10 + /// + /// + /// + /// A user-provided key for a corpus.
+ /// Example: my-corpus + /// + /// + /// Role of the API key. A serving API key can only perform query type requests on its corpora. A serving and indexing key can perform both indexing and query type requests on its corpora.
+ /// A personal API key has all the same permissions as the creator of the API key. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListAsResponseAsync( + int? requestTimeout = default, + int? requestTimeoutMillis = default, + int? limit = default, + string? pageKey = default, + string? corpusKey = default, + global::Vectara.ApiKeyRole? apiKeyRole = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IApiKeysClient.Update.g.cs b/src/libs/Vectara/Generated/Vectara.IApiKeysClient.Update.g.cs index 57962ae4..517b5d50 100644 --- a/src/libs/Vectara/Generated/Vectara.IApiKeysClient.Update.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IApiKeysClient.Update.g.cs @@ -32,6 +32,26 @@ public partial interface IApiKeysClient /// /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UpdateAsResponseAsync( + string apiKeyId, + + global::Vectara.UpdateApiKeyRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update an API key
+ /// The Update API Key API lets you enable or disable specific API keys. You can use this endpoint to temporarily disable access without deleting the key.
+ /// This capability is useful for scenarios like maintenance windows, or when your team no longer requires access to a specific corpus. + ///
+ /// + /// + /// /// /// Indicates whether to disable or enable an API key. /// diff --git a/src/libs/Vectara/Generated/Vectara.IAppClientsClient.Create.g.cs b/src/libs/Vectara/Generated/Vectara.IAppClientsClient.Create.g.cs index 588f427b..21f4d5cf 100644 --- a/src/libs/Vectara/Generated/Vectara.IAppClientsClient.Create.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IAppClientsClient.Create.g.cs @@ -16,6 +16,23 @@ public partial interface IAppClientsClient /// global::System.Threading.Tasks.Task CreateAsync( + global::Vectara.CreateAppClientRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create an App Client
+ /// An App Client is used for OAuth 2.0 authentication when calling Vectara APIs. + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateAsResponseAsync( + global::Vectara.CreateAppClientRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, diff --git a/src/libs/Vectara/Generated/Vectara.IAppClientsClient.Delete.g.cs b/src/libs/Vectara/Generated/Vectara.IAppClientsClient.Delete.g.cs index 4f60183a..653b0fda 100644 --- a/src/libs/Vectara/Generated/Vectara.IAppClientsClient.Delete.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IAppClientsClient.Delete.g.cs @@ -20,5 +20,21 @@ public partial interface IAppClientsClient int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete an App Client
+ /// Remove an application client configuration from the customer account. + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeleteAsResponseAsync( + string appClientId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IAppClientsClient.Get.g.cs b/src/libs/Vectara/Generated/Vectara.IAppClientsClient.Get.g.cs index cf5597ba..cee01aa1 100644 --- a/src/libs/Vectara/Generated/Vectara.IAppClientsClient.Get.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IAppClientsClient.Get.g.cs @@ -20,5 +20,21 @@ public partial interface IAppClientsClient int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get an App Client
+ /// Retrieve details of a specific application client by its ID. + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetAsResponseAsync( + string appClientId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IAppClientsClient.List.g.cs b/src/libs/Vectara/Generated/Vectara.IAppClientsClient.List.g.cs index e8dfb083..df8098a2 100644 --- a/src/libs/Vectara/Generated/Vectara.IAppClientsClient.List.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IAppClientsClient.List.g.cs @@ -26,5 +26,27 @@ public partial interface IAppClientsClient string? pageKey = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List App Clients
+ /// Retrieve a list of application clients configured for the customer account. + ///
+ /// + /// + /// + /// Default Value: 10 + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListAsResponseAsync( + int? requestTimeout = default, + int? requestTimeoutMillis = default, + int? limit = default, + string? filter = default, + string? pageKey = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IAppClientsClient.Update.g.cs b/src/libs/Vectara/Generated/Vectara.IAppClientsClient.Update.g.cs index ff03696b..d3c0f7d5 100644 --- a/src/libs/Vectara/Generated/Vectara.IAppClientsClient.Update.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IAppClientsClient.Update.g.cs @@ -30,6 +30,25 @@ public partial interface IAppClientsClient /// /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UpdateAsResponseAsync( + string appClientId, + + global::Vectara.UpdateAppClientRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update an App Client
+ /// Update the configuration or settings of an existing application client. + ///
+ /// + /// + /// /// /// The new App Client description. /// diff --git a/src/libs/Vectara/Generated/Vectara.IAuthenticationClient.GetToken.g.cs b/src/libs/Vectara/Generated/Vectara.IAuthenticationClient.GetToken.g.cs index d569f093..e8368cf5 100644 --- a/src/libs/Vectara/Generated/Vectara.IAuthenticationClient.GetToken.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IAuthenticationClient.GetToken.g.cs @@ -21,6 +21,19 @@ public partial interface IAuthenticationClient /// Request an access token
/// Obtain an OAuth2 access token using client credentials /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetTokenAsResponseAsync( + + global::Vectara.GetOAuthTokenRequest request, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Request an access token
+ /// Obtain an OAuth2 access token using client credentials + ///
/// /// The client ID of the application /// diff --git a/src/libs/Vectara/Generated/Vectara.ICorporaClient.ComputeSize.g.cs b/src/libs/Vectara/Generated/Vectara.ICorporaClient.ComputeSize.g.cs index 31bb4570..169c789c 100644 --- a/src/libs/Vectara/Generated/Vectara.ICorporaClient.ComputeSize.g.cs +++ b/src/libs/Vectara/Generated/Vectara.ICorporaClient.ComputeSize.g.cs @@ -23,5 +23,24 @@ public partial interface ICorporaClient int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Compute the current size of a corpus
+ /// Compute the current size of a corpus, including number of documents, parts, and characters. The `corpus_key` uniquely identifies the corpus. + ///
+ /// + /// + /// + /// A user-provided key for a corpus.
+ /// Example: my-corpus + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ComputeSizeAsResponseAsync( + string corpusKey, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.ICorporaClient.Create.g.cs b/src/libs/Vectara/Generated/Vectara.ICorporaClient.Create.g.cs index 6eec79da..445eae47 100644 --- a/src/libs/Vectara/Generated/Vectara.ICorporaClient.Create.g.cs +++ b/src/libs/Vectara/Generated/Vectara.ICorporaClient.Create.g.cs @@ -61,6 +61,39 @@ public partial interface ICorporaClient /// /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateAsResponseAsync( + + global::Vectara.CreateCorpusRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create a corpus
+ /// The Create Corpus API lets you create a corpus to store and manage your documents. A corpus is a container for documents and their associated metadata. When creating a corpus, you can specify various settings such as the corpus key, name, description, encoder, and filter attributes.
+ /// ## Corpus object
+ /// When you create a `corpus` object, the `corpus_key` property is required to uniquely identify the corpus. The `name` parameter is optional and defaults to the value of `key`. The optional `description` properties lets you provide additional information about the corpus. When creating a new corpus, you also have the flexibility to specify a custom `corpus_key` that follows a naming convention of your choice. This allows you to assign easily identifiable keys to your corpora, making it easier to manage and reference them in your application.
+ /// You can specify whether to treat queries or documents in the corpus as questions or answers using the `queries_are_answers` and `documents_are_questions` boolean properties. These settings affect the semantics of the encoder used at query time and indexing time.
+ /// ## Add metadata as filter attributes
+ /// When creating a corpus with this endpoint or the Vectara Console, you define metadata fields using the `filter_attributes` object. This ensures the corpus supports filtering on specific metadata attributes, either at the document level or the part level.
+ /// Filter attributes enable you to attach metadata to your data at the document (`doc`) or `part` level, which you can use later in filter expressions to narrow the scope of your queries. A filter attribute must specify a unique `name` (up to 64 characters long), and a `level` which indicates whether it exists in the `doc` or `part` level metadata. At indexing time, metadata with this name is extracted and made available for filter expressions to operate on. [Learn more](https://docs.vectara.com/docs/build/prepare-data/metadata-filters)
+ /// ### Doc and part filter levels
+ /// The `doc` attribute applies to the entire document. Use this for metadata that is consistent across the whole document, such as author, publication date, and document ID.
+ /// The `part` attribute applies to specific sections or chunks within a document. Use for metadata that may vary within different parts of the document, such as sections, page numbers, and sentiment scores.
+ /// If `indexed` is true, the system will build an index on the extracted values to further improve the performance of filter expressions involving the attribute.
+ /// Filter attributes must specify a `type`, which is validated when documents are indexed. The four supported types are `integer`, which stores signed whole-number values up to eight bytes in length; `real`, for storing floating point values in [IEEE 754 8-byte format]; `text` for storing textual strings in [UTF-8 encoding], and `boolean` for storing true/false values.
+ /// After you define filter attributes, you can use them within your queries. For example:
+ /// * Document-level attribute: `doc.publication_year > 2020`
+ /// * Part-level attribute: `part.sentiment_score > 0.7`
+ /// ## Custom dimensions
+ /// Custom dimensions let you add additional context to your data that contain user-defined values in addition to what Vectara automatically extracts and stores from the text. For example, *upvotes* can be a custom dimension. For example, see [Add custom dimensions to boost content](/docs/tutorials/add-custom-dimensions)." + ///
+ /// + /// /// /// A user-provided key for a corpus.
/// Example: my-corpus diff --git a/src/libs/Vectara/Generated/Vectara.ICorporaClient.Delete.g.cs b/src/libs/Vectara/Generated/Vectara.ICorporaClient.Delete.g.cs index bec395e2..8052564e 100644 --- a/src/libs/Vectara/Generated/Vectara.ICorporaClient.Delete.g.cs +++ b/src/libs/Vectara/Generated/Vectara.ICorporaClient.Delete.g.cs @@ -27,5 +27,28 @@ public partial interface ICorporaClient int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete a corpus and all its data
+ /// Permanently delete a corpus and all its associated data. The `corpus_key` uniquely identifies the corpus.
+ /// Upon successful completion, space quota consumed by the corpus will be freed, and the corpus will no longer be useable for future indexing or querying.
+ /// :::note
+ /// The corpus_key assigned to the corpus will be released and can be reused.
+ /// ::: + ///
+ /// + /// + /// + /// A user-provided key for a corpus.
+ /// Example: my-corpus + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeleteAsResponseAsync( + string corpusKey, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.ICorporaClient.Get.g.cs b/src/libs/Vectara/Generated/Vectara.ICorporaClient.Get.g.cs index df688669..70959ca1 100644 --- a/src/libs/Vectara/Generated/Vectara.ICorporaClient.Get.g.cs +++ b/src/libs/Vectara/Generated/Vectara.ICorporaClient.Get.g.cs @@ -29,5 +29,30 @@ public partial interface ICorporaClient int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Retrieve metadata about a corpus
+ /// The Get Corpus API lets you view metadata about a specific corpus. This is useful for getting information about a corpus without performing a search. This operation does not search the corpus contents. Specify the `corpus_key` to identify the corpus whose metadata you want to retrieve.
+ /// This endpoint helps administrators understand the access control details and monitor the size of corpora to understand information like the amount of quota consumed. You can also use this information for optimizing search and storage utilization.
+ /// For example, you can track the read and write activity of a specific corpus which can help you change your security strategy proactively. You noticed a corpus with an API key with read/write access that is only being used for high volume reads. You may decide to switch to a read-only key.
+ /// In another case, you might respond to a security incident by disabling a specific corpus because of information returned by this endpoint.
+ /// ## Get the number of documents or document parts in a corpus
+ /// Tracking the usage of documents in a corpus enables adminstrators to manage resource allocation efficiently. Monitoring corpus metrics also helps data usage stay within allocated quotas and identify trends in document growth and document segmentation.
+ /// The `limit` object in the response provides comprehensive information about the current usage and limits of a corpus including the number of stored documents, document parts, and character count. + ///
+ /// + /// + /// + /// A user-provided key for a corpus.
+ /// Example: my-corpus + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetAsResponseAsync( + string corpusKey, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.ICorporaClient.GetFilterAttributeStats.g.cs b/src/libs/Vectara/Generated/Vectara.ICorporaClient.GetFilterAttributeStats.g.cs index ab657d19..46746ba9 100644 --- a/src/libs/Vectara/Generated/Vectara.ICorporaClient.GetFilterAttributeStats.g.cs +++ b/src/libs/Vectara/Generated/Vectara.ICorporaClient.GetFilterAttributeStats.g.cs @@ -40,5 +40,41 @@ public partial interface ICorporaClient int? maxValues = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get filter attribute statistics for corpus metadata
+ /// Retrieve statistics and value distributions for filter attributes in a corpus. This endpoint provides insights into the metadata structure and content distribution, enabling users to understand available filter values and build effective metadata queries.
+ /// This endpoint analyzes document and part metadata fields defined as filter attributes and returns:
+ /// - **Value distributions**: Top occurring values with their counts
+ /// - **Statistics**: Min, max, average, and sum for numeric fields
+ /// By default, statistics are computed across all filter attributes at both document and part levels. You can optionally:
+ /// - Request statistics for specific fields only
+ /// - Apply metadata filters to analyze a subset of the corpus
+ /// - Limit the number of distinct values returned per field
+ /// **Performance and Caching**: Results may be cached for improved performance, with cache duration varying by corpus size. Cached results can take up to 1 hour to refresh for large corpora. Smaller corpora with faster query times have shorter cache durations (2-15 minutes) to ensure fresher data.
+ /// The `corpus_key` uniquely identifies the corpus. For more information, see [Create a corpus](https://docs.vectara.com/docs/rest-api/create-corpus). + ///
+ /// + /// + /// + /// A user-provided key for a corpus.
+ /// Example: my-corpus + /// + /// + /// + /// + /// Default Value: 100 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetFilterAttributeStatsAsResponseAsync( + string corpusKey, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + string? fields = default, + string? metadataFilter = default, + int? maxValues = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.ICorporaClient.List.g.cs b/src/libs/Vectara/Generated/Vectara.ICorporaClient.List.g.cs index bc565bba..2576006b 100644 --- a/src/libs/Vectara/Generated/Vectara.ICorporaClient.List.g.cs +++ b/src/libs/Vectara/Generated/Vectara.ICorporaClient.List.g.cs @@ -29,5 +29,30 @@ public partial interface ICorporaClient string? pageKey = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List corpora
+ /// The List Corpora API lets you retrieve a list of corpora in your account. This endpoint returns a paginated list of corpora objects, which contain basic information about each corpus. The returned corpus objects contain less detail compared to those retrieved the direct corpus retrieval operation.
+ /// You can specify optional parameters to control the pagination and filtering of the results. The limit parameter determines the maximum number of corpora to return, with a default value of 10 and a maximum value of 100. + ///
+ /// + /// + /// + /// Default Value: 10 + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListAsResponseAsync( + int? requestTimeout = default, + int? requestTimeoutMillis = default, + int? limit = default, + string? filter = default, + global::System.Collections.Generic.IList? corpusId = default, + string? pageKey = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.ICorporaClient.Query.g.cs b/src/libs/Vectara/Generated/Vectara.ICorporaClient.Query.g.cs index f9fa29ad..5d6abf17 100644 --- a/src/libs/Vectara/Generated/Vectara.ICorporaClient.Query.g.cs +++ b/src/libs/Vectara/Generated/Vectara.ICorporaClient.Query.g.cs @@ -278,6 +278,149 @@ public partial interface ICorporaClient /// A user-provided key for a corpus.
/// Example: my-corpus /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> QueryAsResponseAsync( + string corpusKey, + + global::Vectara.QueryCorpusRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Advanced Single Corpus Query
+ /// Perform an advanced query on a specific corpus to find relevant results, generate summaries, highlight relevant snippets, and use Retrieval Augmented Generation.
+ /// This endpoint expands on the simple GET version by allowing full customization of:
+ /// - **Search parameters**: Control pagination (`offset`, `limit`), apply metadata filters, and specify lexical interpolation to balance neural and keyword-based retrieval.
+ /// - **Hybrid search**: Adjust the `lexical_interpolation` value between `0.0` (purely neural) and `1.0` (purely lexical). Typical best results are between `0.01` and `0.1`.
+ /// - **Reranking**: Apply advanced rerankers such as Multilingual, MMR, Chain, or User Defined Function rerankers to improve result relevance.
+ /// - **Generation (RAG)**: Include a `generation` object to enable grounded summarization with your own data, citations, and factual consistency scoring.
+ /// - **Streaming**: Optionally stream results or generated summaries in real time with `stream_response`.
+ /// Each query must include the `corpus_key` path parameter that identifies the target corpus. The response contains one or more subdocuments representing the most relevant passages, along with any generated summaries or citations.
+ /// **Typical use cases**
+ /// - Perform a semantically rich search over a large, domain-specific corpus.
+ /// - Retrieve relevant text passages and apply reranking for better result diversity.
+ /// - Generate contextually grounded answers or summaries using Retrieval Augmented Generation.
+ /// ## Basic query
+ /// This basic query example has a minimal configuration:
+ /// ```json
+ /// {
+ /// "query": "What are black holes?",
+ /// "search": {
+ /// "corpora": [{
+ /// "corpus_key": "my-corpus"
+ /// }],
+ /// },
+ /// "generation": {
+ /// "generation_preset_name": "mockingbird-2.0",
+ /// "max_used_search_results": 20
+ /// }
+ /// }
+ /// ```
+ /// ## Request body parameters
+ /// The request body is a JSON object containing the `query`, `search`, and optional `generation` objects.
+ /// `query` (string, required) - (Required) The search query text.
+ /// `search` (string, required) - (Required) An object that controls the retrieval and reranking process.
+ /// `search.corpora` - An array specifying which corpus to search. For this endpoint, the array will contain a single object.
+ /// * `corpus_key` (string, required): The unique ID of the corpus to search.
+ /// * `metadata_filter` (string, optional): A SQL-like filter to narrow results. For syntax and examples, see the Filters guide.
+ /// * `lexical_interpolation` (float, optional): A value between 0.0 (pure neural search) and 1.0 (pure keyword search) to enable hybrid search. A recommended starting point is 0.025.
+ /// * `custom_dimensions` (object, optional): An object to boost or bury results based on custom dimensions. See the Custom Dimensions guide for details.
+ /// `search.limit` (integer, optional) - The maximum number of results to retrieve before reranking. **Default**: 10
+ /// `search.offset` (integer, optional) - The number of results to skip for pagination. **Default**: 0
+ /// `search.context_configuration` (object, optional) - Configuration for surrounding context to include with each search result.
+ /// * `sentences_before` (integer): Number of sentences to include before the matching text.
+ /// * `sentences_after` (integer): Number of sentences to include after the matching text.
+ /// * `characters_before` (integer): Number of characters to include before the matching text.
+ /// * `characters_after` (integer): Number of characters to include after the matching text.
+ /// * `start_tag` (string): HTML-style tag to wrap the beginning of the retrieved context (e.g., `<b>`).
+ /// * `end_tag` (string): HTML-style tag to wrap the end of the retrieved context (e.g., `</b>`).
+ /// :::note
+ /// You can only use sentences before/after OR characters before/after, but not both.
+ /// :::
+ /// Example:
+ /// ```json
+ /// {
+ /// "context_configuration": {
+ /// "sentences_before": 2,
+ /// "sentences_after": 2,
+ /// "start_tag": "<mark>",
+ /// "end_tag": "</mark>"
+ /// }
+ /// }
+ /// ```
+ /// `search.reranker` (object, optional) - Configures a reranker to improve result quality by reordering search results to place the most relevant content first. For more details, see [Reranking overview](/docs/search-and-retrieval/rerankers/reranking-overview).
+ /// * `type` (string): The reranker type. Options include customer_reranker (default multilingual reranker), mmr (for result diversity), or none.
+ /// * `reranker_name` (string): The specific reranker model to use (e.g., Rerank_Multilingual_v1).
+ /// * `limit` (integer): Maximum number of results to return after reranking.
+ /// * `cutoff` (float): Minimum relevance score (between 0.0 and 1.0) for a result to be included. A typical range is 0.3-0.7.
+ /// * `include_context` (boolean): If true, uses surrounding context text for more accurate reranking.
+ /// **Example:**
+ /// ```json
+ /// {
+ /// "reranker": {
+ /// "type": "customer_reranker",
+ /// "reranker_name": "Rerank_Multilingual_v1",
+ /// "limit": 50,
+ /// }
+ /// }
+ /// ```
+ /// `generation` (object, optional) - An object that controls how the agent creates natural language responses. If this object is excluded, summarization is disabled.
+ /// `generation.generation_preset_name` (string, optional) - The name of the pre-configured prompt and LLM bundle.
+ /// **Recommended Presets:**
+ /// * `mockingbird-2.0`: Vectara's cutting-edge LLM for RAG.
+ /// * `vectara-summary-ext-24-05-med-omni`: (gpt-4o, optimized for citations)
+ /// * `vectara-summary-ext-24-05-large`: (gpt-4.0-turbo, optimized for citations)
+ /// * `vectara-summary-ext-24-05-sml`: (gpt-3.5-turbo, optimized for citations)
+ /// **For Tabular data:**
+ /// `vectara-summary-table-query-ext-dec-2024-gpt-4o`
+ /// `generation.prompt_template` (string, optional) - A custom prompt template in JSON format that defines the system and user messages for the LLM. Use this to customize the behavior of the model beyond the preset. The template can include Velocity templates with variables such as `$vectaraQueryResults` to reference retrieved search results. For more information, see [Custom prompts](/docs/prompts/vectara-prompt-engine).
+ /// `generation.max_used_search_results` (integer, optional) - The maximum number of top search results to send for summarization. The number of top search results to send to the LLM for summarization. Increasing this can create a more comprehensive summary but may increase response time. **Default limit**: 25.
+ /// :::caution
+ /// Setting this value too high may prevent the model from generating a response.
+ /// :::
+ /// `generation.response_language` (string, optional) - The language code for the response (e.g. `eng`, `spa`, `deu`). Set this to `auto` to have Vectara guess the language, but we recommend specifying your preferred language for best results.
+ /// `generation.citations` (object, optional) - Configuration for including citations in the generated summary.
+ /// * `style` (string): Citation style. Options are `markdown`, `html`, or `none`.
+ /// * `url_pattern` (string): A URL template for citation links, where `{doc.id}` will be replaced with the document ID.
+ /// * `text_pattern` (string): A text template for citation display, where `{doc.title}` will be replaced with the document title.
+ /// **Example:**
+ /// ```json
+ /// {
+ /// "citations": {
+ /// "style": "markdown",
+ /// "url_pattern": "https://docs.example.com/documents/{doc.id}",
+ /// "text_pattern": "{doc.title}"
+ /// }
+ /// }
+ /// ```
+ /// `generation.model_parameters` (object, optional) - Custom parameters for the underlying LLM that overwrites the defaults of `generation_preset_name`.
+ /// * `temperature` (float): Controls randomness in the output. Higher values (e.g., 0.8) produce more creative results, while lower values (e.g., 0.2) yield more focused and deterministic outputs.
+ /// * `max_tokens` (integer): The maximum number of tokens to generate in the response.
+ /// * `frequency_penalty` (float): Decreases the use of repeating words, reducing repetition. **Default**: `0.0` to `1.0`.
+ /// * `presence_penalty` (float): Increases the chance for the model to introduce new topics. **Default**: `0.0` to `1.0`.
+ /// **Example:**
+ /// ```json
+ /// {
+ /// "model_parameters": {
+ /// "temperature": 0.7,
+ /// "max_tokens": 500,
+ /// "frequency_penalty": 0.5,
+ /// "presence_penalty": 0.3
+ /// }
+ /// }
+ /// ```
+ /// `generation.enable_factual_consistency_score` (boolean): If true, includes a factual consistency score in the response to indicate how well the generated summary aligns with the retrieved documents. + ///
+ /// + /// + /// + /// A user-provided key for a corpus.
+ /// Example: my-corpus + /// /// /// The search query string, which is the question the user is asking. /// diff --git a/src/libs/Vectara/Generated/Vectara.ICorporaClient.ReplaceFilterAttributes.g.cs b/src/libs/Vectara/Generated/Vectara.ICorporaClient.ReplaceFilterAttributes.g.cs index ad8e39b1..96128699 100644 --- a/src/libs/Vectara/Generated/Vectara.ICorporaClient.ReplaceFilterAttributes.g.cs +++ b/src/libs/Vectara/Generated/Vectara.ICorporaClient.ReplaceFilterAttributes.g.cs @@ -38,6 +38,29 @@ public partial interface ICorporaClient /// A user-provided key for a corpus.
/// Example: my-corpus /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ReplaceFilterAttributesAsResponseAsync( + string corpusKey, + + global::Vectara.ReplaceFilterAttributesRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Replace the filter attributes of a corpus
+ /// Replace the filter attributes of a corpus. This does not happen immediately, as this operation creates a job that completes asynchronously. These new filter attributes will not work until the job completes.
+ /// You can monitor the status of the filter change using the returned job ID. The `corpus_key` uniquely identifies the corpus. + ///
+ /// + /// + /// + /// A user-provided key for a corpus.
+ /// Example: my-corpus + /// /// /// The new filter attributes. /// diff --git a/src/libs/Vectara/Generated/Vectara.ICorporaClient.Reset.g.cs b/src/libs/Vectara/Generated/Vectara.ICorporaClient.Reset.g.cs index cf748611..7c221a98 100644 --- a/src/libs/Vectara/Generated/Vectara.ICorporaClient.Reset.g.cs +++ b/src/libs/Vectara/Generated/Vectara.ICorporaClient.Reset.g.cs @@ -23,5 +23,24 @@ public partial interface ICorporaClient int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Remove all documents and data in a corpus
+ /// Resets a corpus, which removes all documents and data from the specified corpus, while keeping the corpus itself. The `corpus_key` uniquely identifies the corpus. For more information, see [Create a corpus](https://docs.vectara.com/docs/rest-api/create-corpus). + ///
+ /// + /// + /// + /// A user-provided key for a corpus.
+ /// Example: my-corpus + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ResetAsResponseAsync( + string corpusKey, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.ICorporaClient.Search.g.cs b/src/libs/Vectara/Generated/Vectara.ICorporaClient.Search.g.cs index 3bf44f88..7ae05277 100644 --- a/src/libs/Vectara/Generated/Vectara.ICorporaClient.Search.g.cs +++ b/src/libs/Vectara/Generated/Vectara.ICorporaClient.Search.g.cs @@ -46,5 +46,47 @@ public partial interface ICorporaClient bool? intelligentQueryRewriting = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Simple Single Corpus Query
+ /// The [**Query APIs**](/docs/rest-api/queries) enable Retrieval Augmented Generation (RAG), allowing you to search your data and generate AI-powered summaries. Vectara provides three query types to match different search needs:
+ /// * [**Single corpus query**](/docs/rest-api/search-corpus): For a simple search within a single data source.
+ /// * [**Advanced single corpus query**](/docs/rest-api/query-corpus): For full-featured search and RAG within one corpus, supporting advanced features like table summarization, metadata filtering, and reranking.
+ /// * [**Multiple corpora query**](/docs/rest-api/query): For searching across one or more corpora with full RAG capabilities.
+ /// Search a single corpus with a straightforward query request, specifying the corpus key and query parameters.
+ /// * Specify the unique `corpus_key` identifying the corpus to query. The `corpus_key` is created in the Vectara Console or the [Create Corpus API](https://docs.vectara.com/docs/rest-api/create-corpus), and the corpus key is part of that process. When creating a new corpus, you have the option to assign a custom `corpus_key` following your preferred naming convention. This key serves as a unique identifier for the corpus, allowing it to be referenced in search requests.
+ /// * Enter the search `query` string for the corpus, which is the question you want to ask.
+ /// * Set the maximum number of results (`limit`) to return. **Default**: 10, **minimum**: 1 + ///
+ /// + /// + /// + /// A user-provided key for a corpus.
+ /// Example: my-corpus + /// + /// + /// + /// Default Value: 10 + /// + /// + /// Default Value: 0 + /// + /// + /// + /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> SearchAsResponseAsync( + string corpusKey, + string query, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + int? limit = default, + int? offset = default, + bool? saveHistory = default, + bool? intelligentQueryRewriting = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.ICorporaClient.Update.g.cs b/src/libs/Vectara/Generated/Vectara.ICorporaClient.Update.g.cs index 96bdfa20..445fc47c 100644 --- a/src/libs/Vectara/Generated/Vectara.ICorporaClient.Update.g.cs +++ b/src/libs/Vectara/Generated/Vectara.ICorporaClient.Update.g.cs @@ -38,6 +38,29 @@ public partial interface ICorporaClient /// A user-provided key for a corpus.
/// Example: my-corpus /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UpdateAsResponseAsync( + string corpusKey, + + global::Vectara.UpdateCorpusRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update a corpus
+ /// The Update Corpus API lets you enable, disable, or update the name and description of a corpus. This is useful to manage the availability of data within the system, such as when you need to take the corpus offline without having to delete the corpus.
+ /// This lets you utilize automated scripts to programmatically control the availability of corpora based on certain conditions. For example, quickly disable a corpus for maintenance updates or in response to security incidents. + ///
+ /// + /// + /// + /// A user-provided key for a corpus.
+ /// Example: my-corpus + /// /// /// Set whether or not the corpus is enabled. If unset then the corpus will remain in the same state.
/// Example: false diff --git a/src/libs/Vectara/Generated/Vectara.IDocumentsClient.BulkDelete.g.cs b/src/libs/Vectara/Generated/Vectara.IDocumentsClient.BulkDelete.g.cs index 2b0e1d3c..0c6978cc 100644 --- a/src/libs/Vectara/Generated/Vectara.IDocumentsClient.BulkDelete.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IDocumentsClient.BulkDelete.g.cs @@ -36,5 +36,37 @@ public partial interface IDocumentsClient bool? async = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Bulk delete documents from a corpus
+ /// Initiates an asynchronous bulk delete operation for documents in a corpus.
+ /// This operation accepts a metadata filter, a list of specific document IDs, or both.
+ /// **Important**: This is a best-effort operation.
+ /// See the response schema documentation for details on the behavior differences between `metadata_filter` and `document_ids` parameters.
+ /// The operation runs as a background workflow.
+ /// Use the returned `job_id` to track progress via the Jobs API. + ///
+ /// + /// + /// + /// A user-provided key for a corpus.
+ /// Example: my-corpus + /// + /// + /// + /// + /// Default Value: true + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> BulkDeleteAsResponseAsync( + string corpusKey, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + string? metadataFilter = default, + string? documentIds = default, + bool? async = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IDocumentsClient.Create.g.cs b/src/libs/Vectara/Generated/Vectara.IDocumentsClient.Create.g.cs index 5e7bb504..b43a2f05 100644 --- a/src/libs/Vectara/Generated/Vectara.IDocumentsClient.Create.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IDocumentsClient.Create.g.cs @@ -45,6 +45,53 @@ public partial interface IDocumentsClient global::System.Threading.Tasks.Task CreateAsync( string corpusKey, + global::Vectara.CreateDocumentRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.CreateCorpusDocumentWaitFor? waitFor = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Add a document to a corpus
+ /// Add a document to a corpus for indexing, making its content available for search, retrieval, and generation. This endpoint supports two ingestion modes: **structured** documents and **core** documents. These modes offer different levels of control over document structure and chunking.
+ /// Each document becomes part of a corpus. You can use this API directly or with [Vectara Ingest](https://github.com/vectara/vectara-ingest) or the [File Upload API](/docs/rest-api/upload-file).
+ /// ## Structured documents
+ /// Structured documents provide a natural hierarchy where Vectar handles chunking and metadata automatically. Structured documents are ideal when you want to index documents that have logical organization (titles, sections, paragraphs, and optionally tables or images) but prefer Vectara to manage how the content is split into search-optimized units.
+ /// Each structured document contains:
+ /// - A unique `id` and optional `title`, `description`, and `metadata`.
+ /// - An array of `sections`, each with its own title, text, and optional nested sections, tables, or images.
+ /// - Optional `custom_dimensions` that can influence ranking during search.
+ /// When indexed, Vectara partitions the text into document parts automatically using an intelligent sentence- or character-based chunking strategy. This lets you ingest data with minimal pre-processing while maintaining semantic integrity across context boundaries.
+ /// Structured documents are recommended for content with well-defined sections such as reports, articles, FAQs, or documentation.
+ /// ## Core documents
+ /// Core documents offer fine-grained, explicit control of every part of a document that becomes searchable. Instead of providing a hierarchical structure, you specify each **document part** directly as unit that maps 1:1 to a search result or embedding.
+ /// A core document includes:
+ /// - A unique `id` and optional `metadata`.
+ /// - A list of `document_parts`, where each part includes `text`, optional `context`, `metadata`, and `custom_dimensions`.
+ /// - Optional `tables` and `images`, allowing you to represent complex structured data like spreadsheets or charts.
+ /// Core documents are designed for advanced use cases such as precise chunk-level optimization or experimental corpus structures, and applications where metadata-driven retrieval or ranking must be explicitly controlled.
+ /// ## Chunking strategies
+ /// By default, Vectara uses **sentence-based chunking**, which provides optimal retrieval accuracy for most datasets.
+ /// For larger documents or performance-tuned ingestion, you can explicitly set a `chunking_strategy`:
+ /// - `sentence_chunking_strategy` — creates one chunk per sentence (default).
+ /// - `max_chars_chunking_strategy` — creates larger chunks up to a specified character limit (`max_chars_per_chunk`), balancing retrieval speed with contextual coherence. + ///
+ /// + /// + /// + /// A user-provided key for a corpus.
+ /// Example: my-corpus + /// + /// + /// Default Value: searchable + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateAsResponseAsync( + string corpusKey, + global::Vectara.CreateDocumentRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, diff --git a/src/libs/Vectara/Generated/Vectara.IDocumentsClient.Delete.g.cs b/src/libs/Vectara/Generated/Vectara.IDocumentsClient.Delete.g.cs index f67e5033..ec8a62f1 100644 --- a/src/libs/Vectara/Generated/Vectara.IDocumentsClient.Delete.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IDocumentsClient.Delete.g.cs @@ -25,5 +25,26 @@ public partial interface IDocumentsClient int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete a document
+ /// Permanently delete a document identified by its unique `document_id` from a specific corpus. This operation cannot be undone, so use it with caution. + ///
+ /// + /// + /// + /// A user-provided key for a corpus.
+ /// Example: my-corpus + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeleteAsResponseAsync( + string corpusKey, + string documentId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IDocumentsClient.Get.g.cs b/src/libs/Vectara/Generated/Vectara.IDocumentsClient.Get.g.cs index 28092d0f..0f9de019 100644 --- a/src/libs/Vectara/Generated/Vectara.IDocumentsClient.Get.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IDocumentsClient.Get.g.cs @@ -26,5 +26,27 @@ public partial interface IDocumentsClient int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Retrieve a document
+ /// The Retrieve Document API enables you to fetch the content and metadata of a specific document from a corpus, identified by its unique `document_id` from a specific corpus. Use this endpoint to view the full details of a document, including its text, metadata, and associated tables, if table extraction is enabled.
+ /// This information is particularly useful when you need to analyze the details of a specific document or integrate document content into your application workflows. + ///
+ /// + /// + /// + /// A user-provided key for a corpus.
+ /// Example: my-corpus + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetAsResponseAsync( + string corpusKey, + string documentId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IDocumentsClient.GetImage.g.cs b/src/libs/Vectara/Generated/Vectara.IDocumentsClient.GetImage.g.cs index cab7b26d..e9de846b 100644 --- a/src/libs/Vectara/Generated/Vectara.IDocumentsClient.GetImage.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IDocumentsClient.GetImage.g.cs @@ -27,5 +27,28 @@ public partial interface IDocumentsClient int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Retrieve an image from a document
+ /// Returns a specific image that is embedded within a document. The `image_id` uniquely identifies the image within the document. Use this endpoint to fetch the raw image data and associated metadata. + ///
+ /// + /// + /// + /// A user-provided key for a corpus.
+ /// Example: my-corpus + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetImageAsResponseAsync( + string corpusKey, + string documentId, + string imageId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IDocumentsClient.List.g.cs b/src/libs/Vectara/Generated/Vectara.IDocumentsClient.List.g.cs index cacb431d..15f74208 100644 --- a/src/libs/Vectara/Generated/Vectara.IDocumentsClient.List.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IDocumentsClient.List.g.cs @@ -34,5 +34,35 @@ public partial interface IDocumentsClient string? pageKey = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List the documents in the corpus
+ /// The List Documents API enables you to retrieve a list of documents stored in a specific corpus. This endpoint provides an overview of document metadata, including document IDs, tables (if table extraction is enabled), and pagination details.
+ /// Use this API for viewing documents indexed so far and helping you decide to remove documents that are no longer needed. It helps you manage the document lifecycle in your environment.
+ /// This information enables you to catalog and inventory large amounts of data while also retrieving lists of documents for further analysis. For example, developers can utilize the metadata to to build custom search and filtering capabilities into their applications. If you enabled tabled extraction, this endpoint also returns the tables that this document contains.
+ /// Currently Document Admin APIs do not allow you to access the text of your documents. + ///
+ /// + /// + /// + /// A user-provided key for a corpus.
+ /// Example: my-corpus + /// + /// + /// Default Value: 10 + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListAsResponseAsync( + string corpusKey, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + int? limit = default, + string? metadataFilter = default, + string? pageKey = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IDocumentsClient.Summarize.g.cs b/src/libs/Vectara/Generated/Vectara.IDocumentsClient.Summarize.g.cs index a7d5568a..8254c05f 100644 --- a/src/libs/Vectara/Generated/Vectara.IDocumentsClient.Summarize.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IDocumentsClient.Summarize.g.cs @@ -123,6 +123,72 @@ public partial interface IDocumentsClient /// Example: my-corpus /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> SummarizeAsResponseAsync( + string corpusKey, + string documentId, + + global::Vectara.SummarizeDocumentRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Summarize a document
+ /// Organizations often struggle with extracting relevant insights from extensive documentation, such as vendor quotes, financial statements, and technical reports. Manually reviewing these documents is both time-consuming and prone to errors.
+ /// The tech preview of the Documentation Summarization API enables users to generate concise summaries that capture essential insights from single documents without having to process entire documents manually. Efficiently process large documents, extract key insights, and interact with real-time data summaries.
+ /// * Enable streaming for large documents to receive summaries incrementally.
+ /// * Customize `prompt_template` to fine-tune summary output for specific domains.
+ /// * Use standard responses for small documents where streaming is unnecessary.
+ /// * Monitor streaming events to track the progress of real-time summarization.
+ /// :::note
+ /// The documentation length is limited by the context window of your selected LLM.
+ /// :::
+ /// ## Response formats
+ /// The API supports two response modes:
+ /// * **Standard**: Provides a complete summary in one response.
+ /// * **Streaming** Provides incremental responses using Server-Sent Events (SSE).
+ /// ### Non-streaming response
+ /// In standard mode, the API returns a structured response containing the complete summary of the document. The summary field contains the generated text, enabling users to extract essential information quickly.
+ /// ### Streaming response
+ /// For streaming responses, the API returns Server-Sent Events (SSE). The first event begins streaming partial results as soon as they are available, while the final event marks the end of the summarization process.
+ /// The streamed response consists of multiple events:
+ /// * `generation_info`: Contains the `rendered_prompt` which is the compiled prompt sent to the LLM for document summarization.
+ /// * `generation_chunk`: Returns partial chunk of the generated summary.
+ /// * `generation_end`: Marks the completion of the summary generation.
+ /// * `error`: Returns an error message if summarization fails.
+ /// * `end`: Indicates the end of the streaming session.
+ /// ## Prompt template example
+ /// When crafting a prompt, you can access your document with the `$vectaraDocument` field. This example shows a simple prompt:
+ /// ```json
+ /// {
+ /// "role": "user",
+ /// "content": "Summarize the document: \$vectaraDocument.json()"
+ /// }
+ /// ```
+ /// The document also has the following methods to support custom prompts.
+ /// * `$vectaraDocument.json()`: Provides a JSON representation of the whole document.
+ /// * `$vectaraDocument.id()`: Specifies the unique identifier of the document (`document_id`)
+ /// * `$vectaraDocument.metadata()`: Specifies metadata from the document.
+ /// For example,
+ /// `$vectaraDocument.metadata().get("key")` retrieves a specific metadata value by key.
+ /// * `$vectaraDocument.parts()`: Returns an array of document parts which you can look through.
+ /// For example, `#foreach ($part in $vectaraDocument.parts())`.
+ /// * `$part.text()`: Retrieves the text of the part.
+ /// * `$part.metadata()`: Retrieves metadata of a part.
+ /// * `$part.hasTable()`: Determines if the part contains a table.
+ /// * `$part.table()`: Provides access to the table within the part. For example, use `$part.table().json()` to retrieve the table in JSON format. + ///
+ /// + /// + /// + /// A user-provided key for a corpus.
+ /// Example: my-corpus + /// + /// /// /// The name of the LLM.
/// Example: mockingbird-2.0 diff --git a/src/libs/Vectara/Generated/Vectara.IDocumentsClient.Update.g.cs b/src/libs/Vectara/Generated/Vectara.IDocumentsClient.Update.g.cs index bf77db1e..6748d024 100644 --- a/src/libs/Vectara/Generated/Vectara.IDocumentsClient.Update.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IDocumentsClient.Update.g.cs @@ -39,6 +39,30 @@ public partial interface IDocumentsClient /// Example: my-corpus /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UpdateAsResponseAsync( + string corpusKey, + string documentId, + + global::Vectara.UpdateDocumentRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update document, merging the metadata.
+ /// Updates document identified by its unique `document_id` from a specific corpus. The request body metadata is merged with the existing metadata, adding or modifying only the specified fields. + ///
+ /// + /// + /// + /// A user-provided key for a corpus.
+ /// Example: my-corpus + /// + /// /// /// The metadata for a document as an arbitrary object. Properties of this object can be used by document level filter attributes.
/// Example: {"title":"2024 ESG Annual Report \u2013 EuroBank","region":"EU","industry":"banking","year":2024} diff --git a/src/libs/Vectara/Generated/Vectara.IDocumentsClient.UpdateMetadata.g.cs b/src/libs/Vectara/Generated/Vectara.IDocumentsClient.UpdateMetadata.g.cs index 51b42626..0d81c6eb 100644 --- a/src/libs/Vectara/Generated/Vectara.IDocumentsClient.UpdateMetadata.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IDocumentsClient.UpdateMetadata.g.cs @@ -39,6 +39,30 @@ public partial interface IDocumentsClient /// Example: my-corpus /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UpdateMetadataAsResponseAsync( + string corpusKey, + string documentId, + + global::Vectara.UpdateDocumentRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Replace the document metadata.
+ /// Replaces metadata of a document identified by its unique `document_id` from a specific corpus. + ///
+ /// + /// + /// + /// A user-provided key for a corpus.
+ /// Example: my-corpus + /// + /// /// /// The metadata for a document as an arbitrary object. Properties of this object can be used by document level filter attributes.
/// Example: {"title":"2024 ESG Annual Report \u2013 EuroBank","region":"EU","industry":"banking","year":2024} diff --git a/src/libs/Vectara/Generated/Vectara.IEncodersClient.Create.g.cs b/src/libs/Vectara/Generated/Vectara.IEncodersClient.Create.g.cs index ab7d8c62..30e2cfb8 100644 --- a/src/libs/Vectara/Generated/Vectara.IEncodersClient.Create.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IEncodersClient.Create.g.cs @@ -16,6 +16,23 @@ public partial interface IEncodersClient /// global::System.Threading.Tasks.Task CreateAsync( + global::Vectara.CreateEncoderRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create an encoder
+ /// Create a new encoder. + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateAsResponseAsync( + global::Vectara.CreateEncoderRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, diff --git a/src/libs/Vectara/Generated/Vectara.IEncodersClient.List.g.cs b/src/libs/Vectara/Generated/Vectara.IEncodersClient.List.g.cs index 8c6c6988..29feabe8 100644 --- a/src/libs/Vectara/Generated/Vectara.IEncodersClient.List.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IEncodersClient.List.g.cs @@ -28,5 +28,29 @@ public partial interface IEncodersClient string? pageKey = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List encoders
+ /// The List Encoders API retrieves a list of available encoders used for embedding documents and queries. + ///
+ /// + /// + /// + /// Example: vectara.* + /// + /// + /// Default Value: 10 + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListAsResponseAsync( + int? requestTimeout = default, + int? requestTimeoutMillis = default, + string? filter = default, + int? limit = default, + string? pageKey = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IFactualConsistencyClient.Evaluate.g.cs b/src/libs/Vectara/Generated/Vectara.IFactualConsistencyClient.Evaluate.g.cs index e8edc9a1..9929efb8 100644 --- a/src/libs/Vectara/Generated/Vectara.IFactualConsistencyClient.Evaluate.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IFactualConsistencyClient.Evaluate.g.cs @@ -87,6 +87,53 @@ public partial interface IFactualConsistencyClient /// /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> EvaluateAsResponseAsync( + + global::Vectara.EvaluateFactualConsistencyRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Evaluate factual consistency
+ /// Evaluate the factual consistency of a generated text (like a summary) against source documents. This determines how accurately the generated text reflects the information in the source documents, helping identify potential hallucinations or misrepresentations.
+ /// Use this API to programmatically validate generated content against trusted source materials—an essential capability for applications in high-integrity environments such as legal, healthcare, scientific publishing, and enterprise knowledge systems.
+ /// The request body must include the following parameters:
+ /// * `model_parameters:` Optionally specifies the evaluation model to use. Default is `hhem_v2.2`.
+ /// * `generated_text`: The output text you want to evaluate, such as a model-generated summary, answer, or response.
+ /// * `source_texts`: An array of source documents or passages used to verify the accuracy of the generated text.
+ /// * `language`: The ISO 639-3 code representing the language of the provided texts (`eng` for English, `fra` for French).
+ /// ### Example request
+ /// This example evaluates whether a generated statement about the Eiffel Tower is factually accurate based on two reference documents.
+ /// ```json
+ /// {
+ /// "generated_text": "The Eiffel Tower is located in Berlin.",
+ /// "source_texts": [
+ /// "The Eiffel Tower is a famous landmark located in Paris, France.",
+ /// "It was built in 1889 and remains one of the most visited monuments in the world."
+ /// ],
+ /// "language": "eng"
+ /// }
+ /// ```
+ /// ### Example response
+ /// The response includes a factual consistency score and probability estimates.
+ /// ```json
+ /// {
+ /// "score": 0.23,
+ /// "p_consistent": 0.12,
+ /// "p_inconsistent": 0.88
+ /// }
+ /// ```
+ /// * `score`: A normalized value between `0.0` and `1.0` that reflects the overall factual alignment between the generated text and the source texts. Higher scores indicate stronger consistency.
+ /// * `p_consistent`: The estimated probability that the generated text is factually consistent with the sources.
+ /// * `p_inconsistent`: The estimated probability that the generated text contains factual inaccuracies relative to the source documents. + ///
+ /// + /// /// /// The model parameters for the evaluation. /// diff --git a/src/libs/Vectara/Generated/Vectara.IGenerationPresetsClient.Create.g.cs b/src/libs/Vectara/Generated/Vectara.IGenerationPresetsClient.Create.g.cs index ae53e42b..1775ee61 100644 --- a/src/libs/Vectara/Generated/Vectara.IGenerationPresetsClient.Create.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IGenerationPresetsClient.Create.g.cs @@ -29,6 +29,24 @@ public partial interface IGenerationPresetsClient /// /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateAsResponseAsync( + + global::Vectara.CreateGenerationPresetRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create a generation preset
+ /// Create a custom generation preset for use in query and chat requests. A generation preset bundles a prompt template, an LLM, and model parameters into a reusable configuration.
+ /// The created preset can be referenced by name using the `generation_preset_name` field in query or chat requests. + ///
+ /// + /// /// /// The ID of the generation preset.
/// Example: gnp_123 diff --git a/src/libs/Vectara/Generated/Vectara.IGenerationPresetsClient.Delete.g.cs b/src/libs/Vectara/Generated/Vectara.IGenerationPresetsClient.Delete.g.cs index a790a7b9..8a6e8363 100644 --- a/src/libs/Vectara/Generated/Vectara.IGenerationPresetsClient.Delete.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IGenerationPresetsClient.Delete.g.cs @@ -21,5 +21,22 @@ public partial interface IGenerationPresetsClient int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete a generation preset
+ /// Delete an existing custom generation preset.
+ /// The preset must have been created by the customer (platform presets cannot be deleted). + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeleteAsResponseAsync( + string generationPresetId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IGenerationPresetsClient.List.g.cs b/src/libs/Vectara/Generated/Vectara.IGenerationPresetsClient.List.g.cs index b5b6b20d..280e9862 100644 --- a/src/libs/Vectara/Generated/Vectara.IGenerationPresetsClient.List.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IGenerationPresetsClient.List.g.cs @@ -37,5 +37,38 @@ public partial interface IGenerationPresetsClient string? pageKey = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List generation presets
+ /// Organizations often struggle to fine-tune query responses and maintain consistency across different use cases. Vectara creates and maintains predefined generation presets for our users which provides a flexible and powerful way to utilize generation parameters. Each preset includes a complete Velocity template for the prompt along with other generation parameters. Presets are typically associated with a single LLM.
+ /// The List Generation Presets API lets you view the generation presets used for [query](/docs/rest-api/queries) requests. Generation presets group several properties that configure generation for a request. These presets provide more flexibility in how generation parameters are configured, enabling more fine-tuned control over query responses.
+ /// This includes the `prompt_template`, the Large Language Model (LLM), and other generation settings like `max_tokens` and `temperature`. Users specify a generation preset in their query or chat requests using the `generation_preset_name` field.
+ /// ## Generation presets object
+ /// The `generation_presets` object contains the `name`, `description`, `llm_name`, `prompt_template`, and other fields make up the preset.
+ /// If your account has access to a preset, then `enabled` is set to `true`. A preset can also be set as a `default`.\n\n### Example generation presets response\n\n```json\n{\n \"generation_presets\": [\n {\n \"name\": \"vectara-summary-ext-24-05-med-omni\",\n \"description\": \"Generate summary with controllable citations, Uses GPT-4o with 2,048 max tokens\",\n \"llm_name\": \"gpt-4o\",\n \"prompt_template\": \"[\\n {\\\"role\\\": \\\"system\\\", \\\"content\\\": \\\"Follow these detailed step-by-step\",\n \"max_used_search_results\": 25,\n \"max_tokens\": 2048,\n \"temperature\": 0,\n \"frequency_penalty\": 0,\n \"presence_penalty\": 0,\n \"enabled\": true,\n \"default\": false\n },\n // More presets appear here\n}\n```\n" + ///
+ /// + /// + /// + /// Example: mockingbird-2.0 + /// + /// + /// Example: mockingbird.* + /// + /// + /// Default Value: 10 + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListAsResponseAsync( + int? requestTimeout = default, + int? requestTimeoutMillis = default, + string? llmName = default, + string? filter = default, + int? limit = default, + string? pageKey = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IGenerationPresetsClient.Replace.g.cs b/src/libs/Vectara/Generated/Vectara.IGenerationPresetsClient.Replace.g.cs index 905de5dd..54e4a6b3 100644 --- a/src/libs/Vectara/Generated/Vectara.IGenerationPresetsClient.Replace.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IGenerationPresetsClient.Replace.g.cs @@ -32,6 +32,26 @@ public partial interface IGenerationPresetsClient /// /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ReplaceAsResponseAsync( + string generationPresetId, + + global::Vectara.CreateGenerationPresetRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Replace a generation preset
+ /// Replace an existing custom generation preset. This performs a full replacement of the preset configuration.
+ /// The preset must have been created by the customer (platform presets cannot be replaced). + ///
+ /// + /// + /// /// /// The ID of the generation preset.
/// Example: gnp_123 diff --git a/src/libs/Vectara/Generated/Vectara.IGlossariesClient.Create.g.cs b/src/libs/Vectara/Generated/Vectara.IGlossariesClient.Create.g.cs index 2370bd1d..5b93e186 100644 --- a/src/libs/Vectara/Generated/Vectara.IGlossariesClient.Create.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IGlossariesClient.Create.g.cs @@ -27,6 +27,23 @@ public partial interface IGlossariesClient /// /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateAsResponseAsync( + + global::Vectara.CreateGlossaryRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create glossary
+ /// Create a new glossary. A glossary is a reusable mapping of terms to expanded forms that agents use to expand abbreviations and acronyms in user messages. + ///
+ /// + /// /// /// A user-provided key that uniquely identifies a glossary.
/// Example: eng-acronyms diff --git a/src/libs/Vectara/Generated/Vectara.IGlossariesClient.Delete.g.cs b/src/libs/Vectara/Generated/Vectara.IGlossariesClient.Delete.g.cs index 2783df44..eb1b338b 100644 --- a/src/libs/Vectara/Generated/Vectara.IGlossariesClient.Delete.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IGlossariesClient.Delete.g.cs @@ -23,5 +23,24 @@ public partial interface IGlossariesClient int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete glossary
+ /// Delete a glossary and all its entries. + ///
+ /// + /// + /// + /// A user-provided key that uniquely identifies a glossary.
+ /// Example: eng-acronyms + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeleteAsResponseAsync( + string glossaryKey, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IGlossariesClient.DeleteEntries.g.cs b/src/libs/Vectara/Generated/Vectara.IGlossariesClient.DeleteEntries.g.cs index 722a2c6b..38402b31 100644 --- a/src/libs/Vectara/Generated/Vectara.IGlossariesClient.DeleteEntries.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IGlossariesClient.DeleteEntries.g.cs @@ -36,6 +36,28 @@ public partial interface IGlossariesClient /// A user-provided key that uniquely identifies a glossary.
/// Example: eng-acronyms /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeleteEntriesAsResponseAsync( + string glossaryKey, + + global::Vectara.DeleteGlossaryEntriesRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete glossary entries
+ /// Bulk delete entries from a glossary by term. The glossary index blob is rebuilt after deletion. + ///
+ /// + /// + /// + /// A user-provided key that uniquely identifies a glossary.
+ /// Example: eng-acronyms + /// /// /// The terms to remove from the glossary. /// diff --git a/src/libs/Vectara/Generated/Vectara.IGlossariesClient.Get.g.cs b/src/libs/Vectara/Generated/Vectara.IGlossariesClient.Get.g.cs index 0214adf2..2ff09827 100644 --- a/src/libs/Vectara/Generated/Vectara.IGlossariesClient.Get.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IGlossariesClient.Get.g.cs @@ -23,5 +23,24 @@ public partial interface IGlossariesClient int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get glossary
+ /// Get the metadata of a specific glossary. + ///
+ /// + /// + /// + /// A user-provided key that uniquely identifies a glossary.
+ /// Example: eng-acronyms + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetAsResponseAsync( + string glossaryKey, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IGlossariesClient.List.g.cs b/src/libs/Vectara/Generated/Vectara.IGlossariesClient.List.g.cs index 6580c6ed..620e96d2 100644 --- a/src/libs/Vectara/Generated/Vectara.IGlossariesClient.List.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IGlossariesClient.List.g.cs @@ -28,5 +28,29 @@ public partial interface IGlossariesClient string? pageKey = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List glossaries
+ /// List all glossaries available to the authenticated user. + ///
+ /// + /// + /// + /// Example: engineering + /// + /// + /// Default Value: 10 + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListAsResponseAsync( + int? requestTimeout = default, + int? requestTimeoutMillis = default, + string? filter = default, + int? limit = default, + string? pageKey = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IGlossariesClient.ListEntries.g.cs b/src/libs/Vectara/Generated/Vectara.IGlossariesClient.ListEntries.g.cs index 9dbaa2ed..b4db7654 100644 --- a/src/libs/Vectara/Generated/Vectara.IGlossariesClient.ListEntries.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IGlossariesClient.ListEntries.g.cs @@ -29,5 +29,30 @@ public partial interface IGlossariesClient string? pageKey = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List glossary entries
+ /// List the entries in a glossary. + ///
+ /// + /// + /// + /// A user-provided key that uniquely identifies a glossary.
+ /// Example: eng-acronyms + /// + /// + /// Default Value: 100 + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListEntriesAsResponseAsync( + string glossaryKey, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + int? limit = default, + string? pageKey = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IGlossariesClient.Update.g.cs b/src/libs/Vectara/Generated/Vectara.IGlossariesClient.Update.g.cs index de465821..00a70f16 100644 --- a/src/libs/Vectara/Generated/Vectara.IGlossariesClient.Update.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IGlossariesClient.Update.g.cs @@ -36,6 +36,28 @@ public partial interface IGlossariesClient /// A user-provided key that uniquely identifies a glossary.
/// Example: eng-acronyms /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UpdateAsResponseAsync( + string glossaryKey, + + global::Vectara.UpdateGlossaryRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update glossary
+ /// Update the metadata of a glossary. + ///
+ /// + /// + /// + /// A user-provided key that uniquely identifies a glossary.
+ /// Example: eng-acronyms + /// /// /// Updated name for the glossary.
/// Example: Platform Acronyms diff --git a/src/libs/Vectara/Generated/Vectara.IGlossariesClient.UpsertEntries.g.cs b/src/libs/Vectara/Generated/Vectara.IGlossariesClient.UpsertEntries.g.cs index 7d2c1602..28570682 100644 --- a/src/libs/Vectara/Generated/Vectara.IGlossariesClient.UpsertEntries.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IGlossariesClient.UpsertEntries.g.cs @@ -36,6 +36,28 @@ public partial interface IGlossariesClient /// A user-provided key that uniquely identifies a glossary.
/// Example: eng-acronyms /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task UpsertEntriesAsResponseAsync( + string glossaryKey, + + global::Vectara.UpsertGlossaryEntriesRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Upsert glossary entries
+ /// Bulk upsert entries into a glossary. Entries with existing terms are updated and new terms are inserted. The glossary index blob is rebuilt after the upsert. + ///
+ /// + /// + /// + /// A user-provided key that uniquely identifies a glossary.
+ /// Example: eng-acronyms + /// /// /// A map of terms to their expanded forms. Keys are terms (1–200 characters);
/// values are expansions (1–1000 characters).
diff --git a/src/libs/Vectara/Generated/Vectara.IHallucinationCorrectorsClient.HallucinationCorrection.g.cs b/src/libs/Vectara/Generated/Vectara.IHallucinationCorrectorsClient.HallucinationCorrection.g.cs index 1c476efe..5cfb568d 100644 --- a/src/libs/Vectara/Generated/Vectara.IHallucinationCorrectorsClient.HallucinationCorrection.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IHallucinationCorrectorsClient.HallucinationCorrection.g.cs @@ -37,6 +37,28 @@ public partial interface IHallucinationCorrectorsClient /// /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> HallucinationCorrectionAsResponseAsync( + + global::Vectara.HallucinationCorrectionRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Corrects hallucinations in generated text based on source documents
+ /// The Hallucination Correctors API enables users to automatically detect and correct factual inaccuracies, commonly referred to as hallucinations, in generated summaries or responses. By comparing a user-provided summary against one or more source documents, the API returns a corrected version of the summary with minimal necessary edits.
+ /// Use this API to validate and improve the factual accuracy of summaries generated by LLMs in Retrieval Augmented Generation (RAG) pipelines, ensuring that the output remains grounded in trusted source content. If HCM does not detect hallucination, it preserves the original summary.
+ /// The response corrects the original summary. If the input summary is accurate, the `corrected_summary` matches the `original_summary`.
+ /// ## Interpreting empty corrections
+ /// In some cases, the `corrected_text` field in the response may be an empty string. This indicates VHC determined that the entire input text was hallucinated, and VHC recommends removing it completely.
+ /// This outcome is valid and typically occurs when none of the content in the `generated_text` is supported by the provided source documents or query. The response still includes an explanation of why VHC removed the text. + ///
+ /// + /// /// /// The generated text to be evaluated. The hallucination corrector reviews this text and applies corrections based on the provided source documents. /// diff --git a/src/libs/Vectara/Generated/Vectara.IHallucinationCorrectorsClient.List.g.cs b/src/libs/Vectara/Generated/Vectara.IHallucinationCorrectorsClient.List.g.cs index 05f77c0a..0cf42377 100644 --- a/src/libs/Vectara/Generated/Vectara.IHallucinationCorrectorsClient.List.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IHallucinationCorrectorsClient.List.g.cs @@ -27,5 +27,28 @@ public partial interface IHallucinationCorrectorsClient string? pageKey = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List hallucination correctors
+ /// The List Hallucination Correctors API enables users to list available hallucination correctors used for detecting and correcting hallucinations in AI-generated content. Vectara provides these models as part of its broader hallucination evaluation framework, and the Hallucination Correctors endpoint uses these models to propose factual corrections to summaries and other generative outputs.
+ /// Use this API to inspect available correctors, filter results, and determine which hallucination corrector to reference in downstream workflows or evaluation pipelines. + ///
+ /// + /// + /// + /// + /// Default Value: 10 + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListAsResponseAsync( + int? requestTimeout = default, + int? requestTimeoutMillis = default, + string? filter = default, + int? limit = default, + string? pageKey = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IInstructionsClient.Create.g.cs b/src/libs/Vectara/Generated/Vectara.IInstructionsClient.Create.g.cs index ebd89c55..be444d89 100644 --- a/src/libs/Vectara/Generated/Vectara.IInstructionsClient.Create.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IInstructionsClient.Create.g.cs @@ -51,6 +51,58 @@ public partial interface IInstructionsClient /// global::System.Threading.Tasks.Task CreateAsync( + global::Vectara.CreateInstructionRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create instruction
+ /// Create a new instruction that defines how an agent should behave, reason, and respond. Instructions act as system-level guidelines that shape the agent's tone, style, constraints, and tool usage.
+ /// Instructions support dynamic content using the Apache Velocity templating engine. Velocity variables allow instructions to reference runtime context:
+ /// - `\$\tools`: The list of tools available to the agent.
+ /// - `\$\{session.metadata.field}`: Session-level metadata (user context, permissions, preferences).
+ /// - `\$\{agent.metadata.field}`: Agent-level metadata (configuration or environment).
+ /// Example tool iteration:
+ /// ```velocity
+ /// You have access to the following tools:
+ /// \#foreach(\$\tool in $tools)
+ /// - \$\{tool.name}: \$\{tool.description}
+ /// #end
+ /// ```
+ /// :::tip Tips for effective instruction design
+ /// Instructions are one of the most critical parts of an agent's design. Best practices vary by model, but at a minimum you should provide clear guidance on what tools are available, what output format is desired, and what steps to follow for common queries. Instructions typically need to be iterated on and tested over time.
+ /// For guidance on writing effective instructions, see:
+ /// - [Claude Prompt Engineering](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/overview)
+ /// - [OpenAI Prompt Engineering](https://platform.openai.com/docs/guides/prompt-engineering)
+ /// :::
+ /// Metadata can personalize behavior at runtime. For example:
+ /// ```velocity
+ /// Hello ${session.metadata.user_name}, how can I help with ${session.metadata.department} today?
+ /// ```
+ /// **Example request:**
+ /// ```json
+ /// {
+ /// "name": "Customer Support Tone and Style Guide",
+ /// "description": "Defines tone and behavior for customer interactions.",
+ /// "template": "You are a customer support agent for the ${session.metadata.department} department.",
+ /// "enabled": true,
+ /// "metadata": {
+ /// "owner": "customer-support-team",
+ /// "version": "1.0.0"
+ /// }
+ /// }
+ /// ```
+ /// A successful response returns the full instruction definition, including its unique ID, version, and timestamps. + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateAsResponseAsync( + global::Vectara.CreateInstructionRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, diff --git a/src/libs/Vectara/Generated/Vectara.IInstructionsClient.Delete.g.cs b/src/libs/Vectara/Generated/Vectara.IInstructionsClient.Delete.g.cs index 7ce60316..7723c2dd 100644 --- a/src/libs/Vectara/Generated/Vectara.IInstructionsClient.Delete.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IInstructionsClient.Delete.g.cs @@ -26,5 +26,27 @@ public partial interface IInstructionsClient int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete instruction
+ /// Permanently delete an instruction and all its associated configuration.
+ /// :::warning
+ /// This action cannot be undone. Agents currently using this instruction may fail or behave unexpectedly. Update agents to use different instructions before deleting.
+ /// ::: + ///
+ /// + /// + /// + /// The unique identifier for an instruction.
+ /// Example: ins_customer_support_init + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeleteAsResponseAsync( + string instructionId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IInstructionsClient.DeleteVersion.g.cs b/src/libs/Vectara/Generated/Vectara.IInstructionsClient.DeleteVersion.g.cs index 4d9313d3..feb9cc4e 100644 --- a/src/libs/Vectara/Generated/Vectara.IInstructionsClient.DeleteVersion.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IInstructionsClient.DeleteVersion.g.cs @@ -27,5 +27,28 @@ public partial interface IInstructionsClient int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete instruction version
+ /// Permanently delete the specified version of the instruction. This action cannot be undone. + ///
+ /// + /// + /// + /// The unique identifier for an instruction.
+ /// Example: ins_customer_support_init + /// + /// + /// Example: 1 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeleteVersionAsResponseAsync( + string instructionId, + int version, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IInstructionsClient.Get.g.cs b/src/libs/Vectara/Generated/Vectara.IInstructionsClient.Get.g.cs index 148de0f3..36cc8136 100644 --- a/src/libs/Vectara/Generated/Vectara.IInstructionsClient.Get.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IInstructionsClient.Get.g.cs @@ -27,5 +27,28 @@ public partial interface IInstructionsClient int? version = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get instruction
+ /// Retrieve the full definition of a specific instruction, including its template, metadata, enabled status, and version. Instruction templates may contain Velocity expressions that reference tools and metadata. If no version is specified, the latest version is returned. + ///
+ /// + /// + /// + /// The unique identifier for an instruction.
+ /// Example: ins_customer_support_init + /// + /// + /// Example: 1 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetAsResponseAsync( + string instructionId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + int? version = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IInstructionsClient.List.g.cs b/src/libs/Vectara/Generated/Vectara.IInstructionsClient.List.g.cs index fb49af5a..92522614 100644 --- a/src/libs/Vectara/Generated/Vectara.IInstructionsClient.List.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IInstructionsClient.List.g.cs @@ -36,5 +36,37 @@ public partial interface IInstructionsClient string? pageKey = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List instructions
+ /// List all instructions available to the authenticated user, with optional filtering and pagination. This endpoint returns high-level information about each instruction, including name, status, and version details. + ///
+ /// + /// + /// + /// Example: support.* + /// + /// + /// Example: initial + /// + /// + /// Example: true + /// + /// + /// Default Value: 10 + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListAsResponseAsync( + int? requestTimeout = default, + int? requestTimeoutMillis = default, + string? filter = default, + global::Vectara.ListInstructionsType? type = default, + bool? enabled = default, + int? limit = default, + string? pageKey = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IInstructionsClient.Test.g.cs b/src/libs/Vectara/Generated/Vectara.IInstructionsClient.Test.g.cs index bac68726..738324f4 100644 --- a/src/libs/Vectara/Generated/Vectara.IInstructionsClient.Test.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IInstructionsClient.Test.g.cs @@ -43,6 +43,32 @@ public partial interface IInstructionsClient /// /// Example: 1 /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> TestAsResponseAsync( + string instructionId, + + global::Vectara.TestInstructionRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + int? version = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Test instruction
+ /// Test an instruction template using supplied context and available tools. This endpoint evaluates Velocity expressions such as `$tools`, `${session.metadata.field}`, or `${agent.metadata.field}`, and returns the fully rendered template output. Use this operation to validate formatting, logic, or metadata-dependent behavior before deploying instructions to agents. + ///
+ /// + /// + /// + /// The unique identifier for an instruction.
+ /// Example: ins_customer_support_init + /// + /// + /// Example: 1 + /// /// /// Context data to use when rendering the instruction template. This will be merged into `$session.metadata` for template access.
/// Example: If you provide `{"currentDate": "2024-01-15"}`, you can access it in the template as `$session.metadata.currentDate`.
diff --git a/src/libs/Vectara/Generated/Vectara.IInstructionsClient.Update.g.cs b/src/libs/Vectara/Generated/Vectara.IInstructionsClient.Update.g.cs index a0807a77..aa8ac2b8 100644 --- a/src/libs/Vectara/Generated/Vectara.IInstructionsClient.Update.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IInstructionsClient.Update.g.cs @@ -29,6 +29,36 @@ public partial interface IInstructionsClient global::System.Threading.Tasks.Task UpdateAsync( string instructionId, + global::Vectara.UpdateInstructionRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update instruction
+ /// Update an existing instruction's template, metadata, and configuration. Updated templates may include Velocity variables such as `$tools` or metadata references. Each update creates a new version, allowing agents to continue using existing versions until explicitly changed.
+ /// ::info Version Management
+ /// Agents referencing a specific version continue to use it until updated. Agents without a pinned version always use the latest.
+ /// :::
+ /// ## Disable an instruction
+ /// This endpoint can also be used to disable an instruction without deleting it.
+ /// :::warning
+ /// Disabling an instruction prevents it from being added to new agents, but agents already using it continue to operate normally.
+ /// ::: + ///
+ /// + /// + /// + /// The unique identifier for an instruction.
+ /// Example: ins_customer_support_init + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UpdateAsResponseAsync( + string instructionId, + global::Vectara.UpdateInstructionRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, diff --git a/src/libs/Vectara/Generated/Vectara.IJobsClient.Get.g.cs b/src/libs/Vectara/Generated/Vectara.IJobsClient.Get.g.cs index 35a7233f..341c8c9a 100644 --- a/src/libs/Vectara/Generated/Vectara.IJobsClient.Get.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IJobsClient.Get.g.cs @@ -20,5 +20,21 @@ public partial interface IJobsClient int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get a job by ID
+ /// Get a job by a specific `job_id`. Jobs are background processes like replacing the filterable metadata attributes. + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetAsResponseAsync( + string jobId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IJobsClient.List.g.cs b/src/libs/Vectara/Generated/Vectara.IJobsClient.List.g.cs index 387f2ab0..99b21358 100644 --- a/src/libs/Vectara/Generated/Vectara.IJobsClient.List.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IJobsClient.List.g.cs @@ -30,5 +30,31 @@ public partial interface IJobsClient string? pageKey = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List jobs
+ /// List jobs for the account. Jobs are background processes like replacing the filterable metadata attributes. + ///
+ /// + /// + /// + /// + /// + /// + /// Default Value: 10 + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListAsResponseAsync( + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::System.Collections.Generic.IList? corpusKey = default, + global::System.DateTime? after = default, + global::System.Collections.Generic.IList? state = default, + int? limit = default, + string? pageKey = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.ILlmClient.ChatCompletion.g.cs b/src/libs/Vectara/Generated/Vectara.ILlmClient.ChatCompletion.g.cs index 9c02969e..dbec8982 100644 --- a/src/libs/Vectara/Generated/Vectara.ILlmClient.ChatCompletion.g.cs +++ b/src/libs/Vectara/Generated/Vectara.ILlmClient.ChatCompletion.g.cs @@ -109,6 +109,64 @@ public partial interface ILlmClient /// /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ChatCompletionAsResponseAsync( + + global::Vectara.CreateChatCompletionRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Creates a model response for the given chat conversation
+ /// The Chat Completions API provides an OpenAI-compatible interface for generating model responses in multi-turn chat conversations. This API enables you to integrate our language models directly into applications designed to work with the OpenAI Chat Completions format, making it easy to leverage Vectara capabilities with minimal changes to existing tools or code.
+ /// Use this API to enable interactive chat experiences that support context-aware responses, streaming output, and token usage tracking.
+ /// The request includes a series of chat messages and optional parameters that control the behavior and structure of the model response. The request body must include the `messages` parameter, an array of message objects (role, content) representing the full conversation so far.
+ /// ### Streaming responses
+ /// If the `stream` parameter is set to `true`, the response appears as a series of text/event-stream parts (also known as chunks). Each chunk includes a `delta` field showing the incremental message update.
+ /// ### Example request
+ /// This example sends a simple chat conversation to the API, asking the assistant for the capital of France. The request includes a system prompt, a user message, and a temperature setting for response variability.
+ /// ```json
+ /// {
+ /// "model": "chat-model-001","messages": [{ "role": "system", "content": "You are a helpful assistant." },
+ /// { "role": "user", "content": "What is the capital of France?" }
+ /// ],
+ /// "temperature": 0.7,
+ /// "stream": false
+ /// }
+ /// ```
+ /// ### Example response
+ /// The response includes a generated reply from the assistant, along with token usage statistics. In this example, the model returns a direct answer to a user question.
+ /// ```json
+ /// {
+ /// "id": "chatcmpl-abc123",}
+ /// "object": "chat.completion",
+ /// "created": 1712454830,
+ /// "model": "chat-model-001",
+ /// "choices": [
+ /// {
+ /// "index": 0,
+ /// "message": {
+ /// "role": "assistant",
+ /// "content": "The capital of France is Paris."
+ /// },
+ /// "finish_reason": "stop"
+ /// }
+ /// ],
+ /// "usage": {
+ /// "prompt_tokens": 21,
+ /// "completion_tokens": 9,
+ /// "total_tokens": 30
+ /// }
+ /// }
+ /// ```
+ /// If the input summary is accurate, the `corrected_summary` matches the `original_summary`. + ///
+ /// + /// /// /// The ID of the model to use. This field is required. /// diff --git a/src/libs/Vectara/Generated/Vectara.ILlmsClient.Create.g.cs b/src/libs/Vectara/Generated/Vectara.ILlmsClient.Create.g.cs index 81d013c3..9f3639b2 100644 --- a/src/libs/Vectara/Generated/Vectara.ILlmsClient.Create.g.cs +++ b/src/libs/Vectara/Generated/Vectara.ILlmsClient.Create.g.cs @@ -140,6 +140,147 @@ public partial interface ILlmsClient /// global::System.Threading.Tasks.Task CreateAsync( + global::Vectara.CreateLLMRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create an LLM
+ /// Integrate external Large Language Models (LLMs) into Vectara for Retrieval Augmented Generation (RAG) and chat. Connect OpenAI API-compatible models from providers like Anthropic, Azure, Google, or custom-hosted endpoints. Once created, reference your custom LLM by name in query generation parameters.
+ /// - Connect external LLMs using OpenAI-compatible API format
+ /// - Configure multiple LLM providers for different use cases
+ /// - Override Vectara's built-in LLMs with your own models
+ /// - Use custom models for RAG, chat, and document summarization
+ /// **Example providers:**
+ /// ### OpenAI
+ /// **Type:** `openai-compatible`
+ /// **Models:** GPT-4o, GPT-5
+ /// **Auth:** Bearer token
+ /// ```json
+ /// {
+ /// "type": "openai-compatible",
+ /// "name": "my-gpt5",
+ /// "model": "gpt-5",
+ /// "uri": "https://api.openai.com/v1/chat/completions",
+ /// "auth": {
+ /// "type": "bearer",
+ /// "token": "sk-..."
+ /// }
+ /// }
+ /// ```
+ /// ### OpenAI Responses API
+ /// **Type**: openai-responses
+ /// **Models**: o1-preview, o1-mini, o3-mini (reasoning models)
+ /// **Auth**: Bearer token
+ /// **Note**: For reasoning models that don't support streaming
+ /// ```json
+ /// {
+ /// "type": "openai-responses",
+ /// "name": "my-o1",
+ /// "model": "o1-preview",
+ /// "uri": "https://api.openai.com/v1/chat/completions",
+ /// "auth": {
+ /// "type": "bearer",
+ /// "token": "sk-..."
+ /// }
+ /// }
+ /// ```
+ /// ### Anthropic Claude
+ /// **Type:** `openai-compatible`
+ /// **Models:** claude-4-opus, claude-4-5-haiku, claude-4-5-sonnet
+ /// **Auth:** Bearer token with header
+ /// ```json
+ /// {
+ /// "type": "openai-compatible",
+ /// "name": "my-claude",
+ /// "model": "claude-sonnet-4-5-20250929",
+ /// "uri": "https://api.anthropic.com/v1/messages",
+ /// "auth": {
+ /// "type": "bearer",
+ /// "token": "sk-ant-..."
+ /// },
+ /// "headers": {
+ /// "anthropic-version": "2023-06-01"
+ /// }
+ /// }
+ /// ```
+ /// ### Azure OpenAI
+ /// **Type:** `openai-compatible`
+ /// **Models:** GPT-3.5, GPT-4 (Azure-deployed versions)
+ /// **Auth:** Custom header (api-key)
+ /// ```json
+ /// {
+ /// "type": "openai-compatible",
+ /// "name": "my-azure-gpt4",
+ /// "model": "gpt-4",
+ /// "uri": "https://YOUR-RESOURCE.openai.azure.com/openai/deployments/YOUR-DEPLOYMENT/chat/completions?api-version=2024-02-15-preview",
+ /// "auth": {
+ /// "type": "header",
+ /// "header": "api-key",
+ /// "value": "your-azure-key"
+ /// }
+ /// }
+ /// ```
+ /// ### Google Vertex AI (Gemini) — Service Account
+ /// **Type:** `vertex-ai`
+ /// **Models:** gemini-2.5-pro, gemini-2.5-flash
+ /// **Auth:** Service account
+ /// ```json
+ /// {
+ /// "type": "vertex-ai",
+ /// "name": "my-gemini",
+ /// "model": "gemini-2.5-flash",
+ /// "uri": "https://us-central1-aiplatform.googleapis.com/v1/projects/YOUR-PROJECT/locations/us-central1",
+ /// "auth": {
+ /// "type": "service_account",
+ /// "key_json": "{...service account JSON...}"
+ /// }
+ /// }
+ /// ```
+ /// ### Google AI Studio (Gemini) — API Key
+ /// **Type:** `vertex-ai`
+ /// **Models:** gemini-2.5-pro, gemini-2.5-flash
+ /// **Auth:** API key
+ /// ```json
+ /// {
+ /// "type": "vertex-ai",
+ /// "name": "my-gemini",
+ /// "model": "gemini-2.5-flash",
+ /// "uri": "https://generativelanguage.googleapis.com/v1beta",
+ /// "auth": {
+ /// "type": "api_key",
+ /// "api_key": "your-google-api-key"
+ /// }
+ /// }
+ /// ```
+ /// The `uri` field is flexible — you can provide a base URI or a full URL copied from Google docs
+ /// (including model path and `:generateContent` suffix). The system normalizes it automatically.
+ /// ### Custom OpenAI-Compatible
+ /// **Type:** `openai-compatible`
+ /// **Models:** Any self-hosted or custom LLM, such as OpenRouter.
+ /// **Auth:** Bearer or custom header
+ /// ```json
+ /// {
+ /// "type": "openai-compatible",
+ /// "name": "my-custom-llm",
+ /// "model": "llama-3-70b",
+ /// "uri": "https://my-llm-endpoint.com/v1/chat/completions",
+ /// "auth": {
+ /// "type": "bearer",
+ /// "token": "custom-token"
+ /// }
+ /// }
+ /// ``` + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateAsResponseAsync( + global::Vectara.CreateLLMRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, diff --git a/src/libs/Vectara/Generated/Vectara.ILlmsClient.Delete.g.cs b/src/libs/Vectara/Generated/Vectara.ILlmsClient.Delete.g.cs index c6f70f35..e79e409b 100644 --- a/src/libs/Vectara/Generated/Vectara.ILlmsClient.Delete.g.cs +++ b/src/libs/Vectara/Generated/Vectara.ILlmsClient.Delete.g.cs @@ -22,5 +22,23 @@ public partial interface ILlmsClient int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete an LLM
+ /// The Delete LLM API enables users to remove a previously configured custom Large Language Model (LLM) from their Vectara account. This functionality is essential for managing active LLM configurations and ensuring that only relevant models are available for use. Built-in LLMs cannot be deleted, ensuring that core system models remain accessible.
+ /// By providing an LLM identifier, users can permanently delete a model configuration, freeing up resources and maintaining an organized list of available LLMs.
+ /// If successful, the API responds with `HTTP 204 No Content` status, confirming the LLM deletion. + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeleteAsResponseAsync( + string llmId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.ILlmsClient.Get.g.cs b/src/libs/Vectara/Generated/Vectara.ILlmsClient.Get.g.cs index 434de41c..f3f55e43 100644 --- a/src/libs/Vectara/Generated/Vectara.ILlmsClient.Get.g.cs +++ b/src/libs/Vectara/Generated/Vectara.ILlmsClient.Get.g.cs @@ -23,5 +23,24 @@ public partial interface ILlmsClient int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get an LLM
+ /// The Get LLM API allows users to retrieve details about a specific Large Language Model (LLM) that has been configured within the Vectara platform. This API provides metadata about the LLM, including its name, description, model type, API endpoint, and authentication method.
+ /// Use this API to verify model configurations, confirm connectivity details, and ensure that the correct LLM is being utilized within their workflows.
+ /// ## Authentication methods
+ /// The request requires authentication details, and you can provide them either as a Bearer token or custom header-based authentication. + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetAsResponseAsync( + string llmId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.ILlmsClient.List.g.cs b/src/libs/Vectara/Generated/Vectara.ILlmsClient.List.g.cs index 9a2391b6..e9ad6e73 100644 --- a/src/libs/Vectara/Generated/Vectara.ILlmsClient.List.g.cs +++ b/src/libs/Vectara/Generated/Vectara.ILlmsClient.List.g.cs @@ -26,5 +26,27 @@ public partial interface ILlmsClient string? pageKey = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List LLMs
+ /// List LLMs that can be used with query and chat endpoints. The LLM is not directly specified in a query, but instead a `generation_preset_name` is used. The `generation_preset_name` property in generation parameters can be found as the `name` property on the Generations Presets retrieved from `/v2/generation_presets`. + ///
+ /// + /// + /// + /// + /// Default Value: 10 + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListAsResponseAsync( + int? requestTimeout = default, + int? requestTimeoutMillis = default, + string? filter = default, + int? limit = default, + string? pageKey = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.ILlmsClient.Update.g.cs b/src/libs/Vectara/Generated/Vectara.ILlmsClient.Update.g.cs index 65440f83..792e5430 100644 --- a/src/libs/Vectara/Generated/Vectara.ILlmsClient.Update.g.cs +++ b/src/libs/Vectara/Generated/Vectara.ILlmsClient.Update.g.cs @@ -32,6 +32,39 @@ public partial interface ILlmsClient global::System.Threading.Tasks.Task UpdateAsync( string llmId, + global::Vectara.UpdateLLMRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update an LLM
+ /// Update an existing LLM's configuration. This endpoint allows partial updates - only provide fields you want to change. Only the name field is immutable.
+ /// The updated LLM will be tested before saving to ensure credentials are valid.
+ /// **Updatable fields:**
+ /// - `description` - LLM description
+ /// - `type` - LLM type (openai-compatible, vertex-ai, etc.)
+ /// - `model` - Model identifier
+ /// - `uri` - API endpoint
+ /// - `auth` - Authentication credentials (including service account key_json)
+ /// - `headers` - Additional HTTP headers (for openai-compatible and anthropic types)
+ /// - `enabled` - Whether the LLM is enabled
+ /// - `capabilities` - Model capabilities (image support, context limit, tool calling)
+ /// **Immutable fields:**
+ /// - `id` - System-generated identifier
+ /// - `name` - LLM name
+ /// Built-in LLMs (system-provided models) cannot be updated. + ///
+ /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UpdateAsResponseAsync( + string llmId, + global::Vectara.UpdateLLMRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, diff --git a/src/libs/Vectara/Generated/Vectara.IMetadataClient.QueryMetadata.g.cs b/src/libs/Vectara/Generated/Vectara.IMetadataClient.QueryMetadata.g.cs index f869401e..7e6225d7 100644 --- a/src/libs/Vectara/Generated/Vectara.IMetadataClient.QueryMetadata.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IMetadataClient.QueryMetadata.g.cs @@ -36,6 +36,28 @@ public partial interface IMetadataClient /// A user-provided key for a corpus.
/// Example: my-corpus /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> QueryMetadataAsResponseAsync( + string corpusKey, + + global::Vectara.MetadataQueryRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Query across metadata fields in a corpus
+ /// Query for documents in a specific corpus using fuzzy matching across specified metadata fields. The search first applies any exact metadata filters to narrow the results, then performs fuzzy matching on the remaining documents using the specified field queries. + ///
+ /// + /// + /// + /// A user-provided key for a corpus.
+ /// Example: my-corpus + /// /// /// Whether to search document-level or part-level metadata. Document-level returns unique documents, part-level can return multiple parts from the same document.
/// Default Value: document diff --git a/src/libs/Vectara/Generated/Vectara.IPipelineDeadLetterEntriesClient.Create.g.cs b/src/libs/Vectara/Generated/Vectara.IPipelineDeadLetterEntriesClient.Create.g.cs index c26611a5..29ab924a 100644 --- a/src/libs/Vectara/Generated/Vectara.IPipelineDeadLetterEntriesClient.Create.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IPipelineDeadLetterEntriesClient.Create.g.cs @@ -36,6 +36,28 @@ public partial interface IPipelineDeadLetterEntriesClient /// The unique key for the pipeline. Can be user-provided or auto-generated.
/// Example: sharepoint-legal-ingest /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateAsResponseAsync( + string pipelineKey, + + global::Vectara.CreatePipelineDeadLetterEntryRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create dead letter
+ /// Manually add a source record to the dead letter queue for reprocessing. Use this when you want to force a record through the pipeline again, for example when the agent or judge made an incorrect decision. + ///
+ /// + /// + /// + /// The unique key for the pipeline. Can be user-provided or auto-generated.
+ /// Example: sharepoint-legal-ingest + /// /// /// The identifier for the source record to add. Format depends on connector type:
/// - S3: the object key (e.g. `legal/contracts/doc.pdf`)
diff --git a/src/libs/Vectara/Generated/Vectara.IPipelineDeadLetterEntriesClient.Delete.g.cs b/src/libs/Vectara/Generated/Vectara.IPipelineDeadLetterEntriesClient.Delete.g.cs index 4bac8de6..c337bc8a 100644 --- a/src/libs/Vectara/Generated/Vectara.IPipelineDeadLetterEntriesClient.Delete.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IPipelineDeadLetterEntriesClient.Delete.g.cs @@ -25,5 +25,26 @@ public partial interface IPipelineDeadLetterEntriesClient int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete dead letter
+ /// Remove a dead letter from the queue. Use this to dismiss a known failure that does not need retrying. + ///
+ /// + /// + /// + /// The unique key for the pipeline. Can be user-provided or auto-generated.
+ /// Example: sharepoint-legal-ingest + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeleteAsResponseAsync( + string pipelineKey, + string deadLetterId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IPipelineDeadLetterEntriesClient.Get.g.cs b/src/libs/Vectara/Generated/Vectara.IPipelineDeadLetterEntriesClient.Get.g.cs index 824aa6b6..1d7c7b42 100644 --- a/src/libs/Vectara/Generated/Vectara.IPipelineDeadLetterEntriesClient.Get.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IPipelineDeadLetterEntriesClient.Get.g.cs @@ -25,5 +25,26 @@ public partial interface IPipelineDeadLetterEntriesClient int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get dead letter
+ /// Retrieve a specific dead letter by its ID. + ///
+ /// + /// + /// + /// The unique key for the pipeline. Can be user-provided or auto-generated.
+ /// Example: sharepoint-legal-ingest + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetAsResponseAsync( + string pipelineKey, + string deadLetterId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IPipelineDeadLetterEntriesClient.List.g.cs b/src/libs/Vectara/Generated/Vectara.IPipelineDeadLetterEntriesClient.List.g.cs index c24afbec..77c1d5a5 100644 --- a/src/libs/Vectara/Generated/Vectara.IPipelineDeadLetterEntriesClient.List.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IPipelineDeadLetterEntriesClient.List.g.cs @@ -42,5 +42,43 @@ public partial interface IPipelineDeadLetterEntriesClient string? pageKey = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List dead letters
+ /// List dead letters for a pipeline, with optional filtering by status or run. + ///
+ /// + /// + /// + /// The unique key for the pipeline. Can be user-provided or auto-generated.
+ /// Example: sharepoint-legal-ingest + /// + /// + /// The status of a dead letter entry. + /// + /// + /// The unique identifier for a pipeline run.
+ /// Example: run_pip_abc_manual_550e8400 + /// + /// + /// How this dead letter was created. + /// + /// + /// Default Value: 10 + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListAsResponseAsync( + string pipelineKey, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.DeadLetterStatus? status = default, + string? lastRunId = default, + global::Vectara.DeadLetterOrigin? origin = default, + int? limit = default, + string? pageKey = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IPipelineDeadLetterEntriesClient.Process.g.cs b/src/libs/Vectara/Generated/Vectara.IPipelineDeadLetterEntriesClient.Process.g.cs index b8ab478f..df435982 100644 --- a/src/libs/Vectara/Generated/Vectara.IPipelineDeadLetterEntriesClient.Process.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IPipelineDeadLetterEntriesClient.Process.g.cs @@ -36,6 +36,28 @@ public partial interface IPipelineDeadLetterEntriesClient /// The unique key for the pipeline. Can be user-provided or auto-generated.
/// Example: sharepoint-legal-ingest /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ProcessAsResponseAsync( + string pipelineKey, + + global::Vectara.ProcessPipelineDeadLetterEntriesRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Process dead letters
+ /// Process dead letters by creating a new pipeline run that re-fetches the specified records from source and sends them through the agent. If no filters are provided, all pending dead letters are processed. + ///
+ /// + /// + /// + /// The unique key for the pipeline. Can be user-provided or auto-generated.
+ /// Example: sharepoint-legal-ingest + /// /// /// Specific source record IDs to process. If omitted, processes all matching dead letters. /// diff --git a/src/libs/Vectara/Generated/Vectara.IPipelineRunsClient.Get.g.cs b/src/libs/Vectara/Generated/Vectara.IPipelineRunsClient.Get.g.cs index 319aaa35..b7af573e 100644 --- a/src/libs/Vectara/Generated/Vectara.IPipelineRunsClient.Get.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IPipelineRunsClient.Get.g.cs @@ -28,5 +28,29 @@ public partial interface IPipelineRunsClient int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get pipeline run
+ /// Retrieve details of a specific pipeline run including record counts, session keys, and status. + ///
+ /// + /// + /// + /// The unique key for the pipeline. Can be user-provided or auto-generated.
+ /// Example: sharepoint-legal-ingest + /// + /// + /// The unique identifier for a pipeline run.
+ /// Example: run_pip_abc_manual_550e8400 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetAsResponseAsync( + string pipelineKey, + string runId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IPipelineRunsClient.List.g.cs b/src/libs/Vectara/Generated/Vectara.IPipelineRunsClient.List.g.cs index 489d4867..5182b2b6 100644 --- a/src/libs/Vectara/Generated/Vectara.IPipelineRunsClient.List.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IPipelineRunsClient.List.g.cs @@ -35,5 +35,36 @@ public partial interface IPipelineRunsClient string? pageKey = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List pipeline runs
+ /// List execution runs for a pipeline, with optional filtering by status. + ///
+ /// + /// + /// + /// The unique key for the pipeline. Can be user-provided or auto-generated.
+ /// Example: sharepoint-legal-ingest + /// + /// + /// The status of a pipeline run. + /// + /// + /// + /// Default Value: 10 + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListAsResponseAsync( + string pipelineKey, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.PipelineRunStatus? status = default, + global::System.DateTime? after = default, + int? limit = default, + string? pageKey = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IPipelinesClient.Create.g.cs b/src/libs/Vectara/Generated/Vectara.IPipelinesClient.Create.g.cs index a2e5f3d8..e10d1ca7 100644 --- a/src/libs/Vectara/Generated/Vectara.IPipelinesClient.Create.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IPipelinesClient.Create.g.cs @@ -27,6 +27,23 @@ public partial interface IPipelinesClient /// /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateAsResponseAsync( + + global::Vectara.CreatePipelineRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create pipeline
+ /// Create a new pipeline that continuously ingests data from a source system and sends each record to an agent for processing. A new agent session is created per source record. A pipeline is distinct from an agent schedule (which is a recurring single execution of an agent) and from a connector (which is a bidirectional chat integration like Slack). A pipeline is an automated, one-directional flow of all source data through an agent. + ///
+ /// + /// /// /// A user-provided key for the pipeline. If omitted, one is auto-generated. /// diff --git a/src/libs/Vectara/Generated/Vectara.IPipelinesClient.Delete.g.cs b/src/libs/Vectara/Generated/Vectara.IPipelinesClient.Delete.g.cs index e18e95b7..2808f3b9 100644 --- a/src/libs/Vectara/Generated/Vectara.IPipelinesClient.Delete.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IPipelinesClient.Delete.g.cs @@ -23,5 +23,24 @@ public partial interface IPipelinesClient int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete pipeline
+ /// Permanently delete a pipeline and its run history. This cancels any in-progress runs. Agent sessions created by this pipeline are not deleted. + ///
+ /// + /// + /// + /// The unique key for the pipeline. Can be user-provided or auto-generated.
+ /// Example: sharepoint-legal-ingest + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeleteAsResponseAsync( + string pipelineKey, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IPipelinesClient.Get.g.cs b/src/libs/Vectara/Generated/Vectara.IPipelinesClient.Get.g.cs index cd149067..a9059202 100644 --- a/src/libs/Vectara/Generated/Vectara.IPipelinesClient.Get.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IPipelinesClient.Get.g.cs @@ -23,5 +23,24 @@ public partial interface IPipelinesClient int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get pipeline
+ /// Retrieve a pipeline by its key, including its current status, watermark, and configuration. + ///
+ /// + /// + /// + /// The unique key for the pipeline. Can be user-provided or auto-generated.
+ /// Example: sharepoint-legal-ingest + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetAsResponseAsync( + string pipelineKey, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IPipelinesClient.List.g.cs b/src/libs/Vectara/Generated/Vectara.IPipelinesClient.List.g.cs index f6162894..73d97ca2 100644 --- a/src/libs/Vectara/Generated/Vectara.IPipelinesClient.List.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IPipelinesClient.List.g.cs @@ -34,5 +34,35 @@ public partial interface IPipelinesClient string? pageKey = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List pipelines
+ /// List all pipelines with optional filtering by source type, status, or enabled state. + ///
+ /// + /// + /// + /// + /// The current operational status of the pipeline. + /// + /// + /// + /// + /// Default Value: 10 + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListAsResponseAsync( + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.ListPipelinesSourceType? sourceType = default, + global::Vectara.PipelineStatus? status = default, + bool? enabled = default, + string? filter = default, + int? limit = default, + string? pageKey = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IPipelinesClient.Replace.g.cs b/src/libs/Vectara/Generated/Vectara.IPipelinesClient.Replace.g.cs index 18a4cbd1..6d9b42bb 100644 --- a/src/libs/Vectara/Generated/Vectara.IPipelinesClient.Replace.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IPipelinesClient.Replace.g.cs @@ -36,6 +36,28 @@ public partial interface IPipelinesClient /// The unique key for the pipeline. Can be user-provided or auto-generated.
/// Example: sharepoint-legal-ingest /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ReplaceAsResponseAsync( + string pipelineKey, + + global::Vectara.CreatePipelineRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Replace pipeline
+ /// Replace a pipeline's configuration. The full pipeline definition must be provided. + ///
+ /// + /// + /// + /// The unique key for the pipeline. Can be user-provided or auto-generated.
+ /// Example: sharepoint-legal-ingest + /// /// /// A user-provided key for the pipeline. If omitted, one is auto-generated. /// diff --git a/src/libs/Vectara/Generated/Vectara.IPipelinesClient.Trigger.g.cs b/src/libs/Vectara/Generated/Vectara.IPipelinesClient.Trigger.g.cs index 057208e1..87f7987b 100644 --- a/src/libs/Vectara/Generated/Vectara.IPipelinesClient.Trigger.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IPipelinesClient.Trigger.g.cs @@ -23,5 +23,24 @@ public partial interface IPipelinesClient int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Trigger pipeline
+ /// Manually trigger a pipeline run outside of the normal schedule. The pipeline will fetch new data from the source and process it through the agent. Returns the created run. + ///
+ /// + /// + /// + /// The unique key for the pipeline. Can be user-provided or auto-generated.
+ /// Example: sharepoint-legal-ingest + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> TriggerAsResponseAsync( + string pipelineKey, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IPipelinesClient.Update.g.cs b/src/libs/Vectara/Generated/Vectara.IPipelinesClient.Update.g.cs index 210b6d8f..04ce592d 100644 --- a/src/libs/Vectara/Generated/Vectara.IPipelinesClient.Update.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IPipelinesClient.Update.g.cs @@ -36,6 +36,28 @@ public partial interface IPipelinesClient /// The unique key for the pipeline. Can be user-provided or auto-generated.
/// Example: sharepoint-legal-ingest /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UpdateAsResponseAsync( + string pipelineKey, + + global::Vectara.UpdatePipelineRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update pipeline
+ /// Partially update a pipeline's configuration. Omitted fields are preserved. + ///
+ /// + /// + /// + /// The unique key for the pipeline. Can be user-provided or auto-generated.
+ /// Example: sharepoint-legal-ingest + /// /// /// The human-readable name of the pipeline.
/// Example: SharePoint Legal Docs Ingest diff --git a/src/libs/Vectara/Generated/Vectara.IQueriesClient.Query2.g.cs b/src/libs/Vectara/Generated/Vectara.IQueriesClient.Query2.g.cs index 711213d1..0620154f 100644 --- a/src/libs/Vectara/Generated/Vectara.IQueriesClient.Query2.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IQueriesClient.Query2.g.cs @@ -39,6 +39,29 @@ public partial interface IQueriesClient /// /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> Query2AsResponseAsync( + + global::Vectara.QueryRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Multiple Corpora Query
+ /// Perform a multipurpose query to retrieve relevant information from one or more corpora and generate a response using Retrieval Augmented Generation (RAG). Similar to the [advanced corpora search](https://docs.vectara.com/docs/rest-api/query-corpus).
+ /// * Specify the unique `corpus_key` identifying the corpus to query. The `corpus_key` is created in the Vectara Console or the [Create Corpus API](https://docs.vectara.com/docs/rest-api/create-corpus), and the corpus key is part of that process. When creating a new corpus, you have the option to assign a custom `corpus_key` following your preferred naming convention. This key serves as a unique identifier for the corpus, allowing it to be referenced in search requests.
+ /// * Customize your search by specifying the query text (`query`), pagination details (`offset` and `limit`), and metadata filters (`metadata_filter`) to tailor your search results.
+ /// * Leverage advanced search capabilities like reranking (`reranker`) and opt-in Retrieval Augmented Generation (RAG) (`generation`) for enhanced query performance. Generation is opt-in by setting the `generation` property. By excluding the property or by setting it to null, the response will not include generation. [Learn more](https://docs.vectara.com/docs/learn/grounded-generation/configure-query-summarization)
+ /// * Specify Vectara's RAG-focused LLM (Mockingbird) for the `generation_preset_name`. [Learn more](https://docs.vectara.com/docs/learn/mockingbird-llm)
+ /// * Use advanced summarization options that utilize detailed summarization parameters such as `max_response_characters`, `temperature`, and `frequency_penalty` for generating precise and relevant summaries. [Learn more](https://docs.vectara.com/docs/search-and-retrieval#advanced-summarization-customization-options)
+ /// * Customize citation formats in summaries using the `citations` object to include numeric, HTML, or Markdown links. [Learn more](https://docs.vectara.com/docs/search-and-retrieval#citations) + ///
+ /// + /// /// /// The search query string, which is the question the user is asking.
/// Example: Am I allowed to bring pets to work? diff --git a/src/libs/Vectara/Generated/Vectara.IQueryHistoryClient.Get.g.cs b/src/libs/Vectara/Generated/Vectara.IQueryHistoryClient.Get.g.cs index 9f336748..c653df30 100644 --- a/src/libs/Vectara/Generated/Vectara.IQueryHistoryClient.Get.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IQueryHistoryClient.Get.g.cs @@ -21,5 +21,22 @@ public partial interface IQueryHistoryClient int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get a query history
+ /// The Get Query History API allows you to retrieve detailed history about a specific query that was made against a corpus. The response includes detailed information about the query, such as latency, the time it was executed, and the various stages in the query pipeline.
+ /// You specify the `query_id` and the response includes the `id` of the query, the `query` object, the `chat_id`, the time information about the query, and the `spans` object. + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetAsResponseAsync( + string queryId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IQueryHistoryClient.List.g.cs b/src/libs/Vectara/Generated/Vectara.IQueryHistoryClient.List.g.cs index fdab388b..232c4d76 100644 --- a/src/libs/Vectara/Generated/Vectara.IQueryHistoryClient.List.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IQueryHistoryClient.List.g.cs @@ -35,5 +35,36 @@ public partial interface IQueryHistoryClient string? pageKey = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List the history of previous queries
+ /// The List Query Histories API allows you to retrieve, update, and manage query history for a specific corpus. This API is particularly useful for tracking query performance, debugging individual queries, and retrieving detailed information such as the call stack of a query execution.
+ /// You can specify the `corpus_key`, `chat_id`, and the `limit` which is the maximum number of historical queries to list. + ///
+ /// + /// + /// + /// + /// + /// + /// + /// + /// Default Value: 10 + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListAsResponseAsync( + int? requestTimeout = default, + int? requestTimeoutMillis = default, + string? corpusKey = default, + global::System.DateTime? startedAfter = default, + global::System.DateTime? startedBefore = default, + string? chatId = default, + string? historyId = default, + int? limit = default, + string? pageKey = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IRerankersClient.List.g.cs b/src/libs/Vectara/Generated/Vectara.IRerankersClient.List.g.cs index 0f0d1d7d..9532928f 100644 --- a/src/libs/Vectara/Generated/Vectara.IRerankersClient.List.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IRerankersClient.List.g.cs @@ -29,5 +29,30 @@ public partial interface IRerankersClient string? pageKey = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List rerankers
+ /// The List Rerankers API retrieves a list of available rerankers used to improve the ranking and ordering of search results.
+ /// For more information about the available rerankers, see [Reranking overview](https://docs.vectara.com/docs/search-and-retrieval/rerankers/reranking-overview). + ///
+ /// + /// + /// + /// Example: vectara.* + /// + /// + /// Default Value: 10 + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListAsResponseAsync( + int? requestTimeout = default, + int? requestTimeoutMillis = default, + string? filter = default, + int? limit = default, + string? pageKey = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.ITableExtractorsClient.List.g.cs b/src/libs/Vectara/Generated/Vectara.ITableExtractorsClient.List.g.cs index 3bb77131..88561a75 100644 --- a/src/libs/Vectara/Generated/Vectara.ITableExtractorsClient.List.g.cs +++ b/src/libs/Vectara/Generated/Vectara.ITableExtractorsClient.List.g.cs @@ -18,5 +18,19 @@ public partial interface ITableExtractorsClient int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List supported table extractors
+ /// Table extractors are used to extract tabular data from documents during indexing. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListAsResponseAsync( + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IToolServersClient.Create.g.cs b/src/libs/Vectara/Generated/Vectara.IToolServersClient.Create.g.cs index 0260c462..7977d80d 100644 --- a/src/libs/Vectara/Generated/Vectara.IToolServersClient.Create.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IToolServersClient.Create.g.cs @@ -27,6 +27,23 @@ public partial interface IToolServersClient /// /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateAsResponseAsync( + + global::Vectara.CreateToolServerRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create tool server
+ /// Create a new tool server to expose tools for use by agents. + ///
+ /// + /// /// /// The human-readable name of a tool server.
/// Example: RAG Search Server diff --git a/src/libs/Vectara/Generated/Vectara.IToolServersClient.Delete.g.cs b/src/libs/Vectara/Generated/Vectara.IToolServersClient.Delete.g.cs index 23bbaa4d..32d6a180 100644 --- a/src/libs/Vectara/Generated/Vectara.IToolServersClient.Delete.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IToolServersClient.Delete.g.cs @@ -22,5 +22,23 @@ public partial interface IToolServersClient int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete tool server
+ /// Permanently delete a tool server and all its associated configuration and tools. This action cannot be undone. + ///
+ /// + /// + /// + /// Example: tsr_rag_search + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeleteAsResponseAsync( + string toolServerId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IToolServersClient.Get.g.cs b/src/libs/Vectara/Generated/Vectara.IToolServersClient.Get.g.cs index 02869e77..22207b71 100644 --- a/src/libs/Vectara/Generated/Vectara.IToolServersClient.Get.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IToolServersClient.Get.g.cs @@ -22,5 +22,23 @@ public partial interface IToolServersClient int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get tool Server
+ /// Retrieve details about a specific tool server by its Id. + ///
+ /// + /// + /// + /// Example: tsr_rag_search + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetAsResponseAsync( + string toolServerId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IToolServersClient.List.g.cs b/src/libs/Vectara/Generated/Vectara.IToolServersClient.List.g.cs index 9b5c916f..b25ffd20 100644 --- a/src/libs/Vectara/Generated/Vectara.IToolServersClient.List.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IToolServersClient.List.g.cs @@ -36,5 +36,37 @@ public partial interface IToolServersClient string? pageKey = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List tool servers
+ /// Retrieve a list of available tool servers that expose various tools. + ///
+ /// + /// + /// + /// Example: rag.* + /// + /// + /// Example: mcp + /// + /// + /// Example: true + /// + /// + /// Default Value: 10 + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListAsResponseAsync( + int? requestTimeout = default, + int? requestTimeoutMillis = default, + string? filter = default, + global::Vectara.ListToolServersType? type = default, + bool? enabled = default, + int? limit = default, + string? pageKey = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IToolServersClient.Sync.g.cs b/src/libs/Vectara/Generated/Vectara.IToolServersClient.Sync.g.cs index 79440695..41f1b058 100644 --- a/src/libs/Vectara/Generated/Vectara.IToolServersClient.Sync.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IToolServersClient.Sync.g.cs @@ -22,5 +22,23 @@ public partial interface IToolServersClient int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Synchronize tool server
+ /// Trigger a synchronization of the tool server to ensure it is up-to-date with the latest tools. + ///
+ /// + /// + /// + /// Example: tsr_rag_search + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task SyncAsResponseAsync( + string toolServerId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IToolServersClient.Update.g.cs b/src/libs/Vectara/Generated/Vectara.IToolServersClient.Update.g.cs index d477dc9a..aae96209 100644 --- a/src/libs/Vectara/Generated/Vectara.IToolServersClient.Update.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IToolServersClient.Update.g.cs @@ -34,6 +34,27 @@ public partial interface IToolServersClient /// /// Example: tsr_rag_search /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UpdateAsResponseAsync( + string toolServerId, + + global::Vectara.UpdateToolServerRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update tool server
+ /// Update the configuration of a specific tool server. + ///
+ /// + /// + /// + /// Example: tsr_rag_search + /// /// /// The human-readable name of a tool server.
/// Example: RAG Search Server diff --git a/src/libs/Vectara/Generated/Vectara.IToolsClient.Create.g.cs b/src/libs/Vectara/Generated/Vectara.IToolsClient.Create.g.cs index edf314fc..83cb6589 100644 --- a/src/libs/Vectara/Generated/Vectara.IToolsClient.Create.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IToolsClient.Create.g.cs @@ -27,6 +27,34 @@ public partial interface IToolsClient /// global::System.Threading.Tasks.Task CreateAsync( + global::Vectara.CreateToolRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create tool
+ /// Create a new tool that agents can use during conversation. Tools give agents capabilities to interact with external systems, process data, query corpora, or run custom logic. Agents select and invoke tools dynamically based on their instructions and the conversational context.
+ /// Vectara provides several built-in tools, but you can also create your own. This endpoint currently supports creating **Lambda tools**, which run user-defined Python functions in a secure sandbox.
+ /// Each tool is defined by:
+ /// - A unique tool ID
+ /// - A description of its purpose
+ /// - An input schema describing accepted parameters
+ /// - Optional metadata
+ /// - Enabled/disabled runtime availability
+ /// ## Artifact-based tools
+ /// Some built-in tools work with artifacts stored in a session:
+ /// - **Document conversion tool**: Converts file artifacts (PDF, Word, PowerPoint, images with OCR support) to markdown and produces new artifacts containing the extracted content.
+ /// These built-in tools operate on artifact references rather than file content, supporting multi-step workflows where agents process or index user-uploaded documents. + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateAsResponseAsync( + global::Vectara.CreateToolRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, diff --git a/src/libs/Vectara/Generated/Vectara.IToolsClient.Delete.g.cs b/src/libs/Vectara/Generated/Vectara.IToolsClient.Delete.g.cs index ade00335..73a6323b 100644 --- a/src/libs/Vectara/Generated/Vectara.IToolsClient.Delete.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IToolsClient.Delete.g.cs @@ -22,5 +22,23 @@ public partial interface IToolsClient int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete tool
+ /// Permanently delete a tool and its configuration. This action cannot be undone. Agents attempting to use a deleted tool will fail, so ensure that agent configurations are updated before removing a tool. + ///
+ /// + /// + /// + /// Example: tol_rag_search + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeleteAsResponseAsync( + string toolId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IToolsClient.Get.g.cs b/src/libs/Vectara/Generated/Vectara.IToolsClient.Get.g.cs index 41a864c0..1e60335c 100644 --- a/src/libs/Vectara/Generated/Vectara.IToolsClient.Get.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IToolsClient.Get.g.cs @@ -22,5 +22,23 @@ public partial interface IToolsClient int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get tool
+ /// Retrieve the full details of a specific tool, including its description, input schema, metadata, and capabilities. Tools may represent structured search functions, document-processing workflows, or user-defined Lambda functions. Some tools work with artifacts stored in a session, while others operate on structured inputs defined by their JSON schema. + ///
+ /// + /// + /// + /// Example: tol_rag_search + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetAsResponseAsync( + string toolId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IToolsClient.List.g.cs b/src/libs/Vectara/Generated/Vectara.IToolsClient.List.g.cs index aad8a040..08600418 100644 --- a/src/libs/Vectara/Generated/Vectara.IToolsClient.List.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IToolsClient.List.g.cs @@ -44,5 +44,45 @@ public partial interface IToolsClient string? pageKey = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List tools
+ /// List all tools available to the authenticated user, with optional filtering and pagination. Tools represent capabilities that agents can invoke during conversation, including built-in system tools and user-defined Lambda tools. Use filters to locate tools by name, type, status, or tool server. + ///
+ /// + /// + /// + /// Example: rag.* + /// + /// + /// Example: mcp + /// + /// + /// Example: true + /// + /// + /// Example: [retrieval, utilities] + /// + /// + /// Example: tsr_rag_search + /// + /// + /// Default Value: 50 + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListAsResponseAsync( + int? requestTimeout = default, + int? requestTimeoutMillis = default, + string? filter = default, + global::Vectara.ListToolsType? type = default, + bool? enabled = default, + global::System.Collections.Generic.IList? category = default, + string? toolServerId = default, + int? limit = default, + string? pageKey = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IToolsClient.Test.g.cs b/src/libs/Vectara/Generated/Vectara.IToolsClient.Test.g.cs index 93de7685..e53934ff 100644 --- a/src/libs/Vectara/Generated/Vectara.IToolsClient.Test.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IToolsClient.Test.g.cs @@ -38,6 +38,29 @@ public partial interface IToolsClient /// /// Example: tol_python_function_123 /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> TestAsResponseAsync( + string toolId, + + global::Vectara.TestToolRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Test Lambda tool
+ /// Execute a Lambda tool with test inputs to verify it works correctly.
+ /// This endpoint allows users to test their functions before using them with agents.
+ /// The function is executed in a secure sandbox environment with the same constraints as production. + ///
+ /// + /// + /// + /// Example: tol_python_function_123 + /// /// /// The input parameters to pass to the function. Must match the tool's input schema.
/// Example: {"number":42,"text":"Hello, world!"} diff --git a/src/libs/Vectara/Generated/Vectara.IToolsClient.TestWithoutCreation.g.cs b/src/libs/Vectara/Generated/Vectara.IToolsClient.TestWithoutCreation.g.cs index ed2c3400..77694ee2 100644 --- a/src/libs/Vectara/Generated/Vectara.IToolsClient.TestWithoutCreation.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IToolsClient.TestWithoutCreation.g.cs @@ -39,6 +39,29 @@ public partial interface IToolsClient /// /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> TestWithoutCreationAsResponseAsync( + + global::Vectara.TestLambdaToolRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Test Lambda tool without creation
+ /// Test a Lambda tool without creating it first. This endpoint allows you to validate code, discover schemas, and test execution before committing to tool creation.
+ /// Use this to:
+ /// - Validate Python code syntax and security constraints
+ /// - Discover input/output schemas from type annotations
+ /// - Test execution with sample input
+ /// - Verify schema compatibility
+ /// The function is executed in the same secure sandbox environment as production tools. + ///
+ /// + /// /// /// The programming language. Currently only 'python' (Python 3.12) is supported.
/// Default Value: python
diff --git a/src/libs/Vectara/Generated/Vectara.IToolsClient.Update.g.cs b/src/libs/Vectara/Generated/Vectara.IToolsClient.Update.g.cs index 03563014..4d31e96d 100644 --- a/src/libs/Vectara/Generated/Vectara.IToolsClient.Update.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IToolsClient.Update.g.cs @@ -20,6 +20,27 @@ public partial interface IToolsClient global::System.Threading.Tasks.Task UpdateAsync( string toolId, + global::Vectara.UpdateToolRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update tool
+ /// Update an existing tool’s configuration, including its metadata, enabled status, or other properties. Updating a tool modifies how agents can invoke it during conversation. + ///
+ /// + /// + /// + /// Example: tol_rag_search + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UpdateAsResponseAsync( + string toolId, + global::Vectara.UpdateToolRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, diff --git a/src/libs/Vectara/Generated/Vectara.IUploadClient.File.g.cs b/src/libs/Vectara/Generated/Vectara.IUploadClient.File.g.cs index 51b92b1f..e204e717 100644 --- a/src/libs/Vectara/Generated/Vectara.IUploadClient.File.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IUploadClient.File.g.cs @@ -156,6 +156,88 @@ public partial interface IUploadClient /// A user-provided key for a corpus.
/// Example: my-corpus /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> FileAsResponseAsync( + string corpusKey, + + global::Vectara.UploadFileRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Upload a file to the corpus
+ /// Upload a file to a corpus for automatic text extraction, chunking, and indexing. This endpoint is designed for unstructured documents where you want Vectara to handle parsing for you. Each uploaded file can be up to **10 MB**.
+ /// Supported file types include:
+ /// - Markdown (`.md`)
+ /// - PDF/A (`.pdf`)
+ /// - OpenOffice documents (`.odt`)
+ /// - Microsoft Word (`.doc`, `.docx`)
+ /// - Microsoft PowerPoint (`.ppt`, `.pptx`)
+ /// - Plain text (`.txt`)
+ /// - HTML (`.html`)
+ /// - LXML (`.lxml`)
+ /// - RTF (`.rtf`)
+ /// - EPUB (`.epub`)
+ /// - Email files (RFC 822)
+ /// :::note
+ /// For semi-structured documents that require more control over fields or metadata, use the [**Create Corpus Document API**](/docs/rest-api/create-corpus-document) instead.
+ /// :::
+ /// ## Additional format support through Vectara Ingest
+ /// If you need to ingest additional file types or data sources, you can use the open-source [**Vectara Ingest**](https://github.com/vectara/vectara-ingest) Python framework. It supports connectors for websites, RSS feeds, CSV, Confluence, HubSpot, ServiceNow, Jira, Notion, Slack, MediaWiki, GitHub, SharePoint, Twitter/X, YouTube, and more.
+ /// :::caution
+ /// Vectara Ingest is provided as an open-source example and is not officially supported.
+ /// :::
+ /// ## Multipart form fields
+ /// This endpoint expects a `multipart/form-data` request with the following fields:
+ /// - **metadata** (optional): JSON metadata to attach to the parsed document.
+ /// Example: `metadata={"key":"value"}`
+ /// - **chunking_strategy** (optional): Controls how extracted text is chunked.
+ /// Defaults to sentence-based chunking (one chunk per sentence).
+ /// Example: `{"type":"sentence_chunking_strategy"}`.
+ /// Example for max character chunking: `{"type":"max_chars_chunking_strategy","max_chars_per_chunk":512}`
+ /// - **table_extraction_config** (optional): Enables extraction of tables from supported file types such as PDFs.
+ /// Example: `{"extract_tables": true}`
+ /// - **file** (required): The file to upload.
+ /// - **filename** (required): The desired document ID, specified within the file upload field.
+ /// Apart from these parameters, the servers expect a valid JWT Token in the HTTP headers:
+ /// ```curl
+ /// \$ curl -L -X POST 'https://api.vectara.io/v2/corpora/:corpus_key/upload_file' \
+ /// -H 'Content-Type: multipart/form-data' \
+ /// -H 'Accept: application/json' \
+ /// -H 'x-api-key: zwt_123456' \
+ /// -F 'metadata=\{"key": "value"\};type=application/json' \
+ /// -F 'file=@/path/to/file/file.pdf;filename=desired_filename.pdf'
+ /// ```
+ /// ## Filenames with non-ASCII characters
+ /// When uploading files with non-ASCII (non-English) characters, such as Russian or Chinese, ensure that the filename is URL encoded. The Vectara REST API follows web standards which require URL-encoded file names.
+ /// ## Set the document ID
+ ///
+ /// To set a custom Document ID, pass it as the filename in the `Content-Disposition` header:
+ /// `Content-Disposition: form-data; name="file"; filename="your_document_id"`
+ /// For more information about Content-Disposition, see the [Mozilla documentation on headers](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition).
+ /// ## Attach additional metadata
+ /// You can attach additional metadata to the file by specifying a metadata form field, which can contain a JSON string:
+ /// `{ "filesize": 1234 }`
+ /// ## Tabular data extraction and summarization
+ /// Setting `table_extraction_config.extract_tables = true` enables extraction of tabular data (such as financial filings such as 10-K, 10-Q, S-1). You can also apply custom prompt templates to summarize table content during upload.
+ /// :::caution
+ /// Table extraction does not support scanned images of tables.
+ /// :::
+ /// ## Custom table summarization with prompt templates
+ /// Vectara supports [table summarization using custom prompt templates](https://docs.vectara.com/docs/build/working-with-tables#summarize-tables-with-custom-prompts) during document upload. This lets you define custom prompt templates that control how the LLM interprets and summarizes table data during extraction. By customizing the prompt_template, you can tailor summaries for domain-specific language, analytical perspectives, or formatting preferences.
+ /// ## Image support
+ /// You can include images in structured documents using the [Indexing API](/docs/rest-api/create-corpus-document) with Base64 encoding. You cannot send images directly with individual query requests. If you want to retrieve a specific image that is embedded within a document, use the [Retrieve image API](/docs/rest-api/get-image) + ///
+ /// + /// + /// + /// A user-provided key for a corpus.
+ /// Example: my-corpus + /// /// /// Arbitrary object that will be attached as document metadata to the extracted document.
/// Example: {"department":"engineering","doc_type\u0022":"architecture_diagram"} @@ -187,5 +269,208 @@ public partial interface IUploadClient string? filename = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Upload a file to the corpus
+ /// Upload a file to a corpus for automatic text extraction, chunking, and indexing. This endpoint is designed for unstructured documents where you want Vectara to handle parsing for you. Each uploaded file can be up to **10 MB**.
+ /// Supported file types include:
+ /// - Markdown (`.md`)
+ /// - PDF/A (`.pdf`)
+ /// - OpenOffice documents (`.odt`)
+ /// - Microsoft Word (`.doc`, `.docx`)
+ /// - Microsoft PowerPoint (`.ppt`, `.pptx`)
+ /// - Plain text (`.txt`)
+ /// - HTML (`.html`)
+ /// - LXML (`.lxml`)
+ /// - RTF (`.rtf`)
+ /// - EPUB (`.epub`)
+ /// - Email files (RFC 822)
+ /// :::note
+ /// For semi-structured documents that require more control over fields or metadata, use the [**Create Corpus Document API**](/docs/rest-api/create-corpus-document) instead.
+ /// :::
+ /// ## Additional format support through Vectara Ingest
+ /// If you need to ingest additional file types or data sources, you can use the open-source [**Vectara Ingest**](https://github.com/vectara/vectara-ingest) Python framework. It supports connectors for websites, RSS feeds, CSV, Confluence, HubSpot, ServiceNow, Jira, Notion, Slack, MediaWiki, GitHub, SharePoint, Twitter/X, YouTube, and more.
+ /// :::caution
+ /// Vectara Ingest is provided as an open-source example and is not officially supported.
+ /// :::
+ /// ## Multipart form fields
+ /// This endpoint expects a `multipart/form-data` request with the following fields:
+ /// - **metadata** (optional): JSON metadata to attach to the parsed document.
+ /// Example: `metadata={"key":"value"}`
+ /// - **chunking_strategy** (optional): Controls how extracted text is chunked.
+ /// Defaults to sentence-based chunking (one chunk per sentence).
+ /// Example: `{"type":"sentence_chunking_strategy"}`.
+ /// Example for max character chunking: `{"type":"max_chars_chunking_strategy","max_chars_per_chunk":512}`
+ /// - **table_extraction_config** (optional): Enables extraction of tables from supported file types such as PDFs.
+ /// Example: `{"extract_tables": true}`
+ /// - **file** (required): The file to upload.
+ /// - **filename** (required): The desired document ID, specified within the file upload field.
+ /// Apart from these parameters, the servers expect a valid JWT Token in the HTTP headers:
+ /// ```curl
+ /// \$ curl -L -X POST 'https://api.vectara.io/v2/corpora/:corpus_key/upload_file' \
+ /// -H 'Content-Type: multipart/form-data' \
+ /// -H 'Accept: application/json' \
+ /// -H 'x-api-key: zwt_123456' \
+ /// -F 'metadata=\{"key": "value"\};type=application/json' \
+ /// -F 'file=@/path/to/file/file.pdf;filename=desired_filename.pdf'
+ /// ```
+ /// ## Filenames with non-ASCII characters
+ /// When uploading files with non-ASCII (non-English) characters, such as Russian or Chinese, ensure that the filename is URL encoded. The Vectara REST API follows web standards which require URL-encoded file names.
+ /// ## Set the document ID
+ ///
+ /// To set a custom Document ID, pass it as the filename in the `Content-Disposition` header:
+ /// `Content-Disposition: form-data; name="file"; filename="your_document_id"`
+ /// For more information about Content-Disposition, see the [Mozilla documentation on headers](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition).
+ /// ## Attach additional metadata
+ /// You can attach additional metadata to the file by specifying a metadata form field, which can contain a JSON string:
+ /// `{ "filesize": 1234 }`
+ /// ## Tabular data extraction and summarization
+ /// Setting `table_extraction_config.extract_tables = true` enables extraction of tabular data (such as financial filings such as 10-K, 10-Q, S-1). You can also apply custom prompt templates to summarize table content during upload.
+ /// :::caution
+ /// Table extraction does not support scanned images of tables.
+ /// :::
+ /// ## Custom table summarization with prompt templates
+ /// Vectara supports [table summarization using custom prompt templates](https://docs.vectara.com/docs/build/working-with-tables#summarize-tables-with-custom-prompts) during document upload. This lets you define custom prompt templates that control how the LLM interprets and summarizes table data during extraction. By customizing the prompt_template, you can tailor summaries for domain-specific language, analytical perspectives, or formatting preferences.
+ /// ## Image support
+ /// You can include images in structured documents using the [Indexing API](/docs/rest-api/create-corpus-document) with Base64 encoding. You cannot send images directly with individual query requests. If you want to retrieve a specific image that is embedded within a document, use the [Retrieve image API](/docs/rest-api/get-image) + ///
+ /// + /// + /// + /// A user-provided key for a corpus.
+ /// Example: my-corpus + /// + /// + /// Arbitrary object that will be attached as document metadata to the extracted document.
+ /// Example: {"department":"engineering","doc_type\u0022":"architecture_diagram"} + /// + /// + /// Choose how to split documents into chunks during indexing. This is optional - if you do not set a chunking strategy, the platform uses the default strategy which creates one chunk (docpart) per sentence. + /// + /// + /// Configuration for table extraction from the document. This is optional and if not provided, the platform does not extract tables from PDF files. + /// + /// + /// Optional multipart section to override the filename.
+ /// Example: system_design_v1.pdf + /// + /// + /// Binary file contents. The file name of the file will be used as the document ID. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task FileAsync( + string corpusKey, + global::System.IO.Stream file, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + object? metadata = default, + global::Vectara.ChunkingStrategy? chunkingStrategy = default, + global::Vectara.TableExtractionConfig? tableExtractionConfig = default, + string? filename = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Upload a file to the corpus
+ /// Upload a file to a corpus for automatic text extraction, chunking, and indexing. This endpoint is designed for unstructured documents where you want Vectara to handle parsing for you. Each uploaded file can be up to **10 MB**.
+ /// Supported file types include:
+ /// - Markdown (`.md`)
+ /// - PDF/A (`.pdf`)
+ /// - OpenOffice documents (`.odt`)
+ /// - Microsoft Word (`.doc`, `.docx`)
+ /// - Microsoft PowerPoint (`.ppt`, `.pptx`)
+ /// - Plain text (`.txt`)
+ /// - HTML (`.html`)
+ /// - LXML (`.lxml`)
+ /// - RTF (`.rtf`)
+ /// - EPUB (`.epub`)
+ /// - Email files (RFC 822)
+ /// :::note
+ /// For semi-structured documents that require more control over fields or metadata, use the [**Create Corpus Document API**](/docs/rest-api/create-corpus-document) instead.
+ /// :::
+ /// ## Additional format support through Vectara Ingest
+ /// If you need to ingest additional file types or data sources, you can use the open-source [**Vectara Ingest**](https://github.com/vectara/vectara-ingest) Python framework. It supports connectors for websites, RSS feeds, CSV, Confluence, HubSpot, ServiceNow, Jira, Notion, Slack, MediaWiki, GitHub, SharePoint, Twitter/X, YouTube, and more.
+ /// :::caution
+ /// Vectara Ingest is provided as an open-source example and is not officially supported.
+ /// :::
+ /// ## Multipart form fields
+ /// This endpoint expects a `multipart/form-data` request with the following fields:
+ /// - **metadata** (optional): JSON metadata to attach to the parsed document.
+ /// Example: `metadata={"key":"value"}`
+ /// - **chunking_strategy** (optional): Controls how extracted text is chunked.
+ /// Defaults to sentence-based chunking (one chunk per sentence).
+ /// Example: `{"type":"sentence_chunking_strategy"}`.
+ /// Example for max character chunking: `{"type":"max_chars_chunking_strategy","max_chars_per_chunk":512}`
+ /// - **table_extraction_config** (optional): Enables extraction of tables from supported file types such as PDFs.
+ /// Example: `{"extract_tables": true}`
+ /// - **file** (required): The file to upload.
+ /// - **filename** (required): The desired document ID, specified within the file upload field.
+ /// Apart from these parameters, the servers expect a valid JWT Token in the HTTP headers:
+ /// ```curl
+ /// \$ curl -L -X POST 'https://api.vectara.io/v2/corpora/:corpus_key/upload_file' \
+ /// -H 'Content-Type: multipart/form-data' \
+ /// -H 'Accept: application/json' \
+ /// -H 'x-api-key: zwt_123456' \
+ /// -F 'metadata=\{"key": "value"\};type=application/json' \
+ /// -F 'file=@/path/to/file/file.pdf;filename=desired_filename.pdf'
+ /// ```
+ /// ## Filenames with non-ASCII characters
+ /// When uploading files with non-ASCII (non-English) characters, such as Russian or Chinese, ensure that the filename is URL encoded. The Vectara REST API follows web standards which require URL-encoded file names.
+ /// ## Set the document ID
+ ///
+ /// To set a custom Document ID, pass it as the filename in the `Content-Disposition` header:
+ /// `Content-Disposition: form-data; name="file"; filename="your_document_id"`
+ /// For more information about Content-Disposition, see the [Mozilla documentation on headers](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition).
+ /// ## Attach additional metadata
+ /// You can attach additional metadata to the file by specifying a metadata form field, which can contain a JSON string:
+ /// `{ "filesize": 1234 }`
+ /// ## Tabular data extraction and summarization
+ /// Setting `table_extraction_config.extract_tables = true` enables extraction of tabular data (such as financial filings such as 10-K, 10-Q, S-1). You can also apply custom prompt templates to summarize table content during upload.
+ /// :::caution
+ /// Table extraction does not support scanned images of tables.
+ /// :::
+ /// ## Custom table summarization with prompt templates
+ /// Vectara supports [table summarization using custom prompt templates](https://docs.vectara.com/docs/build/working-with-tables#summarize-tables-with-custom-prompts) during document upload. This lets you define custom prompt templates that control how the LLM interprets and summarizes table data during extraction. By customizing the prompt_template, you can tailor summaries for domain-specific language, analytical perspectives, or formatting preferences.
+ /// ## Image support
+ /// You can include images in structured documents using the [Indexing API](/docs/rest-api/create-corpus-document) with Base64 encoding. You cannot send images directly with individual query requests. If you want to retrieve a specific image that is embedded within a document, use the [Retrieve image API](/docs/rest-api/get-image) + ///
+ /// + /// + /// + /// A user-provided key for a corpus.
+ /// Example: my-corpus + /// + /// + /// Arbitrary object that will be attached as document metadata to the extracted document.
+ /// Example: {"department":"engineering","doc_type\u0022":"architecture_diagram"} + /// + /// + /// Choose how to split documents into chunks during indexing. This is optional - if you do not set a chunking strategy, the platform uses the default strategy which creates one chunk (docpart) per sentence. + /// + /// + /// Configuration for table extraction from the document. This is optional and if not provided, the platform does not extract tables from PDF files. + /// + /// + /// Optional multipart section to override the filename.
+ /// Example: system_design_v1.pdf + /// + /// + /// Binary file contents. The file name of the file will be used as the document ID. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> FileAsResponseAsync( + string corpusKey, + global::System.IO.Stream file, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + object? metadata = default, + global::Vectara.ChunkingStrategy? chunkingStrategy = default, + global::Vectara.TableExtractionConfig? tableExtractionConfig = default, + string? filename = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IUsersClient.Create.g.cs b/src/libs/Vectara/Generated/Vectara.IUsersClient.Create.g.cs index 5d2dc43c..7bea2d14 100644 --- a/src/libs/Vectara/Generated/Vectara.IUsersClient.Create.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IUsersClient.Create.g.cs @@ -27,6 +27,23 @@ public partial interface IUsersClient /// /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> CreateAsResponseAsync( + + global::Vectara.CreateUserRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create a user in the current customer account
+ /// Create a user for the current customer account. For example, a company wants to onboard new team members efficiently and this endpoint lets you streamline the process by adding new users programmatically, assigning appropriate roles, and setting up access permissions. + ///
+ /// + /// /// /// The email address for the user. /// diff --git a/src/libs/Vectara/Generated/Vectara.IUsersClient.Delete.g.cs b/src/libs/Vectara/Generated/Vectara.IUsersClient.Delete.g.cs index 61701886..6c56e418 100644 --- a/src/libs/Vectara/Generated/Vectara.IUsersClient.Delete.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IUsersClient.Delete.g.cs @@ -20,5 +20,21 @@ public partial interface IUsersClient int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete a user
+ /// Delete a user from the account. + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeleteAsResponseAsync( + string username, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IUsersClient.Get.g.cs b/src/libs/Vectara/Generated/Vectara.IUsersClient.Get.g.cs index 70367517..45d4640f 100644 --- a/src/libs/Vectara/Generated/Vectara.IUsersClient.Get.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IUsersClient.Get.g.cs @@ -20,5 +20,21 @@ public partial interface IUsersClient int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get a user
+ /// Get a user and view details like the email, username, and associated roles. + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetAsResponseAsync( + string username, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IUsersClient.List.g.cs b/src/libs/Vectara/Generated/Vectara.IUsersClient.List.g.cs index 0f47e36c..67bb43f7 100644 --- a/src/libs/Vectara/Generated/Vectara.IUsersClient.List.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IUsersClient.List.g.cs @@ -30,5 +30,31 @@ public partial interface IUsersClient string? corpusKey = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List users in the account
+ /// The List Users API lets you list all users on your team and also their corpus access and customer-level authorizations.
+ /// Other activities such as adding, deleting, enabling, disabling, resetting passwords, and editing user roles are performed by the [Update User](/docs/rest-api/update-user) endpoint. + ///
+ /// + /// + /// + /// Default Value: 10 + /// + /// + /// + /// A user-provided key for a corpus.
+ /// Example: my-corpus + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListAsResponseAsync( + int? requestTimeout = default, + int? requestTimeoutMillis = default, + int? limit = default, + string? pageKey = default, + string? corpusKey = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IUsersClient.ResetPassword.g.cs b/src/libs/Vectara/Generated/Vectara.IUsersClient.ResetPassword.g.cs index c1ed8cf4..4c6efc75 100644 --- a/src/libs/Vectara/Generated/Vectara.IUsersClient.ResetPassword.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IUsersClient.ResetPassword.g.cs @@ -20,5 +20,21 @@ public partial interface IUsersClient int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Reset the password for a user
+ /// Reset the password for a user. + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ResetPasswordAsResponseAsync( + string username, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IUsersClient.Update.g.cs b/src/libs/Vectara/Generated/Vectara.IUsersClient.Update.g.cs index 8a600fe1..af232e70 100644 --- a/src/libs/Vectara/Generated/Vectara.IUsersClient.Update.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IUsersClient.Update.g.cs @@ -30,6 +30,25 @@ public partial interface IUsersClient /// /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UpdateAsResponseAsync( + string username, + + global::Vectara.UpdateUserRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update a user
+ /// Update details about a user such as role names. + ///
+ /// + /// + /// /// /// Indicates whether to enable or disable the user. /// diff --git a/src/libs/Vectara/Generated/Vectara.InstructionsClient.Create.g.cs b/src/libs/Vectara/Generated/Vectara.InstructionsClient.Create.g.cs index 24b0968d..3ff1b73c 100644 --- a/src/libs/Vectara/Generated/Vectara.InstructionsClient.Create.g.cs +++ b/src/libs/Vectara/Generated/Vectara.InstructionsClient.Create.g.cs @@ -108,6 +108,70 @@ partial void ProcessCreateResponseContent( /// public async global::System.Threading.Tasks.Task CreateAsync( + global::Vectara.CreateInstructionRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateAsResponseAsync( + + request: request, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create instruction
+ /// Create a new instruction that defines how an agent should behave, reason, and respond. Instructions act as system-level guidelines that shape the agent's tone, style, constraints, and tool usage.
+ /// Instructions support dynamic content using the Apache Velocity templating engine. Velocity variables allow instructions to reference runtime context:
+ /// - `\$\tools`: The list of tools available to the agent.
+ /// - `\$\{session.metadata.field}`: Session-level metadata (user context, permissions, preferences).
+ /// - `\$\{agent.metadata.field}`: Agent-level metadata (configuration or environment).
+ /// Example tool iteration:
+ /// ```velocity
+ /// You have access to the following tools:
+ /// \#foreach(\$\tool in $tools)
+ /// - \$\{tool.name}: \$\{tool.description}
+ /// #end
+ /// ```
+ /// :::tip Tips for effective instruction design
+ /// Instructions are one of the most critical parts of an agent's design. Best practices vary by model, but at a minimum you should provide clear guidance on what tools are available, what output format is desired, and what steps to follow for common queries. Instructions typically need to be iterated on and tested over time.
+ /// For guidance on writing effective instructions, see:
+ /// - [Claude Prompt Engineering](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/overview)
+ /// - [OpenAI Prompt Engineering](https://platform.openai.com/docs/guides/prompt-engineering)
+ /// :::
+ /// Metadata can personalize behavior at runtime. For example:
+ /// ```velocity
+ /// Hello ${session.metadata.user_name}, how can I help with ${session.metadata.department} today?
+ /// ```
+ /// **Example request:**
+ /// ```json
+ /// {
+ /// "name": "Customer Support Tone and Style Guide",
+ /// "description": "Defines tone and behavior for customer interactions.",
+ /// "template": "You are a customer support agent for the ${session.metadata.department} department.",
+ /// "enabled": true,
+ /// "metadata": {
+ /// "owner": "customer-support-team",
+ /// "version": "1.0.0"
+ /// }
+ /// }
+ /// ```
+ /// A successful response returns the full instruction definition, including its unique ID, version, and timestamps. + ///
+ /// + /// + /// + /// 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> CreateAsResponseAsync( + global::Vectara.CreateInstructionRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, @@ -144,6 +208,7 @@ partial void ProcessCreateResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: "/v2/instructions", baseUri: HttpClient.BaseAddress); @@ -235,6 +300,8 @@ partial void ProcessCreateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -248,6 +315,11 @@ partial void ProcessCreateResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -265,6 +337,8 @@ partial void ProcessCreateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -274,8 +348,7 @@ partial void ProcessCreateResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -284,6 +357,11 @@ partial void ProcessCreateResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -300,14 +378,15 @@ partial void ProcessCreateResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -347,6 +426,8 @@ partial void ProcessCreateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -367,6 +448,8 @@ partial void ProcessCreateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Instruction creation request was malformed or contains invalid content. @@ -467,9 +550,13 @@ partial void ProcessCreateResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.Instruction.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.Instruction.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -497,9 +584,13 @@ partial void ProcessCreateResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.Instruction.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.Instruction.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.InstructionsClient.Delete.g.cs b/src/libs/Vectara/Generated/Vectara.InstructionsClient.Delete.g.cs index 3655a097..0ce9f629 100644 --- a/src/libs/Vectara/Generated/Vectara.InstructionsClient.Delete.g.cs +++ b/src/libs/Vectara/Generated/Vectara.InstructionsClient.Delete.g.cs @@ -78,6 +78,37 @@ partial void ProcessDeleteResponse( int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await DeleteAsResponseAsync( + instructionId: instructionId, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Delete instruction
+ /// Permanently delete an instruction and all its associated configuration.
+ /// :::warning
+ /// This action cannot be undone. Agents currently using this instruction may fail or behave unexpectedly. Update agents to use different instructions before deleting.
+ /// ::: + ///
+ /// + /// + /// + /// The unique identifier for an instruction.
+ /// Example: ins_customer_support_init + /// + /// 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 DeleteAsResponseAsync( + string instructionId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -109,6 +140,7 @@ partial void ProcessDeleteResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/instructions/{instructionId}", baseUri: HttpClient.BaseAddress); @@ -194,6 +226,8 @@ partial void ProcessDeleteResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -207,6 +241,11 @@ partial void ProcessDeleteResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -224,6 +263,8 @@ partial void ProcessDeleteResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -233,8 +274,7 @@ partial void ProcessDeleteResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -243,6 +283,11 @@ partial void ProcessDeleteResponse( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -259,14 +304,15 @@ partial void ProcessDeleteResponse( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -306,6 +352,8 @@ partial void ProcessDeleteResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -326,6 +374,8 @@ partial void ProcessDeleteResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow deleting this instruction. @@ -422,6 +472,10 @@ partial void ProcessDeleteResponse( { __response.EnsureSuccessStatusCode(); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -443,6 +497,10 @@ partial void ProcessDeleteResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.InstructionsClient.DeleteVersion.g.cs b/src/libs/Vectara/Generated/Vectara.InstructionsClient.DeleteVersion.g.cs index c9a55543..957416ee 100644 --- a/src/libs/Vectara/Generated/Vectara.InstructionsClient.DeleteVersion.g.cs +++ b/src/libs/Vectara/Generated/Vectara.InstructionsClient.DeleteVersion.g.cs @@ -81,6 +81,39 @@ partial void ProcessDeleteVersionResponse( int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await DeleteVersionAsResponseAsync( + instructionId: instructionId, + version: version, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Delete instruction version
+ /// Permanently delete the specified version of the instruction. This action cannot be undone. + ///
+ /// + /// + /// + /// The unique identifier for an instruction.
+ /// Example: ins_customer_support_init + /// + /// + /// Example: 1 + /// + /// 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 DeleteVersionAsResponseAsync( + string instructionId, + int version, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -113,6 +146,7 @@ partial void ProcessDeleteVersionResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/instructions/{instructionId}/versions/{version}", baseUri: HttpClient.BaseAddress); @@ -199,6 +233,8 @@ partial void ProcessDeleteVersionResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -212,6 +248,11 @@ partial void ProcessDeleteVersionResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -229,6 +270,8 @@ partial void ProcessDeleteVersionResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -238,8 +281,7 @@ partial void ProcessDeleteVersionResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -248,6 +290,11 @@ partial void ProcessDeleteVersionResponse( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -264,14 +311,15 @@ partial void ProcessDeleteVersionResponse( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -311,6 +359,8 @@ partial void ProcessDeleteVersionResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -331,6 +381,8 @@ partial void ProcessDeleteVersionResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow deleting this instruction. @@ -465,6 +517,10 @@ partial void ProcessDeleteVersionResponse( { __response.EnsureSuccessStatusCode(); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -486,6 +542,10 @@ partial void ProcessDeleteVersionResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.InstructionsClient.Get.g.cs b/src/libs/Vectara/Generated/Vectara.InstructionsClient.Get.g.cs index 8daec923..b2986598 100644 --- a/src/libs/Vectara/Generated/Vectara.InstructionsClient.Get.g.cs +++ b/src/libs/Vectara/Generated/Vectara.InstructionsClient.Get.g.cs @@ -86,6 +86,41 @@ partial void ProcessGetResponseContent( int? version = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetAsResponseAsync( + instructionId: instructionId, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + version: version, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get instruction
+ /// Retrieve the full definition of a specific instruction, including its template, metadata, enabled status, and version. Instruction templates may contain Velocity expressions that reference tools and metadata. If no version is specified, the latest version is returned. + ///
+ /// + /// + /// + /// The unique identifier for an instruction.
+ /// Example: ins_customer_support_init + /// + /// + /// Example: 1 + /// + /// 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> GetAsResponseAsync( + string instructionId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + int? version = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -118,11 +153,12 @@ partial void ProcessGetResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/instructions/{instructionId}", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder - .AddOptionalParameter("version", version?.ToString()) + .AddOptionalParameter("version", version?.ToString()) ; var __path = __pathBuilder.ToString(); __path = global::Vectara.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -207,6 +243,8 @@ partial void ProcessGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -220,6 +258,11 @@ partial void ProcessGetResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -237,6 +280,8 @@ partial void ProcessGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -246,8 +291,7 @@ partial void ProcessGetResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -256,6 +300,11 @@ partial void ProcessGetResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -272,14 +321,15 @@ partial void ProcessGetResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -319,6 +369,8 @@ partial void ProcessGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -339,6 +391,8 @@ partial void ProcessGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow accessing this instruction. @@ -439,9 +493,13 @@ partial void ProcessGetResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.Instruction.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.Instruction.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -469,9 +527,13 @@ partial void ProcessGetResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.Instruction.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.Instruction.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.InstructionsClient.List.g.cs b/src/libs/Vectara/Generated/Vectara.InstructionsClient.List.g.cs index 2545048b..941ac257 100644 --- a/src/libs/Vectara/Generated/Vectara.InstructionsClient.List.g.cs +++ b/src/libs/Vectara/Generated/Vectara.InstructionsClient.List.g.cs @@ -101,6 +101,53 @@ partial void ProcessListResponseContent( string? pageKey = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListAsResponseAsync( + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + filter: filter, + type: type, + enabled: enabled, + limit: limit, + pageKey: pageKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List instructions
+ /// List all instructions available to the authenticated user, with optional filtering and pagination. This endpoint returns high-level information about each instruction, including name, status, and version details. + ///
+ /// + /// + /// + /// Example: support.* + /// + /// + /// Example: initial + /// + /// + /// Example: true + /// + /// + /// Default Value: 10 + /// + /// + /// 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> ListAsResponseAsync( + int? requestTimeout = default, + int? requestTimeoutMillis = default, + string? filter = default, + global::Vectara.ListInstructionsType? type = default, + bool? enabled = default, + int? limit = default, + string? pageKey = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -136,15 +183,16 @@ partial void ProcessListResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: "/v2/instructions", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("filter", filter) .AddOptionalParameter("type", type?.ToValueString()) .AddOptionalParameter("enabled", enabled?.ToString().ToLowerInvariant()) .AddOptionalParameter("limit", limit?.ToString()) - .AddOptionalParameter("page_key", pageKey) + .AddOptionalParameter("page_key", pageKey) ; var __path = __pathBuilder.ToString(); __path = global::Vectara.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -232,6 +280,8 @@ partial void ProcessListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -245,6 +295,11 @@ partial void ProcessListResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -262,6 +317,8 @@ partial void ProcessListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -271,8 +328,7 @@ partial void ProcessListResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -281,6 +337,11 @@ partial void ProcessListResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -297,14 +358,15 @@ partial void ProcessListResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -344,6 +406,8 @@ partial void ProcessListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -364,6 +428,8 @@ partial void ProcessListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow listing instructions. @@ -426,9 +492,13 @@ partial void ProcessListResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.ListInstructionsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.ListInstructionsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -456,9 +526,13 @@ partial void ProcessListResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.ListInstructionsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.ListInstructionsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.InstructionsClient.Test.g.cs b/src/libs/Vectara/Generated/Vectara.InstructionsClient.Test.g.cs index 79daea19..18768d35 100644 --- a/src/libs/Vectara/Generated/Vectara.InstructionsClient.Test.g.cs +++ b/src/libs/Vectara/Generated/Vectara.InstructionsClient.Test.g.cs @@ -85,6 +85,46 @@ partial void ProcessTestResponseContent( public async global::System.Threading.Tasks.Task TestAsync( string instructionId, + global::Vectara.TestInstructionRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + int? version = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await TestAsResponseAsync( + instructionId: instructionId, + + request: request, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + version: version, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Test instruction
+ /// Test an instruction template using supplied context and available tools. This endpoint evaluates Velocity expressions such as `$tools`, `${session.metadata.field}`, or `${agent.metadata.field}`, and returns the fully rendered template output. Use this operation to validate formatting, logic, or metadata-dependent behavior before deploying instructions to agents. + ///
+ /// + /// + /// + /// The unique identifier for an instruction.
+ /// Example: ins_customer_support_init + /// + /// + /// Example: 1 + /// + /// + /// 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> TestAsResponseAsync( + string instructionId, + global::Vectara.TestInstructionRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, @@ -126,11 +166,12 @@ partial void ProcessTestResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/instructions/{instructionId}/test", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder - .AddOptionalParameter("version", version?.ToString()) + .AddOptionalParameter("version", version?.ToString()) ; var __path = __pathBuilder.ToString(); __path = global::Vectara.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -222,6 +263,8 @@ partial void ProcessTestResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -235,6 +278,11 @@ partial void ProcessTestResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -252,6 +300,8 @@ partial void ProcessTestResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -261,8 +311,7 @@ partial void ProcessTestResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -271,6 +320,11 @@ partial void ProcessTestResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -287,14 +341,15 @@ partial void ProcessTestResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -334,6 +389,8 @@ partial void ProcessTestResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -354,6 +411,8 @@ partial void ProcessTestResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Test request was malformed. @@ -530,9 +589,13 @@ partial void ProcessTestResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.TestInstructionResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.TestInstructionResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -560,9 +623,13 @@ partial void ProcessTestResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.TestInstructionResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.TestInstructionResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.InstructionsClient.Update.g.cs b/src/libs/Vectara/Generated/Vectara.InstructionsClient.Update.g.cs index 145d6fa3..4f23b4df 100644 --- a/src/libs/Vectara/Generated/Vectara.InstructionsClient.Update.g.cs +++ b/src/libs/Vectara/Generated/Vectara.InstructionsClient.Update.g.cs @@ -88,6 +88,49 @@ partial void ProcessUpdateResponseContent( public async global::System.Threading.Tasks.Task UpdateAsync( string instructionId, + global::Vectara.UpdateInstructionRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdateAsResponseAsync( + instructionId: instructionId, + + request: request, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update instruction
+ /// Update an existing instruction's template, metadata, and configuration. Updated templates may include Velocity variables such as `$tools` or metadata references. Each update creates a new version, allowing agents to continue using existing versions until explicitly changed.
+ /// ::info Version Management
+ /// Agents referencing a specific version continue to use it until updated. Agents without a pinned version always use the latest.
+ /// :::
+ /// ## Disable an instruction
+ /// This endpoint can also be used to disable an instruction without deleting it.
+ /// :::warning
+ /// Disabling an instruction prevents it from being added to new agents, but agents already using it continue to operate normally.
+ /// ::: + ///
+ /// + /// + /// + /// The unique identifier for an instruction.
+ /// Example: ins_customer_support_init + /// + /// + /// 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> UpdateAsResponseAsync( + string instructionId, + global::Vectara.UpdateInstructionRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, @@ -125,6 +168,7 @@ partial void ProcessUpdateResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/instructions/{instructionId}", baseUri: HttpClient.BaseAddress); @@ -217,6 +261,8 @@ partial void ProcessUpdateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -230,6 +276,11 @@ partial void ProcessUpdateResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -247,6 +298,8 @@ partial void ProcessUpdateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -256,8 +309,7 @@ partial void ProcessUpdateResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -266,6 +318,11 @@ partial void ProcessUpdateResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -282,14 +339,15 @@ partial void ProcessUpdateResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -329,6 +387,8 @@ partial void ProcessUpdateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -349,6 +409,8 @@ partial void ProcessUpdateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Instruction update request was malformed or contains invalid content. @@ -487,9 +549,13 @@ partial void ProcessUpdateResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.Instruction.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.Instruction.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -517,9 +583,13 @@ partial void ProcessUpdateResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.Instruction.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.Instruction.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.InstructionsClient.g.cs b/src/libs/Vectara/Generated/Vectara.InstructionsClient.g.cs index 90152753..e04d0a8c 100644 --- a/src/libs/Vectara/Generated/Vectara.InstructionsClient.g.cs +++ b/src/libs/Vectara/Generated/Vectara.InstructionsClient.g.cs @@ -75,10 +75,10 @@ public InstructionsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public InstructionsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Vectara.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Vectara.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Vectara/Generated/Vectara.JobsClient.Get.g.cs b/src/libs/Vectara/Generated/Vectara.JobsClient.Get.g.cs index e5529395..eac8a56d 100644 --- a/src/libs/Vectara/Generated/Vectara.JobsClient.Get.g.cs +++ b/src/libs/Vectara/Generated/Vectara.JobsClient.Get.g.cs @@ -77,6 +77,33 @@ partial void ProcessGetResponseContent( int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetAsResponseAsync( + jobId: jobId, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get a job by ID
+ /// Get a job by a specific `job_id`. Jobs are background processes like replacing the filterable metadata attributes. + ///
+ /// + /// + /// + /// 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> GetAsResponseAsync( + string jobId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -108,6 +135,7 @@ partial void ProcessGetResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/jobs/{jobId}", baseUri: HttpClient.BaseAddress); @@ -193,6 +221,8 @@ partial void ProcessGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -206,6 +236,11 @@ partial void ProcessGetResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -223,6 +258,8 @@ partial void ProcessGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -232,8 +269,7 @@ partial void ProcessGetResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -242,6 +278,11 @@ partial void ProcessGetResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -258,14 +299,15 @@ partial void ProcessGetResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -305,6 +347,8 @@ partial void ProcessGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -325,6 +369,8 @@ partial void ProcessGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow retrieving a job. @@ -425,9 +471,13 @@ partial void ProcessGetResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.Job.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.Job.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -455,9 +505,13 @@ partial void ProcessGetResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.Job.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.Job.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.JobsClient.List.g.cs b/src/libs/Vectara/Generated/Vectara.JobsClient.List.g.cs index 73ae8815..2e4ce3b7 100644 --- a/src/libs/Vectara/Generated/Vectara.JobsClient.List.g.cs +++ b/src/libs/Vectara/Generated/Vectara.JobsClient.List.g.cs @@ -95,6 +95,47 @@ partial void ProcessListResponseContent( string? pageKey = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListAsResponseAsync( + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + corpusKey: corpusKey, + after: after, + state: state, + limit: limit, + pageKey: pageKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List jobs
+ /// List jobs for the account. Jobs are background processes like replacing the filterable metadata attributes. + ///
+ /// + /// + /// + /// + /// + /// + /// Default Value: 10 + /// + /// + /// 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> ListAsResponseAsync( + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::System.Collections.Generic.IList? corpusKey = default, + global::System.DateTime? after = default, + global::System.Collections.Generic.IList? state = default, + int? limit = default, + string? pageKey = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -130,15 +171,16 @@ partial void ProcessListResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: "/v2/jobs", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("corpus_key", corpusKey, delimiter: ",", explode: true) .AddOptionalParameter("after", after?.ToString("yyyy-MM-ddTHH:mm:ssZ")) .AddOptionalParameter("state", state, selector: static x => x.ToValueString(), delimiter: ",", explode: true) .AddOptionalParameter("limit", limit?.ToString()) - .AddOptionalParameter("page_key", pageKey) + .AddOptionalParameter("page_key", pageKey) ; var __path = __pathBuilder.ToString(); __path = global::Vectara.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -226,6 +268,8 @@ partial void ProcessListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -239,6 +283,11 @@ partial void ProcessListResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -256,6 +305,8 @@ partial void ProcessListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -265,8 +316,7 @@ partial void ProcessListResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -275,6 +325,11 @@ partial void ProcessListResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -291,14 +346,15 @@ partial void ProcessListResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -338,6 +394,8 @@ partial void ProcessListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -358,6 +416,8 @@ partial void ProcessListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow listing jobs. @@ -420,9 +480,13 @@ partial void ProcessListResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.ListJobsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.ListJobsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -450,9 +514,13 @@ partial void ProcessListResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.ListJobsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.ListJobsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.JobsClient.g.cs b/src/libs/Vectara/Generated/Vectara.JobsClient.g.cs index f0052243..d5185f63 100644 --- a/src/libs/Vectara/Generated/Vectara.JobsClient.g.cs +++ b/src/libs/Vectara/Generated/Vectara.JobsClient.g.cs @@ -75,10 +75,10 @@ public JobsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public JobsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Vectara.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Vectara.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Vectara/Generated/Vectara.LlmClient.ChatCompletion.g.cs b/src/libs/Vectara/Generated/Vectara.LlmClient.ChatCompletion.g.cs index 6b342dbe..29fc938a 100644 --- a/src/libs/Vectara/Generated/Vectara.LlmClient.ChatCompletion.g.cs +++ b/src/libs/Vectara/Generated/Vectara.LlmClient.ChatCompletion.g.cs @@ -114,6 +114,76 @@ partial void ProcessChatCompletionResponseContent( /// public async global::System.Threading.Tasks.Task ChatCompletionAsync( + global::Vectara.CreateChatCompletionRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ChatCompletionAsResponseAsync( + + request: request, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Creates a model response for the given chat conversation
+ /// The Chat Completions API provides an OpenAI-compatible interface for generating model responses in multi-turn chat conversations. This API enables you to integrate our language models directly into applications designed to work with the OpenAI Chat Completions format, making it easy to leverage Vectara capabilities with minimal changes to existing tools or code.
+ /// Use this API to enable interactive chat experiences that support context-aware responses, streaming output, and token usage tracking.
+ /// The request includes a series of chat messages and optional parameters that control the behavior and structure of the model response. The request body must include the `messages` parameter, an array of message objects (role, content) representing the full conversation so far.
+ /// ### Streaming responses
+ /// If the `stream` parameter is set to `true`, the response appears as a series of text/event-stream parts (also known as chunks). Each chunk includes a `delta` field showing the incremental message update.
+ /// ### Example request
+ /// This example sends a simple chat conversation to the API, asking the assistant for the capital of France. The request includes a system prompt, a user message, and a temperature setting for response variability.
+ /// ```json
+ /// {
+ /// "model": "chat-model-001","messages": [{ "role": "system", "content": "You are a helpful assistant." },
+ /// { "role": "user", "content": "What is the capital of France?" }
+ /// ],
+ /// "temperature": 0.7,
+ /// "stream": false
+ /// }
+ /// ```
+ /// ### Example response
+ /// The response includes a generated reply from the assistant, along with token usage statistics. In this example, the model returns a direct answer to a user question.
+ /// ```json
+ /// {
+ /// "id": "chatcmpl-abc123",}
+ /// "object": "chat.completion",
+ /// "created": 1712454830,
+ /// "model": "chat-model-001",
+ /// "choices": [
+ /// {
+ /// "index": 0,
+ /// "message": {
+ /// "role": "assistant",
+ /// "content": "The capital of France is Paris."
+ /// },
+ /// "finish_reason": "stop"
+ /// }
+ /// ],
+ /// "usage": {
+ /// "prompt_tokens": 21,
+ /// "completion_tokens": 9,
+ /// "total_tokens": 30
+ /// }
+ /// }
+ /// ```
+ /// If the input summary is accurate, the `corrected_summary` matches the `original_summary`. + ///
+ /// + /// + /// + /// 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> ChatCompletionAsResponseAsync( + global::Vectara.CreateChatCompletionRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, @@ -155,10 +225,11 @@ partial void ProcessChatCompletionResponseContent( var __maxAttempts = global::Vectara.AutoSDKRequestOptionsSupport.GetMaxAttempts( clientOptions: Options, requestOptions: requestOptions, - supportsRetry: true); + supportsRetry: false); global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: "/v2/llms/chat/completions", baseUri: HttpClient.BaseAddress); @@ -250,6 +321,8 @@ partial void ProcessChatCompletionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -263,6 +336,11 @@ partial void ProcessChatCompletionResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -280,6 +358,8 @@ partial void ProcessChatCompletionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -289,8 +369,7 @@ partial void ProcessChatCompletionResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -299,6 +378,11 @@ partial void ProcessChatCompletionResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -315,14 +399,15 @@ partial void ProcessChatCompletionResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -362,6 +447,8 @@ partial void ProcessChatCompletionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -382,6 +469,8 @@ partial void ProcessChatCompletionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Chat completion request was malformed. @@ -482,9 +571,13 @@ partial void ProcessChatCompletionResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.CreateChatCompletionResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.CreateChatCompletionResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -512,9 +605,13 @@ partial void ProcessChatCompletionResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.CreateChatCompletionResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.CreateChatCompletionResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.LlmClient.ChatCompletionAsStream.g.cs b/src/libs/Vectara/Generated/Vectara.LlmClient.ChatCompletionAsStream.g.cs index 97d5e1f7..94f62c36 100644 --- a/src/libs/Vectara/Generated/Vectara.LlmClient.ChatCompletionAsStream.g.cs +++ b/src/libs/Vectara/Generated/Vectara.LlmClient.ChatCompletionAsStream.g.cs @@ -150,10 +150,11 @@ partial void ProcessChatCompletionAsStreamResponse( var __maxAttempts = global::Vectara.AutoSDKRequestOptionsSupport.GetMaxAttempts( clientOptions: Options, requestOptions: requestOptions, - supportsRetry: true); + supportsRetry: false); global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: "/v2/llms/chat/completions", baseUri: HttpClient.BaseAddress); @@ -245,6 +246,8 @@ partial void ProcessChatCompletionAsStreamResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -258,6 +261,11 @@ partial void ProcessChatCompletionAsStreamResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -275,6 +283,8 @@ partial void ProcessChatCompletionAsStreamResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -284,8 +294,7 @@ partial void ProcessChatCompletionAsStreamResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -294,6 +303,11 @@ partial void ProcessChatCompletionAsStreamResponse( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -310,14 +324,15 @@ partial void ProcessChatCompletionAsStreamResponse( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -357,6 +372,8 @@ partial void ProcessChatCompletionAsStreamResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -377,6 +394,8 @@ partial void ProcessChatCompletionAsStreamResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } diff --git a/src/libs/Vectara/Generated/Vectara.LlmClient.g.cs b/src/libs/Vectara/Generated/Vectara.LlmClient.g.cs index f6c5059b..49abfd77 100644 --- a/src/libs/Vectara/Generated/Vectara.LlmClient.g.cs +++ b/src/libs/Vectara/Generated/Vectara.LlmClient.g.cs @@ -75,10 +75,10 @@ public LlmClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public LlmClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Vectara.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Vectara.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Vectara/Generated/Vectara.LlmsClient.Create.g.cs b/src/libs/Vectara/Generated/Vectara.LlmsClient.Create.g.cs index 2d5105af..d168da54 100644 --- a/src/libs/Vectara/Generated/Vectara.LlmsClient.Create.g.cs +++ b/src/libs/Vectara/Generated/Vectara.LlmsClient.Create.g.cs @@ -197,6 +197,159 @@ partial void ProcessCreateResponseContent( /// public async global::System.Threading.Tasks.Task CreateAsync( + global::Vectara.CreateLLMRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateAsResponseAsync( + + request: request, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create an LLM
+ /// Integrate external Large Language Models (LLMs) into Vectara for Retrieval Augmented Generation (RAG) and chat. Connect OpenAI API-compatible models from providers like Anthropic, Azure, Google, or custom-hosted endpoints. Once created, reference your custom LLM by name in query generation parameters.
+ /// - Connect external LLMs using OpenAI-compatible API format
+ /// - Configure multiple LLM providers for different use cases
+ /// - Override Vectara's built-in LLMs with your own models
+ /// - Use custom models for RAG, chat, and document summarization
+ /// **Example providers:**
+ /// ### OpenAI
+ /// **Type:** `openai-compatible`
+ /// **Models:** GPT-4o, GPT-5
+ /// **Auth:** Bearer token
+ /// ```json
+ /// {
+ /// "type": "openai-compatible",
+ /// "name": "my-gpt5",
+ /// "model": "gpt-5",
+ /// "uri": "https://api.openai.com/v1/chat/completions",
+ /// "auth": {
+ /// "type": "bearer",
+ /// "token": "sk-..."
+ /// }
+ /// }
+ /// ```
+ /// ### OpenAI Responses API
+ /// **Type**: openai-responses
+ /// **Models**: o1-preview, o1-mini, o3-mini (reasoning models)
+ /// **Auth**: Bearer token
+ /// **Note**: For reasoning models that don't support streaming
+ /// ```json
+ /// {
+ /// "type": "openai-responses",
+ /// "name": "my-o1",
+ /// "model": "o1-preview",
+ /// "uri": "https://api.openai.com/v1/chat/completions",
+ /// "auth": {
+ /// "type": "bearer",
+ /// "token": "sk-..."
+ /// }
+ /// }
+ /// ```
+ /// ### Anthropic Claude
+ /// **Type:** `openai-compatible`
+ /// **Models:** claude-4-opus, claude-4-5-haiku, claude-4-5-sonnet
+ /// **Auth:** Bearer token with header
+ /// ```json
+ /// {
+ /// "type": "openai-compatible",
+ /// "name": "my-claude",
+ /// "model": "claude-sonnet-4-5-20250929",
+ /// "uri": "https://api.anthropic.com/v1/messages",
+ /// "auth": {
+ /// "type": "bearer",
+ /// "token": "sk-ant-..."
+ /// },
+ /// "headers": {
+ /// "anthropic-version": "2023-06-01"
+ /// }
+ /// }
+ /// ```
+ /// ### Azure OpenAI
+ /// **Type:** `openai-compatible`
+ /// **Models:** GPT-3.5, GPT-4 (Azure-deployed versions)
+ /// **Auth:** Custom header (api-key)
+ /// ```json
+ /// {
+ /// "type": "openai-compatible",
+ /// "name": "my-azure-gpt4",
+ /// "model": "gpt-4",
+ /// "uri": "https://YOUR-RESOURCE.openai.azure.com/openai/deployments/YOUR-DEPLOYMENT/chat/completions?api-version=2024-02-15-preview",
+ /// "auth": {
+ /// "type": "header",
+ /// "header": "api-key",
+ /// "value": "your-azure-key"
+ /// }
+ /// }
+ /// ```
+ /// ### Google Vertex AI (Gemini) — Service Account
+ /// **Type:** `vertex-ai`
+ /// **Models:** gemini-2.5-pro, gemini-2.5-flash
+ /// **Auth:** Service account
+ /// ```json
+ /// {
+ /// "type": "vertex-ai",
+ /// "name": "my-gemini",
+ /// "model": "gemini-2.5-flash",
+ /// "uri": "https://us-central1-aiplatform.googleapis.com/v1/projects/YOUR-PROJECT/locations/us-central1",
+ /// "auth": {
+ /// "type": "service_account",
+ /// "key_json": "{...service account JSON...}"
+ /// }
+ /// }
+ /// ```
+ /// ### Google AI Studio (Gemini) — API Key
+ /// **Type:** `vertex-ai`
+ /// **Models:** gemini-2.5-pro, gemini-2.5-flash
+ /// **Auth:** API key
+ /// ```json
+ /// {
+ /// "type": "vertex-ai",
+ /// "name": "my-gemini",
+ /// "model": "gemini-2.5-flash",
+ /// "uri": "https://generativelanguage.googleapis.com/v1beta",
+ /// "auth": {
+ /// "type": "api_key",
+ /// "api_key": "your-google-api-key"
+ /// }
+ /// }
+ /// ```
+ /// The `uri` field is flexible — you can provide a base URI or a full URL copied from Google docs
+ /// (including model path and `:generateContent` suffix). The system normalizes it automatically.
+ /// ### Custom OpenAI-Compatible
+ /// **Type:** `openai-compatible`
+ /// **Models:** Any self-hosted or custom LLM, such as OpenRouter.
+ /// **Auth:** Bearer or custom header
+ /// ```json
+ /// {
+ /// "type": "openai-compatible",
+ /// "name": "my-custom-llm",
+ /// "model": "llama-3-70b",
+ /// "uri": "https://my-llm-endpoint.com/v1/chat/completions",
+ /// "auth": {
+ /// "type": "bearer",
+ /// "token": "custom-token"
+ /// }
+ /// }
+ /// ``` + ///
+ /// + /// + /// + /// 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> CreateAsResponseAsync( + global::Vectara.CreateLLMRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, @@ -233,6 +386,7 @@ partial void ProcessCreateResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: "/v2/llms", baseUri: HttpClient.BaseAddress); @@ -324,6 +478,8 @@ partial void ProcessCreateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -337,6 +493,11 @@ partial void ProcessCreateResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -354,6 +515,8 @@ partial void ProcessCreateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -363,8 +526,7 @@ partial void ProcessCreateResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -373,6 +535,11 @@ partial void ProcessCreateResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -389,14 +556,15 @@ partial void ProcessCreateResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -436,6 +604,8 @@ partial void ProcessCreateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -456,6 +626,8 @@ partial void ProcessCreateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Invalid request body @@ -556,9 +728,13 @@ partial void ProcessCreateResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.Llm.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.Llm.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -586,9 +762,13 @@ partial void ProcessCreateResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.Llm.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.Llm.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.LlmsClient.Delete.g.cs b/src/libs/Vectara/Generated/Vectara.LlmsClient.Delete.g.cs index 4ba8ac43..3ca683c2 100644 --- a/src/libs/Vectara/Generated/Vectara.LlmsClient.Delete.g.cs +++ b/src/libs/Vectara/Generated/Vectara.LlmsClient.Delete.g.cs @@ -74,6 +74,33 @@ partial void ProcessDeleteResponse( int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await DeleteAsResponseAsync( + llmId: llmId, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Delete an LLM
+ /// The Delete LLM API enables users to remove a previously configured custom Large Language Model (LLM) from their Vectara account. This functionality is essential for managing active LLM configurations and ensuring that only relevant models are available for use. Built-in LLMs cannot be deleted, ensuring that core system models remain accessible.
+ /// By providing an LLM identifier, users can permanently delete a model configuration, freeing up resources and maintaining an organized list of available LLMs.
+ /// If successful, the API responds with `HTTP 204 No Content` status, confirming the LLM deletion. + ///
+ /// + /// + /// + /// 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 DeleteAsResponseAsync( + string llmId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -105,6 +132,7 @@ partial void ProcessDeleteResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/llms/{llmId}", baseUri: HttpClient.BaseAddress); @@ -190,6 +218,8 @@ partial void ProcessDeleteResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -203,6 +233,11 @@ partial void ProcessDeleteResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -220,6 +255,8 @@ partial void ProcessDeleteResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -229,8 +266,7 @@ partial void ProcessDeleteResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -239,6 +275,11 @@ partial void ProcessDeleteResponse( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -255,14 +296,15 @@ partial void ProcessDeleteResponse( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -302,6 +344,8 @@ partial void ProcessDeleteResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -322,6 +366,8 @@ partial void ProcessDeleteResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow deleting this LLM. @@ -418,6 +464,10 @@ partial void ProcessDeleteResponse( { __response.EnsureSuccessStatusCode(); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -439,6 +489,10 @@ partial void ProcessDeleteResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.LlmsClient.Get.g.cs b/src/libs/Vectara/Generated/Vectara.LlmsClient.Get.g.cs index e6c86a59..a5f4d7fd 100644 --- a/src/libs/Vectara/Generated/Vectara.LlmsClient.Get.g.cs +++ b/src/libs/Vectara/Generated/Vectara.LlmsClient.Get.g.cs @@ -80,6 +80,36 @@ partial void ProcessGetResponseContent( int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetAsResponseAsync( + llmId: llmId, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get an LLM
+ /// The Get LLM API allows users to retrieve details about a specific Large Language Model (LLM) that has been configured within the Vectara platform. This API provides metadata about the LLM, including its name, description, model type, API endpoint, and authentication method.
+ /// Use this API to verify model configurations, confirm connectivity details, and ensure that the correct LLM is being utilized within their workflows.
+ /// ## Authentication methods
+ /// The request requires authentication details, and you can provide them either as a Bearer token or custom header-based authentication. + ///
+ /// + /// + /// + /// 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> GetAsResponseAsync( + string llmId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -111,6 +141,7 @@ partial void ProcessGetResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/llms/{llmId}", baseUri: HttpClient.BaseAddress); @@ -196,6 +227,8 @@ partial void ProcessGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -209,6 +242,11 @@ partial void ProcessGetResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -226,6 +264,8 @@ partial void ProcessGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -235,8 +275,7 @@ partial void ProcessGetResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -245,6 +284,11 @@ partial void ProcessGetResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -261,14 +305,15 @@ partial void ProcessGetResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -308,6 +353,8 @@ partial void ProcessGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -328,6 +375,8 @@ partial void ProcessGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow retrieving this LLM. @@ -428,9 +477,13 @@ partial void ProcessGetResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.Llm.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.Llm.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -458,9 +511,13 @@ partial void ProcessGetResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.Llm.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.Llm.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.LlmsClient.List.g.cs b/src/libs/Vectara/Generated/Vectara.LlmsClient.List.g.cs index 01f47f4d..4500c00b 100644 --- a/src/libs/Vectara/Generated/Vectara.LlmsClient.List.g.cs +++ b/src/libs/Vectara/Generated/Vectara.LlmsClient.List.g.cs @@ -87,6 +87,41 @@ partial void ProcessListResponseContent( string? pageKey = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListAsResponseAsync( + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + filter: filter, + limit: limit, + pageKey: pageKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List LLMs
+ /// List LLMs that can be used with query and chat endpoints. The LLM is not directly specified in a query, but instead a `generation_preset_name` is used. The `generation_preset_name` property in generation parameters can be found as the `name` property on the Generations Presets retrieved from `/v2/generation_presets`. + ///
+ /// + /// + /// + /// + /// Default Value: 10 + /// + /// + /// 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> ListAsResponseAsync( + int? requestTimeout = default, + int? requestTimeoutMillis = default, + string? filter = default, + int? limit = default, + string? pageKey = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -120,13 +155,14 @@ partial void ProcessListResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: "/v2/llms", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("filter", filter) .AddOptionalParameter("limit", limit?.ToString()) - .AddOptionalParameter("page_key", pageKey) + .AddOptionalParameter("page_key", pageKey) ; var __path = __pathBuilder.ToString(); __path = global::Vectara.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -212,6 +248,8 @@ partial void ProcessListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -225,6 +263,11 @@ partial void ProcessListResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -242,6 +285,8 @@ partial void ProcessListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -251,8 +296,7 @@ partial void ProcessListResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -261,6 +305,11 @@ partial void ProcessListResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -277,14 +326,15 @@ partial void ProcessListResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -324,6 +374,8 @@ partial void ProcessListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -344,6 +396,8 @@ partial void ProcessListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow listing summarizers. @@ -406,9 +460,13 @@ partial void ProcessListResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.ListLLMsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.ListLLMsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -436,9 +494,13 @@ partial void ProcessListResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.ListLLMsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.ListLLMsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.LlmsClient.Update.g.cs b/src/libs/Vectara/Generated/Vectara.LlmsClient.Update.g.cs index ab2bad01..6a0a1687 100644 --- a/src/libs/Vectara/Generated/Vectara.LlmsClient.Update.g.cs +++ b/src/libs/Vectara/Generated/Vectara.LlmsClient.Update.g.cs @@ -91,6 +91,52 @@ partial void ProcessUpdateResponseContent( public async global::System.Threading.Tasks.Task UpdateAsync( string llmId, + global::Vectara.UpdateLLMRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdateAsResponseAsync( + llmId: llmId, + + request: request, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update an LLM
+ /// Update an existing LLM's configuration. This endpoint allows partial updates - only provide fields you want to change. Only the name field is immutable.
+ /// The updated LLM will be tested before saving to ensure credentials are valid.
+ /// **Updatable fields:**
+ /// - `description` - LLM description
+ /// - `type` - LLM type (openai-compatible, vertex-ai, etc.)
+ /// - `model` - Model identifier
+ /// - `uri` - API endpoint
+ /// - `auth` - Authentication credentials (including service account key_json)
+ /// - `headers` - Additional HTTP headers (for openai-compatible and anthropic types)
+ /// - `enabled` - Whether the LLM is enabled
+ /// - `capabilities` - Model capabilities (image support, context limit, tool calling)
+ /// **Immutable fields:**
+ /// - `id` - System-generated identifier
+ /// - `name` - LLM name
+ /// Built-in LLMs (system-provided models) cannot be updated. + ///
+ /// + /// + /// + /// + /// 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> UpdateAsResponseAsync( + string llmId, + global::Vectara.UpdateLLMRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, @@ -128,6 +174,7 @@ partial void ProcessUpdateResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/llms/{llmId}", baseUri: HttpClient.BaseAddress); @@ -220,6 +267,8 @@ partial void ProcessUpdateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -233,6 +282,11 @@ partial void ProcessUpdateResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -250,6 +304,8 @@ partial void ProcessUpdateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -259,8 +315,7 @@ partial void ProcessUpdateResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -269,6 +324,11 @@ partial void ProcessUpdateResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -285,14 +345,15 @@ partial void ProcessUpdateResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -332,6 +393,8 @@ partial void ProcessUpdateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -352,6 +415,8 @@ partial void ProcessUpdateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Invalid request body or connection test failed @@ -490,9 +555,13 @@ partial void ProcessUpdateResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.Llm.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.Llm.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -520,9 +589,13 @@ partial void ProcessUpdateResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.Llm.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.Llm.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.LlmsClient.g.cs b/src/libs/Vectara/Generated/Vectara.LlmsClient.g.cs index 08d5a63e..b3c6a75a 100644 --- a/src/libs/Vectara/Generated/Vectara.LlmsClient.g.cs +++ b/src/libs/Vectara/Generated/Vectara.LlmsClient.g.cs @@ -75,10 +75,10 @@ public LlmsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public LlmsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Vectara.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Vectara.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Vectara/Generated/Vectara.MetadataClient.QueryMetadata.g.cs b/src/libs/Vectara/Generated/Vectara.MetadataClient.QueryMetadata.g.cs index 7e03a4a5..fc404946 100644 --- a/src/libs/Vectara/Generated/Vectara.MetadataClient.QueryMetadata.g.cs +++ b/src/libs/Vectara/Generated/Vectara.MetadataClient.QueryMetadata.g.cs @@ -80,6 +80,41 @@ partial void ProcessQueryMetadataResponseContent( public async global::System.Threading.Tasks.Task QueryMetadataAsync( string corpusKey, + global::Vectara.MetadataQueryRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await QueryMetadataAsResponseAsync( + corpusKey: corpusKey, + + request: request, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Query across metadata fields in a corpus
+ /// Query for documents in a specific corpus using fuzzy matching across specified metadata fields. The search first applies any exact metadata filters to narrow the results, then performs fuzzy matching on the remaining documents using the specified field queries. + ///
+ /// + /// + /// + /// A user-provided key for a corpus.
+ /// Example: my-corpus + /// + /// + /// 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> QueryMetadataAsResponseAsync( + string corpusKey, + global::Vectara.MetadataQueryRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, @@ -119,6 +154,7 @@ partial void ProcessQueryMetadataResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/corpora/{corpusKey}/metadata_query", baseUri: HttpClient.BaseAddress); @@ -211,6 +247,8 @@ partial void ProcessQueryMetadataResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -224,6 +262,11 @@ partial void ProcessQueryMetadataResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -241,6 +284,8 @@ partial void ProcessQueryMetadataResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -250,8 +295,7 @@ partial void ProcessQueryMetadataResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -260,6 +304,11 @@ partial void ProcessQueryMetadataResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -276,14 +325,15 @@ partial void ProcessQueryMetadataResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -323,6 +373,8 @@ partial void ProcessQueryMetadataResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -343,6 +395,8 @@ partial void ProcessQueryMetadataResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Metadata query request was malformed. @@ -481,9 +535,13 @@ partial void ProcessQueryMetadataResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.MetadataQueryResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.MetadataQueryResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -511,9 +569,13 @@ partial void ProcessQueryMetadataResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.MetadataQueryResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.MetadataQueryResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.MetadataClient.g.cs b/src/libs/Vectara/Generated/Vectara.MetadataClient.g.cs index 4d805be9..0d6bfb30 100644 --- a/src/libs/Vectara/Generated/Vectara.MetadataClient.g.cs +++ b/src/libs/Vectara/Generated/Vectara.MetadataClient.g.cs @@ -75,10 +75,10 @@ public MetadataClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public MetadataClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Vectara.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Vectara.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Vectara/Generated/Vectara.OptionsSupport.g.cs b/src/libs/Vectara/Generated/Vectara.OptionsSupport.g.cs index 1cfccec2..7caa1ac8 100644 --- a/src/libs/Vectara/Generated/Vectara.OptionsSupport.g.cs +++ b/src/libs/Vectara/Generated/Vectara.OptionsSupport.g.cs @@ -101,9 +101,45 @@ public sealed class AutoSDKRetryOptions public int MaxAttempts { get; set; } = 1; /// - /// Optional fixed delay between retry attempts. + /// Optional fixed delay between retry attempts. When set, this takes precedence over exponential backoff. /// public global::System.TimeSpan? Delay { get; set; } + + /// + /// Initial exponential backoff delay used when is not set. + /// + public global::System.TimeSpan InitialDelay { get; set; } = global::System.TimeSpan.FromSeconds(1); + + /// + /// Maximum retry delay after applying retry headers, backoff, and jitter. + /// + public global::System.TimeSpan MaxDelay { get; set; } = global::System.TimeSpan.FromSeconds(30); + + /// + /// Multiplier applied to exponential backoff after each failed attempt. + /// Values below 1 are normalized to 1. + /// + public double BackoffMultiplier { get; set; } = 2D; + + /// + /// Randomizes computed backoff by plus or minus this ratio. Values are clamped to 0..1. + /// + public double JitterRatio { get; set; } = 0.2D; + + /// + /// Whether Retry-After response headers should control retry delay when present. + /// + public bool UseRetryAfterHeader { get; set; } = true; + + /// + /// Whether a rate-limit reset response header should control retry delay when present. + /// + public bool UseRateLimitResetHeader { get; set; } + + /// + /// Optional provider-specific rate-limit reset header name. Values may be Unix seconds or an HTTP date. + /// + public string? RateLimitResetHeaderName { get; set; } = "X-RateLimit-Reset"; } @@ -231,6 +267,16 @@ public sealed class AutoSDKHookContext /// public bool WillRetry { get; set; } + /// + /// The computed retry delay when is true. + /// + public global::System.TimeSpan? RetryDelay { get; set; } + + /// + /// A short retry reason such as exception or status:429. + /// + public string RetryReason { get; set; } = string.Empty; + /// /// The effective cancellation token for the current request attempt. /// @@ -254,6 +300,8 @@ internal static class AutoSDKRequestOptionsSupport int attempt, int maxAttempts, bool willRetry, + global::System.TimeSpan? retryDelay, + string retryReason, global::System.Threading.CancellationToken cancellationToken) { return new global::Vectara.AutoSDKHookContext @@ -271,6 +319,8 @@ internal static class AutoSDKRequestOptionsSupport Attempt = attempt, MaxAttempts = maxAttempts, WillRetry = willRetry, + RetryDelay = retryDelay, + RetryReason = retryReason ?? string.Empty, CancellationToken = cancellationToken, }; } @@ -338,19 +388,188 @@ internal static int GetMaxAttempts( return maxAttempts < 1 ? 1 : maxAttempts; } - internal static async global::System.Threading.Tasks.Task DelayBeforeRetryAsync( + internal static global::System.TimeSpan GetRetryDelay( global::Vectara.AutoSDKClientOptions clientOptions, global::Vectara.AutoSDKRequestOptions? requestOptions, + global::System.Net.Http.HttpResponseMessage? response, + int attempt) + { + var retryOptions = requestOptions?.Retry ?? clientOptions.Retry ?? new global::Vectara.AutoSDKRetryOptions(); + + if (retryOptions.UseRetryAfterHeader && + TryGetRetryAfterDelay(response, out var retryAfterDelay)) + { + return ClampRetryDelay(retryAfterDelay, retryOptions); + } + + if (retryOptions.UseRateLimitResetHeader && + TryGetRateLimitResetDelay(response, retryOptions.RateLimitResetHeaderName, out var rateLimitResetDelay)) + { + return ClampRetryDelay(rateLimitResetDelay, retryOptions); + } + + if (retryOptions.Delay.HasValue) + { + return ClampRetryDelay(retryOptions.Delay.Value, retryOptions); + } + + var initialDelay = retryOptions.InitialDelay; + if (initialDelay <= global::System.TimeSpan.Zero) + { + return global::System.TimeSpan.Zero; + } + + var multiplier = retryOptions.BackoffMultiplier < 1D ? 1D : retryOptions.BackoffMultiplier; + var exponent = attempt <= 1 ? 0 : attempt - 1; + var delayMilliseconds = initialDelay.TotalMilliseconds * global::System.Math.Pow(multiplier, exponent); + if (double.IsNaN(delayMilliseconds) || double.IsInfinity(delayMilliseconds) || delayMilliseconds < 0D) + { + delayMilliseconds = 0D; + } + + var delay = global::System.TimeSpan.FromMilliseconds(delayMilliseconds); + delay = ApplyJitter(delay, retryOptions.JitterRatio); + return ClampRetryDelay(delay, retryOptions); + } + + internal static async global::System.Threading.Tasks.Task DelayBeforeRetryAsync( + global::System.TimeSpan retryDelay, global::System.Threading.CancellationToken cancellationToken) { - var delay = requestOptions?.Retry?.Delay ?? - clientOptions.Retry?.Delay; - if (!delay.HasValue || delay.Value <= global::System.TimeSpan.Zero) + if (retryDelay <= global::System.TimeSpan.Zero) { return; } - await global::System.Threading.Tasks.Task.Delay(delay.Value, cancellationToken).ConfigureAwait(false); + await global::System.Threading.Tasks.Task.Delay(retryDelay, cancellationToken).ConfigureAwait(false); + } + + private static bool TryGetRetryAfterDelay( + global::System.Net.Http.HttpResponseMessage? response, + out global::System.TimeSpan delay) + { + delay = global::System.TimeSpan.Zero; + var retryAfter = response?.Headers.RetryAfter; + if (retryAfter == null) + { + return false; + } + + if (retryAfter.Delta.HasValue) + { + delay = retryAfter.Delta.Value; + return delay > global::System.TimeSpan.Zero; + } + + if (retryAfter.Date.HasValue) + { + delay = retryAfter.Date.Value - global::System.DateTimeOffset.UtcNow; + return delay > global::System.TimeSpan.Zero; + } + + return false; + } + + private static bool TryGetRateLimitResetDelay( + global::System.Net.Http.HttpResponseMessage? response, + string? headerName, + out global::System.TimeSpan delay) + { + delay = global::System.TimeSpan.Zero; + if (response == null || string.IsNullOrWhiteSpace(headerName)) + { + return false; + } + + if (!response.Headers.TryGetValues(headerName, out var values) && + (response.Content?.Headers == null || !response.Content.Headers.TryGetValues(headerName, out values))) + { + return false; + } + + var value = global::System.Linq.Enumerable.FirstOrDefault(values); + if (string.IsNullOrWhiteSpace(value)) + { + return false; + } + + value = value.Trim(); + if (long.TryParse( + value, + global::System.Globalization.NumberStyles.Integer, + global::System.Globalization.CultureInfo.InvariantCulture, + out var unixSeconds)) + { + delay = global::System.DateTimeOffset.FromUnixTimeSeconds(unixSeconds) - global::System.DateTimeOffset.UtcNow; + return delay > global::System.TimeSpan.Zero; + } + + if (global::System.DateTimeOffset.TryParse( + value, + global::System.Globalization.CultureInfo.InvariantCulture, + global::System.Globalization.DateTimeStyles.AssumeUniversal | global::System.Globalization.DateTimeStyles.AdjustToUniversal, + out var resetAt)) + { + delay = resetAt - global::System.DateTimeOffset.UtcNow; + return delay > global::System.TimeSpan.Zero; + } + + return false; + } + + private static global::System.TimeSpan ApplyJitter( + global::System.TimeSpan delay, + double jitterRatio) + { + if (delay <= global::System.TimeSpan.Zero || jitterRatio <= 0D) + { + return delay; + } + + if (jitterRatio > 1D) + { + jitterRatio = 1D; + } + + var sample = NextJitterSample(); + var multiplier = 1D - jitterRatio + (sample * jitterRatio * 2D); + var milliseconds = delay.TotalMilliseconds * multiplier; + if (double.IsNaN(milliseconds) || double.IsInfinity(milliseconds) || milliseconds < 0D) + { + milliseconds = 0D; + } + + return global::System.TimeSpan.FromMilliseconds(milliseconds); + } + + private static double NextJitterSample() + { + var bytes = new byte[8]; + using (var randomNumberGenerator = global::System.Security.Cryptography.RandomNumberGenerator.Create()) + { + randomNumberGenerator.GetBytes(bytes); + } + + var value = global::System.BitConverter.ToUInt64(bytes, 0); + return value / (double)ulong.MaxValue; + } + + private static global::System.TimeSpan ClampRetryDelay( + global::System.TimeSpan delay, + global::Vectara.AutoSDKRetryOptions retryOptions) + { + if (delay <= global::System.TimeSpan.Zero) + { + return global::System.TimeSpan.Zero; + } + + var maxDelay = retryOptions.MaxDelay; + if (maxDelay > global::System.TimeSpan.Zero && delay > maxDelay) + { + return maxDelay; + } + + return delay; } internal static bool ShouldRetryStatusCode( diff --git a/src/libs/Vectara/Generated/Vectara.PipelineDeadLetterEntriesClient.Create.g.cs b/src/libs/Vectara/Generated/Vectara.PipelineDeadLetterEntriesClient.Create.g.cs index c2ef439c..7f48a2e1 100644 --- a/src/libs/Vectara/Generated/Vectara.PipelineDeadLetterEntriesClient.Create.g.cs +++ b/src/libs/Vectara/Generated/Vectara.PipelineDeadLetterEntriesClient.Create.g.cs @@ -80,6 +80,41 @@ partial void ProcessCreateResponseContent( public async global::System.Threading.Tasks.Task CreateAsync( string pipelineKey, + global::Vectara.CreatePipelineDeadLetterEntryRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateAsResponseAsync( + pipelineKey: pipelineKey, + + request: request, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create dead letter
+ /// Manually add a source record to the dead letter queue for reprocessing. Use this when you want to force a record through the pipeline again, for example when the agent or judge made an incorrect decision. + ///
+ /// + /// + /// + /// The unique key for the pipeline. Can be user-provided or auto-generated.
+ /// Example: sharepoint-legal-ingest + /// + /// + /// 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> CreateAsResponseAsync( + string pipelineKey, + global::Vectara.CreatePipelineDeadLetterEntryRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, @@ -119,6 +154,7 @@ partial void ProcessCreateResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/pipelines/{pipelineKey}/dead_letters", baseUri: HttpClient.BaseAddress); @@ -211,6 +247,8 @@ partial void ProcessCreateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -224,6 +262,11 @@ partial void ProcessCreateResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -241,6 +284,8 @@ partial void ProcessCreateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -250,8 +295,7 @@ partial void ProcessCreateResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -260,6 +304,11 @@ partial void ProcessCreateResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -276,14 +325,15 @@ partial void ProcessCreateResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -323,6 +373,8 @@ partial void ProcessCreateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -343,6 +395,8 @@ partial void ProcessCreateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Request was malformed. @@ -519,9 +573,13 @@ partial void ProcessCreateResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.PipelineDeadLetterEntry.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.PipelineDeadLetterEntry.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -549,9 +607,13 @@ partial void ProcessCreateResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.PipelineDeadLetterEntry.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.PipelineDeadLetterEntry.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.PipelineDeadLetterEntriesClient.Delete.g.cs b/src/libs/Vectara/Generated/Vectara.PipelineDeadLetterEntriesClient.Delete.g.cs index 8e632d92..70da8ba8 100644 --- a/src/libs/Vectara/Generated/Vectara.PipelineDeadLetterEntriesClient.Delete.g.cs +++ b/src/libs/Vectara/Generated/Vectara.PipelineDeadLetterEntriesClient.Delete.g.cs @@ -79,6 +79,37 @@ partial void ProcessDeleteResponse( int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await DeleteAsResponseAsync( + pipelineKey: pipelineKey, + deadLetterId: deadLetterId, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Delete dead letter
+ /// Remove a dead letter from the queue. Use this to dismiss a known failure that does not need retrying. + ///
+ /// + /// + /// + /// The unique key for the pipeline. Can be user-provided or auto-generated.
+ /// Example: sharepoint-legal-ingest + /// + /// + /// 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 DeleteAsResponseAsync( + string pipelineKey, + string deadLetterId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -111,6 +142,7 @@ partial void ProcessDeleteResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/pipelines/{pipelineKey}/dead_letters/{deadLetterId}", baseUri: HttpClient.BaseAddress); @@ -197,6 +229,8 @@ partial void ProcessDeleteResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -210,6 +244,11 @@ partial void ProcessDeleteResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -227,6 +266,8 @@ partial void ProcessDeleteResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -236,8 +277,7 @@ partial void ProcessDeleteResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -246,6 +286,11 @@ partial void ProcessDeleteResponse( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -262,14 +307,15 @@ partial void ProcessDeleteResponse( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -309,6 +355,8 @@ partial void ProcessDeleteResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -329,6 +377,8 @@ partial void ProcessDeleteResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow deleting this dead letter. @@ -425,6 +475,10 @@ partial void ProcessDeleteResponse( { __response.EnsureSuccessStatusCode(); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -446,6 +500,10 @@ partial void ProcessDeleteResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.PipelineDeadLetterEntriesClient.Get.g.cs b/src/libs/Vectara/Generated/Vectara.PipelineDeadLetterEntriesClient.Get.g.cs index 47b8d82f..9ccd2bae 100644 --- a/src/libs/Vectara/Generated/Vectara.PipelineDeadLetterEntriesClient.Get.g.cs +++ b/src/libs/Vectara/Generated/Vectara.PipelineDeadLetterEntriesClient.Get.g.cs @@ -84,6 +84,39 @@ partial void ProcessGetResponseContent( int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetAsResponseAsync( + pipelineKey: pipelineKey, + deadLetterId: deadLetterId, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get dead letter
+ /// Retrieve a specific dead letter by its ID. + ///
+ /// + /// + /// + /// The unique key for the pipeline. Can be user-provided or auto-generated.
+ /// Example: sharepoint-legal-ingest + /// + /// + /// 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> GetAsResponseAsync( + string pipelineKey, + string deadLetterId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -116,6 +149,7 @@ partial void ProcessGetResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/pipelines/{pipelineKey}/dead_letters/{deadLetterId}", baseUri: HttpClient.BaseAddress); @@ -202,6 +236,8 @@ partial void ProcessGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -215,6 +251,11 @@ partial void ProcessGetResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -232,6 +273,8 @@ partial void ProcessGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -241,8 +284,7 @@ partial void ProcessGetResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -251,6 +293,11 @@ partial void ProcessGetResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -267,14 +314,15 @@ partial void ProcessGetResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -314,6 +362,8 @@ partial void ProcessGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -334,6 +384,8 @@ partial void ProcessGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow accessing this dead letter. @@ -434,9 +486,13 @@ partial void ProcessGetResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.PipelineDeadLetterEntry.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.PipelineDeadLetterEntry.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -464,9 +520,13 @@ partial void ProcessGetResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.PipelineDeadLetterEntry.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.PipelineDeadLetterEntry.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.PipelineDeadLetterEntriesClient.List.g.cs b/src/libs/Vectara/Generated/Vectara.PipelineDeadLetterEntriesClient.List.g.cs index 8dbde12c..826e082b 100644 --- a/src/libs/Vectara/Generated/Vectara.PipelineDeadLetterEntriesClient.List.g.cs +++ b/src/libs/Vectara/Generated/Vectara.PipelineDeadLetterEntriesClient.List.g.cs @@ -109,6 +109,60 @@ partial void ProcessListResponseContent( string? pageKey = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListAsResponseAsync( + pipelineKey: pipelineKey, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + status: status, + lastRunId: lastRunId, + origin: origin, + limit: limit, + pageKey: pageKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List dead letters
+ /// List dead letters for a pipeline, with optional filtering by status or run. + ///
+ /// + /// + /// + /// The unique key for the pipeline. Can be user-provided or auto-generated.
+ /// Example: sharepoint-legal-ingest + /// + /// + /// The status of a dead letter entry. + /// + /// + /// The unique identifier for a pipeline run.
+ /// Example: run_pip_abc_manual_550e8400 + /// + /// + /// How this dead letter was created. + /// + /// + /// Default Value: 10 + /// + /// + /// 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> ListAsResponseAsync( + string pipelineKey, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.DeadLetterStatus? status = default, + string? lastRunId = default, + global::Vectara.DeadLetterOrigin? origin = default, + int? limit = default, + string? pageKey = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -145,15 +199,16 @@ partial void ProcessListResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/pipelines/{pipelineKey}/dead_letters", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("status", status?.ToValueString()) .AddOptionalParameter("last_run_id", lastRunId) .AddOptionalParameter("origin", origin?.ToValueString()) .AddOptionalParameter("limit", limit?.ToString()) - .AddOptionalParameter("page_key", pageKey) + .AddOptionalParameter("page_key", pageKey) ; var __path = __pathBuilder.ToString(); __path = global::Vectara.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -242,6 +297,8 @@ partial void ProcessListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -255,6 +312,11 @@ partial void ProcessListResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -272,6 +334,8 @@ partial void ProcessListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -281,8 +345,7 @@ partial void ProcessListResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -291,6 +354,11 @@ partial void ProcessListResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -307,14 +375,15 @@ partial void ProcessListResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -354,6 +423,8 @@ partial void ProcessListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -374,6 +445,8 @@ partial void ProcessListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow listing dead letters for this pipeline. @@ -474,9 +547,13 @@ partial void ProcessListResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.ListPipelineDeadLetterEntriesResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.ListPipelineDeadLetterEntriesResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -504,9 +581,13 @@ partial void ProcessListResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.ListPipelineDeadLetterEntriesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.ListPipelineDeadLetterEntriesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.PipelineDeadLetterEntriesClient.Process.g.cs b/src/libs/Vectara/Generated/Vectara.PipelineDeadLetterEntriesClient.Process.g.cs index 5349f464..14a51af6 100644 --- a/src/libs/Vectara/Generated/Vectara.PipelineDeadLetterEntriesClient.Process.g.cs +++ b/src/libs/Vectara/Generated/Vectara.PipelineDeadLetterEntriesClient.Process.g.cs @@ -80,6 +80,41 @@ partial void ProcessProcessResponseContent( public async global::System.Threading.Tasks.Task ProcessAsync( string pipelineKey, + global::Vectara.ProcessPipelineDeadLetterEntriesRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ProcessAsResponseAsync( + pipelineKey: pipelineKey, + + request: request, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Process dead letters
+ /// Process dead letters by creating a new pipeline run that re-fetches the specified records from source and sends them through the agent. If no filters are provided, all pending dead letters are processed. + ///
+ /// + /// + /// + /// The unique key for the pipeline. Can be user-provided or auto-generated.
+ /// Example: sharepoint-legal-ingest + /// + /// + /// 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> ProcessAsResponseAsync( + string pipelineKey, + global::Vectara.ProcessPipelineDeadLetterEntriesRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, @@ -119,6 +154,7 @@ partial void ProcessProcessResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/pipelines/{pipelineKey}/dead_letters/process", baseUri: HttpClient.BaseAddress); @@ -211,6 +247,8 @@ partial void ProcessProcessResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -224,6 +262,11 @@ partial void ProcessProcessResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -241,6 +284,8 @@ partial void ProcessProcessResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -250,8 +295,7 @@ partial void ProcessProcessResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -260,6 +304,11 @@ partial void ProcessProcessResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -276,14 +325,15 @@ partial void ProcessProcessResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -323,6 +373,8 @@ partial void ProcessProcessResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -343,6 +395,8 @@ partial void ProcessProcessResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Request was malformed. @@ -519,9 +573,13 @@ partial void ProcessProcessResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.PipelineRun.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.PipelineRun.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -549,9 +607,13 @@ partial void ProcessProcessResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.PipelineRun.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.PipelineRun.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.PipelineDeadLetterEntriesClient.g.cs b/src/libs/Vectara/Generated/Vectara.PipelineDeadLetterEntriesClient.g.cs index 684a07eb..b7714e3c 100644 --- a/src/libs/Vectara/Generated/Vectara.PipelineDeadLetterEntriesClient.g.cs +++ b/src/libs/Vectara/Generated/Vectara.PipelineDeadLetterEntriesClient.g.cs @@ -75,10 +75,10 @@ public PipelineDeadLetterEntriesClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public PipelineDeadLetterEntriesClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Vectara.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Vectara.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Vectara/Generated/Vectara.PipelineRunsClient.Get.g.cs b/src/libs/Vectara/Generated/Vectara.PipelineRunsClient.Get.g.cs index e4005bb3..e7f70283 100644 --- a/src/libs/Vectara/Generated/Vectara.PipelineRunsClient.Get.g.cs +++ b/src/libs/Vectara/Generated/Vectara.PipelineRunsClient.Get.g.cs @@ -87,6 +87,42 @@ partial void ProcessGetResponseContent( int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetAsResponseAsync( + pipelineKey: pipelineKey, + runId: runId, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get pipeline run
+ /// Retrieve details of a specific pipeline run including record counts, session keys, and status. + ///
+ /// + /// + /// + /// The unique key for the pipeline. Can be user-provided or auto-generated.
+ /// Example: sharepoint-legal-ingest + /// + /// + /// The unique identifier for a pipeline run.
+ /// Example: run_pip_abc_manual_550e8400 + /// + /// 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> GetAsResponseAsync( + string pipelineKey, + string runId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -119,6 +155,7 @@ partial void ProcessGetResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/pipelines/{pipelineKey}/runs/{runId}", baseUri: HttpClient.BaseAddress); @@ -205,6 +242,8 @@ partial void ProcessGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -218,6 +257,11 @@ partial void ProcessGetResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -235,6 +279,8 @@ partial void ProcessGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -244,8 +290,7 @@ partial void ProcessGetResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -254,6 +299,11 @@ partial void ProcessGetResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -270,14 +320,15 @@ partial void ProcessGetResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -317,6 +368,8 @@ partial void ProcessGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -337,6 +390,8 @@ partial void ProcessGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow accessing this run. @@ -437,9 +492,13 @@ partial void ProcessGetResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.PipelineRun.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.PipelineRun.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -467,9 +526,13 @@ partial void ProcessGetResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.PipelineRun.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.PipelineRun.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.PipelineRunsClient.List.g.cs b/src/libs/Vectara/Generated/Vectara.PipelineRunsClient.List.g.cs index 0eed8713..bc0e321a 100644 --- a/src/libs/Vectara/Generated/Vectara.PipelineRunsClient.List.g.cs +++ b/src/libs/Vectara/Generated/Vectara.PipelineRunsClient.List.g.cs @@ -100,6 +100,52 @@ partial void ProcessListResponseContent( string? pageKey = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListAsResponseAsync( + pipelineKey: pipelineKey, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + status: status, + after: after, + limit: limit, + pageKey: pageKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List pipeline runs
+ /// List execution runs for a pipeline, with optional filtering by status. + ///
+ /// + /// + /// + /// The unique key for the pipeline. Can be user-provided or auto-generated.
+ /// Example: sharepoint-legal-ingest + /// + /// + /// The status of a pipeline run. + /// + /// + /// + /// Default Value: 10 + /// + /// + /// 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> ListAsResponseAsync( + string pipelineKey, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.PipelineRunStatus? status = default, + global::System.DateTime? after = default, + int? limit = default, + string? pageKey = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -135,14 +181,15 @@ partial void ProcessListResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/pipelines/{pipelineKey}/runs", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("status", status?.ToValueString()) .AddOptionalParameter("after", after?.ToString("yyyy-MM-ddTHH:mm:ssZ")) .AddOptionalParameter("limit", limit?.ToString()) - .AddOptionalParameter("page_key", pageKey) + .AddOptionalParameter("page_key", pageKey) ; var __path = __pathBuilder.ToString(); __path = global::Vectara.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -230,6 +277,8 @@ partial void ProcessListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -243,6 +292,11 @@ partial void ProcessListResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -260,6 +314,8 @@ partial void ProcessListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -269,8 +325,7 @@ partial void ProcessListResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +334,11 @@ partial void ProcessListResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -295,14 +355,15 @@ partial void ProcessListResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -342,6 +403,8 @@ partial void ProcessListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -362,6 +425,8 @@ partial void ProcessListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow listing runs for this pipeline. @@ -462,9 +527,13 @@ partial void ProcessListResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.ListPipelineRunsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.ListPipelineRunsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -492,9 +561,13 @@ partial void ProcessListResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.ListPipelineRunsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.ListPipelineRunsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.PipelineRunsClient.g.cs b/src/libs/Vectara/Generated/Vectara.PipelineRunsClient.g.cs index 3f2be933..6c55c250 100644 --- a/src/libs/Vectara/Generated/Vectara.PipelineRunsClient.g.cs +++ b/src/libs/Vectara/Generated/Vectara.PipelineRunsClient.g.cs @@ -75,10 +75,10 @@ public PipelineRunsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public PipelineRunsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Vectara.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Vectara.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Vectara/Generated/Vectara.PipelinesClient.Create.g.cs b/src/libs/Vectara/Generated/Vectara.PipelinesClient.Create.g.cs index f6ba8a7c..9a837c42 100644 --- a/src/libs/Vectara/Generated/Vectara.PipelinesClient.Create.g.cs +++ b/src/libs/Vectara/Generated/Vectara.PipelinesClient.Create.g.cs @@ -73,6 +73,35 @@ partial void ProcessCreateResponseContent( /// public async global::System.Threading.Tasks.Task CreateAsync( + global::Vectara.CreatePipelineRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateAsResponseAsync( + + request: request, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create pipeline
+ /// Create a new pipeline that continuously ingests data from a source system and sends each record to an agent for processing. A new agent session is created per source record. A pipeline is distinct from an agent schedule (which is a recurring single execution of an agent) and from a connector (which is a bidirectional chat integration like Slack). A pipeline is an automated, one-directional flow of all source data through 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> CreateAsResponseAsync( + global::Vectara.CreatePipelineRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, @@ -111,6 +140,7 @@ partial void ProcessCreateResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: "/v2/pipelines", baseUri: HttpClient.BaseAddress); @@ -202,6 +232,8 @@ partial void ProcessCreateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -215,6 +247,11 @@ partial void ProcessCreateResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -232,6 +269,8 @@ partial void ProcessCreateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -241,8 +280,7 @@ partial void ProcessCreateResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -251,6 +289,11 @@ partial void ProcessCreateResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -267,14 +310,15 @@ partial void ProcessCreateResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -314,6 +358,8 @@ partial void ProcessCreateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -334,6 +380,8 @@ partial void ProcessCreateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Pipeline creation request was malformed or contains invalid configuration. @@ -472,9 +520,13 @@ partial void ProcessCreateResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.Pipeline.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.Pipeline.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -502,9 +554,13 @@ partial void ProcessCreateResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.Pipeline.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.Pipeline.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.PipelinesClient.Delete.g.cs b/src/libs/Vectara/Generated/Vectara.PipelinesClient.Delete.g.cs index 5552c86b..1ffb0557 100644 --- a/src/libs/Vectara/Generated/Vectara.PipelinesClient.Delete.g.cs +++ b/src/libs/Vectara/Generated/Vectara.PipelinesClient.Delete.g.cs @@ -75,6 +75,34 @@ partial void ProcessDeleteResponse( int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await DeleteAsResponseAsync( + pipelineKey: pipelineKey, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Delete pipeline
+ /// Permanently delete a pipeline and its run history. This cancels any in-progress runs. Agent sessions created by this pipeline are not deleted. + ///
+ /// + /// + /// + /// The unique key for the pipeline. Can be user-provided or auto-generated.
+ /// Example: sharepoint-legal-ingest + /// + /// 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 DeleteAsResponseAsync( + string pipelineKey, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -106,6 +134,7 @@ partial void ProcessDeleteResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/pipelines/{pipelineKey}", baseUri: HttpClient.BaseAddress); @@ -191,6 +220,8 @@ partial void ProcessDeleteResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -204,6 +235,11 @@ partial void ProcessDeleteResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -221,6 +257,8 @@ partial void ProcessDeleteResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -230,8 +268,7 @@ partial void ProcessDeleteResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -240,6 +277,11 @@ partial void ProcessDeleteResponse( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -256,14 +298,15 @@ partial void ProcessDeleteResponse( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -303,6 +346,8 @@ partial void ProcessDeleteResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -323,6 +368,8 @@ partial void ProcessDeleteResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow deleting this pipeline. @@ -419,6 +466,10 @@ partial void ProcessDeleteResponse( { __response.EnsureSuccessStatusCode(); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -440,6 +491,10 @@ partial void ProcessDeleteResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.PipelinesClient.Get.g.cs b/src/libs/Vectara/Generated/Vectara.PipelinesClient.Get.g.cs index 666a2bfb..985e8a20 100644 --- a/src/libs/Vectara/Generated/Vectara.PipelinesClient.Get.g.cs +++ b/src/libs/Vectara/Generated/Vectara.PipelinesClient.Get.g.cs @@ -80,6 +80,36 @@ partial void ProcessGetResponseContent( int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetAsResponseAsync( + pipelineKey: pipelineKey, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get pipeline
+ /// Retrieve a pipeline by its key, including its current status, watermark, and configuration. + ///
+ /// + /// + /// + /// The unique key for the pipeline. Can be user-provided or auto-generated.
+ /// Example: sharepoint-legal-ingest + /// + /// 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> GetAsResponseAsync( + string pipelineKey, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -111,6 +141,7 @@ partial void ProcessGetResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/pipelines/{pipelineKey}", baseUri: HttpClient.BaseAddress); @@ -196,6 +227,8 @@ partial void ProcessGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -209,6 +242,11 @@ partial void ProcessGetResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -226,6 +264,8 @@ partial void ProcessGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -235,8 +275,7 @@ partial void ProcessGetResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -245,6 +284,11 @@ partial void ProcessGetResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -261,14 +305,15 @@ partial void ProcessGetResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -308,6 +353,8 @@ partial void ProcessGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -328,6 +375,8 @@ partial void ProcessGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow accessing this pipeline. @@ -428,9 +477,13 @@ partial void ProcessGetResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.Pipeline.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.Pipeline.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -458,9 +511,13 @@ partial void ProcessGetResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.Pipeline.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.Pipeline.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.PipelinesClient.List.g.cs b/src/libs/Vectara/Generated/Vectara.PipelinesClient.List.g.cs index 1028297d..fd026dc7 100644 --- a/src/libs/Vectara/Generated/Vectara.PipelinesClient.List.g.cs +++ b/src/libs/Vectara/Generated/Vectara.PipelinesClient.List.g.cs @@ -101,6 +101,52 @@ partial void ProcessListResponseContent( string? pageKey = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListAsResponseAsync( + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + sourceType: sourceType, + status: status, + enabled: enabled, + filter: filter, + limit: limit, + pageKey: pageKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List pipelines
+ /// List all pipelines with optional filtering by source type, status, or enabled state. + ///
+ /// + /// + /// + /// + /// The current operational status of the pipeline. + /// + /// + /// + /// + /// Default Value: 10 + /// + /// + /// 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> ListAsResponseAsync( + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.ListPipelinesSourceType? sourceType = default, + global::Vectara.PipelineStatus? status = default, + bool? enabled = default, + string? filter = default, + int? limit = default, + string? pageKey = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -137,16 +183,17 @@ partial void ProcessListResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: "/v2/pipelines", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("source_type", sourceType?.ToValueString()) .AddOptionalParameter("status", status?.ToValueString()) .AddOptionalParameter("enabled", enabled?.ToString().ToLowerInvariant()) .AddOptionalParameter("filter", filter) .AddOptionalParameter("limit", limit?.ToString()) - .AddOptionalParameter("page_key", pageKey) + .AddOptionalParameter("page_key", pageKey) ; var __path = __pathBuilder.ToString(); __path = global::Vectara.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -235,6 +282,8 @@ partial void ProcessListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -248,6 +297,11 @@ partial void ProcessListResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -265,6 +319,8 @@ partial void ProcessListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -274,8 +330,7 @@ partial void ProcessListResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -284,6 +339,11 @@ partial void ProcessListResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -300,14 +360,15 @@ partial void ProcessListResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -347,6 +408,8 @@ partial void ProcessListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -367,6 +430,8 @@ partial void ProcessListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow listing pipelines. @@ -429,9 +494,13 @@ partial void ProcessListResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.ListPipelinesResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.ListPipelinesResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -459,9 +528,13 @@ partial void ProcessListResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.ListPipelinesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.ListPipelinesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.PipelinesClient.Replace.g.cs b/src/libs/Vectara/Generated/Vectara.PipelinesClient.Replace.g.cs index a46e1500..2decdc2d 100644 --- a/src/libs/Vectara/Generated/Vectara.PipelinesClient.Replace.g.cs +++ b/src/libs/Vectara/Generated/Vectara.PipelinesClient.Replace.g.cs @@ -80,6 +80,41 @@ partial void ProcessReplaceResponseContent( public async global::System.Threading.Tasks.Task ReplaceAsync( string pipelineKey, + global::Vectara.CreatePipelineRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ReplaceAsResponseAsync( + pipelineKey: pipelineKey, + + request: request, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Replace pipeline
+ /// Replace a pipeline's configuration. The full pipeline definition must be provided. + ///
+ /// + /// + /// + /// The unique key for the pipeline. Can be user-provided or auto-generated.
+ /// Example: sharepoint-legal-ingest + /// + /// + /// 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> ReplaceAsResponseAsync( + string pipelineKey, + global::Vectara.CreatePipelineRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, @@ -119,6 +154,7 @@ partial void ProcessReplaceResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/pipelines/{pipelineKey}", baseUri: HttpClient.BaseAddress); @@ -211,6 +247,8 @@ partial void ProcessReplaceResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -224,6 +262,11 @@ partial void ProcessReplaceResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -241,6 +284,8 @@ partial void ProcessReplaceResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -250,8 +295,7 @@ partial void ProcessReplaceResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -260,6 +304,11 @@ partial void ProcessReplaceResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -276,14 +325,15 @@ partial void ProcessReplaceResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -323,6 +373,8 @@ partial void ProcessReplaceResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -343,6 +395,8 @@ partial void ProcessReplaceResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Pipeline replace request was malformed or contains invalid configuration. @@ -481,9 +535,13 @@ partial void ProcessReplaceResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.Pipeline.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.Pipeline.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -511,9 +569,13 @@ partial void ProcessReplaceResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.Pipeline.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.Pipeline.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.PipelinesClient.Trigger.g.cs b/src/libs/Vectara/Generated/Vectara.PipelinesClient.Trigger.g.cs index ccd0b0b1..dfc4d194 100644 --- a/src/libs/Vectara/Generated/Vectara.PipelinesClient.Trigger.g.cs +++ b/src/libs/Vectara/Generated/Vectara.PipelinesClient.Trigger.g.cs @@ -80,6 +80,36 @@ partial void ProcessTriggerResponseContent( int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await TriggerAsResponseAsync( + pipelineKey: pipelineKey, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Trigger pipeline
+ /// Manually trigger a pipeline run outside of the normal schedule. The pipeline will fetch new data from the source and process it through the agent. Returns the created run. + ///
+ /// + /// + /// + /// The unique key for the pipeline. Can be user-provided or auto-generated.
+ /// Example: sharepoint-legal-ingest + /// + /// 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> TriggerAsResponseAsync( + string pipelineKey, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -111,6 +141,7 @@ partial void ProcessTriggerResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/pipelines/{pipelineKey}/trigger", baseUri: HttpClient.BaseAddress); @@ -196,6 +227,8 @@ partial void ProcessTriggerResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -209,6 +242,11 @@ partial void ProcessTriggerResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -226,6 +264,8 @@ partial void ProcessTriggerResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -235,8 +275,7 @@ partial void ProcessTriggerResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -245,6 +284,11 @@ partial void ProcessTriggerResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -261,14 +305,15 @@ partial void ProcessTriggerResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -308,6 +353,8 @@ partial void ProcessTriggerResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -328,6 +375,8 @@ partial void ProcessTriggerResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow triggering this pipeline. @@ -466,9 +515,13 @@ partial void ProcessTriggerResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.PipelineRun.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.PipelineRun.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -496,9 +549,13 @@ partial void ProcessTriggerResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.PipelineRun.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.PipelineRun.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.PipelinesClient.Update.g.cs b/src/libs/Vectara/Generated/Vectara.PipelinesClient.Update.g.cs index 3d6d6add..e524ab2a 100644 --- a/src/libs/Vectara/Generated/Vectara.PipelinesClient.Update.g.cs +++ b/src/libs/Vectara/Generated/Vectara.PipelinesClient.Update.g.cs @@ -80,6 +80,41 @@ partial void ProcessUpdateResponseContent( public async global::System.Threading.Tasks.Task UpdateAsync( string pipelineKey, + global::Vectara.UpdatePipelineRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdateAsResponseAsync( + pipelineKey: pipelineKey, + + request: request, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update pipeline
+ /// Partially update a pipeline's configuration. Omitted fields are preserved. + ///
+ /// + /// + /// + /// The unique key for the pipeline. Can be user-provided or auto-generated.
+ /// Example: sharepoint-legal-ingest + /// + /// + /// 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> UpdateAsResponseAsync( + string pipelineKey, + global::Vectara.UpdatePipelineRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, @@ -119,6 +154,7 @@ partial void ProcessUpdateResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/pipelines/{pipelineKey}", baseUri: HttpClient.BaseAddress); @@ -211,6 +247,8 @@ partial void ProcessUpdateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -224,6 +262,11 @@ partial void ProcessUpdateResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -241,6 +284,8 @@ partial void ProcessUpdateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -250,8 +295,7 @@ partial void ProcessUpdateResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -260,6 +304,11 @@ partial void ProcessUpdateResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -276,14 +325,15 @@ partial void ProcessUpdateResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -323,6 +373,8 @@ partial void ProcessUpdateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -343,6 +395,8 @@ partial void ProcessUpdateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Pipeline update request was malformed or contains invalid configuration. @@ -481,9 +535,13 @@ partial void ProcessUpdateResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.Pipeline.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.Pipeline.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -511,9 +569,13 @@ partial void ProcessUpdateResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.Pipeline.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.Pipeline.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.PipelinesClient.g.cs b/src/libs/Vectara/Generated/Vectara.PipelinesClient.g.cs index 2fb07d80..cf412bb2 100644 --- a/src/libs/Vectara/Generated/Vectara.PipelinesClient.g.cs +++ b/src/libs/Vectara/Generated/Vectara.PipelinesClient.g.cs @@ -75,10 +75,10 @@ public PipelinesClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public PipelinesClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Vectara.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Vectara.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Vectara/Generated/Vectara.QueriesClient.Query2.g.cs b/src/libs/Vectara/Generated/Vectara.QueriesClient.Query2.g.cs index 7b7ccfe4..f46a4f9f 100644 --- a/src/libs/Vectara/Generated/Vectara.QueriesClient.Query2.g.cs +++ b/src/libs/Vectara/Generated/Vectara.QueriesClient.Query2.g.cs @@ -79,6 +79,41 @@ partial void ProcessQuery2ResponseContent( /// public async global::System.Threading.Tasks.Task Query2Async( + global::Vectara.QueryRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await Query2AsResponseAsync( + + request: request, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Multiple Corpora Query
+ /// Perform a multipurpose query to retrieve relevant information from one or more corpora and generate a response using Retrieval Augmented Generation (RAG). Similar to the [advanced corpora search](https://docs.vectara.com/docs/rest-api/query-corpus).
+ /// * Specify the unique `corpus_key` identifying the corpus to query. The `corpus_key` is created in the Vectara Console or the [Create Corpus API](https://docs.vectara.com/docs/rest-api/create-corpus), and the corpus key is part of that process. When creating a new corpus, you have the option to assign a custom `corpus_key` following your preferred naming convention. This key serves as a unique identifier for the corpus, allowing it to be referenced in search requests.
+ /// * Customize your search by specifying the query text (`query`), pagination details (`offset` and `limit`), and metadata filters (`metadata_filter`) to tailor your search results.
+ /// * Leverage advanced search capabilities like reranking (`reranker`) and opt-in Retrieval Augmented Generation (RAG) (`generation`) for enhanced query performance. Generation is opt-in by setting the `generation` property. By excluding the property or by setting it to null, the response will not include generation. [Learn more](https://docs.vectara.com/docs/learn/grounded-generation/configure-query-summarization)
+ /// * Specify Vectara's RAG-focused LLM (Mockingbird) for the `generation_preset_name`. [Learn more](https://docs.vectara.com/docs/learn/mockingbird-llm)
+ /// * Use advanced summarization options that utilize detailed summarization parameters such as `max_response_characters`, `temperature`, and `frequency_penalty` for generating precise and relevant summaries. [Learn more](https://docs.vectara.com/docs/search-and-retrieval#advanced-summarization-customization-options)
+ /// * Customize citation formats in summaries using the `citations` object to include numeric, HTML, or Markdown links. [Learn more](https://docs.vectara.com/docs/search-and-retrieval#citations) + ///
+ /// + /// + /// + /// 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> Query2AsResponseAsync( + global::Vectara.QueryRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, @@ -117,6 +152,7 @@ partial void ProcessQuery2ResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: "/v2/query", baseUri: HttpClient.BaseAddress); @@ -208,6 +244,8 @@ partial void ProcessQuery2ResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -221,6 +259,11 @@ partial void ProcessQuery2ResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -238,6 +281,8 @@ partial void ProcessQuery2ResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -247,8 +292,7 @@ partial void ProcessQuery2ResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -257,6 +301,11 @@ partial void ProcessQuery2ResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -273,14 +322,15 @@ partial void ProcessQuery2ResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -320,6 +370,8 @@ partial void ProcessQuery2ResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -340,6 +392,8 @@ partial void ProcessQuery2ResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Query request was malformed. @@ -478,9 +532,13 @@ partial void ProcessQuery2ResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.QueryFullResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.QueryFullResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -508,9 +566,13 @@ partial void ProcessQuery2ResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.QueryFullResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.QueryFullResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.QueriesClient.Query2AsStream.g.cs b/src/libs/Vectara/Generated/Vectara.QueriesClient.Query2AsStream.g.cs index 73774afc..84c5cb0f 100644 --- a/src/libs/Vectara/Generated/Vectara.QueriesClient.Query2AsStream.g.cs +++ b/src/libs/Vectara/Generated/Vectara.QueriesClient.Query2AsStream.g.cs @@ -112,6 +112,7 @@ partial void ProcessQuery2AsStreamResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: "/v2/query", baseUri: HttpClient.BaseAddress); @@ -203,6 +204,8 @@ partial void ProcessQuery2AsStreamResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -216,6 +219,11 @@ partial void ProcessQuery2AsStreamResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -233,6 +241,8 @@ partial void ProcessQuery2AsStreamResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -242,8 +252,7 @@ partial void ProcessQuery2AsStreamResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -252,6 +261,11 @@ partial void ProcessQuery2AsStreamResponse( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -268,14 +282,15 @@ partial void ProcessQuery2AsStreamResponse( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -315,6 +330,8 @@ partial void ProcessQuery2AsStreamResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -335,6 +352,8 @@ partial void ProcessQuery2AsStreamResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } diff --git a/src/libs/Vectara/Generated/Vectara.QueriesClient.g.cs b/src/libs/Vectara/Generated/Vectara.QueriesClient.g.cs index dcdc90e8..afbe00ae 100644 --- a/src/libs/Vectara/Generated/Vectara.QueriesClient.g.cs +++ b/src/libs/Vectara/Generated/Vectara.QueriesClient.g.cs @@ -75,10 +75,10 @@ public QueriesClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public QueriesClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Vectara.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Vectara.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Vectara/Generated/Vectara.QueryHistoryClient.Get.g.cs b/src/libs/Vectara/Generated/Vectara.QueryHistoryClient.Get.g.cs index 17ec9459..b492ef54 100644 --- a/src/libs/Vectara/Generated/Vectara.QueryHistoryClient.Get.g.cs +++ b/src/libs/Vectara/Generated/Vectara.QueryHistoryClient.Get.g.cs @@ -78,6 +78,34 @@ partial void ProcessGetResponseContent( int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetAsResponseAsync( + queryId: queryId, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get a query history
+ /// The Get Query History API allows you to retrieve detailed history about a specific query that was made against a corpus. The response includes detailed information about the query, such as latency, the time it was executed, and the various stages in the query pipeline.
+ /// You specify the `query_id` and the response includes the `id` of the query, the `query` object, the `chat_id`, the time information about the query, and the `spans` object. + ///
+ /// + /// + /// + /// 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> GetAsResponseAsync( + string queryId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -109,6 +137,7 @@ partial void ProcessGetResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/queries/{queryId}", baseUri: HttpClient.BaseAddress); @@ -194,6 +223,8 @@ partial void ProcessGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -207,6 +238,11 @@ partial void ProcessGetResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -224,6 +260,8 @@ partial void ProcessGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -233,8 +271,7 @@ partial void ProcessGetResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -243,6 +280,11 @@ partial void ProcessGetResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -259,14 +301,15 @@ partial void ProcessGetResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -306,6 +349,8 @@ partial void ProcessGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -326,6 +371,8 @@ partial void ProcessGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow retrieving the query history. @@ -426,9 +473,13 @@ partial void ProcessGetResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.QueryHistory.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.QueryHistory.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -456,9 +507,13 @@ partial void ProcessGetResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.QueryHistory.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.QueryHistory.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.QueryHistoryClient.List.g.cs b/src/libs/Vectara/Generated/Vectara.QueryHistoryClient.List.g.cs index 1b2266e0..10397c61 100644 --- a/src/libs/Vectara/Generated/Vectara.QueryHistoryClient.List.g.cs +++ b/src/libs/Vectara/Generated/Vectara.QueryHistoryClient.List.g.cs @@ -104,6 +104,54 @@ partial void ProcessListResponseContent( string? pageKey = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListAsResponseAsync( + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + corpusKey: corpusKey, + startedAfter: startedAfter, + startedBefore: startedBefore, + chatId: chatId, + historyId: historyId, + limit: limit, + pageKey: pageKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List the history of previous queries
+ /// The List Query Histories API allows you to retrieve, update, and manage query history for a specific corpus. This API is particularly useful for tracking query performance, debugging individual queries, and retrieving detailed information such as the call stack of a query execution.
+ /// You can specify the `corpus_key`, `chat_id`, and the `limit` which is the maximum number of historical queries to list. + ///
+ /// + /// + /// + /// + /// + /// + /// + /// + /// Default Value: 10 + /// + /// + /// 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> ListAsResponseAsync( + int? requestTimeout = default, + int? requestTimeoutMillis = default, + string? corpusKey = default, + global::System.DateTime? startedAfter = default, + global::System.DateTime? startedBefore = default, + string? chatId = default, + string? historyId = default, + int? limit = default, + string? pageKey = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -141,9 +189,10 @@ partial void ProcessListResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: "/v2/queries", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("corpus_key", corpusKey) .AddOptionalParameter("started_after", startedAfter?.ToString("yyyy-MM-ddTHH:mm:ssZ")) @@ -151,7 +200,7 @@ partial void ProcessListResponseContent( .AddOptionalParameter("chat_id", chatId) .AddOptionalParameter("history_id", historyId) .AddOptionalParameter("limit", limit?.ToString()) - .AddOptionalParameter("page_key", pageKey) + .AddOptionalParameter("page_key", pageKey) ; var __path = __pathBuilder.ToString(); __path = global::Vectara.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -241,6 +290,8 @@ partial void ProcessListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -254,6 +305,11 @@ partial void ProcessListResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -271,6 +327,8 @@ partial void ProcessListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -280,8 +338,7 @@ partial void ProcessListResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -290,6 +347,11 @@ partial void ProcessListResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -306,14 +368,15 @@ partial void ProcessListResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -353,6 +416,8 @@ partial void ProcessListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -373,6 +438,8 @@ partial void ProcessListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Query history list request was malformed. @@ -473,9 +540,13 @@ partial void ProcessListResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.ListQueryHistoriesResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.ListQueryHistoriesResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -503,9 +574,13 @@ partial void ProcessListResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.ListQueryHistoriesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.ListQueryHistoriesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.QueryHistoryClient.g.cs b/src/libs/Vectara/Generated/Vectara.QueryHistoryClient.g.cs index 2399ae6f..50815d76 100644 --- a/src/libs/Vectara/Generated/Vectara.QueryHistoryClient.g.cs +++ b/src/libs/Vectara/Generated/Vectara.QueryHistoryClient.g.cs @@ -75,10 +75,10 @@ public QueryHistoryClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public QueryHistoryClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Vectara.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Vectara.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Vectara/Generated/Vectara.RerankersClient.List.g.cs b/src/libs/Vectara/Generated/Vectara.RerankersClient.List.g.cs index b01969af..099bc917 100644 --- a/src/libs/Vectara/Generated/Vectara.RerankersClient.List.g.cs +++ b/src/libs/Vectara/Generated/Vectara.RerankersClient.List.g.cs @@ -90,6 +90,44 @@ partial void ProcessListResponseContent( string? pageKey = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListAsResponseAsync( + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + filter: filter, + limit: limit, + pageKey: pageKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List rerankers
+ /// The List Rerankers API retrieves a list of available rerankers used to improve the ranking and ordering of search results.
+ /// For more information about the available rerankers, see [Reranking overview](https://docs.vectara.com/docs/search-and-retrieval/rerankers/reranking-overview). + ///
+ /// + /// + /// + /// Example: vectara.* + /// + /// + /// Default Value: 10 + /// + /// + /// 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> ListAsResponseAsync( + int? requestTimeout = default, + int? requestTimeoutMillis = default, + string? filter = default, + int? limit = default, + string? pageKey = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -123,13 +161,14 @@ partial void ProcessListResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: "/v2/rerankers", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("filter", filter) .AddOptionalParameter("limit", limit?.ToString()) - .AddOptionalParameter("page_key", pageKey) + .AddOptionalParameter("page_key", pageKey) ; var __path = __pathBuilder.ToString(); __path = global::Vectara.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -215,6 +254,8 @@ partial void ProcessListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -228,6 +269,11 @@ partial void ProcessListResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -245,6 +291,8 @@ partial void ProcessListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -254,8 +302,7 @@ partial void ProcessListResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -264,6 +311,11 @@ partial void ProcessListResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -280,14 +332,15 @@ partial void ProcessListResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -327,6 +380,8 @@ partial void ProcessListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -347,6 +402,8 @@ partial void ProcessListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow listing rerankers. @@ -409,9 +466,13 @@ partial void ProcessListResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.ListRerankersResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.ListRerankersResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -439,9 +500,13 @@ partial void ProcessListResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.ListRerankersResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.ListRerankersResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.RerankersClient.g.cs b/src/libs/Vectara/Generated/Vectara.RerankersClient.g.cs index 95e49ae7..193315fc 100644 --- a/src/libs/Vectara/Generated/Vectara.RerankersClient.g.cs +++ b/src/libs/Vectara/Generated/Vectara.RerankersClient.g.cs @@ -75,10 +75,10 @@ public RerankersClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public RerankersClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Vectara.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Vectara.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Vectara/Generated/Vectara.TableExtractorsClient.List.g.cs b/src/libs/Vectara/Generated/Vectara.TableExtractorsClient.List.g.cs index 4c7e2851..951c5eb1 100644 --- a/src/libs/Vectara/Generated/Vectara.TableExtractorsClient.List.g.cs +++ b/src/libs/Vectara/Generated/Vectara.TableExtractorsClient.List.g.cs @@ -73,6 +73,30 @@ partial void ProcessListResponseContent( int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListAsResponseAsync( + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List supported table extractors
+ /// Table extractors are used to extract tabular data from documents during indexing. + ///
+ /// + /// + /// 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> ListAsResponseAsync( + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -103,6 +127,7 @@ partial void ProcessListResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: "/v2/table_extractors", baseUri: HttpClient.BaseAddress); @@ -187,6 +212,8 @@ partial void ProcessListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -200,6 +227,11 @@ partial void ProcessListResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -217,6 +249,8 @@ partial void ProcessListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -226,8 +260,7 @@ partial void ProcessListResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -236,6 +269,11 @@ partial void ProcessListResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -252,14 +290,15 @@ partial void ProcessListResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -299,6 +338,8 @@ partial void ProcessListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -319,6 +360,8 @@ partial void ProcessListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow listing table extractors. @@ -381,9 +424,13 @@ partial void ProcessListResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.ListTableExtractorsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.ListTableExtractorsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -411,9 +458,13 @@ partial void ProcessListResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.ListTableExtractorsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.ListTableExtractorsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.TableExtractorsClient.g.cs b/src/libs/Vectara/Generated/Vectara.TableExtractorsClient.g.cs index c81ed207..9495af00 100644 --- a/src/libs/Vectara/Generated/Vectara.TableExtractorsClient.g.cs +++ b/src/libs/Vectara/Generated/Vectara.TableExtractorsClient.g.cs @@ -75,10 +75,10 @@ public TableExtractorsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public TableExtractorsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Vectara.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Vectara.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Vectara/Generated/Vectara.ToolServersClient.Create.g.cs b/src/libs/Vectara/Generated/Vectara.ToolServersClient.Create.g.cs index 8c30c1fa..143b3b2b 100644 --- a/src/libs/Vectara/Generated/Vectara.ToolServersClient.Create.g.cs +++ b/src/libs/Vectara/Generated/Vectara.ToolServersClient.Create.g.cs @@ -73,6 +73,35 @@ partial void ProcessCreateResponseContent( /// public async global::System.Threading.Tasks.Task CreateAsync( + global::Vectara.CreateToolServerRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateAsResponseAsync( + + request: request, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create tool server
+ /// Create a new tool server to expose tools for use by 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> CreateAsResponseAsync( + global::Vectara.CreateToolServerRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, @@ -111,6 +140,7 @@ partial void ProcessCreateResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: "/v2/tool_servers", baseUri: HttpClient.BaseAddress); @@ -202,6 +232,8 @@ partial void ProcessCreateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -215,6 +247,11 @@ partial void ProcessCreateResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -232,6 +269,8 @@ partial void ProcessCreateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -241,8 +280,7 @@ partial void ProcessCreateResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -251,6 +289,11 @@ partial void ProcessCreateResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -267,14 +310,15 @@ partial void ProcessCreateResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -314,6 +358,8 @@ partial void ProcessCreateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -334,6 +380,8 @@ partial void ProcessCreateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Invalid request body. @@ -434,9 +482,13 @@ partial void ProcessCreateResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.ToolServer.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.ToolServer.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -464,9 +516,13 @@ partial void ProcessCreateResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.ToolServer.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.ToolServer.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.ToolServersClient.Delete.g.cs b/src/libs/Vectara/Generated/Vectara.ToolServersClient.Delete.g.cs index 9ca411aa..57cb4983 100644 --- a/src/libs/Vectara/Generated/Vectara.ToolServersClient.Delete.g.cs +++ b/src/libs/Vectara/Generated/Vectara.ToolServersClient.Delete.g.cs @@ -74,6 +74,33 @@ partial void ProcessDeleteResponse( int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await DeleteAsResponseAsync( + toolServerId: toolServerId, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Delete tool server
+ /// Permanently delete a tool server and all its associated configuration and tools. This action cannot be undone. + ///
+ /// + /// + /// + /// Example: tsr_rag_search + /// + /// 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 DeleteAsResponseAsync( + string toolServerId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -105,6 +132,7 @@ partial void ProcessDeleteResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/tool_servers/{toolServerId}", baseUri: HttpClient.BaseAddress); @@ -190,6 +218,8 @@ partial void ProcessDeleteResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -203,6 +233,11 @@ partial void ProcessDeleteResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -220,6 +255,8 @@ partial void ProcessDeleteResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -229,8 +266,7 @@ partial void ProcessDeleteResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -239,6 +275,11 @@ partial void ProcessDeleteResponse( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -255,14 +296,15 @@ partial void ProcessDeleteResponse( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -302,6 +344,8 @@ partial void ProcessDeleteResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -322,6 +366,8 @@ partial void ProcessDeleteResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow deleting this tool server. @@ -418,6 +464,10 @@ partial void ProcessDeleteResponse( { __response.EnsureSuccessStatusCode(); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -439,6 +489,10 @@ partial void ProcessDeleteResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.ToolServersClient.Get.g.cs b/src/libs/Vectara/Generated/Vectara.ToolServersClient.Get.g.cs index f7ff0c43..40fa1cc6 100644 --- a/src/libs/Vectara/Generated/Vectara.ToolServersClient.Get.g.cs +++ b/src/libs/Vectara/Generated/Vectara.ToolServersClient.Get.g.cs @@ -79,6 +79,35 @@ partial void ProcessGetResponseContent( int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetAsResponseAsync( + toolServerId: toolServerId, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get tool Server
+ /// Retrieve details about a specific tool server by its Id. + ///
+ /// + /// + /// + /// Example: tsr_rag_search + /// + /// 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> GetAsResponseAsync( + string toolServerId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -110,6 +139,7 @@ partial void ProcessGetResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/tool_servers/{toolServerId}", baseUri: HttpClient.BaseAddress); @@ -195,6 +225,8 @@ partial void ProcessGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -208,6 +240,11 @@ partial void ProcessGetResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -225,6 +262,8 @@ partial void ProcessGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -234,8 +273,7 @@ partial void ProcessGetResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -244,6 +282,11 @@ partial void ProcessGetResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -260,14 +303,15 @@ partial void ProcessGetResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -307,6 +351,8 @@ partial void ProcessGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -327,6 +373,8 @@ partial void ProcessGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow accessing this tool. @@ -427,9 +475,13 @@ partial void ProcessGetResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.ToolServer.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.ToolServer.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -457,9 +509,13 @@ partial void ProcessGetResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.ToolServer.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.ToolServer.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.ToolServersClient.List.g.cs b/src/libs/Vectara/Generated/Vectara.ToolServersClient.List.g.cs index 431d31af..d9cc4bc6 100644 --- a/src/libs/Vectara/Generated/Vectara.ToolServersClient.List.g.cs +++ b/src/libs/Vectara/Generated/Vectara.ToolServersClient.List.g.cs @@ -101,6 +101,53 @@ partial void ProcessListResponseContent( string? pageKey = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListAsResponseAsync( + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + filter: filter, + type: type, + enabled: enabled, + limit: limit, + pageKey: pageKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List tool servers
+ /// Retrieve a list of available tool servers that expose various tools. + ///
+ /// + /// + /// + /// Example: rag.* + /// + /// + /// Example: mcp + /// + /// + /// Example: true + /// + /// + /// Default Value: 10 + /// + /// + /// 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> ListAsResponseAsync( + int? requestTimeout = default, + int? requestTimeoutMillis = default, + string? filter = default, + global::Vectara.ListToolServersType? type = default, + bool? enabled = default, + int? limit = default, + string? pageKey = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -136,15 +183,16 @@ partial void ProcessListResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: "/v2/tool_servers", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("filter", filter) .AddOptionalParameter("type", type?.ToValueString()) .AddOptionalParameter("enabled", enabled?.ToString().ToLowerInvariant()) .AddOptionalParameter("limit", limit?.ToString()) - .AddOptionalParameter("page_key", pageKey) + .AddOptionalParameter("page_key", pageKey) ; var __path = __pathBuilder.ToString(); __path = global::Vectara.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -232,6 +280,8 @@ partial void ProcessListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -245,6 +295,11 @@ partial void ProcessListResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -262,6 +317,8 @@ partial void ProcessListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -271,8 +328,7 @@ partial void ProcessListResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -281,6 +337,11 @@ partial void ProcessListResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -297,14 +358,15 @@ partial void ProcessListResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -344,6 +406,8 @@ partial void ProcessListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -364,6 +428,8 @@ partial void ProcessListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow listing tool servers. @@ -426,9 +492,13 @@ partial void ProcessListResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.ListToolServersResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.ListToolServersResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -456,9 +526,13 @@ partial void ProcessListResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.ListToolServersResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.ListToolServersResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.ToolServersClient.Sync.g.cs b/src/libs/Vectara/Generated/Vectara.ToolServersClient.Sync.g.cs index a2da0755..f3a71579 100644 --- a/src/libs/Vectara/Generated/Vectara.ToolServersClient.Sync.g.cs +++ b/src/libs/Vectara/Generated/Vectara.ToolServersClient.Sync.g.cs @@ -74,6 +74,33 @@ partial void ProcessSyncResponse( int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await SyncAsResponseAsync( + toolServerId: toolServerId, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Synchronize tool server
+ /// Trigger a synchronization of the tool server to ensure it is up-to-date with the latest tools. + ///
+ /// + /// + /// + /// Example: tsr_rag_search + /// + /// 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 SyncAsResponseAsync( + string toolServerId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -105,6 +132,7 @@ partial void ProcessSyncResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/tool_servers/{toolServerId}/sync", baseUri: HttpClient.BaseAddress); @@ -190,6 +218,8 @@ partial void ProcessSyncResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -203,6 +233,11 @@ partial void ProcessSyncResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -220,6 +255,8 @@ partial void ProcessSyncResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -229,8 +266,7 @@ partial void ProcessSyncResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -239,6 +275,11 @@ partial void ProcessSyncResponse( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -255,14 +296,15 @@ partial void ProcessSyncResponse( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -302,6 +344,8 @@ partial void ProcessSyncResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -322,6 +366,8 @@ partial void ProcessSyncResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow synchronizing this tool server. @@ -418,6 +464,10 @@ partial void ProcessSyncResponse( { __response.EnsureSuccessStatusCode(); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -439,6 +489,10 @@ partial void ProcessSyncResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.ToolServersClient.Update.g.cs b/src/libs/Vectara/Generated/Vectara.ToolServersClient.Update.g.cs index d92592e2..ec3545f2 100644 --- a/src/libs/Vectara/Generated/Vectara.ToolServersClient.Update.g.cs +++ b/src/libs/Vectara/Generated/Vectara.ToolServersClient.Update.g.cs @@ -79,6 +79,40 @@ partial void ProcessUpdateResponseContent( public async global::System.Threading.Tasks.Task UpdateAsync( string toolServerId, + global::Vectara.UpdateToolServerRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdateAsResponseAsync( + toolServerId: toolServerId, + + request: request, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update tool server
+ /// Update the configuration of a specific tool server. + ///
+ /// + /// + /// + /// Example: tsr_rag_search + /// + /// + /// 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> UpdateAsResponseAsync( + string toolServerId, + global::Vectara.UpdateToolServerRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, @@ -118,6 +152,7 @@ partial void ProcessUpdateResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/tool_servers/{toolServerId}", baseUri: HttpClient.BaseAddress); @@ -210,6 +245,8 @@ partial void ProcessUpdateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -223,6 +260,11 @@ partial void ProcessUpdateResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -240,6 +282,8 @@ partial void ProcessUpdateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -249,8 +293,7 @@ partial void ProcessUpdateResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -259,6 +302,11 @@ partial void ProcessUpdateResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -275,14 +323,15 @@ partial void ProcessUpdateResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -322,6 +371,8 @@ partial void ProcessUpdateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -342,6 +393,8 @@ partial void ProcessUpdateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Invalid request body. @@ -480,9 +533,13 @@ partial void ProcessUpdateResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.ToolServer.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.ToolServer.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -510,9 +567,13 @@ partial void ProcessUpdateResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.ToolServer.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.ToolServer.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.ToolServersClient.g.cs b/src/libs/Vectara/Generated/Vectara.ToolServersClient.g.cs index 420974aa..0c0a03e7 100644 --- a/src/libs/Vectara/Generated/Vectara.ToolServersClient.g.cs +++ b/src/libs/Vectara/Generated/Vectara.ToolServersClient.g.cs @@ -75,10 +75,10 @@ public ToolServersClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public ToolServersClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Vectara.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Vectara.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Vectara/Generated/Vectara.ToolsClient.Create.g.cs b/src/libs/Vectara/Generated/Vectara.ToolsClient.Create.g.cs index 3dc77595..e3b1a005 100644 --- a/src/libs/Vectara/Generated/Vectara.ToolsClient.Create.g.cs +++ b/src/libs/Vectara/Generated/Vectara.ToolsClient.Create.g.cs @@ -84,6 +84,46 @@ partial void ProcessCreateResponseContent( /// public async global::System.Threading.Tasks.Task CreateAsync( + global::Vectara.CreateToolRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateAsResponseAsync( + + request: request, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create tool
+ /// Create a new tool that agents can use during conversation. Tools give agents capabilities to interact with external systems, process data, query corpora, or run custom logic. Agents select and invoke tools dynamically based on their instructions and the conversational context.
+ /// Vectara provides several built-in tools, but you can also create your own. This endpoint currently supports creating **Lambda tools**, which run user-defined Python functions in a secure sandbox.
+ /// Each tool is defined by:
+ /// - A unique tool ID
+ /// - A description of its purpose
+ /// - An input schema describing accepted parameters
+ /// - Optional metadata
+ /// - Enabled/disabled runtime availability
+ /// ## Artifact-based tools
+ /// Some built-in tools work with artifacts stored in a session:
+ /// - **Document conversion tool**: Converts file artifacts (PDF, Word, PowerPoint, images with OCR support) to markdown and produces new artifacts containing the extracted content.
+ /// These built-in tools operate on artifact references rather than file content, supporting multi-step workflows where agents process or index user-uploaded documents. + ///
+ /// + /// + /// + /// 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> CreateAsResponseAsync( + global::Vectara.CreateToolRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, @@ -120,6 +160,7 @@ partial void ProcessCreateResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: "/v2/tools", baseUri: HttpClient.BaseAddress); @@ -211,6 +252,8 @@ partial void ProcessCreateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -224,6 +267,11 @@ partial void ProcessCreateResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -241,6 +289,8 @@ partial void ProcessCreateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -250,8 +300,7 @@ partial void ProcessCreateResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -260,6 +309,11 @@ partial void ProcessCreateResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -276,14 +330,15 @@ partial void ProcessCreateResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -323,6 +378,8 @@ partial void ProcessCreateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -343,6 +400,8 @@ partial void ProcessCreateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Tool creation request was malformed or contains invalid configuration. @@ -481,9 +540,13 @@ partial void ProcessCreateResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.Tool.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.Tool.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -511,9 +574,13 @@ partial void ProcessCreateResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.Tool.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.Tool.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.ToolsClient.Delete.g.cs b/src/libs/Vectara/Generated/Vectara.ToolsClient.Delete.g.cs index 8bf79b91..39004241 100644 --- a/src/libs/Vectara/Generated/Vectara.ToolsClient.Delete.g.cs +++ b/src/libs/Vectara/Generated/Vectara.ToolsClient.Delete.g.cs @@ -74,6 +74,33 @@ partial void ProcessDeleteResponse( int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await DeleteAsResponseAsync( + toolId: toolId, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Delete tool
+ /// Permanently delete a tool and its configuration. This action cannot be undone. Agents attempting to use a deleted tool will fail, so ensure that agent configurations are updated before removing a tool. + ///
+ /// + /// + /// + /// Example: tol_rag_search + /// + /// 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 DeleteAsResponseAsync( + string toolId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -105,6 +132,7 @@ partial void ProcessDeleteResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/tools/{toolId}", baseUri: HttpClient.BaseAddress); @@ -190,6 +218,8 @@ partial void ProcessDeleteResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -203,6 +233,11 @@ partial void ProcessDeleteResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -220,6 +255,8 @@ partial void ProcessDeleteResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -229,8 +266,7 @@ partial void ProcessDeleteResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -239,6 +275,11 @@ partial void ProcessDeleteResponse( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -255,14 +296,15 @@ partial void ProcessDeleteResponse( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -302,6 +344,8 @@ partial void ProcessDeleteResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -322,6 +366,8 @@ partial void ProcessDeleteResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow deleting this tool. @@ -418,6 +464,10 @@ partial void ProcessDeleteResponse( { __response.EnsureSuccessStatusCode(); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -439,6 +489,10 @@ partial void ProcessDeleteResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.ToolsClient.Get.g.cs b/src/libs/Vectara/Generated/Vectara.ToolsClient.Get.g.cs index 28bd114f..b898a678 100644 --- a/src/libs/Vectara/Generated/Vectara.ToolsClient.Get.g.cs +++ b/src/libs/Vectara/Generated/Vectara.ToolsClient.Get.g.cs @@ -79,6 +79,35 @@ partial void ProcessGetResponseContent( int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetAsResponseAsync( + toolId: toolId, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get tool
+ /// Retrieve the full details of a specific tool, including its description, input schema, metadata, and capabilities. Tools may represent structured search functions, document-processing workflows, or user-defined Lambda functions. Some tools work with artifacts stored in a session, while others operate on structured inputs defined by their JSON schema. + ///
+ /// + /// + /// + /// Example: tol_rag_search + /// + /// 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> GetAsResponseAsync( + string toolId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -110,6 +139,7 @@ partial void ProcessGetResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/tools/{toolId}", baseUri: HttpClient.BaseAddress); @@ -195,6 +225,8 @@ partial void ProcessGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -208,6 +240,11 @@ partial void ProcessGetResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -225,6 +262,8 @@ partial void ProcessGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -234,8 +273,7 @@ partial void ProcessGetResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -244,6 +282,11 @@ partial void ProcessGetResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -260,14 +303,15 @@ partial void ProcessGetResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -307,6 +351,8 @@ partial void ProcessGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -327,6 +373,8 @@ partial void ProcessGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow accessing this tool. @@ -427,9 +475,13 @@ partial void ProcessGetResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.Tool.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.Tool.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -457,9 +509,13 @@ partial void ProcessGetResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.Tool.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.Tool.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.ToolsClient.List.g.cs b/src/libs/Vectara/Generated/Vectara.ToolsClient.List.g.cs index 395dba22..6ab2e6a8 100644 --- a/src/libs/Vectara/Generated/Vectara.ToolsClient.List.g.cs +++ b/src/libs/Vectara/Generated/Vectara.ToolsClient.List.g.cs @@ -113,6 +113,63 @@ partial void ProcessListResponseContent( string? pageKey = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListAsResponseAsync( + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + filter: filter, + type: type, + enabled: enabled, + category: category, + toolServerId: toolServerId, + limit: limit, + pageKey: pageKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List tools
+ /// List all tools available to the authenticated user, with optional filtering and pagination. Tools represent capabilities that agents can invoke during conversation, including built-in system tools and user-defined Lambda tools. Use filters to locate tools by name, type, status, or tool server. + ///
+ /// + /// + /// + /// Example: rag.* + /// + /// + /// Example: mcp + /// + /// + /// Example: true + /// + /// + /// Example: [retrieval, utilities] + /// + /// + /// Example: tsr_rag_search + /// + /// + /// Default Value: 50 + /// + /// + /// 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> ListAsResponseAsync( + int? requestTimeout = default, + int? requestTimeoutMillis = default, + string? filter = default, + global::Vectara.ListToolsType? type = default, + bool? enabled = default, + global::System.Collections.Generic.IList? category = default, + string? toolServerId = default, + int? limit = default, + string? pageKey = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -150,9 +207,10 @@ partial void ProcessListResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: "/v2/tools", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("filter", filter) .AddOptionalParameter("type", type?.ToValueString()) @@ -160,7 +218,7 @@ partial void ProcessListResponseContent( .AddOptionalParameter("category", category, delimiter: ",", explode: true) .AddOptionalParameter("tool_server_id", toolServerId) .AddOptionalParameter("limit", limit?.ToString()) - .AddOptionalParameter("page_key", pageKey) + .AddOptionalParameter("page_key", pageKey) ; var __path = __pathBuilder.ToString(); __path = global::Vectara.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -250,6 +308,8 @@ partial void ProcessListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -263,6 +323,11 @@ partial void ProcessListResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -280,6 +345,8 @@ partial void ProcessListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -289,8 +356,7 @@ partial void ProcessListResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -299,6 +365,11 @@ partial void ProcessListResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -315,14 +386,15 @@ partial void ProcessListResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -362,6 +434,8 @@ partial void ProcessListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -382,6 +456,8 @@ partial void ProcessListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow listing tools. @@ -444,9 +520,13 @@ partial void ProcessListResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.ListToolsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.ListToolsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -474,9 +554,13 @@ partial void ProcessListResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.ListToolsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.ListToolsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.ToolsClient.Test.g.cs b/src/libs/Vectara/Generated/Vectara.ToolsClient.Test.g.cs index ce89fbc5..edf7bea1 100644 --- a/src/libs/Vectara/Generated/Vectara.ToolsClient.Test.g.cs +++ b/src/libs/Vectara/Generated/Vectara.ToolsClient.Test.g.cs @@ -81,6 +81,42 @@ partial void ProcessTestResponseContent( public async global::System.Threading.Tasks.Task TestAsync( string toolId, + global::Vectara.TestToolRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await TestAsResponseAsync( + toolId: toolId, + + request: request, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Test Lambda tool
+ /// Execute a Lambda tool with test inputs to verify it works correctly.
+ /// This endpoint allows users to test their functions before using them with agents.
+ /// The function is executed in a secure sandbox environment with the same constraints as production. + ///
+ /// + /// + /// + /// Example: tol_python_function_123 + /// + /// + /// 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> TestAsResponseAsync( + string toolId, + global::Vectara.TestToolRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, @@ -120,6 +156,7 @@ partial void ProcessTestResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/tools/{toolId}/test", baseUri: HttpClient.BaseAddress); @@ -212,6 +249,8 @@ partial void ProcessTestResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -225,6 +264,11 @@ partial void ProcessTestResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -242,6 +286,8 @@ partial void ProcessTestResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -251,8 +297,7 @@ partial void ProcessTestResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -261,6 +306,11 @@ partial void ProcessTestResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -277,14 +327,15 @@ partial void ProcessTestResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -324,6 +375,8 @@ partial void ProcessTestResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -344,6 +397,8 @@ partial void ProcessTestResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Invalid test input or tool configuration. @@ -520,9 +575,13 @@ partial void ProcessTestResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.TestToolResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.TestToolResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -550,9 +609,13 @@ partial void ProcessTestResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.TestToolResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.TestToolResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.ToolsClient.TestWithoutCreation.g.cs b/src/libs/Vectara/Generated/Vectara.ToolsClient.TestWithoutCreation.g.cs index c7d74461..1752283e 100644 --- a/src/libs/Vectara/Generated/Vectara.ToolsClient.TestWithoutCreation.g.cs +++ b/src/libs/Vectara/Generated/Vectara.ToolsClient.TestWithoutCreation.g.cs @@ -79,6 +79,41 @@ partial void ProcessTestWithoutCreationResponseContent( /// public async global::System.Threading.Tasks.Task TestWithoutCreationAsync( + global::Vectara.TestLambdaToolRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await TestWithoutCreationAsResponseAsync( + + request: request, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Test Lambda tool without creation
+ /// Test a Lambda tool without creating it first. This endpoint allows you to validate code, discover schemas, and test execution before committing to tool creation.
+ /// Use this to:
+ /// - Validate Python code syntax and security constraints
+ /// - Discover input/output schemas from type annotations
+ /// - Test execution with sample input
+ /// - Verify schema compatibility
+ /// The function is executed in the same secure sandbox environment as production tools. + ///
+ /// + /// + /// + /// 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> TestWithoutCreationAsResponseAsync( + global::Vectara.TestLambdaToolRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, @@ -117,6 +152,7 @@ partial void ProcessTestWithoutCreationResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: "/v2/tools/test", baseUri: HttpClient.BaseAddress); @@ -208,6 +244,8 @@ partial void ProcessTestWithoutCreationResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -221,6 +259,11 @@ partial void ProcessTestWithoutCreationResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -238,6 +281,8 @@ partial void ProcessTestWithoutCreationResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -247,8 +292,7 @@ partial void ProcessTestWithoutCreationResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -257,6 +301,11 @@ partial void ProcessTestWithoutCreationResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -273,14 +322,15 @@ partial void ProcessTestWithoutCreationResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -320,6 +370,8 @@ partial void ProcessTestWithoutCreationResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -340,6 +392,8 @@ partial void ProcessTestWithoutCreationResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Invalid request or malformed code. @@ -440,9 +494,13 @@ partial void ProcessTestWithoutCreationResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.TestLambdaToolResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.TestLambdaToolResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -470,9 +528,13 @@ partial void ProcessTestWithoutCreationResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.TestLambdaToolResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.TestLambdaToolResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.ToolsClient.Update.g.cs b/src/libs/Vectara/Generated/Vectara.ToolsClient.Update.g.cs index 751373b5..c7335745 100644 --- a/src/libs/Vectara/Generated/Vectara.ToolsClient.Update.g.cs +++ b/src/libs/Vectara/Generated/Vectara.ToolsClient.Update.g.cs @@ -79,6 +79,40 @@ partial void ProcessUpdateResponseContent( public async global::System.Threading.Tasks.Task UpdateAsync( string toolId, + global::Vectara.UpdateToolRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdateAsResponseAsync( + toolId: toolId, + + request: request, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update tool
+ /// Update an existing tool’s configuration, including its metadata, enabled status, or other properties. Updating a tool modifies how agents can invoke it during conversation. + ///
+ /// + /// + /// + /// Example: tol_rag_search + /// + /// + /// 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> UpdateAsResponseAsync( + string toolId, + global::Vectara.UpdateToolRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, @@ -116,6 +150,7 @@ partial void ProcessUpdateResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/tools/{toolId}", baseUri: HttpClient.BaseAddress); @@ -208,6 +243,8 @@ partial void ProcessUpdateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -221,6 +258,11 @@ partial void ProcessUpdateResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -238,6 +280,8 @@ partial void ProcessUpdateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -247,8 +291,7 @@ partial void ProcessUpdateResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -257,6 +300,11 @@ partial void ProcessUpdateResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -273,14 +321,15 @@ partial void ProcessUpdateResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -320,6 +369,8 @@ partial void ProcessUpdateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -340,6 +391,8 @@ partial void ProcessUpdateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Tool update request was malformed or contains invalid references. @@ -478,9 +531,13 @@ partial void ProcessUpdateResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.Tool.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.Tool.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -508,9 +565,13 @@ partial void ProcessUpdateResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.Tool.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.Tool.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.ToolsClient.g.cs b/src/libs/Vectara/Generated/Vectara.ToolsClient.g.cs index 1b4a0e3c..dd08432c 100644 --- a/src/libs/Vectara/Generated/Vectara.ToolsClient.g.cs +++ b/src/libs/Vectara/Generated/Vectara.ToolsClient.g.cs @@ -75,10 +75,10 @@ public ToolsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public ToolsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Vectara.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Vectara.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Vectara/Generated/Vectara.UploadClient.File.g.cs b/src/libs/Vectara/Generated/Vectara.UploadClient.File.g.cs index da25c4bb..6824ecdd 100644 --- a/src/libs/Vectara/Generated/Vectara.UploadClient.File.g.cs +++ b/src/libs/Vectara/Generated/Vectara.UploadClient.File.g.cs @@ -140,6 +140,101 @@ partial void ProcessFileResponseContent( public async global::System.Threading.Tasks.Task FileAsync( string corpusKey, + global::Vectara.UploadFileRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await FileAsResponseAsync( + corpusKey: corpusKey, + + request: request, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Upload a file to the corpus
+ /// Upload a file to a corpus for automatic text extraction, chunking, and indexing. This endpoint is designed for unstructured documents where you want Vectara to handle parsing for you. Each uploaded file can be up to **10 MB**.
+ /// Supported file types include:
+ /// - Markdown (`.md`)
+ /// - PDF/A (`.pdf`)
+ /// - OpenOffice documents (`.odt`)
+ /// - Microsoft Word (`.doc`, `.docx`)
+ /// - Microsoft PowerPoint (`.ppt`, `.pptx`)
+ /// - Plain text (`.txt`)
+ /// - HTML (`.html`)
+ /// - LXML (`.lxml`)
+ /// - RTF (`.rtf`)
+ /// - EPUB (`.epub`)
+ /// - Email files (RFC 822)
+ /// :::note
+ /// For semi-structured documents that require more control over fields or metadata, use the [**Create Corpus Document API**](/docs/rest-api/create-corpus-document) instead.
+ /// :::
+ /// ## Additional format support through Vectara Ingest
+ /// If you need to ingest additional file types or data sources, you can use the open-source [**Vectara Ingest**](https://github.com/vectara/vectara-ingest) Python framework. It supports connectors for websites, RSS feeds, CSV, Confluence, HubSpot, ServiceNow, Jira, Notion, Slack, MediaWiki, GitHub, SharePoint, Twitter/X, YouTube, and more.
+ /// :::caution
+ /// Vectara Ingest is provided as an open-source example and is not officially supported.
+ /// :::
+ /// ## Multipart form fields
+ /// This endpoint expects a `multipart/form-data` request with the following fields:
+ /// - **metadata** (optional): JSON metadata to attach to the parsed document.
+ /// Example: `metadata={"key":"value"}`
+ /// - **chunking_strategy** (optional): Controls how extracted text is chunked.
+ /// Defaults to sentence-based chunking (one chunk per sentence).
+ /// Example: `{"type":"sentence_chunking_strategy"}`.
+ /// Example for max character chunking: `{"type":"max_chars_chunking_strategy","max_chars_per_chunk":512}`
+ /// - **table_extraction_config** (optional): Enables extraction of tables from supported file types such as PDFs.
+ /// Example: `{"extract_tables": true}`
+ /// - **file** (required): The file to upload.
+ /// - **filename** (required): The desired document ID, specified within the file upload field.
+ /// Apart from these parameters, the servers expect a valid JWT Token in the HTTP headers:
+ /// ```curl
+ /// \$ curl -L -X POST 'https://api.vectara.io/v2/corpora/:corpus_key/upload_file' \
+ /// -H 'Content-Type: multipart/form-data' \
+ /// -H 'Accept: application/json' \
+ /// -H 'x-api-key: zwt_123456' \
+ /// -F 'metadata=\{"key": "value"\};type=application/json' \
+ /// -F 'file=@/path/to/file/file.pdf;filename=desired_filename.pdf'
+ /// ```
+ /// ## Filenames with non-ASCII characters
+ /// When uploading files with non-ASCII (non-English) characters, such as Russian or Chinese, ensure that the filename is URL encoded. The Vectara REST API follows web standards which require URL-encoded file names.
+ /// ## Set the document ID
+ ///
+ /// To set a custom Document ID, pass it as the filename in the `Content-Disposition` header:
+ /// `Content-Disposition: form-data; name="file"; filename="your_document_id"`
+ /// For more information about Content-Disposition, see the [Mozilla documentation on headers](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition).
+ /// ## Attach additional metadata
+ /// You can attach additional metadata to the file by specifying a metadata form field, which can contain a JSON string:
+ /// `{ "filesize": 1234 }`
+ /// ## Tabular data extraction and summarization
+ /// Setting `table_extraction_config.extract_tables = true` enables extraction of tabular data (such as financial filings such as 10-K, 10-Q, S-1). You can also apply custom prompt templates to summarize table content during upload.
+ /// :::caution
+ /// Table extraction does not support scanned images of tables.
+ /// :::
+ /// ## Custom table summarization with prompt templates
+ /// Vectara supports [table summarization using custom prompt templates](https://docs.vectara.com/docs/build/working-with-tables#summarize-tables-with-custom-prompts) during document upload. This lets you define custom prompt templates that control how the LLM interprets and summarizes table data during extraction. By customizing the prompt_template, you can tailor summaries for domain-specific language, analytical perspectives, or formatting preferences.
+ /// ## Image support
+ /// You can include images in structured documents using the [Indexing API](/docs/rest-api/create-corpus-document) with Base64 encoding. You cannot send images directly with individual query requests. If you want to retrieve a specific image that is embedded within a document, use the [Retrieve image API](/docs/rest-api/get-image) + ///
+ /// + /// + /// + /// A user-provided key for a corpus.
+ /// Example: my-corpus + /// + /// + /// 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> FileAsResponseAsync( + string corpusKey, + global::Vectara.UploadFileRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, @@ -175,10 +270,11 @@ partial void ProcessFileResponseContent( var __maxAttempts = global::Vectara.AutoSDKRequestOptionsSupport.GetMaxAttempts( clientOptions: Options, requestOptions: requestOptions, - supportsRetry: true); + supportsRetry: false); global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/corpora/{corpusKey}/upload_file", baseUri: HttpClient.BaseAddress); @@ -221,6 +317,7 @@ partial void ProcessFileResponseContent( __httpRequest.Headers.TryAddWithoutValidation("Request-Timeout-Millis", requestTimeoutMillis.ToString()); } + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); if (requestTimeout != default) { @@ -228,44 +325,51 @@ partial void ProcessFileResponseContent( __httpRequestContent.Add( content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(requestTimeout, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), name: "\"Request-Timeout\""); - } + + } if (requestTimeoutMillis != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(requestTimeoutMillis, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), name: "\"Request-Timeout-Millis\""); + } __httpRequestContent.Add( content: new global::System.Net.Http.StringContent(corpusKey ?? string.Empty), name: "\"corpus_key\""); + if (request.Metadata != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent(request.Metadata.ToString() ?? string.Empty), name: "\"metadata\""); - } + + } if (request.ChunkingStrategy != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent(request.ChunkingStrategy.ToString() ?? string.Empty), name: "\"chunking_strategy\""); - } + + } if (request.TableExtractionConfig != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent(request.TableExtractionConfig.ToJson(JsonSerializerContext)), name: "\"table_extraction_config\""); - } + + } if (request.Filename != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent(request.Filename ?? string.Empty), name: "\"filename\""); + } var __contentFile = new global::System.Net.Http.ByteArrayContent(request.File ?? global::System.Array.Empty()); __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( @@ -304,7 +408,9 @@ request.Filename is null { __contentFile.Headers.ContentDisposition.FileNameStar = null; } + __httpRequest.Content = __httpRequestContent; + global::Vectara.AutoSDKRequestOptionsSupport.ApplyHeaders( request: __httpRequest, clientHeaders: Options.Headers, @@ -349,6 +455,8 @@ request.Filename is null attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -362,6 +470,11 @@ request.Filename is null } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -379,6 +492,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) { @@ -388,8 +503,7 @@ request.Filename is null __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -398,6 +512,11 @@ request.Filename is null __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -414,14 +533,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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -461,6 +581,8 @@ request.Filename is null attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -481,6 +603,8 @@ request.Filename is null attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Upload file request was malformed. @@ -657,9 +781,13 @@ request.Filename is null { __response.EnsureSuccessStatusCode(); - return - global::Vectara.Document.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.Document.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -687,9 +815,13 @@ request.Filename is null #endif ).ConfigureAwait(false); - return - await global::Vectara.Document.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.Document.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -846,5 +978,1454 @@ request.Filename is null requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } + + /// + /// Upload a file to the corpus
+ /// Upload a file to a corpus for automatic text extraction, chunking, and indexing. This endpoint is designed for unstructured documents where you want Vectara to handle parsing for you. Each uploaded file can be up to **10 MB**.
+ /// Supported file types include:
+ /// - Markdown (`.md`)
+ /// - PDF/A (`.pdf`)
+ /// - OpenOffice documents (`.odt`)
+ /// - Microsoft Word (`.doc`, `.docx`)
+ /// - Microsoft PowerPoint (`.ppt`, `.pptx`)
+ /// - Plain text (`.txt`)
+ /// - HTML (`.html`)
+ /// - LXML (`.lxml`)
+ /// - RTF (`.rtf`)
+ /// - EPUB (`.epub`)
+ /// - Email files (RFC 822)
+ /// :::note
+ /// For semi-structured documents that require more control over fields or metadata, use the [**Create Corpus Document API**](/docs/rest-api/create-corpus-document) instead.
+ /// :::
+ /// ## Additional format support through Vectara Ingest
+ /// If you need to ingest additional file types or data sources, you can use the open-source [**Vectara Ingest**](https://github.com/vectara/vectara-ingest) Python framework. It supports connectors for websites, RSS feeds, CSV, Confluence, HubSpot, ServiceNow, Jira, Notion, Slack, MediaWiki, GitHub, SharePoint, Twitter/X, YouTube, and more.
+ /// :::caution
+ /// Vectara Ingest is provided as an open-source example and is not officially supported.
+ /// :::
+ /// ## Multipart form fields
+ /// This endpoint expects a `multipart/form-data` request with the following fields:
+ /// - **metadata** (optional): JSON metadata to attach to the parsed document.
+ /// Example: `metadata={"key":"value"}`
+ /// - **chunking_strategy** (optional): Controls how extracted text is chunked.
+ /// Defaults to sentence-based chunking (one chunk per sentence).
+ /// Example: `{"type":"sentence_chunking_strategy"}`.
+ /// Example for max character chunking: `{"type":"max_chars_chunking_strategy","max_chars_per_chunk":512}`
+ /// - **table_extraction_config** (optional): Enables extraction of tables from supported file types such as PDFs.
+ /// Example: `{"extract_tables": true}`
+ /// - **file** (required): The file to upload.
+ /// - **filename** (required): The desired document ID, specified within the file upload field.
+ /// Apart from these parameters, the servers expect a valid JWT Token in the HTTP headers:
+ /// ```curl
+ /// \$ curl -L -X POST 'https://api.vectara.io/v2/corpora/:corpus_key/upload_file' \
+ /// -H 'Content-Type: multipart/form-data' \
+ /// -H 'Accept: application/json' \
+ /// -H 'x-api-key: zwt_123456' \
+ /// -F 'metadata=\{"key": "value"\};type=application/json' \
+ /// -F 'file=@/path/to/file/file.pdf;filename=desired_filename.pdf'
+ /// ```
+ /// ## Filenames with non-ASCII characters
+ /// When uploading files with non-ASCII (non-English) characters, such as Russian or Chinese, ensure that the filename is URL encoded. The Vectara REST API follows web standards which require URL-encoded file names.
+ /// ## Set the document ID
+ ///
+ /// To set a custom Document ID, pass it as the filename in the `Content-Disposition` header:
+ /// `Content-Disposition: form-data; name="file"; filename="your_document_id"`
+ /// For more information about Content-Disposition, see the [Mozilla documentation on headers](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition).
+ /// ## Attach additional metadata
+ /// You can attach additional metadata to the file by specifying a metadata form field, which can contain a JSON string:
+ /// `{ "filesize": 1234 }`
+ /// ## Tabular data extraction and summarization
+ /// Setting `table_extraction_config.extract_tables = true` enables extraction of tabular data (such as financial filings such as 10-K, 10-Q, S-1). You can also apply custom prompt templates to summarize table content during upload.
+ /// :::caution
+ /// Table extraction does not support scanned images of tables.
+ /// :::
+ /// ## Custom table summarization with prompt templates
+ /// Vectara supports [table summarization using custom prompt templates](https://docs.vectara.com/docs/build/working-with-tables#summarize-tables-with-custom-prompts) during document upload. This lets you define custom prompt templates that control how the LLM interprets and summarizes table data during extraction. By customizing the prompt_template, you can tailor summaries for domain-specific language, analytical perspectives, or formatting preferences.
+ /// ## Image support
+ /// You can include images in structured documents using the [Indexing API](/docs/rest-api/create-corpus-document) with Base64 encoding. You cannot send images directly with individual query requests. If you want to retrieve a specific image that is embedded within a document, use the [Retrieve image API](/docs/rest-api/get-image) + ///
+ /// + /// + /// + /// A user-provided key for a corpus.
+ /// Example: my-corpus + /// + /// + /// Arbitrary object that will be attached as document metadata to the extracted document.
+ /// Example: {"department":"engineering","doc_type\u0022":"architecture_diagram"} + /// + /// + /// Choose how to split documents into chunks during indexing. This is optional - if you do not set a chunking strategy, the platform uses the default strategy which creates one chunk (docpart) per sentence. + /// + /// + /// Configuration for table extraction from the document. This is optional and if not provided, the platform does not extract tables from PDF files. + /// + /// + /// Optional multipart section to override the filename.
+ /// Example: system_design_v1.pdf + /// + /// + /// Binary file contents. The file name of the file will be used as the document ID. + /// + /// 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 FileAsync( + string corpusKey, + global::System.IO.Stream file, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + object? metadata = default, + global::Vectara.ChunkingStrategy? chunkingStrategy = default, + global::Vectara.TableExtractionConfig? tableExtractionConfig = default, + string? filename = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + file = file ?? throw new global::System.ArgumentNullException(nameof(file)); + var request = new global::Vectara.UploadFileRequest + { + Metadata = metadata, + ChunkingStrategy = chunkingStrategy, + TableExtractionConfig = tableExtractionConfig, + Filename = filename, + File = global::System.Array.Empty(), + }; + PrepareArguments( + client: HttpClient); + PrepareFileArguments( + httpClient: HttpClient, + requestTimeout: ref requestTimeout, + requestTimeoutMillis: ref requestTimeoutMillis, + corpusKey: ref corpusKey, + request: request); + + + var __authorizations = global::Vectara.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_FileSecurityRequirements, + operationName: "FileAsync"); + + using var __timeoutCancellationTokenSource = global::Vectara.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Vectara.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Vectara.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Vectara.PathBuilder( + path: $"/v2/corpora/{corpusKey}/upload_file", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::Vectara.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 (requestTimeout != default) + { + __httpRequest.Headers.TryAddWithoutValidation("Request-Timeout", requestTimeout.ToString()); + } + if (requestTimeoutMillis != default) + { + __httpRequest.Headers.TryAddWithoutValidation("Request-Timeout-Millis", requestTimeoutMillis.ToString()); + } + + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + if (requestTimeout != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(requestTimeout, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"Request-Timeout\""); + + } + if (requestTimeoutMillis != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(requestTimeoutMillis, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"Request-Timeout-Millis\""); + + } + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(corpusKey ?? string.Empty), + name: "\"corpus_key\""); + + if (request.Metadata != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Metadata.ToString() ?? string.Empty), + name: "\"metadata\""); + + } + if (request.ChunkingStrategy != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.ChunkingStrategy.ToString() ?? string.Empty), + name: "\"chunking_strategy\""); + + } + if (request.TableExtractionConfig != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.TableExtractionConfig.ToJson(JsonSerializerContext)), + name: "\"table_extraction_config\""); + + } + if (request.Filename != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Filename ?? string.Empty), + name: "\"filename\""); + + } + 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; + } + + __httpRequest.Content = __httpRequestContent; + + global::Vectara.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareFileRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + corpusKey: corpusKey!, + 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::Vectara.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "File", + methodName: "FileAsync", + pathTemplate: "$\"/v2/corpora/{corpusKey}/upload_file\"", + 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 global::Vectara.VectaraClient.AutoSDKOAuth2Helpers.SendAsync( + httpClient: HttpClient, + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + authorizations: __authorizations, + oAuth2Coordinator: AutoSDKOAuth2State, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "File", + methodName: "FileAsync", + pathTemplate: "$\"/v2/corpora/{corpusKey}/upload_file\"", + 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "File", + methodName: "FileAsync", + pathTemplate: "$\"/v2/corpora/{corpusKey}/upload_file\"", + 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::Vectara.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); + ProcessFileResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "File", + methodName: "FileAsync", + pathTemplate: "$\"/v2/corpora/{corpusKey}/upload_file\"", + 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::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "File", + methodName: "FileAsync", + pathTemplate: "$\"/v2/corpora/{corpusKey}/upload_file\"", + 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); + } + // Upload file request was malformed. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::Vectara.BadRequestError? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::Vectara.BadRequestError.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::Vectara.BadRequestError.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + throw new global::Vectara.ApiException( + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + statusCode: __response.StatusCode) + { + ResponseBody = __content_400, + ResponseObject = __value_400, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Permissions do not allow uploading a file to the corpus. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::Vectara.Error? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::Vectara.Error.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::Vectara.Error.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + throw new global::Vectara.ApiException( + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + statusCode: __response.StatusCode) + { + ResponseBody = __content_403, + ResponseObject = __value_403, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Corpus not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::Vectara.NotFoundError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::Vectara.NotFoundError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::Vectara.NotFoundError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + throw new global::Vectara.ApiException( + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + statusCode: __response.StatusCode) + { + ResponseBody = __content_404, + ResponseObject = __value_404, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // The media type of the uploaded file is not supported. + if ((int)__response.StatusCode == 415) + { + string? __content_415 = null; + global::System.Exception? __exception_415 = null; + global::Vectara.Error? __value_415 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_415 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_415 = global::Vectara.Error.FromJson(__content_415, JsonSerializerContext); + } + else + { + __content_415 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_415 = global::Vectara.Error.FromJson(__content_415, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_415 = __ex; + } + + throw new global::Vectara.ApiException( + message: __content_415 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_415, + statusCode: __response.StatusCode) + { + ResponseBody = __content_415, + ResponseObject = __value_415, + 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); + ProcessFileResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Vectara.Document.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw new global::Vectara.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::Vectara.Document.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::Vectara.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(); + } + } + /// + /// Upload a file to the corpus
+ /// Upload a file to a corpus for automatic text extraction, chunking, and indexing. This endpoint is designed for unstructured documents where you want Vectara to handle parsing for you. Each uploaded file can be up to **10 MB**.
+ /// Supported file types include:
+ /// - Markdown (`.md`)
+ /// - PDF/A (`.pdf`)
+ /// - OpenOffice documents (`.odt`)
+ /// - Microsoft Word (`.doc`, `.docx`)
+ /// - Microsoft PowerPoint (`.ppt`, `.pptx`)
+ /// - Plain text (`.txt`)
+ /// - HTML (`.html`)
+ /// - LXML (`.lxml`)
+ /// - RTF (`.rtf`)
+ /// - EPUB (`.epub`)
+ /// - Email files (RFC 822)
+ /// :::note
+ /// For semi-structured documents that require more control over fields or metadata, use the [**Create Corpus Document API**](/docs/rest-api/create-corpus-document) instead.
+ /// :::
+ /// ## Additional format support through Vectara Ingest
+ /// If you need to ingest additional file types or data sources, you can use the open-source [**Vectara Ingest**](https://github.com/vectara/vectara-ingest) Python framework. It supports connectors for websites, RSS feeds, CSV, Confluence, HubSpot, ServiceNow, Jira, Notion, Slack, MediaWiki, GitHub, SharePoint, Twitter/X, YouTube, and more.
+ /// :::caution
+ /// Vectara Ingest is provided as an open-source example and is not officially supported.
+ /// :::
+ /// ## Multipart form fields
+ /// This endpoint expects a `multipart/form-data` request with the following fields:
+ /// - **metadata** (optional): JSON metadata to attach to the parsed document.
+ /// Example: `metadata={"key":"value"}`
+ /// - **chunking_strategy** (optional): Controls how extracted text is chunked.
+ /// Defaults to sentence-based chunking (one chunk per sentence).
+ /// Example: `{"type":"sentence_chunking_strategy"}`.
+ /// Example for max character chunking: `{"type":"max_chars_chunking_strategy","max_chars_per_chunk":512}`
+ /// - **table_extraction_config** (optional): Enables extraction of tables from supported file types such as PDFs.
+ /// Example: `{"extract_tables": true}`
+ /// - **file** (required): The file to upload.
+ /// - **filename** (required): The desired document ID, specified within the file upload field.
+ /// Apart from these parameters, the servers expect a valid JWT Token in the HTTP headers:
+ /// ```curl
+ /// \$ curl -L -X POST 'https://api.vectara.io/v2/corpora/:corpus_key/upload_file' \
+ /// -H 'Content-Type: multipart/form-data' \
+ /// -H 'Accept: application/json' \
+ /// -H 'x-api-key: zwt_123456' \
+ /// -F 'metadata=\{"key": "value"\};type=application/json' \
+ /// -F 'file=@/path/to/file/file.pdf;filename=desired_filename.pdf'
+ /// ```
+ /// ## Filenames with non-ASCII characters
+ /// When uploading files with non-ASCII (non-English) characters, such as Russian or Chinese, ensure that the filename is URL encoded. The Vectara REST API follows web standards which require URL-encoded file names.
+ /// ## Set the document ID
+ ///
+ /// To set a custom Document ID, pass it as the filename in the `Content-Disposition` header:
+ /// `Content-Disposition: form-data; name="file"; filename="your_document_id"`
+ /// For more information about Content-Disposition, see the [Mozilla documentation on headers](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition).
+ /// ## Attach additional metadata
+ /// You can attach additional metadata to the file by specifying a metadata form field, which can contain a JSON string:
+ /// `{ "filesize": 1234 }`
+ /// ## Tabular data extraction and summarization
+ /// Setting `table_extraction_config.extract_tables = true` enables extraction of tabular data (such as financial filings such as 10-K, 10-Q, S-1). You can also apply custom prompt templates to summarize table content during upload.
+ /// :::caution
+ /// Table extraction does not support scanned images of tables.
+ /// :::
+ /// ## Custom table summarization with prompt templates
+ /// Vectara supports [table summarization using custom prompt templates](https://docs.vectara.com/docs/build/working-with-tables#summarize-tables-with-custom-prompts) during document upload. This lets you define custom prompt templates that control how the LLM interprets and summarizes table data during extraction. By customizing the prompt_template, you can tailor summaries for domain-specific language, analytical perspectives, or formatting preferences.
+ /// ## Image support
+ /// You can include images in structured documents using the [Indexing API](/docs/rest-api/create-corpus-document) with Base64 encoding. You cannot send images directly with individual query requests. If you want to retrieve a specific image that is embedded within a document, use the [Retrieve image API](/docs/rest-api/get-image) + ///
+ /// + /// + /// + /// A user-provided key for a corpus.
+ /// Example: my-corpus + /// + /// + /// Arbitrary object that will be attached as document metadata to the extracted document.
+ /// Example: {"department":"engineering","doc_type\u0022":"architecture_diagram"} + /// + /// + /// Choose how to split documents into chunks during indexing. This is optional - if you do not set a chunking strategy, the platform uses the default strategy which creates one chunk (docpart) per sentence. + /// + /// + /// Configuration for table extraction from the document. This is optional and if not provided, the platform does not extract tables from PDF files. + /// + /// + /// Optional multipart section to override the filename.
+ /// Example: system_design_v1.pdf + /// + /// + /// Binary file contents. The file name of the file will be used as the document ID. + /// + /// 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> FileAsResponseAsync( + string corpusKey, + global::System.IO.Stream file, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + object? metadata = default, + global::Vectara.ChunkingStrategy? chunkingStrategy = default, + global::Vectara.TableExtractionConfig? tableExtractionConfig = default, + string? filename = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + file = file ?? throw new global::System.ArgumentNullException(nameof(file)); + var request = new global::Vectara.UploadFileRequest + { + Metadata = metadata, + ChunkingStrategy = chunkingStrategy, + TableExtractionConfig = tableExtractionConfig, + Filename = filename, + File = global::System.Array.Empty(), + }; + PrepareArguments( + client: HttpClient); + PrepareFileArguments( + httpClient: HttpClient, + requestTimeout: ref requestTimeout, + requestTimeoutMillis: ref requestTimeoutMillis, + corpusKey: ref corpusKey, + request: request); + + + var __authorizations = global::Vectara.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_FileSecurityRequirements, + operationName: "FileAsync"); + + using var __timeoutCancellationTokenSource = global::Vectara.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Vectara.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Vectara.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Vectara.PathBuilder( + path: $"/v2/corpora/{corpusKey}/upload_file", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::Vectara.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 (requestTimeout != default) + { + __httpRequest.Headers.TryAddWithoutValidation("Request-Timeout", requestTimeout.ToString()); + } + if (requestTimeoutMillis != default) + { + __httpRequest.Headers.TryAddWithoutValidation("Request-Timeout-Millis", requestTimeoutMillis.ToString()); + } + + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + if (requestTimeout != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(requestTimeout, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"Request-Timeout\""); + + } + if (requestTimeoutMillis != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(requestTimeoutMillis, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"Request-Timeout-Millis\""); + + } + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(corpusKey ?? string.Empty), + name: "\"corpus_key\""); + + if (request.Metadata != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Metadata.ToString() ?? string.Empty), + name: "\"metadata\""); + + } + if (request.ChunkingStrategy != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.ChunkingStrategy.ToString() ?? string.Empty), + name: "\"chunking_strategy\""); + + } + if (request.TableExtractionConfig != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.TableExtractionConfig.ToJson(JsonSerializerContext)), + name: "\"table_extraction_config\""); + + } + if (request.Filename != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Filename ?? string.Empty), + name: "\"filename\""); + + } + 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; + } + + __httpRequest.Content = __httpRequestContent; + + global::Vectara.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareFileRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + corpusKey: corpusKey!, + 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::Vectara.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "File", + methodName: "FileAsync", + pathTemplate: "$\"/v2/corpora/{corpusKey}/upload_file\"", + 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 global::Vectara.VectaraClient.AutoSDKOAuth2Helpers.SendAsync( + httpClient: HttpClient, + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + authorizations: __authorizations, + oAuth2Coordinator: AutoSDKOAuth2State, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "File", + methodName: "FileAsync", + pathTemplate: "$\"/v2/corpora/{corpusKey}/upload_file\"", + 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "File", + methodName: "FileAsync", + pathTemplate: "$\"/v2/corpora/{corpusKey}/upload_file\"", + 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::Vectara.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); + ProcessFileResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "File", + methodName: "FileAsync", + pathTemplate: "$\"/v2/corpora/{corpusKey}/upload_file\"", + 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::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "File", + methodName: "FileAsync", + pathTemplate: "$\"/v2/corpora/{corpusKey}/upload_file\"", + 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); + } + // Upload file request was malformed. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::Vectara.BadRequestError? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::Vectara.BadRequestError.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::Vectara.BadRequestError.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + throw new global::Vectara.ApiException( + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + statusCode: __response.StatusCode) + { + ResponseBody = __content_400, + ResponseObject = __value_400, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Permissions do not allow uploading a file to the corpus. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::Vectara.Error? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::Vectara.Error.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::Vectara.Error.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + throw new global::Vectara.ApiException( + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + statusCode: __response.StatusCode) + { + ResponseBody = __content_403, + ResponseObject = __value_403, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Corpus not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::Vectara.NotFoundError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::Vectara.NotFoundError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::Vectara.NotFoundError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + throw new global::Vectara.ApiException( + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + statusCode: __response.StatusCode) + { + ResponseBody = __content_404, + ResponseObject = __value_404, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // The media type of the uploaded file is not supported. + if ((int)__response.StatusCode == 415) + { + string? __content_415 = null; + global::System.Exception? __exception_415 = null; + global::Vectara.Error? __value_415 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_415 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_415 = global::Vectara.Error.FromJson(__content_415, JsonSerializerContext); + } + else + { + __content_415 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_415 = global::Vectara.Error.FromJson(__content_415, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_415 = __ex; + } + + throw new global::Vectara.ApiException( + message: __content_415 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_415, + statusCode: __response.StatusCode) + { + ResponseBody = __content_415, + ResponseObject = __value_415, + 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); + ProcessFileResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Vectara.Document.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw new global::Vectara.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::Vectara.Document.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.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::Vectara.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/Vectara/Generated/Vectara.UploadClient.g.cs b/src/libs/Vectara/Generated/Vectara.UploadClient.g.cs index 99f04a2d..049167d3 100644 --- a/src/libs/Vectara/Generated/Vectara.UploadClient.g.cs +++ b/src/libs/Vectara/Generated/Vectara.UploadClient.g.cs @@ -75,10 +75,10 @@ public UploadClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public UploadClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Vectara.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Vectara.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Vectara/Generated/Vectara.UsersClient.Create.g.cs b/src/libs/Vectara/Generated/Vectara.UsersClient.Create.g.cs index 52143d61..7a9d1266 100644 --- a/src/libs/Vectara/Generated/Vectara.UsersClient.Create.g.cs +++ b/src/libs/Vectara/Generated/Vectara.UsersClient.Create.g.cs @@ -73,6 +73,35 @@ partial void ProcessCreateResponseContent( /// public async global::System.Threading.Tasks.Task> CreateAsync( + global::Vectara.CreateUserRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateAsResponseAsync( + + request: request, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create a user in the current customer account
+ /// Create a user for the current customer account. For example, a company wants to onboard new team members efficiently and this endpoint lets you streamline the process by adding new users programmatically, assigning appropriate roles, and setting up access permissions. + ///
+ /// + /// + /// + /// 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>> CreateAsResponseAsync( + global::Vectara.CreateUserRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, @@ -111,6 +140,7 @@ partial void ProcessCreateResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: "/v2/users", baseUri: HttpClient.BaseAddress); @@ -202,6 +232,8 @@ partial void ProcessCreateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -215,6 +247,11 @@ partial void ProcessCreateResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -232,6 +269,8 @@ partial void ProcessCreateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -241,8 +280,7 @@ partial void ProcessCreateResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -251,6 +289,11 @@ partial void ProcessCreateResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -267,14 +310,15 @@ partial void ProcessCreateResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -314,6 +358,8 @@ partial void ProcessCreateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -334,6 +380,8 @@ partial void ProcessCreateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // User creation request was malformed. @@ -434,9 +482,13 @@ partial void ProcessCreateResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.AllOf.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.AllOf.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -464,9 +516,13 @@ partial void ProcessCreateResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.AllOf.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.AllOf.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.UsersClient.Delete.g.cs b/src/libs/Vectara/Generated/Vectara.UsersClient.Delete.g.cs index 301ae6a0..88483988 100644 --- a/src/libs/Vectara/Generated/Vectara.UsersClient.Delete.g.cs +++ b/src/libs/Vectara/Generated/Vectara.UsersClient.Delete.g.cs @@ -72,6 +72,31 @@ partial void ProcessDeleteResponse( int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await DeleteAsResponseAsync( + username: username, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Delete a user
+ /// Delete a user from the account. + ///
+ /// + /// + /// + /// 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 DeleteAsResponseAsync( + string username, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -103,6 +128,7 @@ partial void ProcessDeleteResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/users/{username}", baseUri: HttpClient.BaseAddress); @@ -188,6 +214,8 @@ partial void ProcessDeleteResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -201,6 +229,11 @@ partial void ProcessDeleteResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -218,6 +251,8 @@ partial void ProcessDeleteResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -227,8 +262,7 @@ partial void ProcessDeleteResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -237,6 +271,11 @@ partial void ProcessDeleteResponse( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -253,14 +292,15 @@ partial void ProcessDeleteResponse( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -300,6 +340,8 @@ partial void ProcessDeleteResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -320,6 +362,8 @@ partial void ProcessDeleteResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow deleting the user. @@ -416,6 +460,10 @@ partial void ProcessDeleteResponse( { __response.EnsureSuccessStatusCode(); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -437,6 +485,10 @@ partial void ProcessDeleteResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.UsersClient.Get.g.cs b/src/libs/Vectara/Generated/Vectara.UsersClient.Get.g.cs index ab0636e7..937672d8 100644 --- a/src/libs/Vectara/Generated/Vectara.UsersClient.Get.g.cs +++ b/src/libs/Vectara/Generated/Vectara.UsersClient.Get.g.cs @@ -77,6 +77,33 @@ partial void ProcessGetResponseContent( int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetAsResponseAsync( + username: username, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get a user
+ /// Get a user and view details like the email, username, and associated roles. + ///
+ /// + /// + /// + /// 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> GetAsResponseAsync( + string username, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -108,6 +135,7 @@ partial void ProcessGetResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/users/{username}", baseUri: HttpClient.BaseAddress); @@ -193,6 +221,8 @@ partial void ProcessGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -206,6 +236,11 @@ partial void ProcessGetResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -223,6 +258,8 @@ partial void ProcessGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -232,8 +269,7 @@ partial void ProcessGetResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -242,6 +278,11 @@ partial void ProcessGetResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -258,14 +299,15 @@ partial void ProcessGetResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -305,6 +347,8 @@ partial void ProcessGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -325,6 +369,8 @@ partial void ProcessGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow retrieving the user. @@ -425,9 +471,13 @@ partial void ProcessGetResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.User.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.User.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -455,9 +505,13 @@ partial void ProcessGetResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.User.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.User.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.UsersClient.List.g.cs b/src/libs/Vectara/Generated/Vectara.UsersClient.List.g.cs index ea3982b4..637657e7 100644 --- a/src/libs/Vectara/Generated/Vectara.UsersClient.List.g.cs +++ b/src/libs/Vectara/Generated/Vectara.UsersClient.List.g.cs @@ -91,6 +91,45 @@ partial void ProcessListResponseContent( string? corpusKey = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListAsResponseAsync( + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + limit: limit, + pageKey: pageKey, + corpusKey: corpusKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List users in the account
+ /// The List Users API lets you list all users on your team and also their corpus access and customer-level authorizations.
+ /// Other activities such as adding, deleting, enabling, disabling, resetting passwords, and editing user roles are performed by the [Update User](/docs/rest-api/update-user) endpoint. + ///
+ /// + /// + /// + /// Default Value: 10 + /// + /// + /// + /// A user-provided key for a corpus.
+ /// Example: my-corpus + /// + /// 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> ListAsResponseAsync( + int? requestTimeout = default, + int? requestTimeoutMillis = default, + int? limit = default, + string? pageKey = default, + string? corpusKey = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -124,13 +163,14 @@ partial void ProcessListResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: "/v2/users", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("page_key", pageKey) - .AddOptionalParameter("corpus_key", corpusKey) + .AddOptionalParameter("corpus_key", corpusKey) ; var __path = __pathBuilder.ToString(); __path = global::Vectara.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -216,6 +256,8 @@ partial void ProcessListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -229,6 +271,11 @@ partial void ProcessListResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -246,6 +293,8 @@ partial void ProcessListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -255,8 +304,7 @@ partial void ProcessListResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -265,6 +313,11 @@ partial void ProcessListResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -281,14 +334,15 @@ partial void ProcessListResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -328,6 +382,8 @@ partial void ProcessListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -348,6 +404,8 @@ partial void ProcessListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow listing users. @@ -410,9 +468,13 @@ partial void ProcessListResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.ListUsersResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.ListUsersResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -440,9 +502,13 @@ partial void ProcessListResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.ListUsersResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.ListUsersResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.UsersClient.ResetPassword.g.cs b/src/libs/Vectara/Generated/Vectara.UsersClient.ResetPassword.g.cs index 1158e8fd..ff836831 100644 --- a/src/libs/Vectara/Generated/Vectara.UsersClient.ResetPassword.g.cs +++ b/src/libs/Vectara/Generated/Vectara.UsersClient.ResetPassword.g.cs @@ -77,6 +77,33 @@ partial void ProcessResetPasswordResponseContent( int? requestTimeoutMillis = default, global::Vectara.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ResetPasswordAsResponseAsync( + username: username, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Reset the password for a user
+ /// Reset the password for a user. + ///
+ /// + /// + /// + /// 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> ResetPasswordAsResponseAsync( + string username, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -108,6 +135,7 @@ partial void ProcessResetPasswordResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/users/{username}/reset_password", baseUri: HttpClient.BaseAddress); @@ -193,6 +221,8 @@ partial void ProcessResetPasswordResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -206,6 +236,11 @@ partial void ProcessResetPasswordResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -223,6 +258,8 @@ partial void ProcessResetPasswordResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -232,8 +269,7 @@ partial void ProcessResetPasswordResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -242,6 +278,11 @@ partial void ProcessResetPasswordResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -258,14 +299,15 @@ partial void ProcessResetPasswordResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -305,6 +347,8 @@ partial void ProcessResetPasswordResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -325,6 +369,8 @@ partial void ProcessResetPasswordResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow resetting the user password. @@ -425,9 +471,13 @@ partial void ProcessResetPasswordResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.ResetUserPasswordResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.ResetUserPasswordResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -455,9 +505,13 @@ partial void ProcessResetPasswordResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.ResetUserPasswordResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.ResetUserPasswordResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.UsersClient.Update.g.cs b/src/libs/Vectara/Generated/Vectara.UsersClient.Update.g.cs index 15cfa061..f7a95a2e 100644 --- a/src/libs/Vectara/Generated/Vectara.UsersClient.Update.g.cs +++ b/src/libs/Vectara/Generated/Vectara.UsersClient.Update.g.cs @@ -77,6 +77,38 @@ partial void ProcessUpdateResponseContent( public async global::System.Threading.Tasks.Task UpdateAsync( string username, + global::Vectara.UpdateUserRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdateAsResponseAsync( + username: username, + + request: request, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update a user
+ /// Update details about a user such as role names. + ///
+ /// + /// + /// + /// + /// 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> UpdateAsResponseAsync( + string username, + global::Vectara.UpdateUserRequest request, int? requestTimeout = default, int? requestTimeoutMillis = default, @@ -116,6 +148,7 @@ partial void ProcessUpdateResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Vectara.PathBuilder( path: $"/v2/users/{username}", baseUri: HttpClient.BaseAddress); @@ -208,6 +241,8 @@ partial void ProcessUpdateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -221,6 +256,11 @@ partial void ProcessUpdateResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -238,6 +278,8 @@ partial void ProcessUpdateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -247,8 +289,7 @@ partial void ProcessUpdateResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -257,6 +298,11 @@ partial void ProcessUpdateResponseContent( __attempt < __maxAttempts && global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -273,14 +319,15 @@ partial void ProcessUpdateResponseContent( 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -320,6 +367,8 @@ partial void ProcessUpdateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -340,6 +389,8 @@ partial void ProcessUpdateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Permissions do not allow updating the user. @@ -440,9 +491,13 @@ partial void ProcessUpdateResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Vectara.User.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Vectara.User.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -470,9 +525,13 @@ partial void ProcessUpdateResponseContent( #endif ).ConfigureAwait(false); - return - await global::Vectara.User.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Vectara.User.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Vectara.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Vectara/Generated/Vectara.UsersClient.g.cs b/src/libs/Vectara/Generated/Vectara.UsersClient.g.cs index 6f10cd40..7d4b0102 100644 --- a/src/libs/Vectara/Generated/Vectara.UsersClient.g.cs +++ b/src/libs/Vectara/Generated/Vectara.UsersClient.g.cs @@ -75,10 +75,10 @@ public UsersClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public UsersClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Vectara.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Vectara.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Vectara/Generated/Vectara.VectaraClient.g.cs b/src/libs/Vectara/Generated/Vectara.VectaraClient.g.cs index 58acdccc..2e255007 100644 --- a/src/libs/Vectara/Generated/Vectara.VectaraClient.g.cs +++ b/src/libs/Vectara/Generated/Vectara.VectaraClient.g.cs @@ -60,7 +60,7 @@ public sealed partial class VectaraClient : global::Vectara.IVectaraClient, glob /// /// /// - public AgentAnalyticsClient AgentAnalytics => new AgentAnalyticsClient(HttpClient, authorizations: Authorizations, options: Options) + public AgentAnalyticsClient AgentAnalytics => new AgentAnalyticsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -70,7 +70,7 @@ public sealed partial class VectaraClient : global::Vectara.IVectaraClient, glob /// /// /// - public AgentArtifactsClient AgentArtifacts => new AgentArtifactsClient(HttpClient, authorizations: Authorizations, options: Options) + public AgentArtifactsClient AgentArtifacts => new AgentArtifactsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -80,7 +80,7 @@ public sealed partial class VectaraClient : global::Vectara.IVectaraClient, glob /// /// /// - public AgentEventsClient AgentEvents => new AgentEventsClient(HttpClient, authorizations: Authorizations, options: Options) + public AgentEventsClient AgentEvents => new AgentEventsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -90,7 +90,7 @@ public sealed partial class VectaraClient : global::Vectara.IVectaraClient, glob /// /// /// - public AgentSchedulesClient AgentSchedules => new AgentSchedulesClient(HttpClient, authorizations: Authorizations, options: Options) + public AgentSchedulesClient AgentSchedules => new AgentSchedulesClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -100,7 +100,7 @@ public sealed partial class VectaraClient : global::Vectara.IVectaraClient, glob /// /// /// - public AgentSessionsClient AgentSessions => new AgentSessionsClient(HttpClient, authorizations: Authorizations, options: Options) + public AgentSessionsClient AgentSessions => new AgentSessionsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -110,7 +110,7 @@ public sealed partial class VectaraClient : global::Vectara.IVectaraClient, glob /// /// /// - public AgentsClient Agents => new AgentsClient(HttpClient, authorizations: Authorizations, options: Options) + public AgentsClient Agents => new AgentsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -120,7 +120,7 @@ public sealed partial class VectaraClient : global::Vectara.IVectaraClient, glob /// /// /// - public ApiKeysClient ApiKeys => new ApiKeysClient(HttpClient, authorizations: Authorizations, options: Options) + public ApiKeysClient ApiKeys => new ApiKeysClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -130,7 +130,7 @@ public sealed partial class VectaraClient : global::Vectara.IVectaraClient, glob /// /// /// - public AppClientsClient AppClients => new AppClientsClient(HttpClient, authorizations: Authorizations, options: Options) + public AppClientsClient AppClients => new AppClientsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -140,7 +140,7 @@ public sealed partial class VectaraClient : global::Vectara.IVectaraClient, glob /// /// Authenticate with the API using OAuth 2.0 or API keys. /// - public AuthenticationClient Authentication => new AuthenticationClient(HttpClient, authorizations: Authorizations, options: Options) + public AuthenticationClient Authentication => new AuthenticationClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -150,7 +150,7 @@ public sealed partial class VectaraClient : global::Vectara.IVectaraClient, glob /// /// /// - public CorporaClient Corpora => new CorporaClient(HttpClient, authorizations: Authorizations, options: Options) + public CorporaClient Corpora => new CorporaClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -160,7 +160,7 @@ public sealed partial class VectaraClient : global::Vectara.IVectaraClient, glob /// /// /// - public DocumentsClient Documents => new DocumentsClient(HttpClient, authorizations: Authorizations, options: Options) + public DocumentsClient Documents => new DocumentsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -170,7 +170,7 @@ public sealed partial class VectaraClient : global::Vectara.IVectaraClient, glob /// /// /// - public EncodersClient Encoders => new EncodersClient(HttpClient, authorizations: Authorizations, options: Options) + public EncodersClient Encoders => new EncodersClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -180,7 +180,7 @@ public sealed partial class VectaraClient : global::Vectara.IVectaraClient, glob /// /// /// - public FactualConsistencyClient FactualConsistency => new FactualConsistencyClient(HttpClient, authorizations: Authorizations, options: Options) + public FactualConsistencyClient FactualConsistency => new FactualConsistencyClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -190,7 +190,7 @@ public sealed partial class VectaraClient : global::Vectara.IVectaraClient, glob /// /// /// - public GenerationPresetsClient GenerationPresets => new GenerationPresetsClient(HttpClient, authorizations: Authorizations, options: Options) + public GenerationPresetsClient GenerationPresets => new GenerationPresetsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -200,7 +200,7 @@ public sealed partial class VectaraClient : global::Vectara.IVectaraClient, glob /// /// /// - public GlossariesClient Glossaries => new GlossariesClient(HttpClient, authorizations: Authorizations, options: Options) + public GlossariesClient Glossaries => new GlossariesClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -210,7 +210,7 @@ public sealed partial class VectaraClient : global::Vectara.IVectaraClient, glob /// /// /// - public HallucinationCorrectorsClient HallucinationCorrectors => new HallucinationCorrectorsClient(HttpClient, authorizations: Authorizations, options: Options) + public HallucinationCorrectorsClient HallucinationCorrectors => new HallucinationCorrectorsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -220,7 +220,7 @@ public sealed partial class VectaraClient : global::Vectara.IVectaraClient, glob /// /// /// - public InstructionsClient Instructions => new InstructionsClient(HttpClient, authorizations: Authorizations, options: Options) + public InstructionsClient Instructions => new InstructionsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -230,7 +230,7 @@ public sealed partial class VectaraClient : global::Vectara.IVectaraClient, glob /// /// /// - public JobsClient Jobs => new JobsClient(HttpClient, authorizations: Authorizations, options: Options) + public JobsClient Jobs => new JobsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -240,7 +240,7 @@ public sealed partial class VectaraClient : global::Vectara.IVectaraClient, glob /// /// /// - public LlmClient Llm => new LlmClient(HttpClient, authorizations: Authorizations, options: Options) + public LlmClient Llm => new LlmClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -250,7 +250,7 @@ public sealed partial class VectaraClient : global::Vectara.IVectaraClient, glob /// /// /// - public LlmsClient Llms => new LlmsClient(HttpClient, authorizations: Authorizations, options: Options) + public LlmsClient Llms => new LlmsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -260,7 +260,7 @@ public sealed partial class VectaraClient : global::Vectara.IVectaraClient, glob /// /// /// - public MetadataClient Metadata => new MetadataClient(HttpClient, authorizations: Authorizations, options: Options) + public MetadataClient Metadata => new MetadataClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -270,7 +270,7 @@ public sealed partial class VectaraClient : global::Vectara.IVectaraClient, glob /// /// /// - public PipelineDeadLetterEntriesClient PipelineDeadLetterEntries => new PipelineDeadLetterEntriesClient(HttpClient, authorizations: Authorizations, options: Options) + public PipelineDeadLetterEntriesClient PipelineDeadLetterEntries => new PipelineDeadLetterEntriesClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -280,7 +280,7 @@ public sealed partial class VectaraClient : global::Vectara.IVectaraClient, glob /// /// /// - public PipelineRunsClient PipelineRuns => new PipelineRunsClient(HttpClient, authorizations: Authorizations, options: Options) + public PipelineRunsClient PipelineRuns => new PipelineRunsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -290,7 +290,7 @@ public sealed partial class VectaraClient : global::Vectara.IVectaraClient, glob /// /// /// - public PipelinesClient Pipelines => new PipelinesClient(HttpClient, authorizations: Authorizations, options: Options) + public PipelinesClient Pipelines => new PipelinesClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -300,7 +300,7 @@ public sealed partial class VectaraClient : global::Vectara.IVectaraClient, glob /// /// /// - public QueriesClient Queries => new QueriesClient(HttpClient, authorizations: Authorizations, options: Options) + public QueriesClient Queries => new QueriesClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -310,7 +310,7 @@ public sealed partial class VectaraClient : global::Vectara.IVectaraClient, glob /// /// /// - public QueryHistoryClient QueryHistory => new QueryHistoryClient(HttpClient, authorizations: Authorizations, options: Options) + public QueryHistoryClient QueryHistory => new QueryHistoryClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -320,7 +320,7 @@ public sealed partial class VectaraClient : global::Vectara.IVectaraClient, glob /// /// /// - public RerankersClient Rerankers => new RerankersClient(HttpClient, authorizations: Authorizations, options: Options) + public RerankersClient Rerankers => new RerankersClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -330,7 +330,7 @@ public sealed partial class VectaraClient : global::Vectara.IVectaraClient, glob /// /// /// - public TableExtractorsClient TableExtractors => new TableExtractorsClient(HttpClient, authorizations: Authorizations, options: Options) + public TableExtractorsClient TableExtractors => new TableExtractorsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -340,7 +340,7 @@ public sealed partial class VectaraClient : global::Vectara.IVectaraClient, glob /// /// /// - public ToolServersClient ToolServers => new ToolServersClient(HttpClient, authorizations: Authorizations, options: Options) + public ToolServersClient ToolServers => new ToolServersClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -350,7 +350,7 @@ public sealed partial class VectaraClient : global::Vectara.IVectaraClient, glob /// /// /// - public ToolsClient Tools => new ToolsClient(HttpClient, authorizations: Authorizations, options: Options) + public ToolsClient Tools => new ToolsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -360,7 +360,7 @@ public sealed partial class VectaraClient : global::Vectara.IVectaraClient, glob /// /// /// - public UploadClient Upload => new UploadClient(HttpClient, authorizations: Authorizations, options: Options) + public UploadClient Upload => new UploadClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -370,7 +370,7 @@ public sealed partial class VectaraClient : global::Vectara.IVectaraClient, glob /// /// /// - public UsersClient Users => new UsersClient(HttpClient, authorizations: Authorizations, options: Options) + public UsersClient Users => new UsersClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -410,10 +410,10 @@ public VectaraClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public VectaraClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Vectara.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Vectara.AutoSDKClientOptions? options, bool disposeHttpClient = true) {