Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
/// <summary>
/// Get agent trace<br/>
/// Retrieve the summary of a specific agent trace by its trace ID.
/// </summary>
/// <param name="requestTimeout"></param>
/// <param name="requestTimeoutMillis"></param>
/// <param name="traceId">
/// Example: 0af7651916cd43dd8448eb211c80319c
/// </param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::Vectara.ApiException"></exception>
public async global::System.Threading.Tasks.Task<global::Vectara.AutoSDKHttpResponse<global::Vectara.AgentTrace>> GetTraceAsResponseAsync(
string traceId,
int? requestTimeout = default,
int? requestTimeoutMillis = default,
global::Vectara.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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
{
Expand All @@ -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,
Expand All @@ -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)
{
Expand All @@ -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;
}
Expand All @@ -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(
Expand All @@ -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;
}
Expand Down Expand Up @@ -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
Expand All @@ -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.
Expand Down Expand Up @@ -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<global::Vectara.AgentTrace>(
statusCode: __response.StatusCode,
headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response),
requestUri: __response.RequestMessage?.RequestUri,
body: __value);
}
catch (global::System.Exception __ex)
{
Expand Down Expand Up @@ -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<global::Vectara.AgentTrace>(
statusCode: __response.StatusCode,
headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response),
requestUri: __response.RequestMessage?.RequestUri,
body: __value);
}
catch (global::System.Exception __ex)
{
Expand Down
Loading
Loading