diff --git a/src/libs/Vectara/Generated/Vectara.AgentAnalyticsClient.GetTrace.g.cs b/src/libs/Vectara/Generated/Vectara.AgentAnalyticsClient.GetTrace.g.cs new file mode 100644 index 00000000..29cc8cb4 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.AgentAnalyticsClient.GetTrace.g.cs @@ -0,0 +1,501 @@ + +#nullable enable + +namespace Vectara +{ + public partial class AgentAnalyticsClient + { + + + private static readonly global::Vectara.EndPointSecurityRequirement s_GetTraceSecurityRequirement0 = + new global::Vectara.EndPointSecurityRequirement + { + Authorizations = new global::Vectara.EndPointAuthorizationRequirement[] + { new global::Vectara.EndPointAuthorizationRequirement + { + Type = "ApiKey", + SchemeId = "ApiKeyAuth", + Location = "Header", + Name = "x-api-key", + FriendlyName = "ApiKeyInHeader", + }, + }, + }; + + private static readonly global::Vectara.EndPointSecurityRequirement s_GetTraceSecurityRequirement1 = + new global::Vectara.EndPointSecurityRequirement + { + Authorizations = new global::Vectara.EndPointAuthorizationRequirement[] + { new global::Vectara.EndPointAuthorizationRequirement + { + Type = "OAuth2", + SchemeId = "OAuth2", + Location = "Header", + Name = "", + FriendlyName = "OAuth2", + }, + }, + }; + private static readonly global::Vectara.EndPointSecurityRequirement[] s_GetTraceSecurityRequirements = + new global::Vectara.EndPointSecurityRequirement[] + { s_GetTraceSecurityRequirement0, + s_GetTraceSecurityRequirement1, + }; + partial void PrepareGetTraceArguments( + global::System.Net.Http.HttpClient httpClient, + ref int? requestTimeout, + ref int? requestTimeoutMillis, + ref string traceId); + partial void PrepareGetTraceRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + int? requestTimeout, + int? requestTimeoutMillis, + string traceId); + partial void ProcessGetTraceResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGetTraceResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// 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 GetTraceAsync( + string traceId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetTraceArguments( + httpClient: HttpClient, + requestTimeout: ref requestTimeout, + requestTimeoutMillis: ref requestTimeoutMillis, + traceId: ref traceId); + + + var __authorizations = global::Vectara.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GetTraceSecurityRequirements, + operationName: "GetTraceAsync"); + + 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: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + var __pathBuilder = new global::Vectara.PathBuilder( + path: $"/v2/agent_analytics/traces/{traceId}", + 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.Get, + 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()); + } + + global::Vectara.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetTraceRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + traceId: traceId); + + 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: "GetTrace", + methodName: "GetTraceAsync", + pathTemplate: "$\"/v2/agent_analytics/traces/{traceId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + 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 __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetTrace", + methodName: "GetTraceAsync", + pathTemplate: "$\"/v2/agent_analytics/traces/{traceId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetTrace", + methodName: "GetTraceAsync", + pathTemplate: "$\"/v2/agent_analytics/traces/{traceId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessGetTraceResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetTrace", + methodName: "GetTraceAsync", + pathTemplate: "$\"/v2/agent_analytics/traces/{traceId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetTrace", + methodName: "GetTraceAsync", + pathTemplate: "$\"/v2/agent_analytics/traces/{traceId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Permissions do not allow accessing this trace. + 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), + }; + } + // Trace 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), + }; + } + + 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); + ProcessGetTraceResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Vectara.AgentTrace.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.AgentTrace.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.AgentAnalyticsClient.GetTraceSpan.g.cs b/src/libs/Vectara/Generated/Vectara.AgentAnalyticsClient.GetTraceSpan.g.cs new file mode 100644 index 00000000..72a235e7 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.AgentAnalyticsClient.GetTraceSpan.g.cs @@ -0,0 +1,516 @@ + +#nullable enable + +namespace Vectara +{ + public partial class AgentAnalyticsClient + { + + + private static readonly global::Vectara.EndPointSecurityRequirement s_GetTraceSpanSecurityRequirement0 = + new global::Vectara.EndPointSecurityRequirement + { + Authorizations = new global::Vectara.EndPointAuthorizationRequirement[] + { new global::Vectara.EndPointAuthorizationRequirement + { + Type = "ApiKey", + SchemeId = "ApiKeyAuth", + Location = "Header", + Name = "x-api-key", + FriendlyName = "ApiKeyInHeader", + }, + }, + }; + + private static readonly global::Vectara.EndPointSecurityRequirement s_GetTraceSpanSecurityRequirement1 = + new global::Vectara.EndPointSecurityRequirement + { + Authorizations = new global::Vectara.EndPointAuthorizationRequirement[] + { new global::Vectara.EndPointAuthorizationRequirement + { + Type = "OAuth2", + SchemeId = "OAuth2", + Location = "Header", + Name = "", + FriendlyName = "OAuth2", + }, + }, + }; + private static readonly global::Vectara.EndPointSecurityRequirement[] s_GetTraceSpanSecurityRequirements = + new global::Vectara.EndPointSecurityRequirement[] + { s_GetTraceSpanSecurityRequirement0, + s_GetTraceSpanSecurityRequirement1, + }; + partial void PrepareGetTraceSpanArguments( + global::System.Net.Http.HttpClient httpClient, + ref int? requestTimeout, + ref int? requestTimeoutMillis, + ref string traceId, + ref string spanId, + ref bool? includeContent); + partial void PrepareGetTraceSpanRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + int? requestTimeout, + int? requestTimeoutMillis, + string traceId, + string spanId, + bool? includeContent); + partial void ProcessGetTraceSpanResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGetTraceSpanResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// 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 GetTraceSpanAsync( + 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); + PrepareGetTraceSpanArguments( + httpClient: HttpClient, + requestTimeout: ref requestTimeout, + requestTimeoutMillis: ref requestTimeoutMillis, + traceId: ref traceId, + spanId: ref spanId, + includeContent: ref includeContent); + + + var __authorizations = global::Vectara.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GetTraceSpanSecurityRequirements, + operationName: "GetTraceSpanAsync"); + + 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: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + var __pathBuilder = new global::Vectara.PathBuilder( + path: $"/v2/agent_analytics/traces/{traceId}/spans/{spanId}", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("include_content", includeContent?.ToString().ToLowerInvariant()) + ; + 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.Get, + 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()); + } + + global::Vectara.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetTraceSpanRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + traceId: traceId, + spanId: spanId, + includeContent: includeContent); + + 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: "GetTraceSpan", + methodName: "GetTraceSpanAsync", + pathTemplate: "$\"/v2/agent_analytics/traces/{traceId}/spans/{spanId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + 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 __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetTraceSpan", + methodName: "GetTraceSpanAsync", + pathTemplate: "$\"/v2/agent_analytics/traces/{traceId}/spans/{spanId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetTraceSpan", + methodName: "GetTraceSpanAsync", + pathTemplate: "$\"/v2/agent_analytics/traces/{traceId}/spans/{spanId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessGetTraceSpanResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetTraceSpan", + methodName: "GetTraceSpanAsync", + pathTemplate: "$\"/v2/agent_analytics/traces/{traceId}/spans/{spanId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetTraceSpan", + methodName: "GetTraceSpanAsync", + pathTemplate: "$\"/v2/agent_analytics/traces/{traceId}/spans/{spanId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Permissions do not allow accessing this span. + 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), + }; + } + // Trace or span 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), + }; + } + + 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); + ProcessGetTraceSpanResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Vectara.AgentTraceSpan.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.AgentTraceSpan.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.AgentAnalyticsClient.ListTraceSpans.g.cs b/src/libs/Vectara/Generated/Vectara.AgentAnalyticsClient.ListTraceSpans.g.cs new file mode 100644 index 00000000..19e7f341 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.AgentAnalyticsClient.ListTraceSpans.g.cs @@ -0,0 +1,533 @@ + +#nullable enable + +namespace Vectara +{ + public partial class AgentAnalyticsClient + { + + + private static readonly global::Vectara.EndPointSecurityRequirement s_ListTraceSpansSecurityRequirement0 = + new global::Vectara.EndPointSecurityRequirement + { + Authorizations = new global::Vectara.EndPointAuthorizationRequirement[] + { new global::Vectara.EndPointAuthorizationRequirement + { + Type = "ApiKey", + SchemeId = "ApiKeyAuth", + Location = "Header", + Name = "x-api-key", + FriendlyName = "ApiKeyInHeader", + }, + }, + }; + + private static readonly global::Vectara.EndPointSecurityRequirement s_ListTraceSpansSecurityRequirement1 = + new global::Vectara.EndPointSecurityRequirement + { + Authorizations = new global::Vectara.EndPointAuthorizationRequirement[] + { new global::Vectara.EndPointAuthorizationRequirement + { + Type = "OAuth2", + SchemeId = "OAuth2", + Location = "Header", + Name = "", + FriendlyName = "OAuth2", + }, + }, + }; + private static readonly global::Vectara.EndPointSecurityRequirement[] s_ListTraceSpansSecurityRequirements = + new global::Vectara.EndPointSecurityRequirement[] + { s_ListTraceSpansSecurityRequirement0, + s_ListTraceSpansSecurityRequirement1, + }; + partial void PrepareListTraceSpansArguments( + global::System.Net.Http.HttpClient httpClient, + ref int? requestTimeout, + ref int? requestTimeoutMillis, + ref string traceId, + ref bool? includeContent, + ref global::Vectara.ListTraceSpansOperation? operation, + ref int? limit, + ref string? pageKey); + partial void PrepareListTraceSpansRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + int? requestTimeout, + int? requestTimeoutMillis, + string traceId, + bool? includeContent, + global::Vectara.ListTraceSpansOperation? operation, + int? limit, + string? pageKey); + partial void ProcessListTraceSpansResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessListTraceSpansResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// 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 ListTraceSpansAsync( + 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); + PrepareListTraceSpansArguments( + httpClient: HttpClient, + requestTimeout: ref requestTimeout, + requestTimeoutMillis: ref requestTimeoutMillis, + traceId: ref traceId, + includeContent: ref includeContent, + operation: ref operation, + limit: ref limit, + pageKey: ref pageKey); + + + var __authorizations = global::Vectara.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ListTraceSpansSecurityRequirements, + operationName: "ListTraceSpansAsync"); + + 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: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + var __pathBuilder = new global::Vectara.PathBuilder( + path: $"/v2/agent_analytics/traces/{traceId}/spans", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("include_content", includeContent?.ToString().ToLowerInvariant()) + .AddOptionalParameter("operation", operation?.ToValueString()) + .AddOptionalParameter("limit", limit?.ToString()) + .AddOptionalParameter("page_key", pageKey) + ; + 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.Get, + 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()); + } + + global::Vectara.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareListTraceSpansRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + traceId: traceId, + includeContent: includeContent, + operation: operation, + limit: limit, + pageKey: pageKey); + + 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: "ListTraceSpans", + methodName: "ListTraceSpansAsync", + pathTemplate: "$\"/v2/agent_analytics/traces/{traceId}/spans\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + 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 __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListTraceSpans", + methodName: "ListTraceSpansAsync", + pathTemplate: "$\"/v2/agent_analytics/traces/{traceId}/spans\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListTraceSpans", + methodName: "ListTraceSpansAsync", + pathTemplate: "$\"/v2/agent_analytics/traces/{traceId}/spans\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessListTraceSpansResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListTraceSpans", + methodName: "ListTraceSpansAsync", + pathTemplate: "$\"/v2/agent_analytics/traces/{traceId}/spans\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListTraceSpans", + methodName: "ListTraceSpansAsync", + pathTemplate: "$\"/v2/agent_analytics/traces/{traceId}/spans\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Permissions do not allow accessing this trace. + 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), + }; + } + // Trace 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), + }; + } + + 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); + ProcessListTraceSpansResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Vectara.ListAgentTraceSpansResponse.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.ListAgentTraceSpansResponse.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.AgentAnalyticsClient.ListTraces.g.cs b/src/libs/Vectara/Generated/Vectara.AgentAnalyticsClient.ListTraces.g.cs new file mode 100644 index 00000000..be4c9360 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.AgentAnalyticsClient.ListTraces.g.cs @@ -0,0 +1,550 @@ + +#nullable enable + +namespace Vectara +{ + public partial class AgentAnalyticsClient + { + + + private static readonly global::Vectara.EndPointSecurityRequirement s_ListTracesSecurityRequirement0 = + new global::Vectara.EndPointSecurityRequirement + { + Authorizations = new global::Vectara.EndPointAuthorizationRequirement[] + { new global::Vectara.EndPointAuthorizationRequirement + { + Type = "ApiKey", + SchemeId = "ApiKeyAuth", + Location = "Header", + Name = "x-api-key", + FriendlyName = "ApiKeyInHeader", + }, + }, + }; + + private static readonly global::Vectara.EndPointSecurityRequirement s_ListTracesSecurityRequirement1 = + new global::Vectara.EndPointSecurityRequirement + { + Authorizations = new global::Vectara.EndPointAuthorizationRequirement[] + { new global::Vectara.EndPointAuthorizationRequirement + { + Type = "OAuth2", + SchemeId = "OAuth2", + Location = "Header", + Name = "", + FriendlyName = "OAuth2", + }, + }, + }; + private static readonly global::Vectara.EndPointSecurityRequirement[] s_ListTracesSecurityRequirements = + new global::Vectara.EndPointSecurityRequirement[] + { s_ListTracesSecurityRequirement0, + s_ListTracesSecurityRequirement1, + }; + partial void PrepareListTracesArguments( + global::System.Net.Http.HttpClient httpClient, + ref int? requestTimeout, + ref int? requestTimeoutMillis, + ref string? agentKey, + ref string? sessionKey, + ref global::Vectara.ListTracesStatus? status, + ref global::Vectara.ListTracesErrorType? errorType, + ref global::Vectara.ListTracesOperation? operation, + ref string? toolName, + ref global::Vectara.ListTracesToolErrorType? toolErrorType, + ref global::System.DateTime? startedAfter, + ref global::System.DateTime? startedBefore, + ref long? minDurationMs, + ref long? maxDurationMs, + ref int? limit, + ref string? pageKey); + partial void PrepareListTracesRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + int? requestTimeout, + int? requestTimeoutMillis, + string? agentKey, + string? sessionKey, + global::Vectara.ListTracesStatus? status, + global::Vectara.ListTracesErrorType? errorType, + global::Vectara.ListTracesOperation? operation, + string? toolName, + global::Vectara.ListTracesToolErrorType? toolErrorType, + global::System.DateTime? startedAfter, + global::System.DateTime? startedBefore, + long? minDurationMs, + long? maxDurationMs, + int? limit, + string? pageKey); + partial void ProcessListTracesResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessListTracesResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// 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 ListTracesAsync( + 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); + PrepareListTracesArguments( + httpClient: HttpClient, + requestTimeout: ref requestTimeout, + requestTimeoutMillis: ref requestTimeoutMillis, + agentKey: ref agentKey, + sessionKey: ref sessionKey, + status: ref status, + errorType: ref errorType, + operation: ref operation, + toolName: ref toolName, + toolErrorType: ref toolErrorType, + startedAfter: ref startedAfter, + startedBefore: ref startedBefore, + minDurationMs: ref minDurationMs, + maxDurationMs: ref maxDurationMs, + limit: ref limit, + pageKey: ref pageKey); + + + var __authorizations = global::Vectara.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ListTracesSecurityRequirements, + operationName: "ListTracesAsync"); + + 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: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + var __pathBuilder = new global::Vectara.PathBuilder( + path: "/v2/agent_analytics/traces", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("agent_key", agentKey) + .AddOptionalParameter("session_key", sessionKey) + .AddOptionalParameter("status", status?.ToValueString()) + .AddOptionalParameter("error_type", errorType?.ToValueString()) + .AddOptionalParameter("operation", operation?.ToValueString()) + .AddOptionalParameter("tool_name", toolName) + .AddOptionalParameter("tool_error_type", toolErrorType?.ToValueString()) + .AddOptionalParameter("started_after", startedAfter?.ToString("yyyy-MM-ddTHH:mm:ssZ")) + .AddOptionalParameter("started_before", startedBefore?.ToString("yyyy-MM-ddTHH:mm:ssZ")) + .AddOptionalParameter("min_duration_ms", minDurationMs?.ToString()) + .AddOptionalParameter("max_duration_ms", maxDurationMs?.ToString()) + .AddOptionalParameter("limit", limit?.ToString()) + .AddOptionalParameter("page_key", pageKey) + ; + 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.Get, + 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()); + } + + global::Vectara.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareListTracesRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + 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); + + 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: "ListTraces", + methodName: "ListTracesAsync", + pathTemplate: "\"/v2/agent_analytics/traces\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + 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 __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListTraces", + methodName: "ListTracesAsync", + pathTemplate: "\"/v2/agent_analytics/traces\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListTraces", + methodName: "ListTracesAsync", + pathTemplate: "\"/v2/agent_analytics/traces\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessListTracesResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListTraces", + methodName: "ListTracesAsync", + pathTemplate: "\"/v2/agent_analytics/traces\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListTraces", + methodName: "ListTracesAsync", + pathTemplate: "\"/v2/agent_analytics/traces\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Permissions do not allow listing traces. + 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), + }; + } + + 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); + ProcessListTracesResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Vectara.ListAgentTracesResponse.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.ListAgentTracesResponse.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.AgentAnalyticsClient.g.cs b/src/libs/Vectara/Generated/Vectara.AgentAnalyticsClient.g.cs new file mode 100644 index 00000000..4eb291fe --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.AgentAnalyticsClient.g.cs @@ -0,0 +1,118 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public sealed partial class AgentAnalyticsClient : global::Vectara.IAgentAnalyticsClient, global::System.IDisposable + { + /// + /// + /// + public const string DefaultBaseUrl = "https://api.vectara.io/"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => HttpClient.BaseAddress; + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::Vectara.AutoSDKClientOptions Options { get; } + + + internal global::Vectara.VectaraClient.AutoSDKOAuth2Coordinator AutoSDKOAuth2State { get; set; } = new global::Vectara.VectaraClient.AutoSDKOAuth2Coordinator(); + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Vectara.SourceGenerationContext.Default; + + + /// + /// Creates a new instance of the AgentAnalyticsClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// 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, + bool disposeHttpClient = true) : this( + httpClient, + baseUri, + authorizations, + options: null, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the AgentAnalyticsClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// 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, + bool disposeHttpClient = true) + { + + HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); + HttpClient.BaseAddress ??= baseUri ?? new global::System.Uri(DefaultBaseUrl); + Authorizations = authorizations ?? new global::System.Collections.Generic.List(); + Options = options ?? new global::Vectara.AutoSDKClientOptions(); + _disposeHttpClient = disposeHttpClient; + + Initialized(HttpClient); + } + + /// + public void Dispose() + { + if (_disposeHttpClient) + { + HttpClient.Dispose(); + } + } + + partial void Initialized( + global::System.Net.Http.HttpClient client); + partial void PrepareArguments( + global::System.Net.Http.HttpClient client); + partial void PrepareRequest( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpRequestMessage request); + partial void ProcessResponse( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response); + partial void ProcessResponseContent( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response, + ref string content); + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.AgentsClient.CreateConnector.g.cs b/src/libs/Vectara/Generated/Vectara.AgentsClient.CreateConnector.g.cs new file mode 100644 index 00000000..30dfd07b --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.AgentsClient.CreateConnector.g.cs @@ -0,0 +1,624 @@ + +#nullable enable + +namespace Vectara +{ + public partial class AgentsClient + { + + + private static readonly global::Vectara.EndPointSecurityRequirement s_CreateConnectorSecurityRequirement0 = + new global::Vectara.EndPointSecurityRequirement + { + Authorizations = new global::Vectara.EndPointAuthorizationRequirement[] + { new global::Vectara.EndPointAuthorizationRequirement + { + Type = "ApiKey", + SchemeId = "ApiKeyAuth", + Location = "Header", + Name = "x-api-key", + FriendlyName = "ApiKeyInHeader", + }, + }, + }; + + private static readonly global::Vectara.EndPointSecurityRequirement s_CreateConnectorSecurityRequirement1 = + new global::Vectara.EndPointSecurityRequirement + { + Authorizations = new global::Vectara.EndPointAuthorizationRequirement[] + { new global::Vectara.EndPointAuthorizationRequirement + { + Type = "OAuth2", + SchemeId = "OAuth2", + Location = "Header", + Name = "", + FriendlyName = "OAuth2", + }, + }, + }; + private static readonly global::Vectara.EndPointSecurityRequirement[] s_CreateConnectorSecurityRequirements = + new global::Vectara.EndPointSecurityRequirement[] + { s_CreateConnectorSecurityRequirement0, + s_CreateConnectorSecurityRequirement1, + }; + partial void PrepareCreateConnectorArguments( + global::System.Net.Http.HttpClient httpClient, + ref int? requestTimeout, + ref int? requestTimeoutMillis, + ref string agentKey, + global::Vectara.CreateAgentConnectorRequest request); + partial void PrepareCreateConnectorRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + int? requestTimeout, + int? requestTimeoutMillis, + string agentKey, + global::Vectara.CreateAgentConnectorRequest request); + partial void ProcessCreateConnectorResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessCreateConnectorResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// 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 CreateConnectorAsync( + string agentKey, + + global::Vectara.CreateAgentConnectorRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareCreateConnectorArguments( + httpClient: HttpClient, + requestTimeout: ref requestTimeout, + requestTimeoutMillis: ref requestTimeoutMillis, + agentKey: ref agentKey, + request: request); + + + var __authorizations = global::Vectara.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CreateConnectorSecurityRequirements, + operationName: "CreateConnectorAsync"); + + 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: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + var __pathBuilder = new global::Vectara.PathBuilder( + path: $"/v2/agents/{agentKey}/connectors", + 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 __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::Vectara.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCreateConnectorRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + agentKey: agentKey, + 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: "CreateConnector", + methodName: "CreateConnectorAsync", + pathTemplate: "$\"/v2/agents/{agentKey}/connectors\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + 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 __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateConnector", + methodName: "CreateConnectorAsync", + pathTemplate: "$\"/v2/agents/{agentKey}/connectors\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateConnector", + methodName: "CreateConnectorAsync", + pathTemplate: "$\"/v2/agents/{agentKey}/connectors\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessCreateConnectorResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateConnector", + methodName: "CreateConnectorAsync", + pathTemplate: "$\"/v2/agents/{agentKey}/connectors\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateConnector", + methodName: "CreateConnectorAsync", + pathTemplate: "$\"/v2/agents/{agentKey}/connectors\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Connector creation request was malformed or contains invalid configuration. + 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 creating connectors for this agent. + 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), + }; + } + // Agent 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), + }; + } + + 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); + ProcessCreateConnectorResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Vectara.AgentConnector.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.AgentConnector.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(); + } + } + /// + /// 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 + /// + /// + /// A detailed description of what this connector does.
+ /// Example: Receives customer support messages from the + /// + /// + /// The type of connector.
+ /// Example: slack + /// + /// + /// Arbitrary metadata associated with the connector.
+ /// Default Value: {}
+ /// Example: {"priority":"high","department":"customer_service"} + /// + /// + /// Whether the connector should be enabled upon creation.
+ /// Default Value: true
+ /// Example: true + /// + /// + /// Configuration for different types of connectors. + /// + /// 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 CreateConnectorAsync( + string agentKey, + string name, + global::Vectara.SlackConnectorConfiguration configuration, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + string? description = default, + global::Vectara.CreateAgentConnectorRequestType type = default, + object? metadata = default, + bool? enabled = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Vectara.CreateAgentConnectorRequest + { + Name = name, + Description = description, + Type = type, + Metadata = metadata, + Enabled = enabled, + Configuration = configuration, + }; + + return await CreateConnectorAsync( + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + agentKey: agentKey, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.AgentsClient.DeleteConnector.g.cs b/src/libs/Vectara/Generated/Vectara.AgentsClient.DeleteConnector.g.cs new file mode 100644 index 00000000..11bb81da --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.AgentsClient.DeleteConnector.g.cs @@ -0,0 +1,489 @@ + +#nullable enable + +namespace Vectara +{ + public partial class AgentsClient + { + + + private static readonly global::Vectara.EndPointSecurityRequirement s_DeleteConnectorSecurityRequirement0 = + new global::Vectara.EndPointSecurityRequirement + { + Authorizations = new global::Vectara.EndPointAuthorizationRequirement[] + { new global::Vectara.EndPointAuthorizationRequirement + { + Type = "ApiKey", + SchemeId = "ApiKeyAuth", + Location = "Header", + Name = "x-api-key", + FriendlyName = "ApiKeyInHeader", + }, + }, + }; + + private static readonly global::Vectara.EndPointSecurityRequirement s_DeleteConnectorSecurityRequirement1 = + new global::Vectara.EndPointSecurityRequirement + { + Authorizations = new global::Vectara.EndPointAuthorizationRequirement[] + { new global::Vectara.EndPointAuthorizationRequirement + { + Type = "OAuth2", + SchemeId = "OAuth2", + Location = "Header", + Name = "", + FriendlyName = "OAuth2", + }, + }, + }; + private static readonly global::Vectara.EndPointSecurityRequirement[] s_DeleteConnectorSecurityRequirements = + new global::Vectara.EndPointSecurityRequirement[] + { s_DeleteConnectorSecurityRequirement0, + s_DeleteConnectorSecurityRequirement1, + }; + partial void PrepareDeleteConnectorArguments( + global::System.Net.Http.HttpClient httpClient, + ref int? requestTimeout, + ref int? requestTimeoutMillis, + ref string agentKey, + ref string connectorId); + partial void PrepareDeleteConnectorRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + int? requestTimeout, + int? requestTimeoutMillis, + string agentKey, + string connectorId); + partial void ProcessDeleteConnectorResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// 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 DeleteConnectorAsync( + string agentKey, + string connectorId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareDeleteConnectorArguments( + httpClient: HttpClient, + requestTimeout: ref requestTimeout, + requestTimeoutMillis: ref requestTimeoutMillis, + agentKey: ref agentKey, + connectorId: ref connectorId); + + + var __authorizations = global::Vectara.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DeleteConnectorSecurityRequirements, + operationName: "DeleteConnectorAsync"); + + 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: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + var __pathBuilder = new global::Vectara.PathBuilder( + path: $"/v2/agents/{agentKey}/connectors/{connectorId}", + 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.Delete, + 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()); + } + + global::Vectara.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeleteConnectorRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + agentKey: agentKey, + connectorId: connectorId); + + 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: "DeleteConnector", + methodName: "DeleteConnectorAsync", + pathTemplate: "$\"/v2/agents/{agentKey}/connectors/{connectorId}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + 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 __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteConnector", + methodName: "DeleteConnectorAsync", + pathTemplate: "$\"/v2/agents/{agentKey}/connectors/{connectorId}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteConnector", + methodName: "DeleteConnectorAsync", + pathTemplate: "$\"/v2/agents/{agentKey}/connectors/{connectorId}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessDeleteConnectorResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteConnector", + methodName: "DeleteConnectorAsync", + pathTemplate: "$\"/v2/agents/{agentKey}/connectors/{connectorId}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteConnector", + methodName: "DeleteConnectorAsync", + pathTemplate: "$\"/v2/agents/{agentKey}/connectors/{connectorId}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Permissions do not allow deleting this connector. + 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), + }; + } + // Agent or connector 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), + }; + } + + 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); + + try + { + __response.EnsureSuccessStatusCode(); + + } + 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(); + } + 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.AgentsClient.GetConnector.g.cs b/src/libs/Vectara/Generated/Vectara.AgentsClient.GetConnector.g.cs new file mode 100644 index 00000000..42bd2f22 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.AgentsClient.GetConnector.g.cs @@ -0,0 +1,510 @@ + +#nullable enable + +namespace Vectara +{ + public partial class AgentsClient + { + + + private static readonly global::Vectara.EndPointSecurityRequirement s_GetConnectorSecurityRequirement0 = + new global::Vectara.EndPointSecurityRequirement + { + Authorizations = new global::Vectara.EndPointAuthorizationRequirement[] + { new global::Vectara.EndPointAuthorizationRequirement + { + Type = "ApiKey", + SchemeId = "ApiKeyAuth", + Location = "Header", + Name = "x-api-key", + FriendlyName = "ApiKeyInHeader", + }, + }, + }; + + private static readonly global::Vectara.EndPointSecurityRequirement s_GetConnectorSecurityRequirement1 = + new global::Vectara.EndPointSecurityRequirement + { + Authorizations = new global::Vectara.EndPointAuthorizationRequirement[] + { new global::Vectara.EndPointAuthorizationRequirement + { + Type = "OAuth2", + SchemeId = "OAuth2", + Location = "Header", + Name = "", + FriendlyName = "OAuth2", + }, + }, + }; + private static readonly global::Vectara.EndPointSecurityRequirement[] s_GetConnectorSecurityRequirements = + new global::Vectara.EndPointSecurityRequirement[] + { s_GetConnectorSecurityRequirement0, + s_GetConnectorSecurityRequirement1, + }; + partial void PrepareGetConnectorArguments( + global::System.Net.Http.HttpClient httpClient, + ref int? requestTimeout, + ref int? requestTimeoutMillis, + ref string agentKey, + ref string connectorId); + partial void PrepareGetConnectorRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + int? requestTimeout, + int? requestTimeoutMillis, + string agentKey, + string connectorId); + partial void ProcessGetConnectorResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGetConnectorResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// 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 GetConnectorAsync( + string agentKey, + string connectorId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetConnectorArguments( + httpClient: HttpClient, + requestTimeout: ref requestTimeout, + requestTimeoutMillis: ref requestTimeoutMillis, + agentKey: ref agentKey, + connectorId: ref connectorId); + + + var __authorizations = global::Vectara.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GetConnectorSecurityRequirements, + operationName: "GetConnectorAsync"); + + 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: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + var __pathBuilder = new global::Vectara.PathBuilder( + path: $"/v2/agents/{agentKey}/connectors/{connectorId}", + 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.Get, + 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()); + } + + global::Vectara.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetConnectorRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + agentKey: agentKey, + connectorId: connectorId); + + 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: "GetConnector", + methodName: "GetConnectorAsync", + pathTemplate: "$\"/v2/agents/{agentKey}/connectors/{connectorId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + 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 __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetConnector", + methodName: "GetConnectorAsync", + pathTemplate: "$\"/v2/agents/{agentKey}/connectors/{connectorId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetConnector", + methodName: "GetConnectorAsync", + pathTemplate: "$\"/v2/agents/{agentKey}/connectors/{connectorId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessGetConnectorResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetConnector", + methodName: "GetConnectorAsync", + pathTemplate: "$\"/v2/agents/{agentKey}/connectors/{connectorId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetConnector", + methodName: "GetConnectorAsync", + pathTemplate: "$\"/v2/agents/{agentKey}/connectors/{connectorId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Permissions do not allow accessing this connector. + 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), + }; + } + // Agent or connector 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), + }; + } + + 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); + ProcessGetConnectorResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Vectara.AgentConnector.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.AgentConnector.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.AgentsClient.ListConnectors.g.cs b/src/libs/Vectara/Generated/Vectara.AgentsClient.ListConnectors.g.cs new file mode 100644 index 00000000..918200df --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.AgentsClient.ListConnectors.g.cs @@ -0,0 +1,538 @@ + +#nullable enable + +namespace Vectara +{ + public partial class AgentsClient + { + + + private static readonly global::Vectara.EndPointSecurityRequirement s_ListConnectorsSecurityRequirement0 = + new global::Vectara.EndPointSecurityRequirement + { + Authorizations = new global::Vectara.EndPointAuthorizationRequirement[] + { new global::Vectara.EndPointAuthorizationRequirement + { + Type = "ApiKey", + SchemeId = "ApiKeyAuth", + Location = "Header", + Name = "x-api-key", + FriendlyName = "ApiKeyInHeader", + }, + }, + }; + + private static readonly global::Vectara.EndPointSecurityRequirement s_ListConnectorsSecurityRequirement1 = + new global::Vectara.EndPointSecurityRequirement + { + Authorizations = new global::Vectara.EndPointAuthorizationRequirement[] + { new global::Vectara.EndPointAuthorizationRequirement + { + Type = "OAuth2", + SchemeId = "OAuth2", + Location = "Header", + Name = "", + FriendlyName = "OAuth2", + }, + }, + }; + private static readonly global::Vectara.EndPointSecurityRequirement[] s_ListConnectorsSecurityRequirements = + new global::Vectara.EndPointSecurityRequirement[] + { s_ListConnectorsSecurityRequirement0, + s_ListConnectorsSecurityRequirement1, + }; + partial void PrepareListConnectorsArguments( + global::System.Net.Http.HttpClient httpClient, + ref int? requestTimeout, + ref int? requestTimeoutMillis, + ref string agentKey, + ref global::Vectara.ListAgentConnectorsType? type, + ref bool? enabled, + ref int? limit, + ref string? pageKey); + partial void PrepareListConnectorsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + int? requestTimeout, + int? requestTimeoutMillis, + string agentKey, + global::Vectara.ListAgentConnectorsType? type, + bool? enabled, + int? limit, + string? pageKey); + partial void ProcessListConnectorsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessListConnectorsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// 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 ListConnectorsAsync( + 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); + PrepareListConnectorsArguments( + httpClient: HttpClient, + requestTimeout: ref requestTimeout, + requestTimeoutMillis: ref requestTimeoutMillis, + agentKey: ref agentKey, + type: ref type, + enabled: ref enabled, + limit: ref limit, + pageKey: ref pageKey); + + + var __authorizations = global::Vectara.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ListConnectorsSecurityRequirements, + operationName: "ListConnectorsAsync"); + + 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: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + var __pathBuilder = new global::Vectara.PathBuilder( + path: $"/v2/agents/{agentKey}/connectors", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("type", type?.ToValueString()) + .AddOptionalParameter("enabled", enabled?.ToString().ToLowerInvariant()) + .AddOptionalParameter("limit", limit?.ToString()) + .AddOptionalParameter("page_key", pageKey) + ; + 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.Get, + 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()); + } + + global::Vectara.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareListConnectorsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + agentKey: agentKey, + type: type, + enabled: enabled, + limit: limit, + pageKey: pageKey); + + 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: "ListConnectors", + methodName: "ListConnectorsAsync", + pathTemplate: "$\"/v2/agents/{agentKey}/connectors\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + 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 __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListConnectors", + methodName: "ListConnectorsAsync", + pathTemplate: "$\"/v2/agents/{agentKey}/connectors\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListConnectors", + methodName: "ListConnectorsAsync", + pathTemplate: "$\"/v2/agents/{agentKey}/connectors\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessListConnectorsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListConnectors", + methodName: "ListConnectorsAsync", + pathTemplate: "$\"/v2/agents/{agentKey}/connectors\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListConnectors", + methodName: "ListConnectorsAsync", + pathTemplate: "$\"/v2/agents/{agentKey}/connectors\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Permissions do not allow listing connectors for this agent. + 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), + }; + } + // Agent 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), + }; + } + + 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); + ProcessListConnectorsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Vectara.ListAgentConnectorsResponse.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.ListAgentConnectorsResponse.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.AgentsClient.UpdateConnector.g.cs b/src/libs/Vectara/Generated/Vectara.AgentsClient.UpdateConnector.g.cs new file mode 100644 index 00000000..c91b1323 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.AgentsClient.UpdateConnector.g.cs @@ -0,0 +1,629 @@ + +#nullable enable + +namespace Vectara +{ + public partial class AgentsClient + { + + + private static readonly global::Vectara.EndPointSecurityRequirement s_UpdateConnectorSecurityRequirement0 = + new global::Vectara.EndPointSecurityRequirement + { + Authorizations = new global::Vectara.EndPointAuthorizationRequirement[] + { new global::Vectara.EndPointAuthorizationRequirement + { + Type = "ApiKey", + SchemeId = "ApiKeyAuth", + Location = "Header", + Name = "x-api-key", + FriendlyName = "ApiKeyInHeader", + }, + }, + }; + + private static readonly global::Vectara.EndPointSecurityRequirement s_UpdateConnectorSecurityRequirement1 = + new global::Vectara.EndPointSecurityRequirement + { + Authorizations = new global::Vectara.EndPointAuthorizationRequirement[] + { new global::Vectara.EndPointAuthorizationRequirement + { + Type = "OAuth2", + SchemeId = "OAuth2", + Location = "Header", + Name = "", + FriendlyName = "OAuth2", + }, + }, + }; + private static readonly global::Vectara.EndPointSecurityRequirement[] s_UpdateConnectorSecurityRequirements = + new global::Vectara.EndPointSecurityRequirement[] + { s_UpdateConnectorSecurityRequirement0, + s_UpdateConnectorSecurityRequirement1, + }; + partial void PrepareUpdateConnectorArguments( + global::System.Net.Http.HttpClient httpClient, + ref int? requestTimeout, + ref int? requestTimeoutMillis, + ref string agentKey, + ref string connectorId, + global::Vectara.UpdateAgentConnectorRequest request); + partial void PrepareUpdateConnectorRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + int? requestTimeout, + int? requestTimeoutMillis, + string agentKey, + string connectorId, + global::Vectara.UpdateAgentConnectorRequest request); + partial void ProcessUpdateConnectorResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessUpdateConnectorResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// 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 UpdateConnectorAsync( + 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) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareUpdateConnectorArguments( + httpClient: HttpClient, + requestTimeout: ref requestTimeout, + requestTimeoutMillis: ref requestTimeoutMillis, + agentKey: ref agentKey, + connectorId: ref connectorId, + request: request); + + + var __authorizations = global::Vectara.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_UpdateConnectorSecurityRequirements, + operationName: "UpdateConnectorAsync"); + + 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: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + var __pathBuilder = new global::Vectara.PathBuilder( + path: $"/v2/agents/{agentKey}/connectors/{connectorId}", + 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: new global::System.Net.Http.HttpMethod("PATCH"), + 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 __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::Vectara.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareUpdateConnectorRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + agentKey: agentKey, + connectorId: connectorId, + 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: "UpdateConnector", + methodName: "UpdateConnectorAsync", + pathTemplate: "$\"/v2/agents/{agentKey}/connectors/{connectorId}\"", + httpMethod: "PATCH", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + 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 __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateConnector", + methodName: "UpdateConnectorAsync", + pathTemplate: "$\"/v2/agents/{agentKey}/connectors/{connectorId}\"", + httpMethod: "PATCH", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateConnector", + methodName: "UpdateConnectorAsync", + pathTemplate: "$\"/v2/agents/{agentKey}/connectors/{connectorId}\"", + httpMethod: "PATCH", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessUpdateConnectorResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateConnector", + methodName: "UpdateConnectorAsync", + pathTemplate: "$\"/v2/agents/{agentKey}/connectors/{connectorId}\"", + httpMethod: "PATCH", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateConnector", + methodName: "UpdateConnectorAsync", + pathTemplate: "$\"/v2/agents/{agentKey}/connectors/{connectorId}\"", + httpMethod: "PATCH", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Connector update request was malformed or contains invalid configuration. + 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 updating this connector. + 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), + }; + } + // Agent or connector 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), + }; + } + + 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); + ProcessUpdateConnectorResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Vectara.AgentConnector.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.AgentConnector.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(); + } + } + /// + /// 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 + /// + /// + /// A detailed description of what this connector does.
+ /// Example: Updated description for the Slack connector + /// + /// + /// Arbitrary metadata associated with the connector.
+ /// Example: {"priority":"medium","department":"customer_service","last_reviewed":"2024-01-15"} + /// + /// + /// Whether the connector is enabled.
+ /// Example: false + /// + /// + /// Configuration for different types of connectors. + /// + /// 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 UpdateConnectorAsync( + string agentKey, + string connectorId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + string? name = default, + string? description = default, + object? metadata = default, + bool? enabled = default, + global::Vectara.SlackConnectorConfiguration? configuration = default, + global::Vectara.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Vectara.UpdateAgentConnectorRequest + { + Name = name, + Description = description, + Metadata = metadata, + Enabled = enabled, + Configuration = configuration, + }; + + return await UpdateConnectorAsync( + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + agentKey: agentKey, + connectorId: connectorId, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IAgentAnalyticsClient.GetTrace.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentAnalyticsClient.GetTrace.g.cs new file mode 100644 index 00000000..f181e7cf --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.IAgentAnalyticsClient.GetTrace.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace Vectara +{ + public partial interface IAgentAnalyticsClient + { + /// + /// 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 GetTraceAsync( + 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 new file mode 100644 index 00000000..fe7fd5f9 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.IAgentAnalyticsClient.GetTraceSpan.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace Vectara +{ + public partial interface IAgentAnalyticsClient + { + /// + /// 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 GetTraceSpanAsync( + 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 new file mode 100644 index 00000000..e85f968b --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.IAgentAnalyticsClient.ListTraceSpans.g.cs @@ -0,0 +1,36 @@ +#nullable enable + +namespace Vectara +{ + public partial interface IAgentAnalyticsClient + { + /// + /// 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 ListTraceSpansAsync( + 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 new file mode 100644 index 00000000..a5fc8f34 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.IAgentAnalyticsClient.ListTraces.g.cs @@ -0,0 +1,50 @@ +#nullable enable + +namespace Vectara +{ + public partial interface IAgentAnalyticsClient + { + /// + /// 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 ListTracesAsync( + 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.IAgentAnalyticsClient.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentAnalyticsClient.g.cs new file mode 100644 index 00000000..dfd03423 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.IAgentAnalyticsClient.g.cs @@ -0,0 +1,48 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public partial interface IAgentAnalyticsClient : global::System.IDisposable + { + /// + /// The HttpClient instance. + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + /// The base URL for the API. + /// + public System.Uri? BaseUri { get; } + + /// + /// The authorizations to use for the requests. + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// When false, successful responses are deserialized directly from the response stream for better performance. + /// Error responses are always read as strings regardless of this setting, + /// ensuring is populated. + /// + public bool ReadResponseAsString { get; set; } + /// + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// + public global::Vectara.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IAgentsClient.CreateConnector.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentsClient.CreateConnector.g.cs new file mode 100644 index 00000000..0e7705e1 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.IAgentsClient.CreateConnector.g.cs @@ -0,0 +1,80 @@ +#nullable enable + +namespace Vectara +{ + public partial interface IAgentsClient + { + /// + /// 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 + /// + 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); + /// + /// 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 + /// + /// + /// A detailed description of what this connector does.
+ /// Example: Receives customer support messages from the + /// + /// + /// The type of connector.
+ /// Example: slack + /// + /// + /// Arbitrary metadata associated with the connector.
+ /// Default Value: {}
+ /// Example: {"priority":"high","department":"customer_service"} + /// + /// + /// Whether the connector should be enabled upon creation.
+ /// Default Value: true
+ /// Example: true + /// + /// + /// Configuration for different types of connectors. + /// + /// 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 CreateConnectorAsync( + string agentKey, + string name, + global::Vectara.SlackConnectorConfiguration configuration, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + string? description = default, + global::Vectara.CreateAgentConnectorRequestType type = default, + object? metadata = default, + bool? enabled = 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 new file mode 100644 index 00000000..f3280108 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.IAgentsClient.DeleteConnector.g.cs @@ -0,0 +1,31 @@ +#nullable enable + +namespace Vectara +{ + public partial interface IAgentsClient + { + /// + /// 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 DeleteConnectorAsync( + 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.GetConnector.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentsClient.GetConnector.g.cs new file mode 100644 index 00000000..645b7222 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.IAgentsClient.GetConnector.g.cs @@ -0,0 +1,31 @@ +#nullable enable + +namespace Vectara +{ + public partial interface IAgentsClient + { + /// + /// 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 GetConnectorAsync( + 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.ListConnectors.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentsClient.ListConnectors.g.cs new file mode 100644 index 00000000..3cca0403 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.IAgentsClient.ListConnectors.g.cs @@ -0,0 +1,41 @@ +#nullable enable + +namespace Vectara +{ + public partial interface IAgentsClient + { + /// + /// 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 ListConnectorsAsync( + 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.UpdateConnector.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentsClient.UpdateConnector.g.cs new file mode 100644 index 00000000..cac4ab88 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.IAgentsClient.UpdateConnector.g.cs @@ -0,0 +1,81 @@ +#nullable enable + +namespace Vectara +{ + public partial interface IAgentsClient + { + /// + /// 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 + /// + global::System.Threading.Tasks.Task UpdateConnectorAsync( + 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 + /// + /// + /// A detailed description of what this connector does.
+ /// Example: Updated description for the Slack connector + /// + /// + /// Arbitrary metadata associated with the connector.
+ /// Example: {"priority":"medium","department":"customer_service","last_reviewed":"2024-01-15"} + /// + /// + /// Whether the connector is enabled.
+ /// Example: false + /// + /// + /// Configuration for different types of connectors. + /// + /// 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 UpdateConnectorAsync( + string agentKey, + string connectorId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + string? name = default, + string? description = default, + object? metadata = default, + bool? enabled = default, + global::Vectara.SlackConnectorConfiguration? configuration = 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.IVectaraClient.g.cs b/src/libs/Vectara/Generated/Vectara.IVectaraClient.g.cs index b6262415..0d6ec6bb 100644 --- a/src/libs/Vectara/Generated/Vectara.IVectaraClient.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IVectaraClient.g.cs @@ -59,6 +59,11 @@ public partial interface IVectaraClient : global::System.IDisposable global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + /// + /// + /// + public AgentAnalyticsClient AgentAnalytics { get; } + /// /// /// diff --git a/src/libs/Vectara/Generated/Vectara.JsonConverters.AgentConnectorStatus.g.cs b/src/libs/Vectara/Generated/Vectara.JsonConverters.AgentConnectorStatus.g.cs new file mode 100644 index 00000000..276de3a4 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.JsonConverters.AgentConnectorStatus.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Vectara.JsonConverters +{ + /// + public sealed class AgentConnectorStatusJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Vectara.AgentConnectorStatus Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Vectara.AgentConnectorStatusExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Vectara.AgentConnectorStatus)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Vectara.AgentConnectorStatus); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Vectara.AgentConnectorStatus value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Vectara.AgentConnectorStatusExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.JsonConverters.AgentConnectorStatusNullable.g.cs b/src/libs/Vectara/Generated/Vectara.JsonConverters.AgentConnectorStatusNullable.g.cs new file mode 100644 index 00000000..0c31643e --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.JsonConverters.AgentConnectorStatusNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Vectara.JsonConverters +{ + /// + public sealed class AgentConnectorStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Vectara.AgentConnectorStatus? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Vectara.AgentConnectorStatusExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Vectara.AgentConnectorStatus)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Vectara.AgentConnectorStatus?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Vectara.AgentConnectorStatus? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Vectara.AgentConnectorStatusExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.JsonConverters.AgentConnectorType.g.cs b/src/libs/Vectara/Generated/Vectara.JsonConverters.AgentConnectorType.g.cs new file mode 100644 index 00000000..3bcfc522 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.JsonConverters.AgentConnectorType.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Vectara.JsonConverters +{ + /// + public sealed class AgentConnectorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Vectara.AgentConnectorType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Vectara.AgentConnectorTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Vectara.AgentConnectorType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Vectara.AgentConnectorType); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Vectara.AgentConnectorType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Vectara.AgentConnectorTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.JsonConverters.AgentConnectorTypeNullable.g.cs b/src/libs/Vectara/Generated/Vectara.JsonConverters.AgentConnectorTypeNullable.g.cs new file mode 100644 index 00000000..6853a079 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.JsonConverters.AgentConnectorTypeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Vectara.JsonConverters +{ + /// + public sealed class AgentConnectorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Vectara.AgentConnectorType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Vectara.AgentConnectorTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Vectara.AgentConnectorType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Vectara.AgentConnectorType?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Vectara.AgentConnectorType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Vectara.AgentConnectorTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.JsonConverters.AgentToolConfiguration.g.cs b/src/libs/Vectara/Generated/Vectara.JsonConverters.AgentToolConfiguration.g.cs index 93cd9a5d..5f29d44d 100644 --- a/src/libs/Vectara/Generated/Vectara.JsonConverters.AgentToolConfiguration.g.cs +++ b/src/libs/Vectara/Generated/Vectara.JsonConverters.AgentToolConfiguration.g.cs @@ -70,6 +70,13 @@ public class AgentToolConfigurationJsonConverter : global::System.Text.Json.Seri throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Vectara.InlineSubAgentToolConfiguration)}"); subAgent = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); } + global::Vectara.InlineArtifactCreateToolConfiguration? artifactCreate = default; + if (discriminator?.Type == global::Vectara.AgentToolConfigurationDiscriminatorType.ArtifactCreate) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.InlineArtifactCreateToolConfiguration), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Vectara.InlineArtifactCreateToolConfiguration)}"); + artifactCreate = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); + } global::Vectara.InlineArtifactReadToolConfiguration? artifactRead = default; if (discriminator?.Type == global::Vectara.AgentToolConfigurationDiscriminatorType.ArtifactRead) { @@ -122,6 +129,8 @@ public class AgentToolConfigurationJsonConverter : global::System.Text.Json.Seri subAgent, + artifactCreate, + artifactRead, artifactGrep, @@ -187,6 +196,12 @@ public override void Write( throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.InlineSubAgentToolConfiguration).Name}"); global::System.Text.Json.JsonSerializer.Serialize(writer, value.SubAgent!, typeInfo); } + else if (value.IsArtifactCreate) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.InlineArtifactCreateToolConfiguration), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.InlineArtifactCreateToolConfiguration).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.ArtifactCreate!, typeInfo); + } else if (value.IsArtifactRead) { var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.InlineArtifactReadToolConfiguration), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? diff --git a/src/libs/Vectara/Generated/Vectara.JsonConverters.AgentTraceSpan.g.cs b/src/libs/Vectara/Generated/Vectara.JsonConverters.AgentTraceSpan.g.cs new file mode 100644 index 00000000..3778667a --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.JsonConverters.AgentTraceSpan.g.cs @@ -0,0 +1,177 @@ +#nullable enable +#pragma warning disable CS0618 // Type or member is obsolete + +namespace Vectara.JsonConverters +{ + /// + public class AgentTraceSpanJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Vectara.AgentTraceSpan Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + + var readerCopy = reader; + var discriminatorTypeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.AgentTraceSpanDiscriminator), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Vectara.AgentTraceSpanDiscriminator)}"); + var discriminator = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, discriminatorTypeInfo); + + global::Vectara.InvokeAgentTraceSpan? invokeAgent = default; + if (discriminator?.Operation == global::Vectara.AgentTraceSpanDiscriminatorOperation.InvokeAgent) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.InvokeAgentTraceSpan), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Vectara.InvokeAgentTraceSpan)}"); + invokeAgent = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); + } + global::Vectara.ChatTraceSpan? chat = default; + if (discriminator?.Operation == global::Vectara.AgentTraceSpanDiscriminatorOperation.Chat) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.ChatTraceSpan), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Vectara.ChatTraceSpan)}"); + chat = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); + } + global::Vectara.ExecuteToolTraceSpan? executeTool = default; + if (discriminator?.Operation == global::Vectara.AgentTraceSpanDiscriminatorOperation.ExecuteTool) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.ExecuteToolTraceSpan), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Vectara.ExecuteToolTraceSpan)}"); + executeTool = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); + } + global::Vectara.ThinkingTraceSpan? thinking = default; + if (discriminator?.Operation == global::Vectara.AgentTraceSpanDiscriminatorOperation.Thinking) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.ThinkingTraceSpan), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Vectara.ThinkingTraceSpan)}"); + thinking = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); + } + global::Vectara.OutputTraceSpan? output = default; + if (discriminator?.Operation == global::Vectara.AgentTraceSpanDiscriminatorOperation.Output) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.OutputTraceSpan), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Vectara.OutputTraceSpan)}"); + output = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); + } + global::Vectara.GuardrailTraceSpan? guardrail = default; + if (discriminator?.Operation == global::Vectara.AgentTraceSpanDiscriminatorOperation.Guardrail) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.GuardrailTraceSpan), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Vectara.GuardrailTraceSpan)}"); + guardrail = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); + } + global::Vectara.StepTransitionTraceSpan? stepTransition = default; + if (discriminator?.Operation == global::Vectara.AgentTraceSpanDiscriminatorOperation.StepTransition) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.StepTransitionTraceSpan), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Vectara.StepTransitionTraceSpan)}"); + stepTransition = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); + } + global::Vectara.ImageReadTraceSpan? imageRead = default; + if (discriminator?.Operation == global::Vectara.AgentTraceSpanDiscriminatorOperation.ImageRead) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.ImageReadTraceSpan), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Vectara.ImageReadTraceSpan)}"); + imageRead = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); + } + global::Vectara.CompactionTraceSpan? compaction = default; + if (discriminator?.Operation == global::Vectara.AgentTraceSpanDiscriminatorOperation.Compaction) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.CompactionTraceSpan), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Vectara.CompactionTraceSpan)}"); + compaction = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); + } + + var __value = new global::Vectara.AgentTraceSpan( + discriminator?.Operation, + invokeAgent, + + chat, + + executeTool, + + thinking, + + output, + + guardrail, + + stepTransition, + + imageRead, + + compaction + ); + + return __value; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Vectara.AgentTraceSpan value, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + if (value.IsInvokeAgent) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.InvokeAgentTraceSpan), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.InvokeAgentTraceSpan).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.InvokeAgent!.Value, typeInfo); + } + else if (value.IsChat) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.ChatTraceSpan), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.ChatTraceSpan).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Chat!.Value, typeInfo); + } + else if (value.IsExecuteTool) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.ExecuteToolTraceSpan), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.ExecuteToolTraceSpan).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.ExecuteTool!.Value, typeInfo); + } + else if (value.IsThinking) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.ThinkingTraceSpan), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.ThinkingTraceSpan).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Thinking!.Value, typeInfo); + } + else if (value.IsOutput) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.OutputTraceSpan), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.OutputTraceSpan).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Output!.Value, typeInfo); + } + else if (value.IsGuardrail) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.GuardrailTraceSpan), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.GuardrailTraceSpan).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Guardrail!.Value, typeInfo); + } + else if (value.IsStepTransition) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.StepTransitionTraceSpan), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.StepTransitionTraceSpan).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.StepTransition!.Value, typeInfo); + } + else if (value.IsImageRead) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.ImageReadTraceSpan), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.ImageReadTraceSpan).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.ImageRead!.Value, typeInfo); + } + else if (value.IsCompaction) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.CompactionTraceSpan), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.CompactionTraceSpan).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Compaction!.Value, typeInfo); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.JsonConverters.AgentTraceSpanDiscriminatorOperation.g.cs b/src/libs/Vectara/Generated/Vectara.JsonConverters.AgentTraceSpanDiscriminatorOperation.g.cs new file mode 100644 index 00000000..d4f296ca --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.JsonConverters.AgentTraceSpanDiscriminatorOperation.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Vectara.JsonConverters +{ + /// + public sealed class AgentTraceSpanDiscriminatorOperationJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Vectara.AgentTraceSpanDiscriminatorOperation Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Vectara.AgentTraceSpanDiscriminatorOperationExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Vectara.AgentTraceSpanDiscriminatorOperation)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Vectara.AgentTraceSpanDiscriminatorOperation); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Vectara.AgentTraceSpanDiscriminatorOperation value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Vectara.AgentTraceSpanDiscriminatorOperationExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.JsonConverters.AgentTraceSpanDiscriminatorOperationNullable.g.cs b/src/libs/Vectara/Generated/Vectara.JsonConverters.AgentTraceSpanDiscriminatorOperationNullable.g.cs new file mode 100644 index 00000000..9c832a62 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.JsonConverters.AgentTraceSpanDiscriminatorOperationNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Vectara.JsonConverters +{ + /// + public sealed class AgentTraceSpanDiscriminatorOperationNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Vectara.AgentTraceSpanDiscriminatorOperation? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Vectara.AgentTraceSpanDiscriminatorOperationExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Vectara.AgentTraceSpanDiscriminatorOperation)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Vectara.AgentTraceSpanDiscriminatorOperation?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Vectara.AgentTraceSpanDiscriminatorOperation? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Vectara.AgentTraceSpanDiscriminatorOperationExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.JsonConverters.AgentTraceSpanStatus.g.cs b/src/libs/Vectara/Generated/Vectara.JsonConverters.AgentTraceSpanStatus.g.cs new file mode 100644 index 00000000..d201d826 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.JsonConverters.AgentTraceSpanStatus.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Vectara.JsonConverters +{ + /// + public sealed class AgentTraceSpanStatusJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Vectara.AgentTraceSpanStatus Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Vectara.AgentTraceSpanStatusExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Vectara.AgentTraceSpanStatus)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Vectara.AgentTraceSpanStatus); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Vectara.AgentTraceSpanStatus value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Vectara.AgentTraceSpanStatusExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.JsonConverters.AgentTraceSpanStatusNullable.g.cs b/src/libs/Vectara/Generated/Vectara.JsonConverters.AgentTraceSpanStatusNullable.g.cs new file mode 100644 index 00000000..07a6f8bd --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.JsonConverters.AgentTraceSpanStatusNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Vectara.JsonConverters +{ + /// + public sealed class AgentTraceSpanStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Vectara.AgentTraceSpanStatus? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Vectara.AgentTraceSpanStatusExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Vectara.AgentTraceSpanStatus)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Vectara.AgentTraceSpanStatus?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Vectara.AgentTraceSpanStatus? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Vectara.AgentTraceSpanStatusExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.JsonConverters.AgentTraceStatus.g.cs b/src/libs/Vectara/Generated/Vectara.JsonConverters.AgentTraceStatus.g.cs new file mode 100644 index 00000000..ab1903ab --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.JsonConverters.AgentTraceStatus.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Vectara.JsonConverters +{ + /// + public sealed class AgentTraceStatusJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Vectara.AgentTraceStatus Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Vectara.AgentTraceStatusExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Vectara.AgentTraceStatus)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Vectara.AgentTraceStatus); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Vectara.AgentTraceStatus value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Vectara.AgentTraceStatusExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.JsonConverters.AgentTraceStatusNullable.g.cs b/src/libs/Vectara/Generated/Vectara.JsonConverters.AgentTraceStatusNullable.g.cs new file mode 100644 index 00000000..424f8f31 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.JsonConverters.AgentTraceStatusNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Vectara.JsonConverters +{ + /// + public sealed class AgentTraceStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Vectara.AgentTraceStatus? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Vectara.AgentTraceStatusExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Vectara.AgentTraceStatus)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Vectara.AgentTraceStatus?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Vectara.AgentTraceStatus? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Vectara.AgentTraceStatusExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.JsonConverters.ChatTraceSpan.g.cs b/src/libs/Vectara/Generated/Vectara.JsonConverters.ChatTraceSpan.g.cs new file mode 100644 index 00000000..9d0f4eec --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.JsonConverters.ChatTraceSpan.g.cs @@ -0,0 +1,160 @@ +#nullable enable +#pragma warning disable CS0618 // Type or member is obsolete + +namespace Vectara.JsonConverters +{ + /// + public class ChatTraceSpanJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Vectara.ChatTraceSpan Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + using var __jsonDocument = global::System.Text.Json.JsonDocument.ParseValue(ref reader); + var __rawJson = __jsonDocument.RootElement.GetRawText(); + var __jsonProps = new global::System.Collections.Generic.HashSet(); + if (__jsonDocument.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Object) + { + foreach (var __jsonProp in __jsonDocument.RootElement.EnumerateObject()) + { + __jsonProps.Add(__jsonProp.Name); + if (__jsonProp.Value.ValueKind == global::System.Text.Json.JsonValueKind.Object) + { + foreach (var __nestedJsonProp in __jsonProp.Value.EnumerateObject()) + { + __jsonProps.Add(__jsonProp.Name + "." + __nestedJsonProp.Name); + } + } + + } + } + + var __score0 = 0; + if (__jsonProps.Contains("duration_ms")) __score0++; + if (__jsonProps.Contains("error_message")) __score0++; + if (__jsonProps.Contains("parent_span_id")) __score0++; + if (__jsonProps.Contains("span_id")) __score0++; + if (__jsonProps.Contains("started_at")) __score0++; + if (__jsonProps.Contains("status")) __score0++; + if (__jsonProps.Contains("step_name")) __score0++; + if (__jsonProps.Contains("trace_id")) __score0++; + var __score1 = 0; + if (__jsonProps.Contains("attributes")) __score1++; + if (__jsonProps.Contains("attributes.cache_read_input_tokens")) __score1++; + if (__jsonProps.Contains("attributes.finish_reasons")) __score1++; + if (__jsonProps.Contains("attributes.input_tokens")) __score1++; + if (__jsonProps.Contains("attributes.max_tokens")) __score1++; + if (__jsonProps.Contains("attributes.model")) __score1++; + if (__jsonProps.Contains("attributes.output_tokens")) __score1++; + if (__jsonProps.Contains("attributes.provider_name")) __score1++; + if (__jsonProps.Contains("attributes.response_id")) __score1++; + if (__jsonProps.Contains("attributes.temperature")) __score1++; + if (__jsonProps.Contains("operation")) __score1++; + var __bestScore = 0; + var __bestIndex = -1; + if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; } + if (__score1 > __bestScore) { __bestScore = __score1; __bestIndex = 1; } + + global::Vectara.AgentTraceSpanBase? agentBase = default; + global::Vectara.ChatTraceSpanVariant2? chatTraceSpanVariant2 = default; + if (__bestIndex >= 0) + { + if (__bestIndex == 0) + { + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.AgentTraceSpanBase), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.AgentTraceSpanBase).Name}"); + agentBase = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + else if (__bestIndex == 1) + { + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.ChatTraceSpanVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.ChatTraceSpanVariant2).Name}"); + chatTraceSpanVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + } + + if (agentBase == null && chatTraceSpanVariant2 == null) + { + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.AgentTraceSpanBase), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.AgentTraceSpanBase).Name}"); + agentBase = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.ChatTraceSpanVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.ChatTraceSpanVariant2).Name}"); + chatTraceSpanVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + var __value = new global::Vectara.ChatTraceSpan( + agentBase, + + chatTraceSpanVariant2 + ); + + return __value; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Vectara.ChatTraceSpan value, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + if (value.IsAgentBase) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.AgentTraceSpanBase), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.AgentTraceSpanBase).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.AgentBase!, typeInfo); + } + else if (value.IsChatTraceSpanVariant2) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.ChatTraceSpanVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.ChatTraceSpanVariant2).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.ChatTraceSpanVariant2!, typeInfo); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.JsonConverters.CompactionTraceSpan.g.cs b/src/libs/Vectara/Generated/Vectara.JsonConverters.CompactionTraceSpan.g.cs new file mode 100644 index 00000000..b382e219 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.JsonConverters.CompactionTraceSpan.g.cs @@ -0,0 +1,155 @@ +#nullable enable +#pragma warning disable CS0618 // Type or member is obsolete + +namespace Vectara.JsonConverters +{ + /// + public class CompactionTraceSpanJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Vectara.CompactionTraceSpan Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + using var __jsonDocument = global::System.Text.Json.JsonDocument.ParseValue(ref reader); + var __rawJson = __jsonDocument.RootElement.GetRawText(); + var __jsonProps = new global::System.Collections.Generic.HashSet(); + if (__jsonDocument.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Object) + { + foreach (var __jsonProp in __jsonDocument.RootElement.EnumerateObject()) + { + __jsonProps.Add(__jsonProp.Name); + if (__jsonProp.Value.ValueKind == global::System.Text.Json.JsonValueKind.Object) + { + foreach (var __nestedJsonProp in __jsonProp.Value.EnumerateObject()) + { + __jsonProps.Add(__jsonProp.Name + "." + __nestedJsonProp.Name); + } + } + + } + } + + var __score0 = 0; + if (__jsonProps.Contains("duration_ms")) __score0++; + if (__jsonProps.Contains("error_message")) __score0++; + if (__jsonProps.Contains("parent_span_id")) __score0++; + if (__jsonProps.Contains("span_id")) __score0++; + if (__jsonProps.Contains("started_at")) __score0++; + if (__jsonProps.Contains("status")) __score0++; + if (__jsonProps.Contains("step_name")) __score0++; + if (__jsonProps.Contains("trace_id")) __score0++; + var __score1 = 0; + if (__jsonProps.Contains("attributes")) __score1++; + if (__jsonProps.Contains("attributes.events_compacted")) __score1++; + if (__jsonProps.Contains("attributes.summary_key")) __score1++; + if (__jsonProps.Contains("attributes.turns_compacted")) __score1++; + if (__jsonProps.Contains("event_id")) __score1++; + if (__jsonProps.Contains("operation")) __score1++; + var __bestScore = 0; + var __bestIndex = -1; + if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; } + if (__score1 > __bestScore) { __bestScore = __score1; __bestIndex = 1; } + + global::Vectara.AgentTraceSpanBase? agentBase = default; + global::Vectara.CompactionTraceSpanVariant2? compactionTraceSpanVariant2 = default; + if (__bestIndex >= 0) + { + if (__bestIndex == 0) + { + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.AgentTraceSpanBase), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.AgentTraceSpanBase).Name}"); + agentBase = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + else if (__bestIndex == 1) + { + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.CompactionTraceSpanVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.CompactionTraceSpanVariant2).Name}"); + compactionTraceSpanVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + } + + if (agentBase == null && compactionTraceSpanVariant2 == null) + { + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.AgentTraceSpanBase), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.AgentTraceSpanBase).Name}"); + agentBase = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.CompactionTraceSpanVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.CompactionTraceSpanVariant2).Name}"); + compactionTraceSpanVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + var __value = new global::Vectara.CompactionTraceSpan( + agentBase, + + compactionTraceSpanVariant2 + ); + + return __value; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Vectara.CompactionTraceSpan value, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + if (value.IsAgentBase) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.AgentTraceSpanBase), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.AgentTraceSpanBase).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.AgentBase!, typeInfo); + } + else if (value.IsCompactionTraceSpanVariant2) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.CompactionTraceSpanVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.CompactionTraceSpanVariant2).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.CompactionTraceSpanVariant2!, typeInfo); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.JsonConverters.ConnectorConfiguration.g.cs b/src/libs/Vectara/Generated/Vectara.JsonConverters.ConnectorConfiguration.g.cs new file mode 100644 index 00000000..0b3b2867 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.JsonConverters.ConnectorConfiguration.g.cs @@ -0,0 +1,57 @@ +#nullable enable +#pragma warning disable CS0618 // Type or member is obsolete + +namespace Vectara.JsonConverters +{ + /// + public class ConnectorConfigurationJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Vectara.ConnectorConfiguration Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + + var readerCopy = reader; + var discriminatorTypeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.ConnectorConfigurationDiscriminator), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Vectara.ConnectorConfigurationDiscriminator)}"); + var discriminator = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, discriminatorTypeInfo); + + global::Vectara.SlackConnectorConfiguration? slack = default; + if (discriminator?.Type == global::Vectara.ConnectorConfigurationDiscriminatorType.Slack) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.SlackConnectorConfiguration), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Vectara.SlackConnectorConfiguration)}"); + slack = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); + } + + var __value = new global::Vectara.ConnectorConfiguration( + discriminator?.Type, + slack + ); + + return __value; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Vectara.ConnectorConfiguration value, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + if (value.IsSlack) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.SlackConnectorConfiguration), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.SlackConnectorConfiguration).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Slack!, typeInfo); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.JsonConverters.ConnectorConfigurationDiscriminatorType.g.cs b/src/libs/Vectara/Generated/Vectara.JsonConverters.ConnectorConfigurationDiscriminatorType.g.cs new file mode 100644 index 00000000..8ffa68a4 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.JsonConverters.ConnectorConfigurationDiscriminatorType.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Vectara.JsonConverters +{ + /// + public sealed class ConnectorConfigurationDiscriminatorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Vectara.ConnectorConfigurationDiscriminatorType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Vectara.ConnectorConfigurationDiscriminatorTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Vectara.ConnectorConfigurationDiscriminatorType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Vectara.ConnectorConfigurationDiscriminatorType); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Vectara.ConnectorConfigurationDiscriminatorType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Vectara.ConnectorConfigurationDiscriminatorTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.JsonConverters.ConnectorConfigurationDiscriminatorTypeNullable.g.cs b/src/libs/Vectara/Generated/Vectara.JsonConverters.ConnectorConfigurationDiscriminatorTypeNullable.g.cs new file mode 100644 index 00000000..d80cd008 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.JsonConverters.ConnectorConfigurationDiscriminatorTypeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Vectara.JsonConverters +{ + /// + public sealed class ConnectorConfigurationDiscriminatorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Vectara.ConnectorConfigurationDiscriminatorType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Vectara.ConnectorConfigurationDiscriminatorTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Vectara.ConnectorConfigurationDiscriminatorType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Vectara.ConnectorConfigurationDiscriminatorType?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Vectara.ConnectorConfigurationDiscriminatorType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Vectara.ConnectorConfigurationDiscriminatorTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.JsonConverters.CreateAgentConnectorRequestType.g.cs b/src/libs/Vectara/Generated/Vectara.JsonConverters.CreateAgentConnectorRequestType.g.cs new file mode 100644 index 00000000..f1401941 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.JsonConverters.CreateAgentConnectorRequestType.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Vectara.JsonConverters +{ + /// + public sealed class CreateAgentConnectorRequestTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Vectara.CreateAgentConnectorRequestType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Vectara.CreateAgentConnectorRequestTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Vectara.CreateAgentConnectorRequestType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Vectara.CreateAgentConnectorRequestType); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Vectara.CreateAgentConnectorRequestType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Vectara.CreateAgentConnectorRequestTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.JsonConverters.CreateAgentConnectorRequestTypeNullable.g.cs b/src/libs/Vectara/Generated/Vectara.JsonConverters.CreateAgentConnectorRequestTypeNullable.g.cs new file mode 100644 index 00000000..b6ad4589 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.JsonConverters.CreateAgentConnectorRequestTypeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Vectara.JsonConverters +{ + /// + public sealed class CreateAgentConnectorRequestTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Vectara.CreateAgentConnectorRequestType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Vectara.CreateAgentConnectorRequestTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Vectara.CreateAgentConnectorRequestType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Vectara.CreateAgentConnectorRequestType?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Vectara.CreateAgentConnectorRequestType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Vectara.CreateAgentConnectorRequestTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.JsonConverters.ExecuteToolTraceSpan.g.cs b/src/libs/Vectara/Generated/Vectara.JsonConverters.ExecuteToolTraceSpan.g.cs new file mode 100644 index 00000000..8518be97 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.JsonConverters.ExecuteToolTraceSpan.g.cs @@ -0,0 +1,159 @@ +#nullable enable +#pragma warning disable CS0618 // Type or member is obsolete + +namespace Vectara.JsonConverters +{ + /// + public class ExecuteToolTraceSpanJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Vectara.ExecuteToolTraceSpan Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + using var __jsonDocument = global::System.Text.Json.JsonDocument.ParseValue(ref reader); + var __rawJson = __jsonDocument.RootElement.GetRawText(); + var __jsonProps = new global::System.Collections.Generic.HashSet(); + if (__jsonDocument.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Object) + { + foreach (var __jsonProp in __jsonDocument.RootElement.EnumerateObject()) + { + __jsonProps.Add(__jsonProp.Name); + if (__jsonProp.Value.ValueKind == global::System.Text.Json.JsonValueKind.Object) + { + foreach (var __nestedJsonProp in __jsonProp.Value.EnumerateObject()) + { + __jsonProps.Add(__jsonProp.Name + "." + __nestedJsonProp.Name); + } + } + + } + } + + var __score0 = 0; + if (__jsonProps.Contains("duration_ms")) __score0++; + if (__jsonProps.Contains("error_message")) __score0++; + if (__jsonProps.Contains("parent_span_id")) __score0++; + if (__jsonProps.Contains("span_id")) __score0++; + if (__jsonProps.Contains("started_at")) __score0++; + if (__jsonProps.Contains("status")) __score0++; + if (__jsonProps.Contains("step_name")) __score0++; + if (__jsonProps.Contains("trace_id")) __score0++; + var __score1 = 0; + if (__jsonProps.Contains("attributes")) __score1++; + if (__jsonProps.Contains("attributes.corpus_keys")) __score1++; + if (__jsonProps.Contains("attributes.tool_call_id")) __score1++; + if (__jsonProps.Contains("attributes.tool_input_event_id")) __score1++; + if (__jsonProps.Contains("attributes.tool_key")) __score1++; + if (__jsonProps.Contains("attributes.tool_name")) __score1++; + if (__jsonProps.Contains("attributes.tool_output_event_id")) __score1++; + if (__jsonProps.Contains("attributes.tool_type")) __score1++; + if (__jsonProps.Contains("content")) __score1++; + if (__jsonProps.Contains("operation")) __score1++; + var __bestScore = 0; + var __bestIndex = -1; + if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; } + if (__score1 > __bestScore) { __bestScore = __score1; __bestIndex = 1; } + + global::Vectara.AgentTraceSpanBase? agentBase = default; + global::Vectara.ExecuteToolTraceSpanVariant2? executeToolTraceSpanVariant2 = default; + if (__bestIndex >= 0) + { + if (__bestIndex == 0) + { + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.AgentTraceSpanBase), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.AgentTraceSpanBase).Name}"); + agentBase = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + else if (__bestIndex == 1) + { + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.ExecuteToolTraceSpanVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.ExecuteToolTraceSpanVariant2).Name}"); + executeToolTraceSpanVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + } + + if (agentBase == null && executeToolTraceSpanVariant2 == null) + { + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.AgentTraceSpanBase), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.AgentTraceSpanBase).Name}"); + agentBase = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.ExecuteToolTraceSpanVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.ExecuteToolTraceSpanVariant2).Name}"); + executeToolTraceSpanVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + var __value = new global::Vectara.ExecuteToolTraceSpan( + agentBase, + + executeToolTraceSpanVariant2 + ); + + return __value; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Vectara.ExecuteToolTraceSpan value, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + if (value.IsAgentBase) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.AgentTraceSpanBase), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.AgentTraceSpanBase).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.AgentBase!, typeInfo); + } + else if (value.IsExecuteToolTraceSpanVariant2) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.ExecuteToolTraceSpanVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.ExecuteToolTraceSpanVariant2).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.ExecuteToolTraceSpanVariant2!, typeInfo); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.JsonConverters.GuardrailTraceSpan.g.cs b/src/libs/Vectara/Generated/Vectara.JsonConverters.GuardrailTraceSpan.g.cs new file mode 100644 index 00000000..d037e707 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.JsonConverters.GuardrailTraceSpan.g.cs @@ -0,0 +1,154 @@ +#nullable enable +#pragma warning disable CS0618 // Type or member is obsolete + +namespace Vectara.JsonConverters +{ + /// + public class GuardrailTraceSpanJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Vectara.GuardrailTraceSpan Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + using var __jsonDocument = global::System.Text.Json.JsonDocument.ParseValue(ref reader); + var __rawJson = __jsonDocument.RootElement.GetRawText(); + var __jsonProps = new global::System.Collections.Generic.HashSet(); + if (__jsonDocument.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Object) + { + foreach (var __jsonProp in __jsonDocument.RootElement.EnumerateObject()) + { + __jsonProps.Add(__jsonProp.Name); + if (__jsonProp.Value.ValueKind == global::System.Text.Json.JsonValueKind.Object) + { + foreach (var __nestedJsonProp in __jsonProp.Value.EnumerateObject()) + { + __jsonProps.Add(__jsonProp.Name + "." + __nestedJsonProp.Name); + } + } + + } + } + + var __score0 = 0; + if (__jsonProps.Contains("duration_ms")) __score0++; + if (__jsonProps.Contains("error_message")) __score0++; + if (__jsonProps.Contains("parent_span_id")) __score0++; + if (__jsonProps.Contains("span_id")) __score0++; + if (__jsonProps.Contains("started_at")) __score0++; + if (__jsonProps.Contains("status")) __score0++; + if (__jsonProps.Contains("step_name")) __score0++; + if (__jsonProps.Contains("trace_id")) __score0++; + var __score1 = 0; + if (__jsonProps.Contains("attributes")) __score1++; + if (__jsonProps.Contains("attributes.guardrail_passed")) __score1++; + if (__jsonProps.Contains("attributes.retry_attempt")) __score1++; + if (__jsonProps.Contains("content")) __score1++; + if (__jsonProps.Contains("operation")) __score1++; + var __bestScore = 0; + var __bestIndex = -1; + if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; } + if (__score1 > __bestScore) { __bestScore = __score1; __bestIndex = 1; } + + global::Vectara.AgentTraceSpanBase? agentBase = default; + global::Vectara.GuardrailTraceSpanVariant2? guardrailTraceSpanVariant2 = default; + if (__bestIndex >= 0) + { + if (__bestIndex == 0) + { + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.AgentTraceSpanBase), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.AgentTraceSpanBase).Name}"); + agentBase = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + else if (__bestIndex == 1) + { + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.GuardrailTraceSpanVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.GuardrailTraceSpanVariant2).Name}"); + guardrailTraceSpanVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + } + + if (agentBase == null && guardrailTraceSpanVariant2 == null) + { + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.AgentTraceSpanBase), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.AgentTraceSpanBase).Name}"); + agentBase = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.GuardrailTraceSpanVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.GuardrailTraceSpanVariant2).Name}"); + guardrailTraceSpanVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + var __value = new global::Vectara.GuardrailTraceSpan( + agentBase, + + guardrailTraceSpanVariant2 + ); + + return __value; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Vectara.GuardrailTraceSpan value, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + if (value.IsAgentBase) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.AgentTraceSpanBase), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.AgentTraceSpanBase).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.AgentBase!, typeInfo); + } + else if (value.IsGuardrailTraceSpanVariant2) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.GuardrailTraceSpanVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.GuardrailTraceSpanVariant2).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.GuardrailTraceSpanVariant2!, typeInfo); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.JsonConverters.ImageReadTraceSpan.g.cs b/src/libs/Vectara/Generated/Vectara.JsonConverters.ImageReadTraceSpan.g.cs new file mode 100644 index 00000000..2ce20f23 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.JsonConverters.ImageReadTraceSpan.g.cs @@ -0,0 +1,154 @@ +#nullable enable +#pragma warning disable CS0618 // Type or member is obsolete + +namespace Vectara.JsonConverters +{ + /// + public class ImageReadTraceSpanJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Vectara.ImageReadTraceSpan Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + using var __jsonDocument = global::System.Text.Json.JsonDocument.ParseValue(ref reader); + var __rawJson = __jsonDocument.RootElement.GetRawText(); + var __jsonProps = new global::System.Collections.Generic.HashSet(); + if (__jsonDocument.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Object) + { + foreach (var __jsonProp in __jsonDocument.RootElement.EnumerateObject()) + { + __jsonProps.Add(__jsonProp.Name); + if (__jsonProp.Value.ValueKind == global::System.Text.Json.JsonValueKind.Object) + { + foreach (var __nestedJsonProp in __jsonProp.Value.EnumerateObject()) + { + __jsonProps.Add(__jsonProp.Name + "." + __nestedJsonProp.Name); + } + } + + } + } + + var __score0 = 0; + if (__jsonProps.Contains("duration_ms")) __score0++; + if (__jsonProps.Contains("error_message")) __score0++; + if (__jsonProps.Contains("parent_span_id")) __score0++; + if (__jsonProps.Contains("span_id")) __score0++; + if (__jsonProps.Contains("started_at")) __score0++; + if (__jsonProps.Contains("status")) __score0++; + if (__jsonProps.Contains("step_name")) __score0++; + if (__jsonProps.Contains("trace_id")) __score0++; + var __score1 = 0; + if (__jsonProps.Contains("attributes")) __score1++; + if (__jsonProps.Contains("attributes.artifact_id")) __score1++; + if (__jsonProps.Contains("attributes.detail")) __score1++; + if (__jsonProps.Contains("event_id")) __score1++; + if (__jsonProps.Contains("operation")) __score1++; + var __bestScore = 0; + var __bestIndex = -1; + if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; } + if (__score1 > __bestScore) { __bestScore = __score1; __bestIndex = 1; } + + global::Vectara.AgentTraceSpanBase? agentBase = default; + global::Vectara.ImageReadTraceSpanVariant2? imageReadTraceSpanVariant2 = default; + if (__bestIndex >= 0) + { + if (__bestIndex == 0) + { + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.AgentTraceSpanBase), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.AgentTraceSpanBase).Name}"); + agentBase = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + else if (__bestIndex == 1) + { + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.ImageReadTraceSpanVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.ImageReadTraceSpanVariant2).Name}"); + imageReadTraceSpanVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + } + + if (agentBase == null && imageReadTraceSpanVariant2 == null) + { + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.AgentTraceSpanBase), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.AgentTraceSpanBase).Name}"); + agentBase = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.ImageReadTraceSpanVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.ImageReadTraceSpanVariant2).Name}"); + imageReadTraceSpanVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + var __value = new global::Vectara.ImageReadTraceSpan( + agentBase, + + imageReadTraceSpanVariant2 + ); + + return __value; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Vectara.ImageReadTraceSpan value, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + if (value.IsAgentBase) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.AgentTraceSpanBase), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.AgentTraceSpanBase).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.AgentBase!, typeInfo); + } + else if (value.IsImageReadTraceSpanVariant2) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.ImageReadTraceSpanVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.ImageReadTraceSpanVariant2).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.ImageReadTraceSpanVariant2!, typeInfo); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.JsonConverters.InvokeAgentSpanAttributesOutputType.g.cs b/src/libs/Vectara/Generated/Vectara.JsonConverters.InvokeAgentSpanAttributesOutputType.g.cs new file mode 100644 index 00000000..579a5948 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.JsonConverters.InvokeAgentSpanAttributesOutputType.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Vectara.JsonConverters +{ + /// + public sealed class InvokeAgentSpanAttributesOutputTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Vectara.InvokeAgentSpanAttributesOutputType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Vectara.InvokeAgentSpanAttributesOutputTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Vectara.InvokeAgentSpanAttributesOutputType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Vectara.InvokeAgentSpanAttributesOutputType); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Vectara.InvokeAgentSpanAttributesOutputType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Vectara.InvokeAgentSpanAttributesOutputTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.JsonConverters.InvokeAgentSpanAttributesOutputTypeNullable.g.cs b/src/libs/Vectara/Generated/Vectara.JsonConverters.InvokeAgentSpanAttributesOutputTypeNullable.g.cs new file mode 100644 index 00000000..9abd7881 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.JsonConverters.InvokeAgentSpanAttributesOutputTypeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Vectara.JsonConverters +{ + /// + public sealed class InvokeAgentSpanAttributesOutputTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Vectara.InvokeAgentSpanAttributesOutputType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Vectara.InvokeAgentSpanAttributesOutputTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Vectara.InvokeAgentSpanAttributesOutputType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Vectara.InvokeAgentSpanAttributesOutputType?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Vectara.InvokeAgentSpanAttributesOutputType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Vectara.InvokeAgentSpanAttributesOutputTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.JsonConverters.InvokeAgentTraceSpan.g.cs b/src/libs/Vectara/Generated/Vectara.JsonConverters.InvokeAgentTraceSpan.g.cs new file mode 100644 index 00000000..2b6940a2 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.JsonConverters.InvokeAgentTraceSpan.g.cs @@ -0,0 +1,165 @@ +#nullable enable +#pragma warning disable CS0618 // Type or member is obsolete + +namespace Vectara.JsonConverters +{ + /// + public class InvokeAgentTraceSpanJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Vectara.InvokeAgentTraceSpan Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + using var __jsonDocument = global::System.Text.Json.JsonDocument.ParseValue(ref reader); + var __rawJson = __jsonDocument.RootElement.GetRawText(); + var __jsonProps = new global::System.Collections.Generic.HashSet(); + if (__jsonDocument.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Object) + { + foreach (var __jsonProp in __jsonDocument.RootElement.EnumerateObject()) + { + __jsonProps.Add(__jsonProp.Name); + if (__jsonProp.Value.ValueKind == global::System.Text.Json.JsonValueKind.Object) + { + foreach (var __nestedJsonProp in __jsonProp.Value.EnumerateObject()) + { + __jsonProps.Add(__jsonProp.Name + "." + __nestedJsonProp.Name); + } + } + + } + } + + var __score0 = 0; + if (__jsonProps.Contains("duration_ms")) __score0++; + if (__jsonProps.Contains("error_message")) __score0++; + if (__jsonProps.Contains("parent_span_id")) __score0++; + if (__jsonProps.Contains("span_id")) __score0++; + if (__jsonProps.Contains("started_at")) __score0++; + if (__jsonProps.Contains("status")) __score0++; + if (__jsonProps.Contains("step_name")) __score0++; + if (__jsonProps.Contains("trace_id")) __score0++; + var __score1 = 0; + if (__jsonProps.Contains("attributes")) __score1++; + if (__jsonProps.Contains("attributes.agent_description")) __score1++; + if (__jsonProps.Contains("attributes.agent_name")) __score1++; + if (__jsonProps.Contains("attributes.cache_read_input_tokens")) __score1++; + if (__jsonProps.Contains("attributes.input_event_id")) __score1++; + if (__jsonProps.Contains("attributes.input_files")) __score1++; + if (__jsonProps.Contains("attributes.input_tokens")) __score1++; + if (__jsonProps.Contains("attributes.max_tokens")) __score1++; + if (__jsonProps.Contains("attributes.model")) __score1++; + if (__jsonProps.Contains("attributes.output_event_id")) __score1++; + if (__jsonProps.Contains("attributes.output_tokens")) __score1++; + if (__jsonProps.Contains("attributes.output_type")) __score1++; + if (__jsonProps.Contains("attributes.provider_name")) __score1++; + if (__jsonProps.Contains("attributes.temperature")) __score1++; + if (__jsonProps.Contains("content")) __score1++; + if (__jsonProps.Contains("operation")) __score1++; + var __bestScore = 0; + var __bestIndex = -1; + if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; } + if (__score1 > __bestScore) { __bestScore = __score1; __bestIndex = 1; } + + global::Vectara.AgentTraceSpanBase? @base = default; + global::Vectara.InvokeAgentTraceSpanVariant2? invokeAgentTraceSpanVariant2 = default; + if (__bestIndex >= 0) + { + if (__bestIndex == 0) + { + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.AgentTraceSpanBase), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.AgentTraceSpanBase).Name}"); + @base = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + else if (__bestIndex == 1) + { + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.InvokeAgentTraceSpanVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.InvokeAgentTraceSpanVariant2).Name}"); + invokeAgentTraceSpanVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + } + + if (@base == null && invokeAgentTraceSpanVariant2 == null) + { + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.AgentTraceSpanBase), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.AgentTraceSpanBase).Name}"); + @base = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.InvokeAgentTraceSpanVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.InvokeAgentTraceSpanVariant2).Name}"); + invokeAgentTraceSpanVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + var __value = new global::Vectara.InvokeAgentTraceSpan( + @base, + + invokeAgentTraceSpanVariant2 + ); + + return __value; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Vectara.InvokeAgentTraceSpan value, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + if (value.IsBase) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.AgentTraceSpanBase), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.AgentTraceSpanBase).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Base!, typeInfo); + } + else if (value.IsInvokeAgentTraceSpanVariant2) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.InvokeAgentTraceSpanVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.InvokeAgentTraceSpanVariant2).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.InvokeAgentTraceSpanVariant2!, typeInfo); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.JsonConverters.ListAgentConnectorsType.g.cs b/src/libs/Vectara/Generated/Vectara.JsonConverters.ListAgentConnectorsType.g.cs new file mode 100644 index 00000000..588dea59 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.JsonConverters.ListAgentConnectorsType.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Vectara.JsonConverters +{ + /// + public sealed class ListAgentConnectorsTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Vectara.ListAgentConnectorsType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Vectara.ListAgentConnectorsTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Vectara.ListAgentConnectorsType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Vectara.ListAgentConnectorsType); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Vectara.ListAgentConnectorsType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Vectara.ListAgentConnectorsTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.JsonConverters.ListAgentConnectorsTypeNullable.g.cs b/src/libs/Vectara/Generated/Vectara.JsonConverters.ListAgentConnectorsTypeNullable.g.cs new file mode 100644 index 00000000..768d44e1 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.JsonConverters.ListAgentConnectorsTypeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Vectara.JsonConverters +{ + /// + public sealed class ListAgentConnectorsTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Vectara.ListAgentConnectorsType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Vectara.ListAgentConnectorsTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Vectara.ListAgentConnectorsType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Vectara.ListAgentConnectorsType?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Vectara.ListAgentConnectorsType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Vectara.ListAgentConnectorsTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.JsonConverters.ListTraceSpansOperation.g.cs b/src/libs/Vectara/Generated/Vectara.JsonConverters.ListTraceSpansOperation.g.cs new file mode 100644 index 00000000..dd66ef2d --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.JsonConverters.ListTraceSpansOperation.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Vectara.JsonConverters +{ + /// + public sealed class ListTraceSpansOperationJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Vectara.ListTraceSpansOperation Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Vectara.ListTraceSpansOperationExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Vectara.ListTraceSpansOperation)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Vectara.ListTraceSpansOperation); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Vectara.ListTraceSpansOperation value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Vectara.ListTraceSpansOperationExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.JsonConverters.ListTraceSpansOperationNullable.g.cs b/src/libs/Vectara/Generated/Vectara.JsonConverters.ListTraceSpansOperationNullable.g.cs new file mode 100644 index 00000000..71e769ed --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.JsonConverters.ListTraceSpansOperationNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Vectara.JsonConverters +{ + /// + public sealed class ListTraceSpansOperationNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Vectara.ListTraceSpansOperation? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Vectara.ListTraceSpansOperationExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Vectara.ListTraceSpansOperation)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Vectara.ListTraceSpansOperation?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Vectara.ListTraceSpansOperation? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Vectara.ListTraceSpansOperationExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.JsonConverters.ListTracesErrorType.g.cs b/src/libs/Vectara/Generated/Vectara.JsonConverters.ListTracesErrorType.g.cs new file mode 100644 index 00000000..06393ea4 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.JsonConverters.ListTracesErrorType.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Vectara.JsonConverters +{ + /// + public sealed class ListTracesErrorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Vectara.ListTracesErrorType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Vectara.ListTracesErrorTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Vectara.ListTracesErrorType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Vectara.ListTracesErrorType); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Vectara.ListTracesErrorType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Vectara.ListTracesErrorTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.JsonConverters.ListTracesErrorTypeNullable.g.cs b/src/libs/Vectara/Generated/Vectara.JsonConverters.ListTracesErrorTypeNullable.g.cs new file mode 100644 index 00000000..6069caae --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.JsonConverters.ListTracesErrorTypeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Vectara.JsonConverters +{ + /// + public sealed class ListTracesErrorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Vectara.ListTracesErrorType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Vectara.ListTracesErrorTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Vectara.ListTracesErrorType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Vectara.ListTracesErrorType?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Vectara.ListTracesErrorType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Vectara.ListTracesErrorTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.JsonConverters.ListTracesOperation.g.cs b/src/libs/Vectara/Generated/Vectara.JsonConverters.ListTracesOperation.g.cs new file mode 100644 index 00000000..e3394bfa --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.JsonConverters.ListTracesOperation.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Vectara.JsonConverters +{ + /// + public sealed class ListTracesOperationJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Vectara.ListTracesOperation Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Vectara.ListTracesOperationExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Vectara.ListTracesOperation)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Vectara.ListTracesOperation); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Vectara.ListTracesOperation value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Vectara.ListTracesOperationExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.JsonConverters.ListTracesOperationNullable.g.cs b/src/libs/Vectara/Generated/Vectara.JsonConverters.ListTracesOperationNullable.g.cs new file mode 100644 index 00000000..773062e2 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.JsonConverters.ListTracesOperationNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Vectara.JsonConverters +{ + /// + public sealed class ListTracesOperationNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Vectara.ListTracesOperation? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Vectara.ListTracesOperationExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Vectara.ListTracesOperation)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Vectara.ListTracesOperation?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Vectara.ListTracesOperation? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Vectara.ListTracesOperationExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.JsonConverters.ListTracesStatus.g.cs b/src/libs/Vectara/Generated/Vectara.JsonConverters.ListTracesStatus.g.cs new file mode 100644 index 00000000..51a47420 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.JsonConverters.ListTracesStatus.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Vectara.JsonConverters +{ + /// + public sealed class ListTracesStatusJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Vectara.ListTracesStatus Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Vectara.ListTracesStatusExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Vectara.ListTracesStatus)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Vectara.ListTracesStatus); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Vectara.ListTracesStatus value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Vectara.ListTracesStatusExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.JsonConverters.ListTracesStatusNullable.g.cs b/src/libs/Vectara/Generated/Vectara.JsonConverters.ListTracesStatusNullable.g.cs new file mode 100644 index 00000000..73aa0daf --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.JsonConverters.ListTracesStatusNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Vectara.JsonConverters +{ + /// + public sealed class ListTracesStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Vectara.ListTracesStatus? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Vectara.ListTracesStatusExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Vectara.ListTracesStatus)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Vectara.ListTracesStatus?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Vectara.ListTracesStatus? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Vectara.ListTracesStatusExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.JsonConverters.ListTracesToolErrorType.g.cs b/src/libs/Vectara/Generated/Vectara.JsonConverters.ListTracesToolErrorType.g.cs new file mode 100644 index 00000000..37480ebc --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.JsonConverters.ListTracesToolErrorType.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Vectara.JsonConverters +{ + /// + public sealed class ListTracesToolErrorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Vectara.ListTracesToolErrorType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Vectara.ListTracesToolErrorTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Vectara.ListTracesToolErrorType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Vectara.ListTracesToolErrorType); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Vectara.ListTracesToolErrorType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Vectara.ListTracesToolErrorTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.JsonConverters.ListTracesToolErrorTypeNullable.g.cs b/src/libs/Vectara/Generated/Vectara.JsonConverters.ListTracesToolErrorTypeNullable.g.cs new file mode 100644 index 00000000..e6dfa9e7 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.JsonConverters.ListTracesToolErrorTypeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Vectara.JsonConverters +{ + /// + public sealed class ListTracesToolErrorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Vectara.ListTracesToolErrorType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Vectara.ListTracesToolErrorTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Vectara.ListTracesToolErrorType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Vectara.ListTracesToolErrorType?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Vectara.ListTracesToolErrorType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Vectara.ListTracesToolErrorTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.JsonConverters.OutputTraceSpan.g.cs b/src/libs/Vectara/Generated/Vectara.JsonConverters.OutputTraceSpan.g.cs new file mode 100644 index 00000000..71f79783 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.JsonConverters.OutputTraceSpan.g.cs @@ -0,0 +1,145 @@ +#nullable enable +#pragma warning disable CS0618 // Type or member is obsolete + +namespace Vectara.JsonConverters +{ + /// + public class OutputTraceSpanJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Vectara.OutputTraceSpan Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + using var __jsonDocument = global::System.Text.Json.JsonDocument.ParseValue(ref reader); + var __rawJson = __jsonDocument.RootElement.GetRawText(); + var __jsonProps = new global::System.Collections.Generic.HashSet(); + if (__jsonDocument.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Object) + { + foreach (var __jsonProp in __jsonDocument.RootElement.EnumerateObject()) + { + __jsonProps.Add(__jsonProp.Name); + + } + } + + var __score0 = 0; + if (__jsonProps.Contains("duration_ms")) __score0++; + if (__jsonProps.Contains("error_message")) __score0++; + if (__jsonProps.Contains("parent_span_id")) __score0++; + if (__jsonProps.Contains("span_id")) __score0++; + if (__jsonProps.Contains("started_at")) __score0++; + if (__jsonProps.Contains("status")) __score0++; + if (__jsonProps.Contains("step_name")) __score0++; + if (__jsonProps.Contains("trace_id")) __score0++; + var __score1 = 0; + if (__jsonProps.Contains("content")) __score1++; + if (__jsonProps.Contains("event_id")) __score1++; + if (__jsonProps.Contains("operation")) __score1++; + var __bestScore = 0; + var __bestIndex = -1; + if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; } + if (__score1 > __bestScore) { __bestScore = __score1; __bestIndex = 1; } + + global::Vectara.AgentTraceSpanBase? agentBase = default; + global::Vectara.OutputTraceSpanVariant2? outputTraceSpanVariant2 = default; + if (__bestIndex >= 0) + { + if (__bestIndex == 0) + { + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.AgentTraceSpanBase), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.AgentTraceSpanBase).Name}"); + agentBase = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + else if (__bestIndex == 1) + { + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.OutputTraceSpanVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.OutputTraceSpanVariant2).Name}"); + outputTraceSpanVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + } + + if (agentBase == null && outputTraceSpanVariant2 == null) + { + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.AgentTraceSpanBase), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.AgentTraceSpanBase).Name}"); + agentBase = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.OutputTraceSpanVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.OutputTraceSpanVariant2).Name}"); + outputTraceSpanVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + var __value = new global::Vectara.OutputTraceSpan( + agentBase, + + outputTraceSpanVariant2 + ); + + return __value; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Vectara.OutputTraceSpan value, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + if (value.IsAgentBase) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.AgentTraceSpanBase), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.AgentTraceSpanBase).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.AgentBase!, typeInfo); + } + else if (value.IsOutputTraceSpanVariant2) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.OutputTraceSpanVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.OutputTraceSpanVariant2).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.OutputTraceSpanVariant2!, typeInfo); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.JsonConverters.StepTransitionTraceSpan.g.cs b/src/libs/Vectara/Generated/Vectara.JsonConverters.StepTransitionTraceSpan.g.cs new file mode 100644 index 00000000..5217a594 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.JsonConverters.StepTransitionTraceSpan.g.cs @@ -0,0 +1,154 @@ +#nullable enable +#pragma warning disable CS0618 // Type or member is obsolete + +namespace Vectara.JsonConverters +{ + /// + public class StepTransitionTraceSpanJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Vectara.StepTransitionTraceSpan Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + using var __jsonDocument = global::System.Text.Json.JsonDocument.ParseValue(ref reader); + var __rawJson = __jsonDocument.RootElement.GetRawText(); + var __jsonProps = new global::System.Collections.Generic.HashSet(); + if (__jsonDocument.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Object) + { + foreach (var __jsonProp in __jsonDocument.RootElement.EnumerateObject()) + { + __jsonProps.Add(__jsonProp.Name); + if (__jsonProp.Value.ValueKind == global::System.Text.Json.JsonValueKind.Object) + { + foreach (var __nestedJsonProp in __jsonProp.Value.EnumerateObject()) + { + __jsonProps.Add(__jsonProp.Name + "." + __nestedJsonProp.Name); + } + } + + } + } + + var __score0 = 0; + if (__jsonProps.Contains("duration_ms")) __score0++; + if (__jsonProps.Contains("error_message")) __score0++; + if (__jsonProps.Contains("parent_span_id")) __score0++; + if (__jsonProps.Contains("span_id")) __score0++; + if (__jsonProps.Contains("started_at")) __score0++; + if (__jsonProps.Contains("status")) __score0++; + if (__jsonProps.Contains("step_name")) __score0++; + if (__jsonProps.Contains("trace_id")) __score0++; + var __score1 = 0; + if (__jsonProps.Contains("attributes")) __score1++; + if (__jsonProps.Contains("attributes.from_step")) __score1++; + if (__jsonProps.Contains("attributes.to_step")) __score1++; + if (__jsonProps.Contains("event_id")) __score1++; + if (__jsonProps.Contains("operation")) __score1++; + var __bestScore = 0; + var __bestIndex = -1; + if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; } + if (__score1 > __bestScore) { __bestScore = __score1; __bestIndex = 1; } + + global::Vectara.AgentTraceSpanBase? agentBase = default; + global::Vectara.StepTransitionTraceSpanVariant2? stepTransitionTraceSpanVariant2 = default; + if (__bestIndex >= 0) + { + if (__bestIndex == 0) + { + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.AgentTraceSpanBase), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.AgentTraceSpanBase).Name}"); + agentBase = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + else if (__bestIndex == 1) + { + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.StepTransitionTraceSpanVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.StepTransitionTraceSpanVariant2).Name}"); + stepTransitionTraceSpanVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + } + + if (agentBase == null && stepTransitionTraceSpanVariant2 == null) + { + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.AgentTraceSpanBase), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.AgentTraceSpanBase).Name}"); + agentBase = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.StepTransitionTraceSpanVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.StepTransitionTraceSpanVariant2).Name}"); + stepTransitionTraceSpanVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + var __value = new global::Vectara.StepTransitionTraceSpan( + agentBase, + + stepTransitionTraceSpanVariant2 + ); + + return __value; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Vectara.StepTransitionTraceSpan value, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + if (value.IsAgentBase) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.AgentTraceSpanBase), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.AgentTraceSpanBase).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.AgentBase!, typeInfo); + } + else if (value.IsStepTransitionTraceSpanVariant2) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.StepTransitionTraceSpanVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.StepTransitionTraceSpanVariant2).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.StepTransitionTraceSpanVariant2!, typeInfo); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.JsonConverters.ThinkingTraceSpan.g.cs b/src/libs/Vectara/Generated/Vectara.JsonConverters.ThinkingTraceSpan.g.cs new file mode 100644 index 00000000..9a0a8a94 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.JsonConverters.ThinkingTraceSpan.g.cs @@ -0,0 +1,144 @@ +#nullable enable +#pragma warning disable CS0618 // Type or member is obsolete + +namespace Vectara.JsonConverters +{ + /// + public class ThinkingTraceSpanJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Vectara.ThinkingTraceSpan Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + using var __jsonDocument = global::System.Text.Json.JsonDocument.ParseValue(ref reader); + var __rawJson = __jsonDocument.RootElement.GetRawText(); + var __jsonProps = new global::System.Collections.Generic.HashSet(); + if (__jsonDocument.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Object) + { + foreach (var __jsonProp in __jsonDocument.RootElement.EnumerateObject()) + { + __jsonProps.Add(__jsonProp.Name); + + } + } + + var __score0 = 0; + if (__jsonProps.Contains("duration_ms")) __score0++; + if (__jsonProps.Contains("error_message")) __score0++; + if (__jsonProps.Contains("parent_span_id")) __score0++; + if (__jsonProps.Contains("span_id")) __score0++; + if (__jsonProps.Contains("started_at")) __score0++; + if (__jsonProps.Contains("status")) __score0++; + if (__jsonProps.Contains("step_name")) __score0++; + if (__jsonProps.Contains("trace_id")) __score0++; + var __score1 = 0; + if (__jsonProps.Contains("content")) __score1++; + if (__jsonProps.Contains("operation")) __score1++; + var __bestScore = 0; + var __bestIndex = -1; + if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; } + if (__score1 > __bestScore) { __bestScore = __score1; __bestIndex = 1; } + + global::Vectara.AgentTraceSpanBase? agentBase = default; + global::Vectara.ThinkingTraceSpanVariant2? thinkingTraceSpanVariant2 = default; + if (__bestIndex >= 0) + { + if (__bestIndex == 0) + { + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.AgentTraceSpanBase), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.AgentTraceSpanBase).Name}"); + agentBase = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + else if (__bestIndex == 1) + { + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.ThinkingTraceSpanVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.ThinkingTraceSpanVariant2).Name}"); + thinkingTraceSpanVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + } + + if (agentBase == null && thinkingTraceSpanVariant2 == null) + { + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.AgentTraceSpanBase), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.AgentTraceSpanBase).Name}"); + agentBase = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.ThinkingTraceSpanVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.ThinkingTraceSpanVariant2).Name}"); + thinkingTraceSpanVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + var __value = new global::Vectara.ThinkingTraceSpan( + agentBase, + + thinkingTraceSpanVariant2 + ); + + return __value; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Vectara.ThinkingTraceSpan value, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + if (value.IsAgentBase) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.AgentTraceSpanBase), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.AgentTraceSpanBase).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.AgentBase!, typeInfo); + } + else if (value.IsThinkingTraceSpanVariant2) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.ThinkingTraceSpanVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.ThinkingTraceSpanVariant2).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.ThinkingTraceSpanVariant2!, typeInfo); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.JsonSerializerContext.g.cs b/src/libs/Vectara/Generated/Vectara.JsonSerializerContext.g.cs index a6666ef2..6f78bd94 100644 --- a/src/libs/Vectara/Generated/Vectara.JsonSerializerContext.g.cs +++ b/src/libs/Vectara/Generated/Vectara.JsonSerializerContext.g.cs @@ -309,6 +309,22 @@ namespace Vectara typeof(global::Vectara.JsonConverters.AgentIdentityModeNullableJsonConverter), + typeof(global::Vectara.JsonConverters.ConnectorConfigurationDiscriminatorTypeJsonConverter), + + typeof(global::Vectara.JsonConverters.ConnectorConfigurationDiscriminatorTypeNullableJsonConverter), + + typeof(global::Vectara.JsonConverters.AgentConnectorTypeJsonConverter), + + typeof(global::Vectara.JsonConverters.AgentConnectorTypeNullableJsonConverter), + + typeof(global::Vectara.JsonConverters.AgentConnectorStatusJsonConverter), + + typeof(global::Vectara.JsonConverters.AgentConnectorStatusNullableJsonConverter), + + typeof(global::Vectara.JsonConverters.CreateAgentConnectorRequestTypeJsonConverter), + + typeof(global::Vectara.JsonConverters.CreateAgentConnectorRequestTypeNullableJsonConverter), + typeof(global::Vectara.JsonConverters.PipelineStatusJsonConverter), typeof(global::Vectara.JsonConverters.PipelineStatusNullableJsonConverter), @@ -353,6 +369,22 @@ namespace Vectara typeof(global::Vectara.JsonConverters.DeadLetterOriginNullableJsonConverter), + typeof(global::Vectara.JsonConverters.AgentTraceStatusJsonConverter), + + typeof(global::Vectara.JsonConverters.AgentTraceStatusNullableJsonConverter), + + typeof(global::Vectara.JsonConverters.AgentTraceSpanStatusJsonConverter), + + typeof(global::Vectara.JsonConverters.AgentTraceSpanStatusNullableJsonConverter), + + typeof(global::Vectara.JsonConverters.InvokeAgentSpanAttributesOutputTypeJsonConverter), + + typeof(global::Vectara.JsonConverters.InvokeAgentSpanAttributesOutputTypeNullableJsonConverter), + + typeof(global::Vectara.JsonConverters.AgentTraceSpanDiscriminatorOperationJsonConverter), + + typeof(global::Vectara.JsonConverters.AgentTraceSpanDiscriminatorOperationNullableJsonConverter), + typeof(global::Vectara.JsonConverters.CreateCorpusDocumentWaitForJsonConverter), typeof(global::Vectara.JsonConverters.CreateCorpusDocumentWaitForNullableJsonConverter), @@ -377,10 +409,34 @@ namespace Vectara typeof(global::Vectara.JsonConverters.ListSessionArtifactsOrderByNullableJsonConverter), + typeof(global::Vectara.JsonConverters.ListAgentConnectorsTypeJsonConverter), + + typeof(global::Vectara.JsonConverters.ListAgentConnectorsTypeNullableJsonConverter), + typeof(global::Vectara.JsonConverters.ListPipelinesSourceTypeJsonConverter), typeof(global::Vectara.JsonConverters.ListPipelinesSourceTypeNullableJsonConverter), + typeof(global::Vectara.JsonConverters.ListTracesStatusJsonConverter), + + typeof(global::Vectara.JsonConverters.ListTracesStatusNullableJsonConverter), + + typeof(global::Vectara.JsonConverters.ListTracesErrorTypeJsonConverter), + + typeof(global::Vectara.JsonConverters.ListTracesErrorTypeNullableJsonConverter), + + typeof(global::Vectara.JsonConverters.ListTracesOperationJsonConverter), + + typeof(global::Vectara.JsonConverters.ListTracesOperationNullableJsonConverter), + + typeof(global::Vectara.JsonConverters.ListTracesToolErrorTypeJsonConverter), + + typeof(global::Vectara.JsonConverters.ListTracesToolErrorTypeNullableJsonConverter), + + typeof(global::Vectara.JsonConverters.ListTraceSpansOperationJsonConverter), + + typeof(global::Vectara.JsonConverters.ListTraceSpansOperationNullableJsonConverter), + typeof(global::Vectara.JsonConverters.ChunkingStrategyJsonConverter), typeof(global::Vectara.JsonConverters.CreateDocumentRequestJsonConverter), @@ -525,6 +581,8 @@ namespace Vectara typeof(global::Vectara.JsonConverters.ScheduleConfigurationJsonConverter), + typeof(global::Vectara.JsonConverters.ConnectorConfigurationJsonConverter), + typeof(global::Vectara.JsonConverters.S3SourceConfigurationJsonConverter), typeof(global::Vectara.JsonConverters.PipelineSourceJsonConverter), @@ -537,6 +595,26 @@ namespace Vectara typeof(global::Vectara.JsonConverters.UpdatePipelineSourceJsonConverter), + typeof(global::Vectara.JsonConverters.InvokeAgentTraceSpanJsonConverter), + + typeof(global::Vectara.JsonConverters.ChatTraceSpanJsonConverter), + + typeof(global::Vectara.JsonConverters.ExecuteToolTraceSpanJsonConverter), + + typeof(global::Vectara.JsonConverters.ThinkingTraceSpanJsonConverter), + + typeof(global::Vectara.JsonConverters.OutputTraceSpanJsonConverter), + + typeof(global::Vectara.JsonConverters.GuardrailTraceSpanJsonConverter), + + typeof(global::Vectara.JsonConverters.StepTransitionTraceSpanJsonConverter), + + typeof(global::Vectara.JsonConverters.ImageReadTraceSpanJsonConverter), + + typeof(global::Vectara.JsonConverters.CompactionTraceSpanJsonConverter), + + typeof(global::Vectara.JsonConverters.AgentTraceSpanJsonConverter), + typeof(global::Vectara.JsonConverters.AllOfJsonConverter), typeof(global::Vectara.JsonConverters.OneOfJsonConverter), @@ -980,6 +1058,7 @@ namespace Vectara [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.SubAgentSessionMode), TypeInfoPropertyName = "SubAgentSessionMode2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.SubAgentConfiguration))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.InlineSubAgentToolConfiguration))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.InlineArtifactCreateToolConfiguration))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.ArtifactReadToolParameters))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.ArtifactReadToolParametersEncoding), TypeInfoPropertyName = "ArtifactReadToolParametersEncoding2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.ArtifactReadConfiguration))] @@ -1135,6 +1214,18 @@ namespace Vectara [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.AgentIdentityMode), TypeInfoPropertyName = "AgentIdentityMode2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.AgentIdentity))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.UpdateAgentIdentityRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.SlackConnectorConfiguration))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.ConnectorConfiguration), TypeInfoPropertyName = "ConnectorConfiguration2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.ConnectorConfigurationDiscriminator))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.ConnectorConfigurationDiscriminatorType), TypeInfoPropertyName = "ConnectorConfigurationDiscriminatorType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.AgentConnector))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.AgentConnectorType), TypeInfoPropertyName = "AgentConnectorType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.AgentConnectorStatus), TypeInfoPropertyName = "AgentConnectorStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.ListAgentConnectorsResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.CreateAgentConnectorRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.CreateAgentConnectorRequestType), TypeInfoPropertyName = "CreateAgentConnectorRequestType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.UpdateAgentConnectorRequest))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.PipelineStatus), TypeInfoPropertyName = "PipelineStatus2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.BaseS3SourceConfiguration))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.S3SourceConfiguration), TypeInfoPropertyName = "S3SourceConfiguration2")] @@ -1179,6 +1270,50 @@ namespace Vectara [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.ProcessPipelineDeadLetterEntriesRequest))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.ListPipelineRunsResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.AgentTrace))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.AgentTraceStatus), TypeInfoPropertyName = "AgentTraceStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.ListAgentTracesResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.AgentTraceSpanStatus), TypeInfoPropertyName = "AgentTraceSpanStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.AgentTraceSpanBase))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.AgentTraceInputFile))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.InvokeAgentSpanAttributes))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.InvokeAgentSpanAttributesOutputType), TypeInfoPropertyName = "InvokeAgentSpanAttributesOutputType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.InvokeAgentSpanContent))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.InvokeAgentTraceSpan), TypeInfoPropertyName = "InvokeAgentTraceSpan2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.InvokeAgentTraceSpanVariant2))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.ChatSpanAttributes))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.ChatTraceSpan), TypeInfoPropertyName = "ChatTraceSpan2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.ChatTraceSpanVariant2))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.ExecuteToolSpanAttributes))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.ExecuteToolSpanContent))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.ExecuteToolTraceSpan), TypeInfoPropertyName = "ExecuteToolTraceSpan2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.ExecuteToolTraceSpanVariant2))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.ThinkingSpanContent))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.ThinkingTraceSpan), TypeInfoPropertyName = "ThinkingTraceSpan2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.ThinkingTraceSpanVariant2))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.OutputSpanContent))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.OutputTraceSpan), TypeInfoPropertyName = "OutputTraceSpan2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.OutputTraceSpanVariant2))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.GuardrailSpanAttributes))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.GuardrailSpanContent))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.GuardrailTraceSpan), TypeInfoPropertyName = "GuardrailTraceSpan2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.GuardrailTraceSpanVariant2))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.StepTransitionSpanAttributes))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.StepTransitionTraceSpan), TypeInfoPropertyName = "StepTransitionTraceSpan2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.StepTransitionTraceSpanVariant2))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.ImageReadSpanAttributes))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.ImageReadTraceSpan), TypeInfoPropertyName = "ImageReadTraceSpan2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.ImageReadTraceSpanVariant2))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.CompactionSpanAttributes))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.CompactionTraceSpan), TypeInfoPropertyName = "CompactionTraceSpan2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.CompactionTraceSpanVariant2))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.AgentTraceSpan), TypeInfoPropertyName = "AgentTraceSpan2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.AgentTraceSpanDiscriminator))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.AgentTraceSpanDiscriminatorOperation), TypeInfoPropertyName = "AgentTraceSpanDiscriminatorOperation2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.ListAgentTraceSpansResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.Glossary))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.ListGlossariesResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] @@ -1197,7 +1332,13 @@ namespace Vectara [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.ListInstructionsType), TypeInfoPropertyName = "ListInstructionsType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.ListSessionArtifactsSortBy), TypeInfoPropertyName = "ListSessionArtifactsSortBy2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.ListSessionArtifactsOrderBy), TypeInfoPropertyName = "ListSessionArtifactsOrderBy2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.ListAgentConnectorsType), TypeInfoPropertyName = "ListAgentConnectorsType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.ListPipelinesSourceType), TypeInfoPropertyName = "ListPipelinesSourceType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.ListTracesStatus), TypeInfoPropertyName = "ListTracesStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.ListTracesErrorType), TypeInfoPropertyName = "ListTracesErrorType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.ListTracesOperation), TypeInfoPropertyName = "ListTracesOperation2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.ListTracesToolErrorType), TypeInfoPropertyName = "ListTracesToolErrorType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.ListTraceSpansOperation), TypeInfoPropertyName = "ListTraceSpansOperation2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.AllOf), TypeInfoPropertyName = "AllOfUserCreateUserResponse22")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.CreateUserResponse2))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Vectara.ResetUserPasswordResponse))] @@ -1266,9 +1407,13 @@ namespace Vectara [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] diff --git a/src/libs/Vectara/Generated/Vectara.JsonSerializerContextTypes.g.cs b/src/libs/Vectara/Generated/Vectara.JsonSerializerContextTypes.g.cs index 7565b2ff..23364c75 100644 --- a/src/libs/Vectara/Generated/Vectara.JsonSerializerContextTypes.g.cs +++ b/src/libs/Vectara/Generated/Vectara.JsonSerializerContextTypes.g.cs @@ -1684,891 +1684,1143 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::Vectara.ArtifactReadToolParameters? Type414 { get; set; } + public global::Vectara.InlineArtifactCreateToolConfiguration? Type414 { get; set; } /// /// /// - public global::Vectara.ArtifactReadToolParametersEncoding? Type415 { get; set; } + public global::Vectara.ArtifactReadToolParameters? Type415 { get; set; } /// /// /// - public global::Vectara.ArtifactReadConfiguration? Type416 { get; set; } + public global::Vectara.ArtifactReadToolParametersEncoding? Type416 { get; set; } /// /// /// - public global::Vectara.InlineArtifactReadToolConfiguration? Type417 { get; set; } + public global::Vectara.ArtifactReadConfiguration? Type417 { get; set; } /// /// /// - public global::Vectara.ArtifactGrepToolParameters? Type418 { get; set; } + public global::Vectara.InlineArtifactReadToolConfiguration? Type418 { get; set; } /// /// /// - public global::Vectara.InlineArtifactGrepToolConfiguration? Type419 { get; set; } + public global::Vectara.ArtifactGrepToolParameters? Type419 { get; set; } /// /// /// - public global::Vectara.ImageReadToolParameters? Type420 { get; set; } + public global::Vectara.InlineArtifactGrepToolConfiguration? Type420 { get; set; } /// /// /// - public global::Vectara.ImageReadToolParametersDetail? Type421 { get; set; } + public global::Vectara.ImageReadToolParameters? Type421 { get; set; } /// /// /// - public global::Vectara.InlineImageReadToolConfiguration? Type422 { get; set; } + public global::Vectara.ImageReadToolParametersDetail? Type422 { get; set; } /// /// /// - public global::Vectara.DocumentConversionToolParameters? Type423 { get; set; } + public global::Vectara.InlineImageReadToolConfiguration? Type423 { get; set; } /// /// /// - public global::Vectara.DocumentConversionToolParametersOutputFormat? Type424 { get; set; } + public global::Vectara.DocumentConversionToolParameters? Type424 { get; set; } /// /// /// - public global::Vectara.InlineDocumentConversionToolConfiguration? Type425 { get; set; } + public global::Vectara.DocumentConversionToolParametersOutputFormat? Type425 { get; set; } /// /// /// - public global::Vectara.GetDocumentTextParameters? Type426 { get; set; } + public global::Vectara.InlineDocumentConversionToolConfiguration? Type426 { get; set; } /// /// /// - public global::Vectara.GetDocumentTextConfiguration? Type427 { get; set; } + public global::Vectara.GetDocumentTextParameters? Type427 { get; set; } /// /// /// - public global::Vectara.GetDocumentTextConfigurationMetadata? Type428 { get; set; } + public global::Vectara.GetDocumentTextConfiguration? Type428 { get; set; } /// /// /// - public global::Vectara.InlineGetDocumentTextToolConfiguration? Type429 { get; set; } + public global::Vectara.GetDocumentTextConfigurationMetadata? Type429 { get; set; } /// /// /// - public global::Vectara.AgentToolConfiguration? Type430 { get; set; } + public global::Vectara.InlineGetDocumentTextToolConfiguration? Type430 { get; set; } /// /// /// - public global::Vectara.AgentToolConfigurationDiscriminator? Type431 { get; set; } + public global::Vectara.AgentToolConfiguration? Type431 { get; set; } /// /// /// - public global::Vectara.AgentToolConfigurationDiscriminatorType? Type432 { get; set; } + public global::Vectara.AgentToolConfigurationDiscriminator? Type432 { get; set; } /// /// /// - public global::Vectara.AgentSkill? Type433 { get; set; } + public global::Vectara.AgentToolConfigurationDiscriminatorType? Type433 { get; set; } /// /// /// - public global::Vectara.RetryConfiguration? Type434 { get; set; } + public global::Vectara.AgentSkill? Type434 { get; set; } /// /// /// - public global::Vectara.AgentModel? Type435 { get; set; } + public global::Vectara.RetryConfiguration? Type435 { get; set; } /// /// /// - public global::Vectara.InstructionReference? Type436 { get; set; } + public global::Vectara.AgentModel? Type436 { get; set; } /// /// /// - public global::Vectara.ReferenceInstruction? Type437 { get; set; } + public global::Vectara.InstructionReference? Type437 { get; set; } /// /// /// - public global::Vectara.ReferenceInstructionVariant2? Type438 { get; set; } + public global::Vectara.ReferenceInstruction? Type438 { get; set; } /// /// /// - public global::Vectara.InlineInstruction? Type439 { get; set; } + public global::Vectara.ReferenceInstructionVariant2? Type439 { get; set; } /// /// /// - public global::Vectara.InlineInstructionVariant2? Type440 { get; set; } + public global::Vectara.InlineInstruction? Type440 { get; set; } /// /// /// - public global::Vectara.AgentStepInstruction? Type441 { get; set; } + public global::Vectara.InlineInstructionVariant2? Type441 { get; set; } /// /// /// - public global::Vectara.AgentStepInstructionDiscriminator? Type442 { get; set; } + public global::Vectara.AgentStepInstruction? Type442 { get; set; } /// /// /// - public global::Vectara.AgentStepInstructionDiscriminatorType? Type443 { get; set; } + public global::Vectara.AgentStepInstructionDiscriminator? Type443 { get; set; } /// /// /// - public global::Vectara.DefaultOutputParser? Type444 { get; set; } + public global::Vectara.AgentStepInstructionDiscriminatorType? Type444 { get; set; } /// /// /// - public global::Vectara.StructuredOutputParser? Type445 { get; set; } + public global::Vectara.DefaultOutputParser? Type445 { get; set; } /// /// /// - public global::Vectara.AgentOutputParser? Type446 { get; set; } + public global::Vectara.StructuredOutputParser? Type446 { get; set; } /// /// /// - public global::Vectara.AgentOutputParserDiscriminator? Type447 { get; set; } + public global::Vectara.AgentOutputParser? Type447 { get; set; } /// /// /// - public global::Vectara.AgentOutputParserDiscriminatorType? Type448 { get; set; } + public global::Vectara.AgentOutputParserDiscriminator? Type448 { get; set; } /// /// /// - public global::Vectara.TemplatedReminder? Type449 { get; set; } + public global::Vectara.AgentOutputParserDiscriminatorType? Type449 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type450 { get; set; } + public global::Vectara.TemplatedReminder? Type450 { get; set; } /// /// /// - public global::Vectara.TemplatedReminderHook? Type451 { get; set; } + public global::System.Collections.Generic.IList? Type451 { get; set; } /// /// /// - public global::Vectara.GlossaryExpansionReminder? Type452 { get; set; } + public global::Vectara.TemplatedReminderHook? Type452 { get; set; } /// /// /// - public global::Vectara.AgentStepReminder? Type453 { get; set; } + public global::Vectara.GlossaryExpansionReminder? Type453 { get; set; } /// /// /// - public global::Vectara.AgentStepReminderDiscriminator? Type454 { get; set; } + public global::Vectara.AgentStepReminder? Type454 { get; set; } /// /// /// - public global::Vectara.AgentStepReminderDiscriminatorType? Type455 { get; set; } + public global::Vectara.AgentStepReminderDiscriminator? Type455 { get; set; } /// /// /// - public global::Vectara.NextStep? Type456 { get; set; } + public global::Vectara.AgentStepReminderDiscriminatorType? Type456 { get; set; } /// /// /// - public global::Vectara.FirstAgentStep? Type457 { get; set; } + public global::Vectara.NextStep? Type457 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type458 { get; set; } + public global::Vectara.FirstAgentStep? Type458 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type459 { get; set; } + public global::System.Collections.Generic.IList? Type459 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type460 { get; set; } + public global::System.Collections.Generic.IList? Type460 { get; set; } /// /// /// - public global::Vectara.AgentStep? Type461 { get; set; } + public global::System.Collections.Generic.IList? Type461 { get; set; } /// /// /// - public global::Vectara.CompactionConfig? Type462 { get; set; } + public global::Vectara.AgentStep? Type462 { get; set; } /// /// /// - public global::Vectara.CompactionConfigToolEventPolicy? Type463 { get; set; } + public global::Vectara.CompactionConfig? Type463 { get; set; } /// /// /// - public global::Vectara.ToolOutputOffloadingConfiguration? Type464 { get; set; } + public global::Vectara.CompactionConfigToolEventPolicy? Type464 { get; set; } /// /// /// - public global::Vectara.Agent? Type465 { get; set; } + public global::Vectara.ToolOutputOffloadingConfiguration? Type465 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary? Type466 { get; set; } + public global::Vectara.Agent? Type466 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary? Type467 { get; set; } + public global::System.Collections.Generic.Dictionary? Type467 { get; set; } /// /// /// - public global::Vectara.ListAgentsResponse? Type468 { get; set; } + public global::System.Collections.Generic.Dictionary? Type468 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type469 { get; set; } + public global::Vectara.ListAgentsResponse? Type469 { get; set; } /// /// /// - public global::Vectara.CreateAgentRequest? Type470 { get; set; } + public global::System.Collections.Generic.IList? Type470 { get; set; } /// /// /// - public global::Vectara.UpdateFirstAgentStep? Type471 { get; set; } + public global::Vectara.CreateAgentRequest? Type471 { get; set; } /// /// /// - public global::Vectara.UpdateAgentStep? Type472 { get; set; } + public global::Vectara.UpdateFirstAgentStep? Type472 { get; set; } /// /// /// - public global::Vectara.UpdateAgentRequest? Type473 { get; set; } + public global::Vectara.UpdateAgentStep? Type473 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary? Type474 { get; set; } + public global::Vectara.UpdateAgentRequest? Type474 { get; set; } /// /// /// - public global::Vectara.InputTokens? Type475 { get; set; } + public global::System.Collections.Generic.Dictionary? Type475 { get; set; } /// /// /// - public global::Vectara.OutputTokens? Type476 { get; set; } + public global::Vectara.InputTokens? Type476 { get; set; } /// /// /// - public global::Vectara.SessionContextUsage? Type477 { get; set; } + public global::Vectara.OutputTokens? Type477 { get; set; } /// /// /// - public global::Vectara.AgentSession? Type478 { get; set; } + public global::Vectara.SessionContextUsage? Type478 { get; set; } /// /// /// - public global::Vectara.ListAgentSessionsResponse? Type479 { get; set; } + public global::Vectara.AgentSession? Type479 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type480 { get; set; } + public global::Vectara.ListAgentSessionsResponse? Type480 { get; set; } /// /// /// - public global::Vectara.CreateAgentSessionRequest? Type481 { get; set; } + public global::System.Collections.Generic.IList? Type481 { get; set; } /// /// /// - public global::Vectara.CreateAgentSessionRequestFromSession? Type482 { get; set; } + public global::Vectara.CreateAgentSessionRequest? Type482 { get; set; } /// /// /// - public global::Vectara.UpdateAgentSessionRequest? Type483 { get; set; } + public global::Vectara.CreateAgentSessionRequestFromSession? Type483 { get; set; } /// /// /// - public global::Vectara.AgentEventBase? Type484 { get; set; } + public global::Vectara.UpdateAgentSessionRequest? Type484 { get; set; } /// /// /// - public global::Vectara.AgentTextInput? Type485 { get; set; } + public global::Vectara.AgentEventBase? Type485 { get; set; } /// /// /// - public global::Vectara.AgentSkillInput? Type486 { get; set; } + public global::Vectara.AgentTextInput? Type486 { get; set; } /// /// /// - public global::Vectara.AgentInput? Type487 { get; set; } + public global::Vectara.AgentSkillInput? Type487 { get; set; } /// /// /// - public global::Vectara.AgentInputDiscriminator? Type488 { get; set; } + public global::Vectara.AgentInput? Type488 { get; set; } /// /// /// - public global::Vectara.AgentInputDiscriminatorType? Type489 { get; set; } + public global::Vectara.AgentInputDiscriminator? Type489 { get; set; } /// /// /// - public global::Vectara.InputMessageEvent? Type490 { get; set; } + public global::Vectara.AgentInputDiscriminatorType? Type490 { get; set; } /// /// /// - public global::Vectara.InputMessageEventVariant2? Type491 { get; set; } + public global::Vectara.InputMessageEvent? Type491 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type492 { get; set; } + public global::Vectara.InputMessageEventVariant2? Type492 { get; set; } /// /// /// - public global::Vectara.SkillLoadEvent? Type493 { get; set; } + public global::System.Collections.Generic.IList? Type493 { get; set; } /// /// /// - public global::Vectara.SkillLoadEventVariant2? Type494 { get; set; } + public global::Vectara.SkillLoadEvent? Type494 { get; set; } /// /// /// - public global::Vectara.ArtifactReference? Type495 { get; set; } + public global::Vectara.SkillLoadEventVariant2? Type495 { get; set; } /// /// /// - public global::Vectara.ArtifactUploadEvent? Type496 { get; set; } + public global::Vectara.ArtifactReference? Type496 { get; set; } /// /// /// - public global::Vectara.ArtifactUploadEventVariant2? Type497 { get; set; } + public global::Vectara.ArtifactUploadEvent? Type497 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type498 { get; set; } + public global::Vectara.ArtifactUploadEventVariant2? Type498 { get; set; } /// /// /// - public global::Vectara.ToolInputEvent? Type499 { get; set; } + public global::System.Collections.Generic.IList? Type499 { get; set; } /// /// /// - public global::Vectara.ToolInputEventVariant2? Type500 { get; set; } + public global::Vectara.ToolInputEvent? Type500 { get; set; } /// /// /// - public global::Vectara.ToolOutputEvent? Type501 { get; set; } + public global::Vectara.ToolInputEventVariant2? Type501 { get; set; } /// /// /// - public global::Vectara.ToolOutputEventVariant2? Type502 { get; set; } + public global::Vectara.ToolOutputEvent? Type502 { get; set; } /// /// /// - public global::Vectara.ThinkingEvent? Type503 { get; set; } + public global::Vectara.ToolOutputEventVariant2? Type503 { get; set; } /// /// /// - public global::Vectara.ThinkingEventVariant2? Type504 { get; set; } + public global::Vectara.ThinkingEvent? Type504 { get; set; } /// /// /// - public global::Vectara.AgentOutputEvent? Type505 { get; set; } + public global::Vectara.ThinkingEventVariant2? Type505 { get; set; } /// /// /// - public global::Vectara.AgentOutputEventVariant2? Type506 { get; set; } + public global::Vectara.AgentOutputEvent? Type506 { get; set; } /// /// /// - public global::Vectara.StructuredOutputEvent? Type507 { get; set; } + public global::Vectara.AgentOutputEventVariant2? Type507 { get; set; } /// /// /// - public global::Vectara.StructuredOutputEventVariant2? Type508 { get; set; } + public global::Vectara.StructuredOutputEvent? Type508 { get; set; } /// /// /// - public global::Vectara.ContextLimitExceededEvent? Type509 { get; set; } + public global::Vectara.StructuredOutputEventVariant2? Type509 { get; set; } /// /// /// - public global::Vectara.ContextLimitExceededEventVariant2? Type510 { get; set; } + public global::Vectara.ContextLimitExceededEvent? Type510 { get; set; } /// /// /// - public global::Vectara.StepTransitionLimitExceededEvent? Type511 { get; set; } + public global::Vectara.ContextLimitExceededEventVariant2? Type511 { get; set; } /// /// /// - public global::Vectara.StepTransitionLimitExceededEventVariant2? Type512 { get; set; } + public global::Vectara.StepTransitionLimitExceededEvent? Type512 { get; set; } /// /// /// - public global::Vectara.SessionInterruptedEvent? Type513 { get; set; } + public global::Vectara.StepTransitionLimitExceededEventVariant2? Type513 { get; set; } /// /// /// - public global::Vectara.SessionInterruptedEventVariant2? Type514 { get; set; } + public global::Vectara.SessionInterruptedEvent? Type514 { get; set; } /// /// /// - public global::Vectara.ImageReadEvent? Type515 { get; set; } + public global::Vectara.SessionInterruptedEventVariant2? Type515 { get; set; } /// /// /// - public global::Vectara.ImageReadEventVariant2? Type516 { get; set; } + public global::Vectara.ImageReadEvent? Type516 { get; set; } /// /// /// - public global::Vectara.ImageReadEventVariant2Detail? Type517 { get; set; } + public global::Vectara.ImageReadEventVariant2? Type517 { get; set; } /// /// /// - public global::Vectara.StepTransitionEvent? Type518 { get; set; } + public global::Vectara.ImageReadEventVariant2Detail? Type518 { get; set; } /// /// /// - public global::Vectara.StepTransitionEventVariant2? Type519 { get; set; } + public global::Vectara.StepTransitionEvent? Type519 { get; set; } /// /// /// - public global::Vectara.CompactionEvent? Type520 { get; set; } + public global::Vectara.StepTransitionEventVariant2? Type520 { get; set; } /// /// /// - public global::Vectara.CompactionEventVariant2? Type521 { get; set; } + public global::Vectara.CompactionEvent? Type521 { get; set; } /// /// /// - public global::Vectara.AgentEvent? Type522 { get; set; } + public global::Vectara.CompactionEventVariant2? Type522 { get; set; } /// /// /// - public global::Vectara.AgentEventDiscriminator? Type523 { get; set; } + public global::Vectara.AgentEvent? Type523 { get; set; } /// /// /// - public global::Vectara.AgentEventDiscriminatorType? Type524 { get; set; } + public global::Vectara.AgentEventDiscriminator? Type524 { get; set; } /// /// /// - public global::Vectara.ListAgentEventsResponse? Type525 { get; set; } + public global::Vectara.AgentEventDiscriminatorType? Type525 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type526 { get; set; } + public global::Vectara.ListAgentEventsResponse? Type526 { get; set; } /// /// /// - public global::Vectara.CreateInputRequestBase? Type527 { get; set; } + public global::System.Collections.Generic.IList? Type527 { get; set; } /// /// /// - public global::Vectara.InputBehavior? Type528 { get; set; } + public global::Vectara.CreateInputRequestBase? Type528 { get; set; } /// /// /// - public global::Vectara.CreateInputMessageRequest? Type529 { get; set; } + public global::Vectara.InputBehavior? Type529 { get; set; } /// /// /// - public global::Vectara.CreateInputMessageRequestVariant2? Type530 { get; set; } + public global::Vectara.CreateInputMessageRequest? Type530 { get; set; } /// /// /// - public global::Vectara.CreateInterruptRequest? Type531 { get; set; } + public global::Vectara.CreateInputMessageRequestVariant2? Type531 { get; set; } /// /// /// - public global::Vectara.CreateInterruptRequestVariant2? Type532 { get; set; } + public global::Vectara.CreateInterruptRequest? Type532 { get; set; } /// /// /// - public global::Vectara.CreateCompactRequest? Type533 { get; set; } + public global::Vectara.CreateInterruptRequestVariant2? Type533 { get; set; } /// /// /// - public global::Vectara.CreateCompactRequestVariant2? Type534 { get; set; } + public global::Vectara.CreateCompactRequest? Type534 { get; set; } /// /// /// - public global::Vectara.CreateInputRequest? Type535 { get; set; } + public global::Vectara.CreateCompactRequestVariant2? Type535 { get; set; } /// /// /// - public global::Vectara.CreateInputRequestDiscriminator? Type536 { get; set; } + public global::Vectara.CreateInputRequest? Type536 { get; set; } /// /// /// - public global::Vectara.CreateInputRequestDiscriminatorType? Type537 { get; set; } + public global::Vectara.CreateInputRequestDiscriminator? Type537 { get; set; } /// /// /// - public global::Vectara.AgentResponse? Type538 { get; set; } + public global::Vectara.CreateInputRequestDiscriminatorType? Type538 { get; set; } /// /// /// - public global::Vectara.StreamingAgentOutput? Type539 { get; set; } + public global::Vectara.AgentResponse? Type539 { get; set; } /// /// /// - public global::Vectara.StreamingAgentOutputEnd? Type540 { get; set; } + public global::Vectara.StreamingAgentOutput? Type540 { get; set; } /// /// /// - public global::Vectara.StreamingThinking? Type541 { get; set; } + public global::Vectara.StreamingAgentOutputEnd? Type541 { get; set; } /// /// /// - public global::Vectara.StreamingThinkingEnd? Type542 { get; set; } + public global::Vectara.StreamingThinking? Type542 { get; set; } /// /// /// - public global::Vectara.ContextConsumedEvent? Type543 { get; set; } + public global::Vectara.StreamingThinkingEnd? Type543 { get; set; } /// /// /// - public global::Vectara.CompactionStartedEvent? Type544 { get; set; } + public global::Vectara.ContextConsumedEvent? Type544 { get; set; } /// /// /// - public global::Vectara.CompactionStartedEventVariant2? Type545 { get; set; } + public global::Vectara.CompactionStartedEvent? Type545 { get; set; } /// /// /// - public global::Vectara.AgentStreamedResponse? Type546 { get; set; } + public global::Vectara.CompactionStartedEventVariant2? Type546 { get; set; } /// /// /// - public global::Vectara.AgentStreamedResponseDiscriminator? Type547 { get; set; } + public global::Vectara.AgentStreamedResponse? Type547 { get; set; } /// /// /// - public global::Vectara.AgentStreamedResponseDiscriminatorType? Type548 { get; set; } + public global::Vectara.AgentStreamedResponseDiscriminator? Type548 { get; set; } /// /// /// - public global::Vectara.SessionArtifact? Type549 { get; set; } + public global::Vectara.AgentStreamedResponseDiscriminatorType? Type549 { get; set; } /// /// /// - public global::Vectara.ListSessionArtifactsResponse? Type550 { get; set; } + public global::Vectara.SessionArtifact? Type550 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type551 { get; set; } + public global::Vectara.ListSessionArtifactsResponse? Type551 { get; set; } /// /// /// - public global::Vectara.IntervalScheduleConfiguration? Type552 { get; set; } + public global::System.Collections.Generic.IList? Type552 { get; set; } /// /// /// - public global::Vectara.IntervalScheduleConfigurationType? Type553 { get; set; } + public global::Vectara.IntervalScheduleConfiguration? Type553 { get; set; } /// /// /// - public global::Vectara.CronScheduleConfiguration? Type554 { get; set; } + public global::Vectara.IntervalScheduleConfigurationType? Type554 { get; set; } /// /// /// - public global::Vectara.CronScheduleConfigurationType? Type555 { get; set; } + public global::Vectara.CronScheduleConfiguration? Type555 { get; set; } /// /// /// - public global::Vectara.ScheduleConfiguration? Type556 { get; set; } + public global::Vectara.CronScheduleConfigurationType? Type556 { get; set; } /// /// /// - public global::Vectara.AgentSchedule? Type557 { get; set; } + public global::Vectara.ScheduleConfiguration? Type557 { get; set; } /// /// /// - public global::Vectara.ListAgentSchedulesResponse? Type558 { get; set; } + public global::Vectara.AgentSchedule? Type558 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type559 { get; set; } + public global::Vectara.ListAgentSchedulesResponse? Type559 { get; set; } /// /// /// - public global::Vectara.CreateAgentScheduleRequest? Type560 { get; set; } + public global::System.Collections.Generic.IList? Type560 { get; set; } /// /// /// - public global::Vectara.UpdateAgentScheduleRequest? Type561 { get; set; } + public global::Vectara.CreateAgentScheduleRequest? Type561 { get; set; } /// /// /// - public global::Vectara.AgentScheduleExecution? Type562 { get; set; } + public global::Vectara.UpdateAgentScheduleRequest? Type562 { get; set; } /// /// /// - public global::Vectara.AgentScheduleExecutionStatus? Type563 { get; set; } + public global::Vectara.AgentScheduleExecution? Type563 { get; set; } /// /// /// - public global::Vectara.ListAgentScheduleExecutionsResponse? Type564 { get; set; } + public global::Vectara.AgentScheduleExecutionStatus? Type564 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type565 { get; set; } + public global::Vectara.ListAgentScheduleExecutionsResponse? Type565 { get; set; } /// /// /// - public global::Vectara.AgentIdentityMode? Type566 { get; set; } + public global::System.Collections.Generic.IList? Type566 { get; set; } /// /// /// - public global::Vectara.AgentIdentity? Type567 { get; set; } + public global::Vectara.AgentIdentityMode? Type567 { get; set; } /// /// /// - public global::Vectara.UpdateAgentIdentityRequest? Type568 { get; set; } + public global::Vectara.AgentIdentity? Type568 { get; set; } /// /// /// - public global::Vectara.PipelineStatus? Type569 { get; set; } + public global::Vectara.UpdateAgentIdentityRequest? Type569 { get; set; } /// /// /// - public global::Vectara.BaseS3SourceConfiguration? Type570 { get; set; } + public global::Vectara.SlackConnectorConfiguration? Type570 { get; set; } /// /// /// - public global::Vectara.S3SourceConfiguration? Type571 { get; set; } + public global::Vectara.ConnectorConfiguration? Type571 { get; set; } /// /// /// - public global::Vectara.PipelineSource? Type572 { get; set; } + public global::Vectara.ConnectorConfigurationDiscriminator? Type572 { get; set; } /// /// /// - public global::Vectara.PipelineSourceDiscriminator? Type573 { get; set; } + public global::Vectara.ConnectorConfigurationDiscriminatorType? Type573 { get; set; } /// /// /// - public global::Vectara.PipelineSourceDiscriminatorType? Type574 { get; set; } + public global::Vectara.AgentConnector? Type574 { get; set; } /// /// /// - public global::Vectara.CronTriggerConfiguration? Type575 { get; set; } + public global::Vectara.AgentConnectorType? Type575 { get; set; } /// /// /// - public global::Vectara.IntervalTriggerConfiguration? Type576 { get; set; } + public global::Vectara.AgentConnectorStatus? Type576 { get; set; } /// /// /// - public global::Vectara.ManualTriggerConfiguration? Type577 { get; set; } + public global::Vectara.ListAgentConnectorsResponse? Type577 { get; set; } /// /// /// - public global::Vectara.PipelineTrigger? Type578 { get; set; } + public global::System.Collections.Generic.IList? Type578 { get; set; } /// /// /// - public global::Vectara.PipelineTriggerDiscriminator? Type579 { get; set; } + public global::Vectara.CreateAgentConnectorRequest? Type579 { get; set; } /// /// /// - public global::Vectara.PipelineTriggerDiscriminatorType? Type580 { get; set; } + public global::Vectara.CreateAgentConnectorRequestType? Type580 { get; set; } /// /// /// - public global::Vectara.ConditionVerification? Type581 { get; set; } + public global::Vectara.UpdateAgentConnectorRequest? Type581 { get; set; } /// /// /// - public global::Vectara.AgentVerification? Type582 { get; set; } + public global::Vectara.PipelineStatus? Type582 { get; set; } /// /// /// - public global::Vectara.PipelineVerification? Type583 { get; set; } + public global::Vectara.BaseS3SourceConfiguration? Type583 { get; set; } /// /// /// - public global::Vectara.PipelineVerificationDiscriminator? Type584 { get; set; } + public global::Vectara.S3SourceConfiguration? Type584 { get; set; } /// /// /// - public global::Vectara.PipelineVerificationDiscriminatorType? Type585 { get; set; } + public global::Vectara.PipelineSource? Type585 { get; set; } /// /// /// - public global::Vectara.AgentTransformConfiguration? Type586 { get; set; } + public global::Vectara.PipelineSourceDiscriminator? Type586 { get; set; } /// /// /// - public global::Vectara.PipelineTransform? Type587 { get; set; } + public global::Vectara.PipelineSourceDiscriminatorType? Type587 { get; set; } /// /// /// - public global::Vectara.PipelineTransformDiscriminator? Type588 { get; set; } + public global::Vectara.CronTriggerConfiguration? Type588 { get; set; } /// /// /// - public global::Vectara.PipelineTransformDiscriminatorType? Type589 { get; set; } + public global::Vectara.IntervalTriggerConfiguration? Type589 { get; set; } /// /// /// - public global::Vectara.PipelineSyncMode? Type590 { get; set; } + public global::Vectara.ManualTriggerConfiguration? Type590 { get; set; } /// /// /// - public global::Vectara.PipelineWatermark? Type591 { get; set; } + public global::Vectara.PipelineTrigger? Type591 { get; set; } /// /// /// - public global::Vectara.Pipeline? Type592 { get; set; } + public global::Vectara.PipelineTriggerDiscriminator? Type592 { get; set; } /// /// /// - public global::Vectara.ListPipelinesResponse? Type593 { get; set; } + public global::Vectara.PipelineTriggerDiscriminatorType? Type593 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type594 { get; set; } + public global::Vectara.ConditionVerification? Type594 { get; set; } /// /// /// - public global::Vectara.CreatePipelineRequest? Type595 { get; set; } + public global::Vectara.AgentVerification? Type595 { get; set; } /// /// /// - public global::Vectara.UpdateS3SourceConfiguration? Type596 { get; set; } + public global::Vectara.PipelineVerification? Type596 { get; set; } /// /// /// - public global::Vectara.UpdatePipelineSource? Type597 { get; set; } + public global::Vectara.PipelineVerificationDiscriminator? Type597 { get; set; } /// /// /// - public global::Vectara.UpdatePipelineSourceDiscriminator? Type598 { get; set; } + public global::Vectara.PipelineVerificationDiscriminatorType? Type598 { get; set; } /// /// /// - public global::Vectara.UpdatePipelineSourceDiscriminatorType? Type599 { get; set; } + public global::Vectara.AgentTransformConfiguration? Type599 { get; set; } /// /// /// - public global::Vectara.UpdatePipelineRequest? Type600 { get; set; } + public global::Vectara.PipelineTransform? Type600 { get; set; } /// /// /// - public global::Vectara.PipelineRunStatus? Type601 { get; set; } + public global::Vectara.PipelineTransformDiscriminator? Type601 { get; set; } /// /// /// - public global::Vectara.PipelineRunTriggerType? Type602 { get; set; } + public global::Vectara.PipelineTransformDiscriminatorType? Type602 { get; set; } /// /// /// - public global::Vectara.PipelineRun? Type603 { get; set; } + public global::Vectara.PipelineSyncMode? Type603 { get; set; } /// /// /// - public global::Vectara.DeadLetterStatus? Type604 { get; set; } + public global::Vectara.PipelineWatermark? Type604 { get; set; } /// /// /// - public global::Vectara.DeadLetterOrigin? Type605 { get; set; } + public global::Vectara.Pipeline? Type605 { get; set; } /// /// /// - public global::Vectara.PipelineDeadLetterEntry? Type606 { get; set; } + public global::Vectara.ListPipelinesResponse? Type606 { get; set; } /// /// /// - public global::Vectara.ListPipelineDeadLetterEntriesResponse? Type607 { get; set; } + public global::System.Collections.Generic.IList? Type607 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type608 { get; set; } + public global::Vectara.CreatePipelineRequest? Type608 { get; set; } /// /// /// - public global::Vectara.CreatePipelineDeadLetterEntryRequest? Type609 { get; set; } + public global::Vectara.UpdateS3SourceConfiguration? Type609 { get; set; } /// /// /// - public global::Vectara.ProcessPipelineDeadLetterEntriesRequest? Type610 { get; set; } + public global::Vectara.UpdatePipelineSource? Type610 { get; set; } /// /// /// - public global::Vectara.ListPipelineRunsResponse? Type611 { get; set; } + public global::Vectara.UpdatePipelineSourceDiscriminator? Type611 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type612 { get; set; } + public global::Vectara.UpdatePipelineSourceDiscriminatorType? Type612 { get; set; } /// /// /// - public global::Vectara.Glossary? Type613 { get; set; } + public global::Vectara.UpdatePipelineRequest? Type613 { get; set; } /// /// /// - public global::Vectara.ListGlossariesResponse? Type614 { get; set; } + public global::Vectara.PipelineRunStatus? Type614 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type615 { get; set; } + public global::Vectara.PipelineRunTriggerType? Type615 { get; set; } /// /// /// - public global::Vectara.CreateGlossaryRequest? Type616 { get; set; } + public global::Vectara.PipelineRun? Type616 { get; set; } /// /// /// - public global::Vectara.UpdateGlossaryRequest? Type617 { get; set; } + public global::Vectara.DeadLetterStatus? Type617 { get; set; } /// /// /// - public global::Vectara.GlossaryEntry? Type618 { get; set; } + public global::Vectara.DeadLetterOrigin? Type618 { get; set; } /// /// /// - public global::Vectara.GlossaryEntriesResponse? Type619 { get; set; } + public global::Vectara.PipelineDeadLetterEntry? Type619 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type620 { get; set; } + public global::Vectara.ListPipelineDeadLetterEntriesResponse? Type620 { get; set; } /// /// /// - public global::Vectara.UpsertGlossaryEntriesRequest? Type621 { get; set; } + public global::System.Collections.Generic.IList? Type621 { get; set; } /// /// /// - public global::Vectara.DeleteGlossaryEntriesRequest? Type622 { get; set; } + public global::Vectara.CreatePipelineDeadLetterEntryRequest? Type622 { get; set; } /// /// /// - public global::Vectara.GetOAuthTokenRequest? Type623 { get; set; } + public global::Vectara.ProcessPipelineDeadLetterEntriesRequest? Type623 { get; set; } /// /// /// - public global::Vectara.CreateCorpusDocumentWaitFor? Type624 { get; set; } + public global::Vectara.ListPipelineRunsResponse? Type624 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type625 { get; set; } + public global::System.Collections.Generic.IList? Type625 { get; set; } /// /// /// - public global::Vectara.ListToolServersType? Type626 { get; set; } + public global::Vectara.AgentTrace? Type626 { get; set; } /// /// /// - public global::Vectara.ListToolsType? Type627 { get; set; } + public global::Vectara.AgentTraceStatus? Type627 { get; set; } /// /// /// - public global::Vectara.ListInstructionsType? Type628 { get; set; } + public global::Vectara.ListAgentTracesResponse? Type628 { get; set; } /// /// /// - public global::Vectara.ListSessionArtifactsSortBy? Type629 { get; set; } + public global::System.Collections.Generic.IList? Type629 { get; set; } /// /// /// - public global::Vectara.ListSessionArtifactsOrderBy? Type630 { get; set; } + public global::Vectara.AgentTraceSpanStatus? Type630 { get; set; } /// /// /// - public global::Vectara.ListPipelinesSourceType? Type631 { get; set; } + public global::Vectara.AgentTraceSpanBase? Type631 { get; set; } /// /// /// - public global::Vectara.AllOf? Type632 { get; set; } + public global::Vectara.AgentTraceInputFile? Type632 { get; set; } /// /// /// - public global::Vectara.CreateUserResponse2? Type633 { get; set; } + public global::Vectara.InvokeAgentSpanAttributes? Type633 { get; set; } /// /// /// - public global::Vectara.ResetUserPasswordResponse? Type634 { get; set; } + public global::Vectara.InvokeAgentSpanAttributesOutputType? Type634 { get; set; } /// /// /// - public global::Vectara.GetTokenResponse? Type635 { get; set; } + public global::System.Collections.Generic.IList? Type635 { get; set; } + /// + /// + /// + public global::Vectara.InvokeAgentSpanContent? Type636 { get; set; } + /// + /// + /// + public global::Vectara.InvokeAgentTraceSpan? Type637 { get; set; } + /// + /// + /// + public global::Vectara.InvokeAgentTraceSpanVariant2? Type638 { get; set; } + /// + /// + /// + public global::Vectara.ChatSpanAttributes? Type639 { get; set; } + /// + /// + /// + public global::Vectara.ChatTraceSpan? Type640 { get; set; } + /// + /// + /// + public global::Vectara.ChatTraceSpanVariant2? Type641 { get; set; } + /// + /// + /// + public global::Vectara.ExecuteToolSpanAttributes? Type642 { get; set; } + /// + /// + /// + public global::Vectara.ExecuteToolSpanContent? Type643 { get; set; } + /// + /// + /// + public global::Vectara.ExecuteToolTraceSpan? Type644 { get; set; } + /// + /// + /// + public global::Vectara.ExecuteToolTraceSpanVariant2? Type645 { get; set; } + /// + /// + /// + public global::Vectara.ThinkingSpanContent? Type646 { get; set; } + /// + /// + /// + public global::Vectara.ThinkingTraceSpan? Type647 { get; set; } + /// + /// + /// + public global::Vectara.ThinkingTraceSpanVariant2? Type648 { get; set; } + /// + /// + /// + public global::Vectara.OutputSpanContent? Type649 { get; set; } + /// + /// + /// + public global::Vectara.OutputTraceSpan? Type650 { get; set; } + /// + /// + /// + public global::Vectara.OutputTraceSpanVariant2? Type651 { get; set; } + /// + /// + /// + public global::Vectara.GuardrailSpanAttributes? Type652 { get; set; } + /// + /// + /// + public global::Vectara.GuardrailSpanContent? Type653 { get; set; } + /// + /// + /// + public global::Vectara.GuardrailTraceSpan? Type654 { get; set; } + /// + /// + /// + public global::Vectara.GuardrailTraceSpanVariant2? Type655 { get; set; } + /// + /// + /// + public global::Vectara.StepTransitionSpanAttributes? Type656 { get; set; } + /// + /// + /// + public global::Vectara.StepTransitionTraceSpan? Type657 { get; set; } + /// + /// + /// + public global::Vectara.StepTransitionTraceSpanVariant2? Type658 { get; set; } + /// + /// + /// + public global::Vectara.ImageReadSpanAttributes? Type659 { get; set; } + /// + /// + /// + public global::Vectara.ImageReadTraceSpan? Type660 { get; set; } + /// + /// + /// + public global::Vectara.ImageReadTraceSpanVariant2? Type661 { get; set; } + /// + /// + /// + public global::Vectara.CompactionSpanAttributes? Type662 { get; set; } + /// + /// + /// + public global::Vectara.CompactionTraceSpan? Type663 { get; set; } + /// + /// + /// + public global::Vectara.CompactionTraceSpanVariant2? Type664 { get; set; } + /// + /// + /// + public global::Vectara.AgentTraceSpan? Type665 { get; set; } + /// + /// + /// + public global::Vectara.AgentTraceSpanDiscriminator? Type666 { get; set; } + /// + /// + /// + public global::Vectara.AgentTraceSpanDiscriminatorOperation? Type667 { get; set; } + /// + /// + /// + public global::Vectara.ListAgentTraceSpansResponse? Type668 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type669 { get; set; } + /// + /// + /// + public global::Vectara.Glossary? Type670 { get; set; } + /// + /// + /// + public global::Vectara.ListGlossariesResponse? Type671 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type672 { get; set; } + /// + /// + /// + public global::Vectara.CreateGlossaryRequest? Type673 { get; set; } + /// + /// + /// + public global::Vectara.UpdateGlossaryRequest? Type674 { get; set; } + /// + /// + /// + public global::Vectara.GlossaryEntry? Type675 { get; set; } + /// + /// + /// + public global::Vectara.GlossaryEntriesResponse? Type676 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type677 { get; set; } + /// + /// + /// + public global::Vectara.UpsertGlossaryEntriesRequest? Type678 { get; set; } + /// + /// + /// + public global::Vectara.DeleteGlossaryEntriesRequest? Type679 { get; set; } + /// + /// + /// + public global::Vectara.GetOAuthTokenRequest? Type680 { get; set; } + /// + /// + /// + public global::Vectara.CreateCorpusDocumentWaitFor? Type681 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type682 { get; set; } + /// + /// + /// + public global::Vectara.ListToolServersType? Type683 { get; set; } + /// + /// + /// + public global::Vectara.ListToolsType? Type684 { get; set; } + /// + /// + /// + public global::Vectara.ListInstructionsType? Type685 { get; set; } + /// + /// + /// + public global::Vectara.ListSessionArtifactsSortBy? Type686 { get; set; } + /// + /// + /// + public global::Vectara.ListSessionArtifactsOrderBy? Type687 { get; set; } + /// + /// + /// + public global::Vectara.ListAgentConnectorsType? Type688 { get; set; } + /// + /// + /// + public global::Vectara.ListPipelinesSourceType? Type689 { get; set; } + /// + /// + /// + public global::Vectara.ListTracesStatus? Type690 { get; set; } + /// + /// + /// + public global::Vectara.ListTracesErrorType? Type691 { get; set; } + /// + /// + /// + public global::Vectara.ListTracesOperation? Type692 { get; set; } + /// + /// + /// + public global::Vectara.ListTracesToolErrorType? Type693 { get; set; } + /// + /// + /// + public global::Vectara.ListTraceSpansOperation? Type694 { get; set; } + /// + /// + /// + public global::Vectara.AllOf? Type695 { get; set; } + /// + /// + /// + public global::Vectara.CreateUserResponse2? Type696 { get; set; } + /// + /// + /// + public global::Vectara.ResetUserPasswordResponse? Type697 { get; set; } + /// + /// + /// + public global::Vectara.GetTokenResponse? Type698 { get; set; } /// /// @@ -2829,26 +3081,42 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::System.Collections.Generic.List? ListType64 { get; set; } + public global::System.Collections.Generic.List? ListType64 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType65 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType66 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType67 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType68 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType65 { get; set; } + public global::System.Collections.Generic.List? ListType69 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType66 { get; set; } + public global::System.Collections.Generic.List? ListType70 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType67 { get; set; } + public global::System.Collections.Generic.List? ListType71 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType68 { get; set; } + public global::System.Collections.Generic.List? ListType72 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType69 { get; set; } + public global::System.Collections.Generic.List? ListType73 { get; set; } } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.AgentConnector.Json.g.cs b/src/libs/Vectara/Generated/Vectara.Models.AgentConnector.Json.g.cs new file mode 100644 index 00000000..82f0987e --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.AgentConnector.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Vectara +{ + public sealed partial class AgentConnector + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Vectara.AgentConnector? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Vectara.AgentConnector), + jsonSerializerContext) as global::Vectara.AgentConnector; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Vectara.AgentConnector? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Vectara.AgentConnector), + jsonSerializerContext).ConfigureAwait(false)) as global::Vectara.AgentConnector; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.AgentConnector.g.cs b/src/libs/Vectara/Generated/Vectara.Models.AgentConnector.g.cs new file mode 100644 index 00000000..de02b785 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.AgentConnector.g.cs @@ -0,0 +1,213 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// A connector that allows an agent to receive events from external platforms like Slack. + /// + public sealed partial class AgentConnector + { + /// + /// The unique identifier for the connector.
+ /// Example: con_slack_support + ///
+ /// con_slack_support + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Id { get; set; } + + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + ///
+ /// customer_support + [global::System.Text.Json.Serialization.JsonPropertyName("agent_key")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string AgentKey { get; set; } + + /// + /// The human-readable name of the connector.
+ /// Example: Customer Support Slack Channel + ///
+ /// Customer Support Slack Channel + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// A detailed description of what this connector does.
+ /// Example: Receives customer support messages from the + ///
+ /// Receives customer support messages from the + [global::System.Text.Json.Serialization.JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// The type of connector.
+ /// Example: slack + ///
+ /// slack + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Vectara.JsonConverters.AgentConnectorTypeJsonConverter))] + public global::Vectara.AgentConnectorType Type { get; set; } + + /// + /// The current status of the connector.
+ /// Default Value: active
+ /// Example: active + ///
+ /// global::Vectara.AgentConnectorStatus.Active + /// active + [global::System.Text.Json.Serialization.JsonPropertyName("status")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Vectara.JsonConverters.AgentConnectorStatusJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Vectara.AgentConnectorStatus Status { get; set; } = global::Vectara.AgentConnectorStatus.Active; + + /// + /// Detailed status message (e.g., error description or success confirmation).
+ /// Example: Slack authentication successful + ///
+ /// Slack authentication successful + [global::System.Text.Json.Serialization.JsonPropertyName("status_message")] + public string? StatusMessage { get; set; } + + /// + /// Arbitrary metadata associated with the connector.
+ /// Example: {"priority":"high","department":"customer_service"} + ///
+ /// {"priority":"high","department":"customer_service"} + [global::System.Text.Json.Serialization.JsonPropertyName("metadata")] + public object? Metadata { get; set; } + + /// + /// Whether the connector is currently enabled and can receive events.
+ /// Default Value: true
+ /// Example: true + ///
+ /// true + [global::System.Text.Json.Serialization.JsonPropertyName("enabled")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool Enabled { get; set; } + + /// + /// Configuration for different types of connectors. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("configuration")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Vectara.SlackConnectorConfiguration Configuration { get; set; } + + /// + /// Timestamp when the connector was created.
+ /// Example: 2024-01-15T10:30:00Z + ///
+ /// 2024-01-15T10:30:00Z + [global::System.Text.Json.Serialization.JsonPropertyName("created_at")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTime CreatedAt { get; set; } + + /// + /// Timestamp when the connector was last updated.
+ /// Example: 2024-01-16T14:45:00Z + ///
+ /// 2024-01-16T14:45:00Z + [global::System.Text.Json.Serialization.JsonPropertyName("updated_at")] + public global::System.DateTime? UpdatedAt { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The unique identifier for the connector.
+ /// Example: con_slack_support + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// + /// + /// The human-readable name of the connector.
+ /// Example: Customer Support Slack Channel + /// + /// + /// The current status of the connector.
+ /// Default Value: active
+ /// Example: active + /// + /// + /// Whether the connector is currently enabled and can receive events.
+ /// Default Value: true
+ /// Example: true + /// + /// + /// Configuration for different types of connectors. + /// + /// + /// Timestamp when the connector was created.
+ /// Example: 2024-01-15T10:30:00Z + /// + /// + /// A detailed description of what this connector does.
+ /// Example: Receives customer support messages from the + /// + /// + /// The type of connector.
+ /// Example: slack + /// + /// + /// Detailed status message (e.g., error description or success confirmation).
+ /// Example: Slack authentication successful + /// + /// + /// Arbitrary metadata associated with the connector.
+ /// Example: {"priority":"high","department":"customer_service"} + /// + /// + /// Timestamp when the connector was last updated.
+ /// Example: 2024-01-16T14:45:00Z + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public AgentConnector( + string id, + string agentKey, + string name, + global::Vectara.AgentConnectorStatus status, + bool enabled, + global::Vectara.SlackConnectorConfiguration configuration, + global::System.DateTime createdAt, + string? description, + global::Vectara.AgentConnectorType type, + string? statusMessage, + object? metadata, + global::System.DateTime? updatedAt) + { + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.AgentKey = agentKey ?? throw new global::System.ArgumentNullException(nameof(agentKey)); + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.Description = description; + this.Type = type; + this.Status = status; + this.StatusMessage = statusMessage; + this.Metadata = metadata; + this.Enabled = enabled; + this.Configuration = configuration ?? throw new global::System.ArgumentNullException(nameof(configuration)); + this.CreatedAt = createdAt; + this.UpdatedAt = updatedAt; + } + + /// + /// Initializes a new instance of the class. + /// + public AgentConnector() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.AgentConnectorMetadata.Json.g.cs b/src/libs/Vectara/Generated/Vectara.Models.AgentConnectorMetadata.Json.g.cs new file mode 100644 index 00000000..3fbc6e0e --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.AgentConnectorMetadata.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Vectara +{ + public sealed partial class AgentConnectorMetadata + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Vectara.AgentConnectorMetadata? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Vectara.AgentConnectorMetadata), + jsonSerializerContext) as global::Vectara.AgentConnectorMetadata; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Vectara.AgentConnectorMetadata? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Vectara.AgentConnectorMetadata), + jsonSerializerContext).ConfigureAwait(false)) as global::Vectara.AgentConnectorMetadata; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.AgentConnectorMetadata.g.cs b/src/libs/Vectara/Generated/Vectara.Models.AgentConnectorMetadata.g.cs new file mode 100644 index 00000000..757ed7cb --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.AgentConnectorMetadata.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// Arbitrary metadata associated with the connector.
+ /// Example: {"priority":"high","department":"customer_service"} + ///
+ public sealed partial class AgentConnectorMetadata + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.AgentConnectorStatus.g.cs b/src/libs/Vectara/Generated/Vectara.Models.AgentConnectorStatus.g.cs new file mode 100644 index 00000000..71d453be --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.AgentConnectorStatus.g.cs @@ -0,0 +1,59 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// The current status of the connector.
+ /// Default Value: active
+ /// Example: active + ///
+ public enum AgentConnectorStatus + { + /// + /// + /// + Active, + /// + /// + /// + Error, + /// + /// + /// + Inactive, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class AgentConnectorStatusExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this AgentConnectorStatus value) + { + return value switch + { + AgentConnectorStatus.Active => "active", + AgentConnectorStatus.Error => "error", + AgentConnectorStatus.Inactive => "inactive", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static AgentConnectorStatus? ToEnum(string value) + { + return value switch + { + "active" => AgentConnectorStatus.Active, + "error" => AgentConnectorStatus.Error, + "inactive" => AgentConnectorStatus.Inactive, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.AgentConnectorType.g.cs b/src/libs/Vectara/Generated/Vectara.Models.AgentConnectorType.g.cs new file mode 100644 index 00000000..bb62933a --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.AgentConnectorType.g.cs @@ -0,0 +1,46 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// The type of connector.
+ /// Example: slack + ///
+ public enum AgentConnectorType + { + /// + /// + /// + Slack, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class AgentConnectorTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this AgentConnectorType value) + { + return value switch + { + AgentConnectorType.Slack => "slack", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static AgentConnectorType? ToEnum(string value) + { + return value switch + { + "slack" => AgentConnectorType.Slack, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.AgentToolConfiguration.g.cs b/src/libs/Vectara/Generated/Vectara.Models.AgentToolConfiguration.g.cs index f0b13a13..f2191ac3 100644 --- a/src/libs/Vectara/Generated/Vectara.Models.AgentToolConfiguration.g.cs +++ b/src/libs/Vectara/Generated/Vectara.Models.AgentToolConfiguration.g.cs @@ -134,6 +134,23 @@ namespace Vectara #endif public bool IsSubAgent => SubAgent != null; + /// + /// An artifact create tool configuration defined inline in the agent for creating artifacts on-the-fly from text or structured data content. + /// +#if NET6_0_OR_GREATER + public global::Vectara.InlineArtifactCreateToolConfiguration? ArtifactCreate { get; init; } +#else + public global::Vectara.InlineArtifactCreateToolConfiguration? ArtifactCreate { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ArtifactCreate))] +#endif + public bool IsArtifactCreate => ArtifactCreate != null; + /// /// An artifact read tool configuration defined inline in the agent for reading artifacts from the session workspace. /// @@ -344,6 +361,24 @@ public AgentToolConfiguration(global::Vectara.InlineSubAgentToolConfiguration? v SubAgent = value; } + /// + /// + /// + public static implicit operator AgentToolConfiguration(global::Vectara.InlineArtifactCreateToolConfiguration value) => new AgentToolConfiguration((global::Vectara.InlineArtifactCreateToolConfiguration?)value); + + /// + /// + /// + public static implicit operator global::Vectara.InlineArtifactCreateToolConfiguration?(AgentToolConfiguration @this) => @this.ArtifactCreate; + + /// + /// + /// + public AgentToolConfiguration(global::Vectara.InlineArtifactCreateToolConfiguration? value) + { + ArtifactCreate = value; + } + /// /// /// @@ -446,6 +481,7 @@ public AgentToolConfiguration( global::Vectara.InlineWebGetToolConfiguration? webGet, global::Vectara.InlineLambdaToolConfiguration? lambda, global::Vectara.InlineSubAgentToolConfiguration? subAgent, + global::Vectara.InlineArtifactCreateToolConfiguration? artifactCreate, global::Vectara.InlineArtifactReadToolConfiguration? artifactRead, global::Vectara.InlineArtifactGrepToolConfiguration? artifactGrep, global::Vectara.InlineImageReadToolConfiguration? imageRead, @@ -462,6 +498,7 @@ public AgentToolConfiguration( WebGet = webGet; Lambda = lambda; SubAgent = subAgent; + ArtifactCreate = artifactCreate; ArtifactRead = artifactRead; ArtifactGrep = artifactGrep; ImageRead = imageRead; @@ -478,6 +515,7 @@ DocumentConversion as object ?? ImageRead as object ?? ArtifactGrep as object ?? ArtifactRead as object ?? + ArtifactCreate as object ?? SubAgent as object ?? Lambda as object ?? WebGet as object ?? @@ -498,6 +536,7 @@ DynamicVectara as object WebGet?.ToString() ?? Lambda?.ToString() ?? SubAgent?.ToString() ?? + ArtifactCreate?.ToString() ?? ArtifactRead?.ToString() ?? ArtifactGrep?.ToString() ?? ImageRead?.ToString() ?? @@ -510,7 +549,7 @@ DynamicVectara as object ///
public bool Validate() { - return IsDynamicVectara && !IsMcp && !IsCorporaSearch && !IsWebSearch && !IsWebGet && !IsLambda && !IsSubAgent && !IsArtifactRead && !IsArtifactGrep && !IsImageRead && !IsDocumentConversion && !IsGetDocumentText || !IsDynamicVectara && IsMcp && !IsCorporaSearch && !IsWebSearch && !IsWebGet && !IsLambda && !IsSubAgent && !IsArtifactRead && !IsArtifactGrep && !IsImageRead && !IsDocumentConversion && !IsGetDocumentText || !IsDynamicVectara && !IsMcp && IsCorporaSearch && !IsWebSearch && !IsWebGet && !IsLambda && !IsSubAgent && !IsArtifactRead && !IsArtifactGrep && !IsImageRead && !IsDocumentConversion && !IsGetDocumentText || !IsDynamicVectara && !IsMcp && !IsCorporaSearch && IsWebSearch && !IsWebGet && !IsLambda && !IsSubAgent && !IsArtifactRead && !IsArtifactGrep && !IsImageRead && !IsDocumentConversion && !IsGetDocumentText || !IsDynamicVectara && !IsMcp && !IsCorporaSearch && !IsWebSearch && IsWebGet && !IsLambda && !IsSubAgent && !IsArtifactRead && !IsArtifactGrep && !IsImageRead && !IsDocumentConversion && !IsGetDocumentText || !IsDynamicVectara && !IsMcp && !IsCorporaSearch && !IsWebSearch && !IsWebGet && IsLambda && !IsSubAgent && !IsArtifactRead && !IsArtifactGrep && !IsImageRead && !IsDocumentConversion && !IsGetDocumentText || !IsDynamicVectara && !IsMcp && !IsCorporaSearch && !IsWebSearch && !IsWebGet && !IsLambda && IsSubAgent && !IsArtifactRead && !IsArtifactGrep && !IsImageRead && !IsDocumentConversion && !IsGetDocumentText || !IsDynamicVectara && !IsMcp && !IsCorporaSearch && !IsWebSearch && !IsWebGet && !IsLambda && !IsSubAgent && IsArtifactRead && !IsArtifactGrep && !IsImageRead && !IsDocumentConversion && !IsGetDocumentText || !IsDynamicVectara && !IsMcp && !IsCorporaSearch && !IsWebSearch && !IsWebGet && !IsLambda && !IsSubAgent && !IsArtifactRead && IsArtifactGrep && !IsImageRead && !IsDocumentConversion && !IsGetDocumentText || !IsDynamicVectara && !IsMcp && !IsCorporaSearch && !IsWebSearch && !IsWebGet && !IsLambda && !IsSubAgent && !IsArtifactRead && !IsArtifactGrep && IsImageRead && !IsDocumentConversion && !IsGetDocumentText || !IsDynamicVectara && !IsMcp && !IsCorporaSearch && !IsWebSearch && !IsWebGet && !IsLambda && !IsSubAgent && !IsArtifactRead && !IsArtifactGrep && !IsImageRead && IsDocumentConversion && !IsGetDocumentText || !IsDynamicVectara && !IsMcp && !IsCorporaSearch && !IsWebSearch && !IsWebGet && !IsLambda && !IsSubAgent && !IsArtifactRead && !IsArtifactGrep && !IsImageRead && !IsDocumentConversion && IsGetDocumentText; + return IsDynamicVectara && !IsMcp && !IsCorporaSearch && !IsWebSearch && !IsWebGet && !IsLambda && !IsSubAgent && !IsArtifactCreate && !IsArtifactRead && !IsArtifactGrep && !IsImageRead && !IsDocumentConversion && !IsGetDocumentText || !IsDynamicVectara && IsMcp && !IsCorporaSearch && !IsWebSearch && !IsWebGet && !IsLambda && !IsSubAgent && !IsArtifactCreate && !IsArtifactRead && !IsArtifactGrep && !IsImageRead && !IsDocumentConversion && !IsGetDocumentText || !IsDynamicVectara && !IsMcp && IsCorporaSearch && !IsWebSearch && !IsWebGet && !IsLambda && !IsSubAgent && !IsArtifactCreate && !IsArtifactRead && !IsArtifactGrep && !IsImageRead && !IsDocumentConversion && !IsGetDocumentText || !IsDynamicVectara && !IsMcp && !IsCorporaSearch && IsWebSearch && !IsWebGet && !IsLambda && !IsSubAgent && !IsArtifactCreate && !IsArtifactRead && !IsArtifactGrep && !IsImageRead && !IsDocumentConversion && !IsGetDocumentText || !IsDynamicVectara && !IsMcp && !IsCorporaSearch && !IsWebSearch && IsWebGet && !IsLambda && !IsSubAgent && !IsArtifactCreate && !IsArtifactRead && !IsArtifactGrep && !IsImageRead && !IsDocumentConversion && !IsGetDocumentText || !IsDynamicVectara && !IsMcp && !IsCorporaSearch && !IsWebSearch && !IsWebGet && IsLambda && !IsSubAgent && !IsArtifactCreate && !IsArtifactRead && !IsArtifactGrep && !IsImageRead && !IsDocumentConversion && !IsGetDocumentText || !IsDynamicVectara && !IsMcp && !IsCorporaSearch && !IsWebSearch && !IsWebGet && !IsLambda && IsSubAgent && !IsArtifactCreate && !IsArtifactRead && !IsArtifactGrep && !IsImageRead && !IsDocumentConversion && !IsGetDocumentText || !IsDynamicVectara && !IsMcp && !IsCorporaSearch && !IsWebSearch && !IsWebGet && !IsLambda && !IsSubAgent && IsArtifactCreate && !IsArtifactRead && !IsArtifactGrep && !IsImageRead && !IsDocumentConversion && !IsGetDocumentText || !IsDynamicVectara && !IsMcp && !IsCorporaSearch && !IsWebSearch && !IsWebGet && !IsLambda && !IsSubAgent && !IsArtifactCreate && IsArtifactRead && !IsArtifactGrep && !IsImageRead && !IsDocumentConversion && !IsGetDocumentText || !IsDynamicVectara && !IsMcp && !IsCorporaSearch && !IsWebSearch && !IsWebGet && !IsLambda && !IsSubAgent && !IsArtifactCreate && !IsArtifactRead && IsArtifactGrep && !IsImageRead && !IsDocumentConversion && !IsGetDocumentText || !IsDynamicVectara && !IsMcp && !IsCorporaSearch && !IsWebSearch && !IsWebGet && !IsLambda && !IsSubAgent && !IsArtifactCreate && !IsArtifactRead && !IsArtifactGrep && IsImageRead && !IsDocumentConversion && !IsGetDocumentText || !IsDynamicVectara && !IsMcp && !IsCorporaSearch && !IsWebSearch && !IsWebGet && !IsLambda && !IsSubAgent && !IsArtifactCreate && !IsArtifactRead && !IsArtifactGrep && !IsImageRead && IsDocumentConversion && !IsGetDocumentText || !IsDynamicVectara && !IsMcp && !IsCorporaSearch && !IsWebSearch && !IsWebGet && !IsLambda && !IsSubAgent && !IsArtifactCreate && !IsArtifactRead && !IsArtifactGrep && !IsImageRead && !IsDocumentConversion && IsGetDocumentText; } /// @@ -524,6 +563,7 @@ public bool Validate() global::System.Func? webGet = null, global::System.Func? lambda = null, global::System.Func? subAgent = null, + global::System.Func? artifactCreate = null, global::System.Func? artifactRead = null, global::System.Func? artifactGrep = null, global::System.Func? imageRead = null, @@ -564,6 +604,10 @@ public bool Validate() { return subAgent(SubAgent!); } + else if (IsArtifactCreate && artifactCreate != null) + { + return artifactCreate(ArtifactCreate!); + } else if (IsArtifactRead && artifactRead != null) { return artifactRead(ArtifactRead!); @@ -599,6 +643,7 @@ public void Match( global::System.Action? webGet = null, global::System.Action? lambda = null, global::System.Action? subAgent = null, + global::System.Action? artifactCreate = null, global::System.Action? artifactRead = null, global::System.Action? artifactGrep = null, global::System.Action? imageRead = null, @@ -639,6 +684,10 @@ public void Match( { subAgent?.Invoke(SubAgent!); } + else if (IsArtifactCreate) + { + artifactCreate?.Invoke(ArtifactCreate!); + } else if (IsArtifactRead) { artifactRead?.Invoke(ArtifactRead!); @@ -682,6 +731,8 @@ public override int GetHashCode() typeof(global::Vectara.InlineLambdaToolConfiguration), SubAgent, typeof(global::Vectara.InlineSubAgentToolConfiguration), + ArtifactCreate, + typeof(global::Vectara.InlineArtifactCreateToolConfiguration), ArtifactRead, typeof(global::Vectara.InlineArtifactReadToolConfiguration), ArtifactGrep, @@ -715,6 +766,7 @@ public bool Equals(AgentToolConfiguration other) global::System.Collections.Generic.EqualityComparer.Default.Equals(WebGet, other.WebGet) && global::System.Collections.Generic.EqualityComparer.Default.Equals(Lambda, other.Lambda) && global::System.Collections.Generic.EqualityComparer.Default.Equals(SubAgent, other.SubAgent) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(ArtifactCreate, other.ArtifactCreate) && global::System.Collections.Generic.EqualityComparer.Default.Equals(ArtifactRead, other.ArtifactRead) && global::System.Collections.Generic.EqualityComparer.Default.Equals(ArtifactGrep, other.ArtifactGrep) && global::System.Collections.Generic.EqualityComparer.Default.Equals(ImageRead, other.ImageRead) && diff --git a/src/libs/Vectara/Generated/Vectara.Models.AgentToolConfigurationDiscriminatorType.g.cs b/src/libs/Vectara/Generated/Vectara.Models.AgentToolConfigurationDiscriminatorType.g.cs index 348e4948..6502ccdc 100644 --- a/src/libs/Vectara/Generated/Vectara.Models.AgentToolConfigurationDiscriminatorType.g.cs +++ b/src/libs/Vectara/Generated/Vectara.Models.AgentToolConfigurationDiscriminatorType.g.cs @@ -8,6 +8,10 @@ namespace Vectara /// public enum AgentToolConfigurationDiscriminatorType { + /// + /// + /// + ArtifactCreate, /// /// /// @@ -70,6 +74,7 @@ public static string ToValueString(this AgentToolConfigurationDiscriminatorType { return value switch { + AgentToolConfigurationDiscriminatorType.ArtifactCreate => "artifact_create", AgentToolConfigurationDiscriminatorType.ArtifactGrep => "artifact_grep", AgentToolConfigurationDiscriminatorType.ArtifactRead => "artifact_read", AgentToolConfigurationDiscriminatorType.CorporaSearch => "corpora_search", @@ -92,6 +97,7 @@ public static string ToValueString(this AgentToolConfigurationDiscriminatorType { return value switch { + "artifact_create" => AgentToolConfigurationDiscriminatorType.ArtifactCreate, "artifact_grep" => AgentToolConfigurationDiscriminatorType.ArtifactGrep, "artifact_read" => AgentToolConfigurationDiscriminatorType.ArtifactRead, "corpora_search" => AgentToolConfigurationDiscriminatorType.CorporaSearch, diff --git a/src/libs/Vectara/Generated/Vectara.Models.AgentTrace.Json.g.cs b/src/libs/Vectara/Generated/Vectara.Models.AgentTrace.Json.g.cs new file mode 100644 index 00000000..5a80b9f7 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.AgentTrace.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Vectara +{ + public sealed partial class AgentTrace + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Vectara.AgentTrace? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Vectara.AgentTrace), + jsonSerializerContext) as global::Vectara.AgentTrace; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Vectara.AgentTrace? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Vectara.AgentTrace), + jsonSerializerContext).ConfigureAwait(false)) as global::Vectara.AgentTrace; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.AgentTrace.g.cs b/src/libs/Vectara/Generated/Vectara.Models.AgentTrace.g.cs new file mode 100644 index 00000000..1f5795e0 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.AgentTrace.g.cs @@ -0,0 +1,135 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// A summary of an agent trace representing one complete agent invocation. + /// + public sealed partial class AgentTrace + { + /// + /// The unique identifier of the trace.
+ /// Example: 0af7651916cd43dd8448eb211c80319c + ///
+ /// 0af7651916cd43dd8448eb211c80319c + [global::System.Text.Json.Serialization.JsonPropertyName("trace_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string TraceId { get; set; } + + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + ///
+ /// customer_support + [global::System.Text.Json.Serialization.JsonPropertyName("agent_key")] + public string? AgentKey { get; set; } + + /// + /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat + ///
+ /// customer_support_chat + [global::System.Text.Json.Serialization.JsonPropertyName("session_key")] + public string? SessionKey { get; set; } + + /// + /// The time the trace started. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("started_at")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTime StartedAt { get; set; } + + /// + /// Total duration of the trace in milliseconds. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("duration_ms")] + public long? DurationMs { get; set; } + + /// + /// The final status of the trace. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("status")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Vectara.JsonConverters.AgentTraceStatusJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Vectara.AgentTraceStatus Status { get; set; } + + /// + /// Total input tokens consumed across all spans. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("input_tokens")] + public long? InputTokens { get; set; } + + /// + /// Total output tokens produced across all spans. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("output_tokens")] + public long? OutputTokens { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The unique identifier of the trace.
+ /// Example: 0af7651916cd43dd8448eb211c80319c + /// + /// + /// The time the trace started. + /// + /// + /// The final status of the trace. + /// + /// + /// A unique key that identifies an agent.
+ /// Example: customer_support + /// + /// + /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat + /// + /// + /// Total duration of the trace in milliseconds. + /// + /// + /// Total input tokens consumed across all spans. + /// + /// + /// Total output tokens produced across all spans. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public AgentTrace( + string traceId, + global::System.DateTime startedAt, + global::Vectara.AgentTraceStatus status, + string? agentKey, + string? sessionKey, + long? durationMs, + long? inputTokens, + long? outputTokens) + { + this.TraceId = traceId ?? throw new global::System.ArgumentNullException(nameof(traceId)); + this.AgentKey = agentKey; + this.SessionKey = sessionKey; + this.StartedAt = startedAt; + this.DurationMs = durationMs; + this.Status = status; + this.InputTokens = inputTokens; + this.OutputTokens = outputTokens; + } + + /// + /// Initializes a new instance of the class. + /// + public AgentTrace() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.AgentTraceInputFile.Json.g.cs b/src/libs/Vectara/Generated/Vectara.Models.AgentTraceInputFile.Json.g.cs new file mode 100644 index 00000000..76493546 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.AgentTraceInputFile.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Vectara +{ + public sealed partial class AgentTraceInputFile + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Vectara.AgentTraceInputFile? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Vectara.AgentTraceInputFile), + jsonSerializerContext) as global::Vectara.AgentTraceInputFile; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Vectara.AgentTraceInputFile? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Vectara.AgentTraceInputFile), + jsonSerializerContext).ConfigureAwait(false)) as global::Vectara.AgentTraceInputFile; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.AgentTraceInputFile.g.cs b/src/libs/Vectara/Generated/Vectara.Models.AgentTraceInputFile.g.cs new file mode 100644 index 00000000..3b800597 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.AgentTraceInputFile.g.cs @@ -0,0 +1,58 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// Metadata for a file uploaded alongside an agent input message. + /// + public sealed partial class AgentTraceInputFile + { + /// + /// The original filename. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// The file size in bytes. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("size_bytes")] + [global::System.Text.Json.Serialization.JsonRequired] + public required long SizeBytes { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The original filename. + /// + /// + /// The file size in bytes. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public AgentTraceInputFile( + string name, + long sizeBytes) + { + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.SizeBytes = sizeBytes; + } + + /// + /// Initializes a new instance of the class. + /// + public AgentTraceInputFile() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.AgentTraceSpan.Json.g.cs b/src/libs/Vectara/Generated/Vectara.Models.AgentTraceSpan.Json.g.cs new file mode 100644 index 00000000..6f2f33d7 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.AgentTraceSpan.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Vectara +{ + public readonly partial struct AgentTraceSpan + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Vectara.AgentTraceSpan? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Vectara.AgentTraceSpan), + jsonSerializerContext) as global::Vectara.AgentTraceSpan?; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Vectara.AgentTraceSpan? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Vectara.AgentTraceSpan), + jsonSerializerContext).ConfigureAwait(false)) as global::Vectara.AgentTraceSpan?; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.AgentTraceSpan.g.cs b/src/libs/Vectara/Generated/Vectara.Models.AgentTraceSpan.g.cs new file mode 100644 index 00000000..6d0cc85c --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.AgentTraceSpan.g.cs @@ -0,0 +1,593 @@ +#pragma warning disable CS0618 // Type or member is obsolete + +#nullable enable + +namespace Vectara +{ + /// + /// A single span within an agent trace. The shape of attributes and content varies by operation type. + /// + public readonly partial struct AgentTraceSpan : global::System.IEquatable + { + /// + /// + /// + public global::Vectara.AgentTraceSpanDiscriminatorOperation? Operation { get; } + + /// + /// A span representing a top-level agent invocation. + /// +#if NET6_0_OR_GREATER + public global::Vectara.InvokeAgentTraceSpan? InvokeAgent { get; init; } +#else + public global::Vectara.InvokeAgentTraceSpan? InvokeAgent { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(InvokeAgent))] +#endif + public bool IsInvokeAgent => InvokeAgent != null; + + /// + /// A span representing a single LLM chat completion call within an agent turn. + /// +#if NET6_0_OR_GREATER + public global::Vectara.ChatTraceSpan? Chat { get; init; } +#else + public global::Vectara.ChatTraceSpan? Chat { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Chat))] +#endif + public bool IsChat => Chat != null; + + /// + /// A span representing a tool execution within an agent turn. + /// +#if NET6_0_OR_GREATER + public global::Vectara.ExecuteToolTraceSpan? ExecuteTool { get; init; } +#else + public global::Vectara.ExecuteToolTraceSpan? ExecuteTool { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ExecuteTool))] +#endif + public bool IsExecuteTool => ExecuteTool != null; + + /// + /// A span representing extended thinking output from the LLM. + /// +#if NET6_0_OR_GREATER + public global::Vectara.ThinkingTraceSpan? Thinking { get; init; } +#else + public global::Vectara.ThinkingTraceSpan? Thinking { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Thinking))] +#endif + public bool IsThinking => Thinking != null; + + /// + /// A span representing the final text output of an agent turn. + /// +#if NET6_0_OR_GREATER + public global::Vectara.OutputTraceSpan? Output { get; init; } +#else + public global::Vectara.OutputTraceSpan? Output { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Output))] +#endif + public bool IsOutput => Output != null; + + /// + /// A span representing a guardrail safety check on tool call results. + /// +#if NET6_0_OR_GREATER + public global::Vectara.GuardrailTraceSpan? Guardrail { get; init; } +#else + public global::Vectara.GuardrailTraceSpan? Guardrail { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Guardrail))] +#endif + public bool IsGuardrail => Guardrail != null; + + /// + /// A span representing a transition between agent steps. + /// +#if NET6_0_OR_GREATER + public global::Vectara.StepTransitionTraceSpan? StepTransition { get; init; } +#else + public global::Vectara.StepTransitionTraceSpan? StepTransition { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(StepTransition))] +#endif + public bool IsStepTransition => StepTransition != null; + + /// + /// A span representing an image being loaded into conversation context. + /// +#if NET6_0_OR_GREATER + public global::Vectara.ImageReadTraceSpan? ImageRead { get; init; } +#else + public global::Vectara.ImageReadTraceSpan? ImageRead { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ImageRead))] +#endif + public bool IsImageRead => ImageRead != null; + + /// + /// A span representing context compaction (summarization of older conversation turns). + /// +#if NET6_0_OR_GREATER + public global::Vectara.CompactionTraceSpan? Compaction { get; init; } +#else + public global::Vectara.CompactionTraceSpan? Compaction { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Compaction))] +#endif + public bool IsCompaction => Compaction != null; + /// + /// + /// + public static implicit operator AgentTraceSpan(global::Vectara.InvokeAgentTraceSpan value) => new AgentTraceSpan((global::Vectara.InvokeAgentTraceSpan?)value); + + /// + /// + /// + public static implicit operator global::Vectara.InvokeAgentTraceSpan?(AgentTraceSpan @this) => @this.InvokeAgent; + + /// + /// + /// + public AgentTraceSpan(global::Vectara.InvokeAgentTraceSpan? value) + { + InvokeAgent = value; + } + + /// + /// + /// + public static implicit operator AgentTraceSpan(global::Vectara.ChatTraceSpan value) => new AgentTraceSpan((global::Vectara.ChatTraceSpan?)value); + + /// + /// + /// + public static implicit operator global::Vectara.ChatTraceSpan?(AgentTraceSpan @this) => @this.Chat; + + /// + /// + /// + public AgentTraceSpan(global::Vectara.ChatTraceSpan? value) + { + Chat = value; + } + + /// + /// + /// + public static implicit operator AgentTraceSpan(global::Vectara.ExecuteToolTraceSpan value) => new AgentTraceSpan((global::Vectara.ExecuteToolTraceSpan?)value); + + /// + /// + /// + public static implicit operator global::Vectara.ExecuteToolTraceSpan?(AgentTraceSpan @this) => @this.ExecuteTool; + + /// + /// + /// + public AgentTraceSpan(global::Vectara.ExecuteToolTraceSpan? value) + { + ExecuteTool = value; + } + + /// + /// + /// + public static implicit operator AgentTraceSpan(global::Vectara.ThinkingTraceSpan value) => new AgentTraceSpan((global::Vectara.ThinkingTraceSpan?)value); + + /// + /// + /// + public static implicit operator global::Vectara.ThinkingTraceSpan?(AgentTraceSpan @this) => @this.Thinking; + + /// + /// + /// + public AgentTraceSpan(global::Vectara.ThinkingTraceSpan? value) + { + Thinking = value; + } + + /// + /// + /// + public static implicit operator AgentTraceSpan(global::Vectara.OutputTraceSpan value) => new AgentTraceSpan((global::Vectara.OutputTraceSpan?)value); + + /// + /// + /// + public static implicit operator global::Vectara.OutputTraceSpan?(AgentTraceSpan @this) => @this.Output; + + /// + /// + /// + public AgentTraceSpan(global::Vectara.OutputTraceSpan? value) + { + Output = value; + } + + /// + /// + /// + public static implicit operator AgentTraceSpan(global::Vectara.GuardrailTraceSpan value) => new AgentTraceSpan((global::Vectara.GuardrailTraceSpan?)value); + + /// + /// + /// + public static implicit operator global::Vectara.GuardrailTraceSpan?(AgentTraceSpan @this) => @this.Guardrail; + + /// + /// + /// + public AgentTraceSpan(global::Vectara.GuardrailTraceSpan? value) + { + Guardrail = value; + } + + /// + /// + /// + public static implicit operator AgentTraceSpan(global::Vectara.StepTransitionTraceSpan value) => new AgentTraceSpan((global::Vectara.StepTransitionTraceSpan?)value); + + /// + /// + /// + public static implicit operator global::Vectara.StepTransitionTraceSpan?(AgentTraceSpan @this) => @this.StepTransition; + + /// + /// + /// + public AgentTraceSpan(global::Vectara.StepTransitionTraceSpan? value) + { + StepTransition = value; + } + + /// + /// + /// + public static implicit operator AgentTraceSpan(global::Vectara.ImageReadTraceSpan value) => new AgentTraceSpan((global::Vectara.ImageReadTraceSpan?)value); + + /// + /// + /// + public static implicit operator global::Vectara.ImageReadTraceSpan?(AgentTraceSpan @this) => @this.ImageRead; + + /// + /// + /// + public AgentTraceSpan(global::Vectara.ImageReadTraceSpan? value) + { + ImageRead = value; + } + + /// + /// + /// + public static implicit operator AgentTraceSpan(global::Vectara.CompactionTraceSpan value) => new AgentTraceSpan((global::Vectara.CompactionTraceSpan?)value); + + /// + /// + /// + public static implicit operator global::Vectara.CompactionTraceSpan?(AgentTraceSpan @this) => @this.Compaction; + + /// + /// + /// + public AgentTraceSpan(global::Vectara.CompactionTraceSpan? value) + { + Compaction = value; + } + + /// + /// + /// + public AgentTraceSpan( + global::Vectara.AgentTraceSpanDiscriminatorOperation? operation, + global::Vectara.InvokeAgentTraceSpan? invokeAgent, + global::Vectara.ChatTraceSpan? chat, + global::Vectara.ExecuteToolTraceSpan? executeTool, + global::Vectara.ThinkingTraceSpan? thinking, + global::Vectara.OutputTraceSpan? output, + global::Vectara.GuardrailTraceSpan? guardrail, + global::Vectara.StepTransitionTraceSpan? stepTransition, + global::Vectara.ImageReadTraceSpan? imageRead, + global::Vectara.CompactionTraceSpan? compaction + ) + { + Operation = operation; + + InvokeAgent = invokeAgent; + Chat = chat; + ExecuteTool = executeTool; + Thinking = thinking; + Output = output; + Guardrail = guardrail; + StepTransition = stepTransition; + ImageRead = imageRead; + Compaction = compaction; + } + + /// + /// + /// + public object? Object => + Compaction as object ?? + ImageRead as object ?? + StepTransition as object ?? + Guardrail as object ?? + Output as object ?? + Thinking as object ?? + ExecuteTool as object ?? + Chat as object ?? + InvokeAgent as object + ; + + /// + /// + /// + public override string? ToString() => + InvokeAgent?.ToString() ?? + Chat?.ToString() ?? + ExecuteTool?.ToString() ?? + Thinking?.ToString() ?? + Output?.ToString() ?? + Guardrail?.ToString() ?? + StepTransition?.ToString() ?? + ImageRead?.ToString() ?? + Compaction?.ToString() + ; + + /// + /// + /// + public bool Validate() + { + return IsInvokeAgent && !IsChat && !IsExecuteTool && !IsThinking && !IsOutput && !IsGuardrail && !IsStepTransition && !IsImageRead && !IsCompaction || !IsInvokeAgent && IsChat && !IsExecuteTool && !IsThinking && !IsOutput && !IsGuardrail && !IsStepTransition && !IsImageRead && !IsCompaction || !IsInvokeAgent && !IsChat && IsExecuteTool && !IsThinking && !IsOutput && !IsGuardrail && !IsStepTransition && !IsImageRead && !IsCompaction || !IsInvokeAgent && !IsChat && !IsExecuteTool && IsThinking && !IsOutput && !IsGuardrail && !IsStepTransition && !IsImageRead && !IsCompaction || !IsInvokeAgent && !IsChat && !IsExecuteTool && !IsThinking && IsOutput && !IsGuardrail && !IsStepTransition && !IsImageRead && !IsCompaction || !IsInvokeAgent && !IsChat && !IsExecuteTool && !IsThinking && !IsOutput && IsGuardrail && !IsStepTransition && !IsImageRead && !IsCompaction || !IsInvokeAgent && !IsChat && !IsExecuteTool && !IsThinking && !IsOutput && !IsGuardrail && IsStepTransition && !IsImageRead && !IsCompaction || !IsInvokeAgent && !IsChat && !IsExecuteTool && !IsThinking && !IsOutput && !IsGuardrail && !IsStepTransition && IsImageRead && !IsCompaction || !IsInvokeAgent && !IsChat && !IsExecuteTool && !IsThinking && !IsOutput && !IsGuardrail && !IsStepTransition && !IsImageRead && IsCompaction; + } + + /// + /// + /// + public TResult? Match( + global::System.Func? invokeAgent = null, + global::System.Func? chat = null, + global::System.Func? executeTool = null, + global::System.Func? thinking = null, + global::System.Func? output = null, + global::System.Func? guardrail = null, + global::System.Func? stepTransition = null, + global::System.Func? imageRead = null, + global::System.Func? compaction = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsInvokeAgent && invokeAgent != null) + { + return invokeAgent(InvokeAgent!); + } + else if (IsChat && chat != null) + { + return chat(Chat!); + } + else if (IsExecuteTool && executeTool != null) + { + return executeTool(ExecuteTool!); + } + else if (IsThinking && thinking != null) + { + return thinking(Thinking!); + } + else if (IsOutput && output != null) + { + return output(Output!); + } + else if (IsGuardrail && guardrail != null) + { + return guardrail(Guardrail!); + } + else if (IsStepTransition && stepTransition != null) + { + return stepTransition(StepTransition!); + } + else if (IsImageRead && imageRead != null) + { + return imageRead(ImageRead!); + } + else if (IsCompaction && compaction != null) + { + return compaction(Compaction!); + } + + return default(TResult); + } + + /// + /// + /// + public void Match( + global::System.Action? invokeAgent = null, + global::System.Action? chat = null, + global::System.Action? executeTool = null, + global::System.Action? thinking = null, + global::System.Action? output = null, + global::System.Action? guardrail = null, + global::System.Action? stepTransition = null, + global::System.Action? imageRead = null, + global::System.Action? compaction = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsInvokeAgent) + { + invokeAgent?.Invoke(InvokeAgent!); + } + else if (IsChat) + { + chat?.Invoke(Chat!); + } + else if (IsExecuteTool) + { + executeTool?.Invoke(ExecuteTool!); + } + else if (IsThinking) + { + thinking?.Invoke(Thinking!); + } + else if (IsOutput) + { + output?.Invoke(Output!); + } + else if (IsGuardrail) + { + guardrail?.Invoke(Guardrail!); + } + else if (IsStepTransition) + { + stepTransition?.Invoke(StepTransition!); + } + else if (IsImageRead) + { + imageRead?.Invoke(ImageRead!); + } + else if (IsCompaction) + { + compaction?.Invoke(Compaction!); + } + } + + /// + /// + /// + public override int GetHashCode() + { + var fields = new object?[] + { + InvokeAgent, + typeof(global::Vectara.InvokeAgentTraceSpan), + Chat, + typeof(global::Vectara.ChatTraceSpan), + ExecuteTool, + typeof(global::Vectara.ExecuteToolTraceSpan), + Thinking, + typeof(global::Vectara.ThinkingTraceSpan), + Output, + typeof(global::Vectara.OutputTraceSpan), + Guardrail, + typeof(global::Vectara.GuardrailTraceSpan), + StepTransition, + typeof(global::Vectara.StepTransitionTraceSpan), + ImageRead, + typeof(global::Vectara.ImageReadTraceSpan), + Compaction, + typeof(global::Vectara.CompactionTraceSpan), + }; + const int offset = unchecked((int)2166136261); + const int prime = 16777619; + static int HashCodeAggregator(int hashCode, object? value) => value == null + ? (hashCode ^ 0) * prime + : (hashCode ^ value.GetHashCode()) * prime; + + return global::System.Linq.Enumerable.Aggregate(fields, offset, HashCodeAggregator); + } + + /// + /// + /// + public bool Equals(AgentTraceSpan other) + { + return + global::System.Collections.Generic.EqualityComparer.Default.Equals(InvokeAgent, other.InvokeAgent) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Chat, other.Chat) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(ExecuteTool, other.ExecuteTool) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Thinking, other.Thinking) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Output, other.Output) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Guardrail, other.Guardrail) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(StepTransition, other.StepTransition) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(ImageRead, other.ImageRead) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Compaction, other.Compaction) + ; + } + + /// + /// + /// + public static bool operator ==(AgentTraceSpan obj1, AgentTraceSpan obj2) + { + return global::System.Collections.Generic.EqualityComparer.Default.Equals(obj1, obj2); + } + + /// + /// + /// + public static bool operator !=(AgentTraceSpan obj1, AgentTraceSpan obj2) + { + return !(obj1 == obj2); + } + + /// + /// + /// + public override bool Equals(object? obj) + { + return obj is AgentTraceSpan o && Equals(o); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.AgentTraceSpanBase.Json.g.cs b/src/libs/Vectara/Generated/Vectara.Models.AgentTraceSpanBase.Json.g.cs new file mode 100644 index 00000000..77243c66 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.AgentTraceSpanBase.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Vectara +{ + public sealed partial class AgentTraceSpanBase + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Vectara.AgentTraceSpanBase? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Vectara.AgentTraceSpanBase), + jsonSerializerContext) as global::Vectara.AgentTraceSpanBase; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Vectara.AgentTraceSpanBase? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Vectara.AgentTraceSpanBase), + jsonSerializerContext).ConfigureAwait(false)) as global::Vectara.AgentTraceSpanBase; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.AgentTraceSpanBase.g.cs b/src/libs/Vectara/Generated/Vectara.Models.AgentTraceSpanBase.g.cs new file mode 100644 index 00000000..f28f421d --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.AgentTraceSpanBase.g.cs @@ -0,0 +1,130 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// Common properties shared by all agent trace span types. + /// + public sealed partial class AgentTraceSpanBase + { + /// + /// The unique identifier of the span.
+ /// Example: b7ad6b7169203331 + ///
+ /// b7ad6b7169203331 + [global::System.Text.Json.Serialization.JsonPropertyName("span_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string SpanId { get; set; } + + /// + /// The identifier of the parent span, if any. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("parent_span_id")] + public string? ParentSpanId { get; set; } + + /// + /// The identifier of the trace this span belongs to. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("trace_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string TraceId { get; set; } + + /// + /// The time this span started. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("started_at")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTime StartedAt { get; set; } + + /// + /// Duration of this span in milliseconds. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("duration_ms")] + public long? DurationMs { get; set; } + + /// + /// The status of an agent trace span. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("status")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Vectara.JsonConverters.AgentTraceSpanStatusJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Vectara.AgentTraceSpanStatus Status { get; set; } + + /// + /// Error message if the span status is error. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("error_message")] + public string? ErrorMessage { get; set; } + + /// + /// The name of the agent step active when this span was created. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("step_name")] + public string? StepName { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The unique identifier of the span.
+ /// Example: b7ad6b7169203331 + /// + /// + /// The identifier of the trace this span belongs to. + /// + /// + /// The time this span started. + /// + /// + /// The status of an agent trace span. + /// + /// + /// The identifier of the parent span, if any. + /// + /// + /// Duration of this span in milliseconds. + /// + /// + /// Error message if the span status is error. + /// + /// + /// The name of the agent step active when this span was created. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public AgentTraceSpanBase( + string spanId, + string traceId, + global::System.DateTime startedAt, + global::Vectara.AgentTraceSpanStatus status, + string? parentSpanId, + long? durationMs, + string? errorMessage, + string? stepName) + { + this.SpanId = spanId ?? throw new global::System.ArgumentNullException(nameof(spanId)); + this.ParentSpanId = parentSpanId; + this.TraceId = traceId ?? throw new global::System.ArgumentNullException(nameof(traceId)); + this.StartedAt = startedAt; + this.DurationMs = durationMs; + this.Status = status; + this.ErrorMessage = errorMessage; + this.StepName = stepName; + } + + /// + /// Initializes a new instance of the class. + /// + public AgentTraceSpanBase() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.AgentTraceSpanDiscriminator.Json.g.cs b/src/libs/Vectara/Generated/Vectara.Models.AgentTraceSpanDiscriminator.Json.g.cs new file mode 100644 index 00000000..9da02f15 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.AgentTraceSpanDiscriminator.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Vectara +{ + public sealed partial class AgentTraceSpanDiscriminator + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Vectara.AgentTraceSpanDiscriminator? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Vectara.AgentTraceSpanDiscriminator), + jsonSerializerContext) as global::Vectara.AgentTraceSpanDiscriminator; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Vectara.AgentTraceSpanDiscriminator? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Vectara.AgentTraceSpanDiscriminator), + jsonSerializerContext).ConfigureAwait(false)) as global::Vectara.AgentTraceSpanDiscriminator; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.AgentTraceSpanDiscriminator.g.cs b/src/libs/Vectara/Generated/Vectara.Models.AgentTraceSpanDiscriminator.g.cs new file mode 100644 index 00000000..08377d13 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.AgentTraceSpanDiscriminator.g.cs @@ -0,0 +1,44 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// + /// + public sealed partial class AgentTraceSpanDiscriminator + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("operation")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Vectara.JsonConverters.AgentTraceSpanDiscriminatorOperationJsonConverter))] + public global::Vectara.AgentTraceSpanDiscriminatorOperation? Operation { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public AgentTraceSpanDiscriminator( + global::Vectara.AgentTraceSpanDiscriminatorOperation? operation) + { + this.Operation = operation; + } + + /// + /// Initializes a new instance of the class. + /// + public AgentTraceSpanDiscriminator() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.AgentTraceSpanDiscriminatorOperation.g.cs b/src/libs/Vectara/Generated/Vectara.Models.AgentTraceSpanDiscriminatorOperation.g.cs new file mode 100644 index 00000000..10fb4fa4 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.AgentTraceSpanDiscriminatorOperation.g.cs @@ -0,0 +1,93 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// + /// + public enum AgentTraceSpanDiscriminatorOperation + { + /// + /// + /// + Chat, + /// + /// + /// + Compaction, + /// + /// + /// + ExecuteTool, + /// + /// + /// + Guardrail, + /// + /// + /// + ImageRead, + /// + /// + /// + InvokeAgent, + /// + /// + /// + Output, + /// + /// + /// + StepTransition, + /// + /// + /// + Thinking, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class AgentTraceSpanDiscriminatorOperationExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this AgentTraceSpanDiscriminatorOperation value) + { + return value switch + { + AgentTraceSpanDiscriminatorOperation.Chat => "chat", + AgentTraceSpanDiscriminatorOperation.Compaction => "compaction", + AgentTraceSpanDiscriminatorOperation.ExecuteTool => "execute_tool", + AgentTraceSpanDiscriminatorOperation.Guardrail => "guardrail", + AgentTraceSpanDiscriminatorOperation.ImageRead => "image_read", + AgentTraceSpanDiscriminatorOperation.InvokeAgent => "invoke_agent", + AgentTraceSpanDiscriminatorOperation.Output => "output", + AgentTraceSpanDiscriminatorOperation.StepTransition => "step_transition", + AgentTraceSpanDiscriminatorOperation.Thinking => "thinking", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static AgentTraceSpanDiscriminatorOperation? ToEnum(string value) + { + return value switch + { + "chat" => AgentTraceSpanDiscriminatorOperation.Chat, + "compaction" => AgentTraceSpanDiscriminatorOperation.Compaction, + "execute_tool" => AgentTraceSpanDiscriminatorOperation.ExecuteTool, + "guardrail" => AgentTraceSpanDiscriminatorOperation.Guardrail, + "image_read" => AgentTraceSpanDiscriminatorOperation.ImageRead, + "invoke_agent" => AgentTraceSpanDiscriminatorOperation.InvokeAgent, + "output" => AgentTraceSpanDiscriminatorOperation.Output, + "step_transition" => AgentTraceSpanDiscriminatorOperation.StepTransition, + "thinking" => AgentTraceSpanDiscriminatorOperation.Thinking, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.AgentTraceSpanStatus.g.cs b/src/libs/Vectara/Generated/Vectara.Models.AgentTraceSpanStatus.g.cs new file mode 100644 index 00000000..cb719299 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.AgentTraceSpanStatus.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// The status of an agent trace span. + /// + public enum AgentTraceSpanStatus + { + /// + /// + /// + Error, + /// + /// + /// + Ok, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class AgentTraceSpanStatusExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this AgentTraceSpanStatus value) + { + return value switch + { + AgentTraceSpanStatus.Error => "error", + AgentTraceSpanStatus.Ok => "ok", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static AgentTraceSpanStatus? ToEnum(string value) + { + return value switch + { + "error" => AgentTraceSpanStatus.Error, + "ok" => AgentTraceSpanStatus.Ok, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.AgentTraceStatus.g.cs b/src/libs/Vectara/Generated/Vectara.Models.AgentTraceStatus.g.cs new file mode 100644 index 00000000..1b8319e5 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.AgentTraceStatus.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// The final status of the trace. + /// + public enum AgentTraceStatus + { + /// + /// + /// + Error, + /// + /// + /// + Ok, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class AgentTraceStatusExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this AgentTraceStatus value) + { + return value switch + { + AgentTraceStatus.Error => "error", + AgentTraceStatus.Ok => "ok", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static AgentTraceStatus? ToEnum(string value) + { + return value switch + { + "error" => AgentTraceStatus.Error, + "ok" => AgentTraceStatus.Ok, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.ChatSpanAttributes.Json.g.cs b/src/libs/Vectara/Generated/Vectara.Models.ChatSpanAttributes.Json.g.cs new file mode 100644 index 00000000..87b5d926 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.ChatSpanAttributes.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Vectara +{ + public sealed partial class ChatSpanAttributes + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Vectara.ChatSpanAttributes? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Vectara.ChatSpanAttributes), + jsonSerializerContext) as global::Vectara.ChatSpanAttributes; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Vectara.ChatSpanAttributes? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Vectara.ChatSpanAttributes), + jsonSerializerContext).ConfigureAwait(false)) as global::Vectara.ChatSpanAttributes; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.ChatSpanAttributes.g.cs b/src/libs/Vectara/Generated/Vectara.Models.ChatSpanAttributes.g.cs new file mode 100644 index 00000000..60ae0915 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.ChatSpanAttributes.g.cs @@ -0,0 +1,135 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// Attributes for a chat (LLM completion) span. + /// + public sealed partial class ChatSpanAttributes + { + /// + /// The LLM model used for this completion. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("model")] + public string? Model { get; set; } + + /// + /// Number of input tokens in this completion. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("input_tokens")] + public long? InputTokens { get; set; } + + /// + /// Number of output tokens in this completion. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("output_tokens")] + public long? OutputTokens { get; set; } + + /// + /// Number of input tokens read from cache. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("cache_read_input_tokens")] + public long? CacheReadInputTokens { get; set; } + + /// + /// The reasons the LLM generation finished, one per returned completion. Typically a single-element array
+ /// (e.g., `["stop"]`), but providers may return multiple entries when batching completions. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("finish_reasons")] + public global::System.Collections.Generic.IList? FinishReasons { get; set; } + + /// + /// The temperature parameter used for generation. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("temperature")] + public double? Temperature { get; set; } + + /// + /// The maximum tokens parameter used for generation. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("max_tokens")] + public long? MaxTokens { get; set; } + + /// + /// The LLM provider name. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("provider_name")] + public string? ProviderName { get; set; } + + /// + /// The provider response identifier. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("response_id")] + public string? ResponseId { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The LLM model used for this completion. + /// + /// + /// Number of input tokens in this completion. + /// + /// + /// Number of output tokens in this completion. + /// + /// + /// Number of input tokens read from cache. + /// + /// + /// The reasons the LLM generation finished, one per returned completion. Typically a single-element array
+ /// (e.g., `["stop"]`), but providers may return multiple entries when batching completions. + /// + /// + /// The temperature parameter used for generation. + /// + /// + /// The maximum tokens parameter used for generation. + /// + /// + /// The LLM provider name. + /// + /// + /// The provider response identifier. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ChatSpanAttributes( + string? model, + long? inputTokens, + long? outputTokens, + long? cacheReadInputTokens, + global::System.Collections.Generic.IList? finishReasons, + double? temperature, + long? maxTokens, + string? providerName, + string? responseId) + { + this.Model = model; + this.InputTokens = inputTokens; + this.OutputTokens = outputTokens; + this.CacheReadInputTokens = cacheReadInputTokens; + this.FinishReasons = finishReasons; + this.Temperature = temperature; + this.MaxTokens = maxTokens; + this.ProviderName = providerName; + this.ResponseId = responseId; + } + + /// + /// Initializes a new instance of the class. + /// + public ChatSpanAttributes() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.ChatTraceSpan.Json.g.cs b/src/libs/Vectara/Generated/Vectara.Models.ChatTraceSpan.Json.g.cs new file mode 100644 index 00000000..c3cae225 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.ChatTraceSpan.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Vectara +{ + public readonly partial struct ChatTraceSpan + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Vectara.ChatTraceSpan? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Vectara.ChatTraceSpan), + jsonSerializerContext) as global::Vectara.ChatTraceSpan?; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Vectara.ChatTraceSpan? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Vectara.ChatTraceSpan), + jsonSerializerContext).ConfigureAwait(false)) as global::Vectara.ChatTraceSpan?; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.ChatTraceSpan.g.cs b/src/libs/Vectara/Generated/Vectara.Models.ChatTraceSpan.g.cs new file mode 100644 index 00000000..df6f0eb5 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.ChatTraceSpan.g.cs @@ -0,0 +1,221 @@ +#pragma warning disable CS0618 // Type or member is obsolete + +#nullable enable + +namespace Vectara +{ + /// + /// A span representing a single LLM chat completion call within an agent turn. + /// + public readonly partial struct ChatTraceSpan : global::System.IEquatable + { + /// + /// Common properties shared by all agent trace span types. + /// +#if NET6_0_OR_GREATER + public global::Vectara.AgentTraceSpanBase? AgentBase { get; init; } +#else + public global::Vectara.AgentTraceSpanBase? AgentBase { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(AgentBase))] +#endif + public bool IsAgentBase => AgentBase != null; + + /// + /// + /// +#if NET6_0_OR_GREATER + public global::Vectara.ChatTraceSpanVariant2? ChatTraceSpanVariant2 { get; init; } +#else + public global::Vectara.ChatTraceSpanVariant2? ChatTraceSpanVariant2 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ChatTraceSpanVariant2))] +#endif + public bool IsChatTraceSpanVariant2 => ChatTraceSpanVariant2 != null; + /// + /// + /// + public static implicit operator ChatTraceSpan(global::Vectara.AgentTraceSpanBase value) => new ChatTraceSpan((global::Vectara.AgentTraceSpanBase?)value); + + /// + /// + /// + public static implicit operator global::Vectara.AgentTraceSpanBase?(ChatTraceSpan @this) => @this.AgentBase; + + /// + /// + /// + public ChatTraceSpan(global::Vectara.AgentTraceSpanBase? value) + { + AgentBase = value; + } + + /// + /// + /// + public static implicit operator ChatTraceSpan(global::Vectara.ChatTraceSpanVariant2 value) => new ChatTraceSpan((global::Vectara.ChatTraceSpanVariant2?)value); + + /// + /// + /// + public static implicit operator global::Vectara.ChatTraceSpanVariant2?(ChatTraceSpan @this) => @this.ChatTraceSpanVariant2; + + /// + /// + /// + public ChatTraceSpan(global::Vectara.ChatTraceSpanVariant2? value) + { + ChatTraceSpanVariant2 = value; + } + + /// + /// + /// + public ChatTraceSpan( + global::Vectara.AgentTraceSpanBase? agentBase, + global::Vectara.ChatTraceSpanVariant2? chatTraceSpanVariant2 + ) + { + AgentBase = agentBase; + ChatTraceSpanVariant2 = chatTraceSpanVariant2; + } + + /// + /// + /// + public object? Object => + ChatTraceSpanVariant2 as object ?? + AgentBase as object + ; + + /// + /// + /// + public override string? ToString() => + AgentBase?.ToString() ?? + ChatTraceSpanVariant2?.ToString() + ; + + /// + /// + /// + public bool Validate() + { + return IsAgentBase && IsChatTraceSpanVariant2; + } + + /// + /// + /// + public TResult? Match( + global::System.Func? agentBase = null, + global::System.Func? chatTraceSpanVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsAgentBase && agentBase != null) + { + return agentBase(AgentBase!); + } + else if (IsChatTraceSpanVariant2 && chatTraceSpanVariant2 != null) + { + return chatTraceSpanVariant2(ChatTraceSpanVariant2!); + } + + return default(TResult); + } + + /// + /// + /// + public void Match( + global::System.Action? agentBase = null, + global::System.Action? chatTraceSpanVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsAgentBase) + { + agentBase?.Invoke(AgentBase!); + } + else if (IsChatTraceSpanVariant2) + { + chatTraceSpanVariant2?.Invoke(ChatTraceSpanVariant2!); + } + } + + /// + /// + /// + public override int GetHashCode() + { + var fields = new object?[] + { + AgentBase, + typeof(global::Vectara.AgentTraceSpanBase), + ChatTraceSpanVariant2, + typeof(global::Vectara.ChatTraceSpanVariant2), + }; + const int offset = unchecked((int)2166136261); + const int prime = 16777619; + static int HashCodeAggregator(int hashCode, object? value) => value == null + ? (hashCode ^ 0) * prime + : (hashCode ^ value.GetHashCode()) * prime; + + return global::System.Linq.Enumerable.Aggregate(fields, offset, HashCodeAggregator); + } + + /// + /// + /// + public bool Equals(ChatTraceSpan other) + { + return + global::System.Collections.Generic.EqualityComparer.Default.Equals(AgentBase, other.AgentBase) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(ChatTraceSpanVariant2, other.ChatTraceSpanVariant2) + ; + } + + /// + /// + /// + public static bool operator ==(ChatTraceSpan obj1, ChatTraceSpan obj2) + { + return global::System.Collections.Generic.EqualityComparer.Default.Equals(obj1, obj2); + } + + /// + /// + /// + public static bool operator !=(ChatTraceSpan obj1, ChatTraceSpan obj2) + { + return !(obj1 == obj2); + } + + /// + /// + /// + public override bool Equals(object? obj) + { + return obj is ChatTraceSpan o && Equals(o); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.ChatTraceSpanVariant2.Json.g.cs b/src/libs/Vectara/Generated/Vectara.Models.ChatTraceSpanVariant2.Json.g.cs new file mode 100644 index 00000000..8f0c7313 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.ChatTraceSpanVariant2.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Vectara +{ + public sealed partial class ChatTraceSpanVariant2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Vectara.ChatTraceSpanVariant2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Vectara.ChatTraceSpanVariant2), + jsonSerializerContext) as global::Vectara.ChatTraceSpanVariant2; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Vectara.ChatTraceSpanVariant2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Vectara.ChatTraceSpanVariant2), + jsonSerializerContext).ConfigureAwait(false)) as global::Vectara.ChatTraceSpanVariant2; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.ChatTraceSpanVariant2.g.cs b/src/libs/Vectara/Generated/Vectara.Models.ChatTraceSpanVariant2.g.cs new file mode 100644 index 00000000..b825d96d --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.ChatTraceSpanVariant2.g.cs @@ -0,0 +1,63 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// + /// + public sealed partial class ChatTraceSpanVariant2 + { + /// + /// The operation type for this span.
+ /// Default Value: chat
+ /// Example: chat + ///
+ /// "chat" + /// chat + [global::System.Text.Json.Serialization.JsonPropertyName("operation")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Operation { get; set; } = "chat"; + + /// + /// Attributes for a chat (LLM completion) span. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("attributes")] + public global::Vectara.ChatSpanAttributes? Attributes { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The operation type for this span.
+ /// Default Value: chat
+ /// Example: chat + /// + /// + /// Attributes for a chat (LLM completion) span. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ChatTraceSpanVariant2( + string operation, + global::Vectara.ChatSpanAttributes? attributes) + { + this.Operation = operation ?? throw new global::System.ArgumentNullException(nameof(operation)); + this.Attributes = attributes; + } + + /// + /// Initializes a new instance of the class. + /// + public ChatTraceSpanVariant2() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.CompactionSpanAttributes.Json.g.cs b/src/libs/Vectara/Generated/Vectara.Models.CompactionSpanAttributes.Json.g.cs new file mode 100644 index 00000000..bd3f3dec --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.CompactionSpanAttributes.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Vectara +{ + public sealed partial class CompactionSpanAttributes + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Vectara.CompactionSpanAttributes? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Vectara.CompactionSpanAttributes), + jsonSerializerContext) as global::Vectara.CompactionSpanAttributes; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Vectara.CompactionSpanAttributes? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Vectara.CompactionSpanAttributes), + jsonSerializerContext).ConfigureAwait(false)) as global::Vectara.CompactionSpanAttributes; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.CompactionSpanAttributes.g.cs b/src/libs/Vectara/Generated/Vectara.Models.CompactionSpanAttributes.g.cs new file mode 100644 index 00000000..0722da1d --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.CompactionSpanAttributes.g.cs @@ -0,0 +1,67 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// Attributes for a compaction span. + /// + public sealed partial class CompactionSpanAttributes + { + /// + /// Number of conversation turns compacted. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("turns_compacted")] + public long? TurnsCompacted { get; set; } + + /// + /// Number of events hidden by compaction. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("events_compacted")] + public long? EventsCompacted { get; set; } + + /// + /// Key of the summary created by compaction. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("summary_key")] + public string? SummaryKey { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Number of conversation turns compacted. + /// + /// + /// Number of events hidden by compaction. + /// + /// + /// Key of the summary created by compaction. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public CompactionSpanAttributes( + long? turnsCompacted, + long? eventsCompacted, + string? summaryKey) + { + this.TurnsCompacted = turnsCompacted; + this.EventsCompacted = eventsCompacted; + this.SummaryKey = summaryKey; + } + + /// + /// Initializes a new instance of the class. + /// + public CompactionSpanAttributes() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.CompactionTraceSpan.Json.g.cs b/src/libs/Vectara/Generated/Vectara.Models.CompactionTraceSpan.Json.g.cs new file mode 100644 index 00000000..b9fd5904 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.CompactionTraceSpan.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Vectara +{ + public readonly partial struct CompactionTraceSpan + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Vectara.CompactionTraceSpan? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Vectara.CompactionTraceSpan), + jsonSerializerContext) as global::Vectara.CompactionTraceSpan?; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Vectara.CompactionTraceSpan? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Vectara.CompactionTraceSpan), + jsonSerializerContext).ConfigureAwait(false)) as global::Vectara.CompactionTraceSpan?; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.CompactionTraceSpan.g.cs b/src/libs/Vectara/Generated/Vectara.Models.CompactionTraceSpan.g.cs new file mode 100644 index 00000000..65b80597 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.CompactionTraceSpan.g.cs @@ -0,0 +1,221 @@ +#pragma warning disable CS0618 // Type or member is obsolete + +#nullable enable + +namespace Vectara +{ + /// + /// A span representing context compaction (summarization of older conversation turns). + /// + public readonly partial struct CompactionTraceSpan : global::System.IEquatable + { + /// + /// Common properties shared by all agent trace span types. + /// +#if NET6_0_OR_GREATER + public global::Vectara.AgentTraceSpanBase? AgentBase { get; init; } +#else + public global::Vectara.AgentTraceSpanBase? AgentBase { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(AgentBase))] +#endif + public bool IsAgentBase => AgentBase != null; + + /// + /// + /// +#if NET6_0_OR_GREATER + public global::Vectara.CompactionTraceSpanVariant2? CompactionTraceSpanVariant2 { get; init; } +#else + public global::Vectara.CompactionTraceSpanVariant2? CompactionTraceSpanVariant2 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(CompactionTraceSpanVariant2))] +#endif + public bool IsCompactionTraceSpanVariant2 => CompactionTraceSpanVariant2 != null; + /// + /// + /// + public static implicit operator CompactionTraceSpan(global::Vectara.AgentTraceSpanBase value) => new CompactionTraceSpan((global::Vectara.AgentTraceSpanBase?)value); + + /// + /// + /// + public static implicit operator global::Vectara.AgentTraceSpanBase?(CompactionTraceSpan @this) => @this.AgentBase; + + /// + /// + /// + public CompactionTraceSpan(global::Vectara.AgentTraceSpanBase? value) + { + AgentBase = value; + } + + /// + /// + /// + public static implicit operator CompactionTraceSpan(global::Vectara.CompactionTraceSpanVariant2 value) => new CompactionTraceSpan((global::Vectara.CompactionTraceSpanVariant2?)value); + + /// + /// + /// + public static implicit operator global::Vectara.CompactionTraceSpanVariant2?(CompactionTraceSpan @this) => @this.CompactionTraceSpanVariant2; + + /// + /// + /// + public CompactionTraceSpan(global::Vectara.CompactionTraceSpanVariant2? value) + { + CompactionTraceSpanVariant2 = value; + } + + /// + /// + /// + public CompactionTraceSpan( + global::Vectara.AgentTraceSpanBase? agentBase, + global::Vectara.CompactionTraceSpanVariant2? compactionTraceSpanVariant2 + ) + { + AgentBase = agentBase; + CompactionTraceSpanVariant2 = compactionTraceSpanVariant2; + } + + /// + /// + /// + public object? Object => + CompactionTraceSpanVariant2 as object ?? + AgentBase as object + ; + + /// + /// + /// + public override string? ToString() => + AgentBase?.ToString() ?? + CompactionTraceSpanVariant2?.ToString() + ; + + /// + /// + /// + public bool Validate() + { + return IsAgentBase && IsCompactionTraceSpanVariant2; + } + + /// + /// + /// + public TResult? Match( + global::System.Func? agentBase = null, + global::System.Func? compactionTraceSpanVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsAgentBase && agentBase != null) + { + return agentBase(AgentBase!); + } + else if (IsCompactionTraceSpanVariant2 && compactionTraceSpanVariant2 != null) + { + return compactionTraceSpanVariant2(CompactionTraceSpanVariant2!); + } + + return default(TResult); + } + + /// + /// + /// + public void Match( + global::System.Action? agentBase = null, + global::System.Action? compactionTraceSpanVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsAgentBase) + { + agentBase?.Invoke(AgentBase!); + } + else if (IsCompactionTraceSpanVariant2) + { + compactionTraceSpanVariant2?.Invoke(CompactionTraceSpanVariant2!); + } + } + + /// + /// + /// + public override int GetHashCode() + { + var fields = new object?[] + { + AgentBase, + typeof(global::Vectara.AgentTraceSpanBase), + CompactionTraceSpanVariant2, + typeof(global::Vectara.CompactionTraceSpanVariant2), + }; + const int offset = unchecked((int)2166136261); + const int prime = 16777619; + static int HashCodeAggregator(int hashCode, object? value) => value == null + ? (hashCode ^ 0) * prime + : (hashCode ^ value.GetHashCode()) * prime; + + return global::System.Linq.Enumerable.Aggregate(fields, offset, HashCodeAggregator); + } + + /// + /// + /// + public bool Equals(CompactionTraceSpan other) + { + return + global::System.Collections.Generic.EqualityComparer.Default.Equals(AgentBase, other.AgentBase) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(CompactionTraceSpanVariant2, other.CompactionTraceSpanVariant2) + ; + } + + /// + /// + /// + public static bool operator ==(CompactionTraceSpan obj1, CompactionTraceSpan obj2) + { + return global::System.Collections.Generic.EqualityComparer.Default.Equals(obj1, obj2); + } + + /// + /// + /// + public static bool operator !=(CompactionTraceSpan obj1, CompactionTraceSpan obj2) + { + return !(obj1 == obj2); + } + + /// + /// + /// + public override bool Equals(object? obj) + { + return obj is CompactionTraceSpan o && Equals(o); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.CompactionTraceSpanVariant2.Json.g.cs b/src/libs/Vectara/Generated/Vectara.Models.CompactionTraceSpanVariant2.Json.g.cs new file mode 100644 index 00000000..1826b02a --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.CompactionTraceSpanVariant2.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Vectara +{ + public sealed partial class CompactionTraceSpanVariant2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Vectara.CompactionTraceSpanVariant2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Vectara.CompactionTraceSpanVariant2), + jsonSerializerContext) as global::Vectara.CompactionTraceSpanVariant2; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Vectara.CompactionTraceSpanVariant2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Vectara.CompactionTraceSpanVariant2), + jsonSerializerContext).ConfigureAwait(false)) as global::Vectara.CompactionTraceSpanVariant2; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.CompactionTraceSpanVariant2.g.cs b/src/libs/Vectara/Generated/Vectara.Models.CompactionTraceSpanVariant2.g.cs new file mode 100644 index 00000000..4813edcc --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.CompactionTraceSpanVariant2.g.cs @@ -0,0 +1,75 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// + /// + public sealed partial class CompactionTraceSpanVariant2 + { + /// + /// The operation type for this span.
+ /// Default Value: compaction
+ /// Example: compaction + ///
+ /// "compaction" + /// compaction + [global::System.Text.Json.Serialization.JsonPropertyName("operation")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Operation { get; set; } = "compaction"; + + /// + /// Session event that this span was generated by. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("event_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string EventId { get; set; } + + /// + /// Attributes for a compaction span. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("attributes")] + public global::Vectara.CompactionSpanAttributes? Attributes { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The operation type for this span.
+ /// Default Value: compaction
+ /// Example: compaction + /// + /// + /// Session event that this span was generated by. + /// + /// + /// Attributes for a compaction span. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public CompactionTraceSpanVariant2( + string operation, + string eventId, + global::Vectara.CompactionSpanAttributes? attributes) + { + this.Operation = operation ?? throw new global::System.ArgumentNullException(nameof(operation)); + this.EventId = eventId ?? throw new global::System.ArgumentNullException(nameof(eventId)); + this.Attributes = attributes; + } + + /// + /// Initializes a new instance of the class. + /// + public CompactionTraceSpanVariant2() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.ConnectorConfiguration.Json.g.cs b/src/libs/Vectara/Generated/Vectara.Models.ConnectorConfiguration.Json.g.cs new file mode 100644 index 00000000..9ec27789 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.ConnectorConfiguration.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Vectara +{ + public readonly partial struct ConnectorConfiguration + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Vectara.ConnectorConfiguration? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Vectara.ConnectorConfiguration), + jsonSerializerContext) as global::Vectara.ConnectorConfiguration?; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Vectara.ConnectorConfiguration? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Vectara.ConnectorConfiguration), + jsonSerializerContext).ConfigureAwait(false)) as global::Vectara.ConnectorConfiguration?; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.ConnectorConfiguration.g.cs b/src/libs/Vectara/Generated/Vectara.Models.ConnectorConfiguration.g.cs new file mode 100644 index 00000000..8c94fc08 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.ConnectorConfiguration.g.cs @@ -0,0 +1,177 @@ +#pragma warning disable CS0618 // Type or member is obsolete + +#nullable enable + +namespace Vectara +{ + /// + /// Configuration for different types of connectors. + /// + public readonly partial struct ConnectorConfiguration : global::System.IEquatable + { + /// + /// + /// + public global::Vectara.ConnectorConfigurationDiscriminatorType? Type { get; } + + /// + /// Configuration for Slack connectors. + /// +#if NET6_0_OR_GREATER + public global::Vectara.SlackConnectorConfiguration? Slack { get; init; } +#else + public global::Vectara.SlackConnectorConfiguration? Slack { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Slack))] +#endif + public bool IsSlack => Slack != null; + /// + /// + /// + public static implicit operator ConnectorConfiguration(global::Vectara.SlackConnectorConfiguration value) => new ConnectorConfiguration((global::Vectara.SlackConnectorConfiguration?)value); + + /// + /// + /// + public static implicit operator global::Vectara.SlackConnectorConfiguration?(ConnectorConfiguration @this) => @this.Slack; + + /// + /// + /// + public ConnectorConfiguration(global::Vectara.SlackConnectorConfiguration? value) + { + Slack = value; + } + + /// + /// + /// + public ConnectorConfiguration( + global::Vectara.ConnectorConfigurationDiscriminatorType? type, + global::Vectara.SlackConnectorConfiguration? slack + ) + { + Type = type; + + Slack = slack; + } + + /// + /// + /// + public object? Object => + Slack as object + ; + + /// + /// + /// + public override string? ToString() => + Slack?.ToString() + ; + + /// + /// + /// + public bool Validate() + { + return IsSlack; + } + + /// + /// + /// + public TResult? Match( + global::System.Func? slack = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsSlack && slack != null) + { + return slack(Slack!); + } + + return default(TResult); + } + + /// + /// + /// + public void Match( + global::System.Action? slack = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsSlack) + { + slack?.Invoke(Slack!); + } + } + + /// + /// + /// + public override int GetHashCode() + { + var fields = new object?[] + { + Slack, + typeof(global::Vectara.SlackConnectorConfiguration), + }; + const int offset = unchecked((int)2166136261); + const int prime = 16777619; + static int HashCodeAggregator(int hashCode, object? value) => value == null + ? (hashCode ^ 0) * prime + : (hashCode ^ value.GetHashCode()) * prime; + + return global::System.Linq.Enumerable.Aggregate(fields, offset, HashCodeAggregator); + } + + /// + /// + /// + public bool Equals(ConnectorConfiguration other) + { + return + global::System.Collections.Generic.EqualityComparer.Default.Equals(Slack, other.Slack) + ; + } + + /// + /// + /// + public static bool operator ==(ConnectorConfiguration obj1, ConnectorConfiguration obj2) + { + return global::System.Collections.Generic.EqualityComparer.Default.Equals(obj1, obj2); + } + + /// + /// + /// + public static bool operator !=(ConnectorConfiguration obj1, ConnectorConfiguration obj2) + { + return !(obj1 == obj2); + } + + /// + /// + /// + public override bool Equals(object? obj) + { + return obj is ConnectorConfiguration o && Equals(o); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.ConnectorConfigurationDiscriminator.Json.g.cs b/src/libs/Vectara/Generated/Vectara.Models.ConnectorConfigurationDiscriminator.Json.g.cs new file mode 100644 index 00000000..72132058 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.ConnectorConfigurationDiscriminator.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Vectara +{ + public sealed partial class ConnectorConfigurationDiscriminator + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Vectara.ConnectorConfigurationDiscriminator? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Vectara.ConnectorConfigurationDiscriminator), + jsonSerializerContext) as global::Vectara.ConnectorConfigurationDiscriminator; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Vectara.ConnectorConfigurationDiscriminator? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Vectara.ConnectorConfigurationDiscriminator), + jsonSerializerContext).ConfigureAwait(false)) as global::Vectara.ConnectorConfigurationDiscriminator; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.ConnectorConfigurationDiscriminator.g.cs b/src/libs/Vectara/Generated/Vectara.Models.ConnectorConfigurationDiscriminator.g.cs new file mode 100644 index 00000000..8176f959 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.ConnectorConfigurationDiscriminator.g.cs @@ -0,0 +1,44 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// + /// + public sealed partial class ConnectorConfigurationDiscriminator + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Vectara.JsonConverters.ConnectorConfigurationDiscriminatorTypeJsonConverter))] + public global::Vectara.ConnectorConfigurationDiscriminatorType? Type { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ConnectorConfigurationDiscriminator( + global::Vectara.ConnectorConfigurationDiscriminatorType? type) + { + this.Type = type; + } + + /// + /// Initializes a new instance of the class. + /// + public ConnectorConfigurationDiscriminator() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.ConnectorConfigurationDiscriminatorType.g.cs b/src/libs/Vectara/Generated/Vectara.Models.ConnectorConfigurationDiscriminatorType.g.cs new file mode 100644 index 00000000..f88f198f --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.ConnectorConfigurationDiscriminatorType.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// + /// + public enum ConnectorConfigurationDiscriminatorType + { + /// + /// + /// + Slack, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class ConnectorConfigurationDiscriminatorTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this ConnectorConfigurationDiscriminatorType value) + { + return value switch + { + ConnectorConfigurationDiscriminatorType.Slack => "slack", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static ConnectorConfigurationDiscriminatorType? ToEnum(string value) + { + return value switch + { + "slack" => ConnectorConfigurationDiscriminatorType.Slack, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.CreateAgentConnectorRequest.Json.g.cs b/src/libs/Vectara/Generated/Vectara.Models.CreateAgentConnectorRequest.Json.g.cs new file mode 100644 index 00000000..2f6cfad8 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.CreateAgentConnectorRequest.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Vectara +{ + public sealed partial class CreateAgentConnectorRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Vectara.CreateAgentConnectorRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Vectara.CreateAgentConnectorRequest), + jsonSerializerContext) as global::Vectara.CreateAgentConnectorRequest; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Vectara.CreateAgentConnectorRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Vectara.CreateAgentConnectorRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Vectara.CreateAgentConnectorRequest; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.CreateAgentConnectorRequest.g.cs b/src/libs/Vectara/Generated/Vectara.Models.CreateAgentConnectorRequest.g.cs new file mode 100644 index 00000000..4981045c --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.CreateAgentConnectorRequest.g.cs @@ -0,0 +1,122 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// Request object for creating a new agent connector. + /// + public sealed partial class CreateAgentConnectorRequest + { + /// + /// The human-readable name of the connector.
+ /// Example: Customer Support Slack Channel + ///
+ /// Customer Support Slack Channel + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// A detailed description of what this connector does.
+ /// Example: Receives customer support messages from the + ///
+ /// Receives customer support messages from the + [global::System.Text.Json.Serialization.JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// The type of connector.
+ /// Example: slack + ///
+ /// slack + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Vectara.JsonConverters.CreateAgentConnectorRequestTypeJsonConverter))] + public global::Vectara.CreateAgentConnectorRequestType Type { get; set; } + + /// + /// Arbitrary metadata associated with the connector.
+ /// Default Value: {}
+ /// Example: {"priority":"high","department":"customer_service"} + ///
+ /// {"priority":"high","department":"customer_service"} + [global::System.Text.Json.Serialization.JsonPropertyName("metadata")] + public object? Metadata { get; set; } + + /// + /// Whether the connector should be enabled upon creation.
+ /// Default Value: true
+ /// Example: true + ///
+ /// true + [global::System.Text.Json.Serialization.JsonPropertyName("enabled")] + public bool? Enabled { get; set; } + + /// + /// Configuration for different types of connectors. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("configuration")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Vectara.SlackConnectorConfiguration Configuration { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The human-readable name of the connector.
+ /// Example: Customer Support Slack Channel + /// + /// + /// Configuration for different types of connectors. + /// + /// + /// A detailed description of what this connector does.
+ /// Example: Receives customer support messages from the + /// + /// + /// The type of connector.
+ /// Example: slack + /// + /// + /// Arbitrary metadata associated with the connector.
+ /// Default Value: {}
+ /// Example: {"priority":"high","department":"customer_service"} + /// + /// + /// Whether the connector should be enabled upon creation.
+ /// Default Value: true
+ /// Example: true + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public CreateAgentConnectorRequest( + string name, + global::Vectara.SlackConnectorConfiguration configuration, + string? description, + global::Vectara.CreateAgentConnectorRequestType type, + object? metadata, + bool? enabled) + { + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.Description = description; + this.Type = type; + this.Metadata = metadata; + this.Enabled = enabled; + this.Configuration = configuration ?? throw new global::System.ArgumentNullException(nameof(configuration)); + } + + /// + /// Initializes a new instance of the class. + /// + public CreateAgentConnectorRequest() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.CreateAgentConnectorRequestMetadata.Json.g.cs b/src/libs/Vectara/Generated/Vectara.Models.CreateAgentConnectorRequestMetadata.Json.g.cs new file mode 100644 index 00000000..b7a95b3a --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.CreateAgentConnectorRequestMetadata.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Vectara +{ + public sealed partial class CreateAgentConnectorRequestMetadata + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Vectara.CreateAgentConnectorRequestMetadata? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Vectara.CreateAgentConnectorRequestMetadata), + jsonSerializerContext) as global::Vectara.CreateAgentConnectorRequestMetadata; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Vectara.CreateAgentConnectorRequestMetadata? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Vectara.CreateAgentConnectorRequestMetadata), + jsonSerializerContext).ConfigureAwait(false)) as global::Vectara.CreateAgentConnectorRequestMetadata; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.CreateAgentConnectorRequestMetadata.g.cs b/src/libs/Vectara/Generated/Vectara.Models.CreateAgentConnectorRequestMetadata.g.cs new file mode 100644 index 00000000..550a9edf --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.CreateAgentConnectorRequestMetadata.g.cs @@ -0,0 +1,20 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// Arbitrary metadata associated with the connector.
+ /// Default Value: {}
+ /// Example: {"priority":"high","department":"customer_service"} + ///
+ public sealed partial class CreateAgentConnectorRequestMetadata + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.CreateAgentConnectorRequestType.g.cs b/src/libs/Vectara/Generated/Vectara.Models.CreateAgentConnectorRequestType.g.cs new file mode 100644 index 00000000..f354f7d8 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.CreateAgentConnectorRequestType.g.cs @@ -0,0 +1,46 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// The type of connector.
+ /// Example: slack + ///
+ public enum CreateAgentConnectorRequestType + { + /// + /// + /// + Slack, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class CreateAgentConnectorRequestTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this CreateAgentConnectorRequestType value) + { + return value switch + { + CreateAgentConnectorRequestType.Slack => "slack", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static CreateAgentConnectorRequestType? ToEnum(string value) + { + return value switch + { + "slack" => CreateAgentConnectorRequestType.Slack, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.ExecuteToolSpanAttributes.Json.g.cs b/src/libs/Vectara/Generated/Vectara.Models.ExecuteToolSpanAttributes.Json.g.cs new file mode 100644 index 00000000..9bf02328 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.ExecuteToolSpanAttributes.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Vectara +{ + public sealed partial class ExecuteToolSpanAttributes + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Vectara.ExecuteToolSpanAttributes? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Vectara.ExecuteToolSpanAttributes), + jsonSerializerContext) as global::Vectara.ExecuteToolSpanAttributes; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Vectara.ExecuteToolSpanAttributes? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Vectara.ExecuteToolSpanAttributes), + jsonSerializerContext).ConfigureAwait(false)) as global::Vectara.ExecuteToolSpanAttributes; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.ExecuteToolSpanAttributes.g.cs b/src/libs/Vectara/Generated/Vectara.Models.ExecuteToolSpanAttributes.g.cs new file mode 100644 index 00000000..3d1dd0e1 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.ExecuteToolSpanAttributes.g.cs @@ -0,0 +1,111 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// Attributes for an execute_tool span. + /// + public sealed partial class ExecuteToolSpanAttributes + { + /// + /// The name of the tool called. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("tool_name")] + public string? ToolName { get; set; } + + /// + /// The configuration key of the tool called. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("tool_key")] + public string? ToolKey { get; set; } + + /// + /// The LLM-assigned tool call identifier. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("tool_call_id")] + public string? ToolCallId { get; set; } + + /// + /// The type of the tool (e.g. corpora_search, web_search). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("tool_type")] + public string? ToolType { get; set; } + + /// + /// The event ID for the tool input. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("tool_input_event_id")] + public string? ToolInputEventId { get; set; } + + /// + /// The event ID for the tool output. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("tool_output_event_id")] + public string? ToolOutputEventId { get; set; } + + /// + /// Corpus keys accessed by the tool. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("corpus_keys")] + public global::System.Collections.Generic.IList? CorpusKeys { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The name of the tool called. + /// + /// + /// The configuration key of the tool called. + /// + /// + /// The LLM-assigned tool call identifier. + /// + /// + /// The type of the tool (e.g. corpora_search, web_search). + /// + /// + /// The event ID for the tool input. + /// + /// + /// The event ID for the tool output. + /// + /// + /// Corpus keys accessed by the tool. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ExecuteToolSpanAttributes( + string? toolName, + string? toolKey, + string? toolCallId, + string? toolType, + string? toolInputEventId, + string? toolOutputEventId, + global::System.Collections.Generic.IList? corpusKeys) + { + this.ToolName = toolName; + this.ToolKey = toolKey; + this.ToolCallId = toolCallId; + this.ToolType = toolType; + this.ToolInputEventId = toolInputEventId; + this.ToolOutputEventId = toolOutputEventId; + this.CorpusKeys = corpusKeys; + } + + /// + /// Initializes a new instance of the class. + /// + public ExecuteToolSpanAttributes() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.ExecuteToolSpanContent.Json.g.cs b/src/libs/Vectara/Generated/Vectara.Models.ExecuteToolSpanContent.Json.g.cs new file mode 100644 index 00000000..a13f6eb2 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.ExecuteToolSpanContent.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Vectara +{ + public sealed partial class ExecuteToolSpanContent + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Vectara.ExecuteToolSpanContent? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Vectara.ExecuteToolSpanContent), + jsonSerializerContext) as global::Vectara.ExecuteToolSpanContent; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Vectara.ExecuteToolSpanContent? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Vectara.ExecuteToolSpanContent), + jsonSerializerContext).ConfigureAwait(false)) as global::Vectara.ExecuteToolSpanContent; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.ExecuteToolSpanContent.g.cs b/src/libs/Vectara/Generated/Vectara.Models.ExecuteToolSpanContent.g.cs new file mode 100644 index 00000000..9772142d --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.ExecuteToolSpanContent.g.cs @@ -0,0 +1,56 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// Decrypted content of an execute_tool span. + /// + public sealed partial class ExecuteToolSpanContent + { + /// + /// Arguments passed to the tool call. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("tool_arguments")] + public string? ToolArguments { get; set; } + + /// + /// Result returned by the tool call. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("tool_result")] + public string? ToolResult { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Arguments passed to the tool call. + /// + /// + /// Result returned by the tool call. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ExecuteToolSpanContent( + string? toolArguments, + string? toolResult) + { + this.ToolArguments = toolArguments; + this.ToolResult = toolResult; + } + + /// + /// Initializes a new instance of the class. + /// + public ExecuteToolSpanContent() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.ExecuteToolTraceSpan.Json.g.cs b/src/libs/Vectara/Generated/Vectara.Models.ExecuteToolTraceSpan.Json.g.cs new file mode 100644 index 00000000..04fd9466 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.ExecuteToolTraceSpan.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Vectara +{ + public readonly partial struct ExecuteToolTraceSpan + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Vectara.ExecuteToolTraceSpan? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Vectara.ExecuteToolTraceSpan), + jsonSerializerContext) as global::Vectara.ExecuteToolTraceSpan?; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Vectara.ExecuteToolTraceSpan? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Vectara.ExecuteToolTraceSpan), + jsonSerializerContext).ConfigureAwait(false)) as global::Vectara.ExecuteToolTraceSpan?; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.ExecuteToolTraceSpan.g.cs b/src/libs/Vectara/Generated/Vectara.Models.ExecuteToolTraceSpan.g.cs new file mode 100644 index 00000000..35c8b3b1 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.ExecuteToolTraceSpan.g.cs @@ -0,0 +1,221 @@ +#pragma warning disable CS0618 // Type or member is obsolete + +#nullable enable + +namespace Vectara +{ + /// + /// A span representing a tool execution within an agent turn. + /// + public readonly partial struct ExecuteToolTraceSpan : global::System.IEquatable + { + /// + /// Common properties shared by all agent trace span types. + /// +#if NET6_0_OR_GREATER + public global::Vectara.AgentTraceSpanBase? AgentBase { get; init; } +#else + public global::Vectara.AgentTraceSpanBase? AgentBase { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(AgentBase))] +#endif + public bool IsAgentBase => AgentBase != null; + + /// + /// + /// +#if NET6_0_OR_GREATER + public global::Vectara.ExecuteToolTraceSpanVariant2? ExecuteToolTraceSpanVariant2 { get; init; } +#else + public global::Vectara.ExecuteToolTraceSpanVariant2? ExecuteToolTraceSpanVariant2 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ExecuteToolTraceSpanVariant2))] +#endif + public bool IsExecuteToolTraceSpanVariant2 => ExecuteToolTraceSpanVariant2 != null; + /// + /// + /// + public static implicit operator ExecuteToolTraceSpan(global::Vectara.AgentTraceSpanBase value) => new ExecuteToolTraceSpan((global::Vectara.AgentTraceSpanBase?)value); + + /// + /// + /// + public static implicit operator global::Vectara.AgentTraceSpanBase?(ExecuteToolTraceSpan @this) => @this.AgentBase; + + /// + /// + /// + public ExecuteToolTraceSpan(global::Vectara.AgentTraceSpanBase? value) + { + AgentBase = value; + } + + /// + /// + /// + public static implicit operator ExecuteToolTraceSpan(global::Vectara.ExecuteToolTraceSpanVariant2 value) => new ExecuteToolTraceSpan((global::Vectara.ExecuteToolTraceSpanVariant2?)value); + + /// + /// + /// + public static implicit operator global::Vectara.ExecuteToolTraceSpanVariant2?(ExecuteToolTraceSpan @this) => @this.ExecuteToolTraceSpanVariant2; + + /// + /// + /// + public ExecuteToolTraceSpan(global::Vectara.ExecuteToolTraceSpanVariant2? value) + { + ExecuteToolTraceSpanVariant2 = value; + } + + /// + /// + /// + public ExecuteToolTraceSpan( + global::Vectara.AgentTraceSpanBase? agentBase, + global::Vectara.ExecuteToolTraceSpanVariant2? executeToolTraceSpanVariant2 + ) + { + AgentBase = agentBase; + ExecuteToolTraceSpanVariant2 = executeToolTraceSpanVariant2; + } + + /// + /// + /// + public object? Object => + ExecuteToolTraceSpanVariant2 as object ?? + AgentBase as object + ; + + /// + /// + /// + public override string? ToString() => + AgentBase?.ToString() ?? + ExecuteToolTraceSpanVariant2?.ToString() + ; + + /// + /// + /// + public bool Validate() + { + return IsAgentBase && IsExecuteToolTraceSpanVariant2; + } + + /// + /// + /// + public TResult? Match( + global::System.Func? agentBase = null, + global::System.Func? executeToolTraceSpanVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsAgentBase && agentBase != null) + { + return agentBase(AgentBase!); + } + else if (IsExecuteToolTraceSpanVariant2 && executeToolTraceSpanVariant2 != null) + { + return executeToolTraceSpanVariant2(ExecuteToolTraceSpanVariant2!); + } + + return default(TResult); + } + + /// + /// + /// + public void Match( + global::System.Action? agentBase = null, + global::System.Action? executeToolTraceSpanVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsAgentBase) + { + agentBase?.Invoke(AgentBase!); + } + else if (IsExecuteToolTraceSpanVariant2) + { + executeToolTraceSpanVariant2?.Invoke(ExecuteToolTraceSpanVariant2!); + } + } + + /// + /// + /// + public override int GetHashCode() + { + var fields = new object?[] + { + AgentBase, + typeof(global::Vectara.AgentTraceSpanBase), + ExecuteToolTraceSpanVariant2, + typeof(global::Vectara.ExecuteToolTraceSpanVariant2), + }; + const int offset = unchecked((int)2166136261); + const int prime = 16777619; + static int HashCodeAggregator(int hashCode, object? value) => value == null + ? (hashCode ^ 0) * prime + : (hashCode ^ value.GetHashCode()) * prime; + + return global::System.Linq.Enumerable.Aggregate(fields, offset, HashCodeAggregator); + } + + /// + /// + /// + public bool Equals(ExecuteToolTraceSpan other) + { + return + global::System.Collections.Generic.EqualityComparer.Default.Equals(AgentBase, other.AgentBase) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(ExecuteToolTraceSpanVariant2, other.ExecuteToolTraceSpanVariant2) + ; + } + + /// + /// + /// + public static bool operator ==(ExecuteToolTraceSpan obj1, ExecuteToolTraceSpan obj2) + { + return global::System.Collections.Generic.EqualityComparer.Default.Equals(obj1, obj2); + } + + /// + /// + /// + public static bool operator !=(ExecuteToolTraceSpan obj1, ExecuteToolTraceSpan obj2) + { + return !(obj1 == obj2); + } + + /// + /// + /// + public override bool Equals(object? obj) + { + return obj is ExecuteToolTraceSpan o && Equals(o); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.ExecuteToolTraceSpanVariant2.Json.g.cs b/src/libs/Vectara/Generated/Vectara.Models.ExecuteToolTraceSpanVariant2.Json.g.cs new file mode 100644 index 00000000..0f65934e --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.ExecuteToolTraceSpanVariant2.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Vectara +{ + public sealed partial class ExecuteToolTraceSpanVariant2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Vectara.ExecuteToolTraceSpanVariant2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Vectara.ExecuteToolTraceSpanVariant2), + jsonSerializerContext) as global::Vectara.ExecuteToolTraceSpanVariant2; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Vectara.ExecuteToolTraceSpanVariant2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Vectara.ExecuteToolTraceSpanVariant2), + jsonSerializerContext).ConfigureAwait(false)) as global::Vectara.ExecuteToolTraceSpanVariant2; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.ExecuteToolTraceSpanVariant2.g.cs b/src/libs/Vectara/Generated/Vectara.Models.ExecuteToolTraceSpanVariant2.g.cs new file mode 100644 index 00000000..1fa8a044 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.ExecuteToolTraceSpanVariant2.g.cs @@ -0,0 +1,74 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// + /// + public sealed partial class ExecuteToolTraceSpanVariant2 + { + /// + /// The operation type for this span.
+ /// Default Value: execute_tool
+ /// Example: execute_tool + ///
+ /// "execute_tool" + /// execute_tool + [global::System.Text.Json.Serialization.JsonPropertyName("operation")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Operation { get; set; } = "execute_tool"; + + /// + /// Attributes for an execute_tool span. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("attributes")] + public global::Vectara.ExecuteToolSpanAttributes? Attributes { get; set; } + + /// + /// Span content, only included when include_content=true is requested. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("content")] + public global::Vectara.ExecuteToolSpanContent? Content { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The operation type for this span.
+ /// Default Value: execute_tool
+ /// Example: execute_tool + /// + /// + /// Attributes for an execute_tool span. + /// + /// + /// Span content, only included when include_content=true is requested. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ExecuteToolTraceSpanVariant2( + string operation, + global::Vectara.ExecuteToolSpanAttributes? attributes, + global::Vectara.ExecuteToolSpanContent? content) + { + this.Operation = operation ?? throw new global::System.ArgumentNullException(nameof(operation)); + this.Attributes = attributes; + this.Content = content; + } + + /// + /// Initializes a new instance of the class. + /// + public ExecuteToolTraceSpanVariant2() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.GuardrailSpanAttributes.Json.g.cs b/src/libs/Vectara/Generated/Vectara.Models.GuardrailSpanAttributes.Json.g.cs new file mode 100644 index 00000000..882149d8 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.GuardrailSpanAttributes.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Vectara +{ + public sealed partial class GuardrailSpanAttributes + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Vectara.GuardrailSpanAttributes? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Vectara.GuardrailSpanAttributes), + jsonSerializerContext) as global::Vectara.GuardrailSpanAttributes; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Vectara.GuardrailSpanAttributes? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Vectara.GuardrailSpanAttributes), + jsonSerializerContext).ConfigureAwait(false)) as global::Vectara.GuardrailSpanAttributes; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.GuardrailSpanAttributes.g.cs b/src/libs/Vectara/Generated/Vectara.Models.GuardrailSpanAttributes.g.cs new file mode 100644 index 00000000..10efedba --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.GuardrailSpanAttributes.g.cs @@ -0,0 +1,56 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// Attributes for a guardrail span. + /// + public sealed partial class GuardrailSpanAttributes + { + /// + /// Whether the guardrail check passed. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("guardrail_passed")] + public bool? GuardrailPassed { get; set; } + + /// + /// The retry attempt number, if this span was retried. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("retry_attempt")] + public int? RetryAttempt { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Whether the guardrail check passed. + /// + /// + /// The retry attempt number, if this span was retried. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public GuardrailSpanAttributes( + bool? guardrailPassed, + int? retryAttempt) + { + this.GuardrailPassed = guardrailPassed; + this.RetryAttempt = retryAttempt; + } + + /// + /// Initializes a new instance of the class. + /// + public GuardrailSpanAttributes() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.GuardrailSpanContent.Json.g.cs b/src/libs/Vectara/Generated/Vectara.Models.GuardrailSpanContent.Json.g.cs new file mode 100644 index 00000000..3327e909 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.GuardrailSpanContent.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Vectara +{ + public sealed partial class GuardrailSpanContent + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Vectara.GuardrailSpanContent? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Vectara.GuardrailSpanContent), + jsonSerializerContext) as global::Vectara.GuardrailSpanContent; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Vectara.GuardrailSpanContent? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Vectara.GuardrailSpanContent), + jsonSerializerContext).ConfigureAwait(false)) as global::Vectara.GuardrailSpanContent; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.GuardrailSpanContent.g.cs b/src/libs/Vectara/Generated/Vectara.Models.GuardrailSpanContent.g.cs new file mode 100644 index 00000000..0941d584 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.GuardrailSpanContent.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// Decrypted content of a guardrail span. + /// + public sealed partial class GuardrailSpanContent + { + /// + /// Details of guardrail violations found, if any. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("guardrail_issues")] + public string? GuardrailIssues { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Details of guardrail violations found, if any. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public GuardrailSpanContent( + string? guardrailIssues) + { + this.GuardrailIssues = guardrailIssues; + } + + /// + /// Initializes a new instance of the class. + /// + public GuardrailSpanContent() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.GuardrailTraceSpan.Json.g.cs b/src/libs/Vectara/Generated/Vectara.Models.GuardrailTraceSpan.Json.g.cs new file mode 100644 index 00000000..cc9796c3 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.GuardrailTraceSpan.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Vectara +{ + public readonly partial struct GuardrailTraceSpan + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Vectara.GuardrailTraceSpan? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Vectara.GuardrailTraceSpan), + jsonSerializerContext) as global::Vectara.GuardrailTraceSpan?; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Vectara.GuardrailTraceSpan? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Vectara.GuardrailTraceSpan), + jsonSerializerContext).ConfigureAwait(false)) as global::Vectara.GuardrailTraceSpan?; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.GuardrailTraceSpan.g.cs b/src/libs/Vectara/Generated/Vectara.Models.GuardrailTraceSpan.g.cs new file mode 100644 index 00000000..6fad6550 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.GuardrailTraceSpan.g.cs @@ -0,0 +1,221 @@ +#pragma warning disable CS0618 // Type or member is obsolete + +#nullable enable + +namespace Vectara +{ + /// + /// A span representing a guardrail safety check on tool call results. + /// + public readonly partial struct GuardrailTraceSpan : global::System.IEquatable + { + /// + /// Common properties shared by all agent trace span types. + /// +#if NET6_0_OR_GREATER + public global::Vectara.AgentTraceSpanBase? AgentBase { get; init; } +#else + public global::Vectara.AgentTraceSpanBase? AgentBase { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(AgentBase))] +#endif + public bool IsAgentBase => AgentBase != null; + + /// + /// + /// +#if NET6_0_OR_GREATER + public global::Vectara.GuardrailTraceSpanVariant2? GuardrailTraceSpanVariant2 { get; init; } +#else + public global::Vectara.GuardrailTraceSpanVariant2? GuardrailTraceSpanVariant2 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(GuardrailTraceSpanVariant2))] +#endif + public bool IsGuardrailTraceSpanVariant2 => GuardrailTraceSpanVariant2 != null; + /// + /// + /// + public static implicit operator GuardrailTraceSpan(global::Vectara.AgentTraceSpanBase value) => new GuardrailTraceSpan((global::Vectara.AgentTraceSpanBase?)value); + + /// + /// + /// + public static implicit operator global::Vectara.AgentTraceSpanBase?(GuardrailTraceSpan @this) => @this.AgentBase; + + /// + /// + /// + public GuardrailTraceSpan(global::Vectara.AgentTraceSpanBase? value) + { + AgentBase = value; + } + + /// + /// + /// + public static implicit operator GuardrailTraceSpan(global::Vectara.GuardrailTraceSpanVariant2 value) => new GuardrailTraceSpan((global::Vectara.GuardrailTraceSpanVariant2?)value); + + /// + /// + /// + public static implicit operator global::Vectara.GuardrailTraceSpanVariant2?(GuardrailTraceSpan @this) => @this.GuardrailTraceSpanVariant2; + + /// + /// + /// + public GuardrailTraceSpan(global::Vectara.GuardrailTraceSpanVariant2? value) + { + GuardrailTraceSpanVariant2 = value; + } + + /// + /// + /// + public GuardrailTraceSpan( + global::Vectara.AgentTraceSpanBase? agentBase, + global::Vectara.GuardrailTraceSpanVariant2? guardrailTraceSpanVariant2 + ) + { + AgentBase = agentBase; + GuardrailTraceSpanVariant2 = guardrailTraceSpanVariant2; + } + + /// + /// + /// + public object? Object => + GuardrailTraceSpanVariant2 as object ?? + AgentBase as object + ; + + /// + /// + /// + public override string? ToString() => + AgentBase?.ToString() ?? + GuardrailTraceSpanVariant2?.ToString() + ; + + /// + /// + /// + public bool Validate() + { + return IsAgentBase && IsGuardrailTraceSpanVariant2; + } + + /// + /// + /// + public TResult? Match( + global::System.Func? agentBase = null, + global::System.Func? guardrailTraceSpanVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsAgentBase && agentBase != null) + { + return agentBase(AgentBase!); + } + else if (IsGuardrailTraceSpanVariant2 && guardrailTraceSpanVariant2 != null) + { + return guardrailTraceSpanVariant2(GuardrailTraceSpanVariant2!); + } + + return default(TResult); + } + + /// + /// + /// + public void Match( + global::System.Action? agentBase = null, + global::System.Action? guardrailTraceSpanVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsAgentBase) + { + agentBase?.Invoke(AgentBase!); + } + else if (IsGuardrailTraceSpanVariant2) + { + guardrailTraceSpanVariant2?.Invoke(GuardrailTraceSpanVariant2!); + } + } + + /// + /// + /// + public override int GetHashCode() + { + var fields = new object?[] + { + AgentBase, + typeof(global::Vectara.AgentTraceSpanBase), + GuardrailTraceSpanVariant2, + typeof(global::Vectara.GuardrailTraceSpanVariant2), + }; + const int offset = unchecked((int)2166136261); + const int prime = 16777619; + static int HashCodeAggregator(int hashCode, object? value) => value == null + ? (hashCode ^ 0) * prime + : (hashCode ^ value.GetHashCode()) * prime; + + return global::System.Linq.Enumerable.Aggregate(fields, offset, HashCodeAggregator); + } + + /// + /// + /// + public bool Equals(GuardrailTraceSpan other) + { + return + global::System.Collections.Generic.EqualityComparer.Default.Equals(AgentBase, other.AgentBase) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(GuardrailTraceSpanVariant2, other.GuardrailTraceSpanVariant2) + ; + } + + /// + /// + /// + public static bool operator ==(GuardrailTraceSpan obj1, GuardrailTraceSpan obj2) + { + return global::System.Collections.Generic.EqualityComparer.Default.Equals(obj1, obj2); + } + + /// + /// + /// + public static bool operator !=(GuardrailTraceSpan obj1, GuardrailTraceSpan obj2) + { + return !(obj1 == obj2); + } + + /// + /// + /// + public override bool Equals(object? obj) + { + return obj is GuardrailTraceSpan o && Equals(o); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.GuardrailTraceSpanVariant2.Json.g.cs b/src/libs/Vectara/Generated/Vectara.Models.GuardrailTraceSpanVariant2.Json.g.cs new file mode 100644 index 00000000..bc401de9 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.GuardrailTraceSpanVariant2.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Vectara +{ + public sealed partial class GuardrailTraceSpanVariant2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Vectara.GuardrailTraceSpanVariant2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Vectara.GuardrailTraceSpanVariant2), + jsonSerializerContext) as global::Vectara.GuardrailTraceSpanVariant2; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Vectara.GuardrailTraceSpanVariant2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Vectara.GuardrailTraceSpanVariant2), + jsonSerializerContext).ConfigureAwait(false)) as global::Vectara.GuardrailTraceSpanVariant2; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.GuardrailTraceSpanVariant2.g.cs b/src/libs/Vectara/Generated/Vectara.Models.GuardrailTraceSpanVariant2.g.cs new file mode 100644 index 00000000..0227005e --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.GuardrailTraceSpanVariant2.g.cs @@ -0,0 +1,74 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// + /// + public sealed partial class GuardrailTraceSpanVariant2 + { + /// + /// The operation type for this span.
+ /// Default Value: guardrail
+ /// Example: guardrail + ///
+ /// "guardrail" + /// guardrail + [global::System.Text.Json.Serialization.JsonPropertyName("operation")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Operation { get; set; } = "guardrail"; + + /// + /// Attributes for a guardrail span. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("attributes")] + public global::Vectara.GuardrailSpanAttributes? Attributes { get; set; } + + /// + /// Span content, only included when include_content=true is requested. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("content")] + public global::Vectara.GuardrailSpanContent? Content { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The operation type for this span.
+ /// Default Value: guardrail
+ /// Example: guardrail + /// + /// + /// Attributes for a guardrail span. + /// + /// + /// Span content, only included when include_content=true is requested. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public GuardrailTraceSpanVariant2( + string operation, + global::Vectara.GuardrailSpanAttributes? attributes, + global::Vectara.GuardrailSpanContent? content) + { + this.Operation = operation ?? throw new global::System.ArgumentNullException(nameof(operation)); + this.Attributes = attributes; + this.Content = content; + } + + /// + /// Initializes a new instance of the class. + /// + public GuardrailTraceSpanVariant2() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.ImageReadSpanAttributes.Json.g.cs b/src/libs/Vectara/Generated/Vectara.Models.ImageReadSpanAttributes.Json.g.cs new file mode 100644 index 00000000..05582a10 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.ImageReadSpanAttributes.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Vectara +{ + public sealed partial class ImageReadSpanAttributes + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Vectara.ImageReadSpanAttributes? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Vectara.ImageReadSpanAttributes), + jsonSerializerContext) as global::Vectara.ImageReadSpanAttributes; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Vectara.ImageReadSpanAttributes? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Vectara.ImageReadSpanAttributes), + jsonSerializerContext).ConfigureAwait(false)) as global::Vectara.ImageReadSpanAttributes; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.ImageReadSpanAttributes.g.cs b/src/libs/Vectara/Generated/Vectara.Models.ImageReadSpanAttributes.g.cs new file mode 100644 index 00000000..b47ce8a1 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.ImageReadSpanAttributes.g.cs @@ -0,0 +1,56 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// Attributes for an image_read span. + /// + public sealed partial class ImageReadSpanAttributes + { + /// + /// The ID of the image artifact being loaded. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("artifact_id")] + public string? ArtifactId { get; set; } + + /// + /// The detail level used for image processing. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("detail")] + public string? Detail { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The ID of the image artifact being loaded. + /// + /// + /// The detail level used for image processing. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ImageReadSpanAttributes( + string? artifactId, + string? detail) + { + this.ArtifactId = artifactId; + this.Detail = detail; + } + + /// + /// Initializes a new instance of the class. + /// + public ImageReadSpanAttributes() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.ImageReadTraceSpan.Json.g.cs b/src/libs/Vectara/Generated/Vectara.Models.ImageReadTraceSpan.Json.g.cs new file mode 100644 index 00000000..f1fe8001 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.ImageReadTraceSpan.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Vectara +{ + public readonly partial struct ImageReadTraceSpan + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Vectara.ImageReadTraceSpan? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Vectara.ImageReadTraceSpan), + jsonSerializerContext) as global::Vectara.ImageReadTraceSpan?; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Vectara.ImageReadTraceSpan? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Vectara.ImageReadTraceSpan), + jsonSerializerContext).ConfigureAwait(false)) as global::Vectara.ImageReadTraceSpan?; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.ImageReadTraceSpan.g.cs b/src/libs/Vectara/Generated/Vectara.Models.ImageReadTraceSpan.g.cs new file mode 100644 index 00000000..3f708e70 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.ImageReadTraceSpan.g.cs @@ -0,0 +1,221 @@ +#pragma warning disable CS0618 // Type or member is obsolete + +#nullable enable + +namespace Vectara +{ + /// + /// A span representing an image being loaded into conversation context. + /// + public readonly partial struct ImageReadTraceSpan : global::System.IEquatable + { + /// + /// Common properties shared by all agent trace span types. + /// +#if NET6_0_OR_GREATER + public global::Vectara.AgentTraceSpanBase? AgentBase { get; init; } +#else + public global::Vectara.AgentTraceSpanBase? AgentBase { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(AgentBase))] +#endif + public bool IsAgentBase => AgentBase != null; + + /// + /// + /// +#if NET6_0_OR_GREATER + public global::Vectara.ImageReadTraceSpanVariant2? ImageReadTraceSpanVariant2 { get; init; } +#else + public global::Vectara.ImageReadTraceSpanVariant2? ImageReadTraceSpanVariant2 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ImageReadTraceSpanVariant2))] +#endif + public bool IsImageReadTraceSpanVariant2 => ImageReadTraceSpanVariant2 != null; + /// + /// + /// + public static implicit operator ImageReadTraceSpan(global::Vectara.AgentTraceSpanBase value) => new ImageReadTraceSpan((global::Vectara.AgentTraceSpanBase?)value); + + /// + /// + /// + public static implicit operator global::Vectara.AgentTraceSpanBase?(ImageReadTraceSpan @this) => @this.AgentBase; + + /// + /// + /// + public ImageReadTraceSpan(global::Vectara.AgentTraceSpanBase? value) + { + AgentBase = value; + } + + /// + /// + /// + public static implicit operator ImageReadTraceSpan(global::Vectara.ImageReadTraceSpanVariant2 value) => new ImageReadTraceSpan((global::Vectara.ImageReadTraceSpanVariant2?)value); + + /// + /// + /// + public static implicit operator global::Vectara.ImageReadTraceSpanVariant2?(ImageReadTraceSpan @this) => @this.ImageReadTraceSpanVariant2; + + /// + /// + /// + public ImageReadTraceSpan(global::Vectara.ImageReadTraceSpanVariant2? value) + { + ImageReadTraceSpanVariant2 = value; + } + + /// + /// + /// + public ImageReadTraceSpan( + global::Vectara.AgentTraceSpanBase? agentBase, + global::Vectara.ImageReadTraceSpanVariant2? imageReadTraceSpanVariant2 + ) + { + AgentBase = agentBase; + ImageReadTraceSpanVariant2 = imageReadTraceSpanVariant2; + } + + /// + /// + /// + public object? Object => + ImageReadTraceSpanVariant2 as object ?? + AgentBase as object + ; + + /// + /// + /// + public override string? ToString() => + AgentBase?.ToString() ?? + ImageReadTraceSpanVariant2?.ToString() + ; + + /// + /// + /// + public bool Validate() + { + return IsAgentBase && IsImageReadTraceSpanVariant2; + } + + /// + /// + /// + public TResult? Match( + global::System.Func? agentBase = null, + global::System.Func? imageReadTraceSpanVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsAgentBase && agentBase != null) + { + return agentBase(AgentBase!); + } + else if (IsImageReadTraceSpanVariant2 && imageReadTraceSpanVariant2 != null) + { + return imageReadTraceSpanVariant2(ImageReadTraceSpanVariant2!); + } + + return default(TResult); + } + + /// + /// + /// + public void Match( + global::System.Action? agentBase = null, + global::System.Action? imageReadTraceSpanVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsAgentBase) + { + agentBase?.Invoke(AgentBase!); + } + else if (IsImageReadTraceSpanVariant2) + { + imageReadTraceSpanVariant2?.Invoke(ImageReadTraceSpanVariant2!); + } + } + + /// + /// + /// + public override int GetHashCode() + { + var fields = new object?[] + { + AgentBase, + typeof(global::Vectara.AgentTraceSpanBase), + ImageReadTraceSpanVariant2, + typeof(global::Vectara.ImageReadTraceSpanVariant2), + }; + const int offset = unchecked((int)2166136261); + const int prime = 16777619; + static int HashCodeAggregator(int hashCode, object? value) => value == null + ? (hashCode ^ 0) * prime + : (hashCode ^ value.GetHashCode()) * prime; + + return global::System.Linq.Enumerable.Aggregate(fields, offset, HashCodeAggregator); + } + + /// + /// + /// + public bool Equals(ImageReadTraceSpan other) + { + return + global::System.Collections.Generic.EqualityComparer.Default.Equals(AgentBase, other.AgentBase) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(ImageReadTraceSpanVariant2, other.ImageReadTraceSpanVariant2) + ; + } + + /// + /// + /// + public static bool operator ==(ImageReadTraceSpan obj1, ImageReadTraceSpan obj2) + { + return global::System.Collections.Generic.EqualityComparer.Default.Equals(obj1, obj2); + } + + /// + /// + /// + public static bool operator !=(ImageReadTraceSpan obj1, ImageReadTraceSpan obj2) + { + return !(obj1 == obj2); + } + + /// + /// + /// + public override bool Equals(object? obj) + { + return obj is ImageReadTraceSpan o && Equals(o); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.ImageReadTraceSpanVariant2.Json.g.cs b/src/libs/Vectara/Generated/Vectara.Models.ImageReadTraceSpanVariant2.Json.g.cs new file mode 100644 index 00000000..cfa404a1 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.ImageReadTraceSpanVariant2.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Vectara +{ + public sealed partial class ImageReadTraceSpanVariant2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Vectara.ImageReadTraceSpanVariant2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Vectara.ImageReadTraceSpanVariant2), + jsonSerializerContext) as global::Vectara.ImageReadTraceSpanVariant2; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Vectara.ImageReadTraceSpanVariant2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Vectara.ImageReadTraceSpanVariant2), + jsonSerializerContext).ConfigureAwait(false)) as global::Vectara.ImageReadTraceSpanVariant2; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.ImageReadTraceSpanVariant2.g.cs b/src/libs/Vectara/Generated/Vectara.Models.ImageReadTraceSpanVariant2.g.cs new file mode 100644 index 00000000..7808eac0 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.ImageReadTraceSpanVariant2.g.cs @@ -0,0 +1,75 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// + /// + public sealed partial class ImageReadTraceSpanVariant2 + { + /// + /// The operation type for this span.
+ /// Default Value: image_read
+ /// Example: image_read + ///
+ /// "image_read" + /// image_read + [global::System.Text.Json.Serialization.JsonPropertyName("operation")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Operation { get; set; } = "image_read"; + + /// + /// Session event that this span was generated by. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("event_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string EventId { get; set; } + + /// + /// Attributes for an image_read span. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("attributes")] + public global::Vectara.ImageReadSpanAttributes? Attributes { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The operation type for this span.
+ /// Default Value: image_read
+ /// Example: image_read + /// + /// + /// Session event that this span was generated by. + /// + /// + /// Attributes for an image_read span. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ImageReadTraceSpanVariant2( + string operation, + string eventId, + global::Vectara.ImageReadSpanAttributes? attributes) + { + this.Operation = operation ?? throw new global::System.ArgumentNullException(nameof(operation)); + this.EventId = eventId ?? throw new global::System.ArgumentNullException(nameof(eventId)); + this.Attributes = attributes; + } + + /// + /// Initializes a new instance of the class. + /// + public ImageReadTraceSpanVariant2() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.InlineArtifactCreateToolConfiguration.Json.g.cs b/src/libs/Vectara/Generated/Vectara.Models.InlineArtifactCreateToolConfiguration.Json.g.cs new file mode 100644 index 00000000..fcebef45 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.InlineArtifactCreateToolConfiguration.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Vectara +{ + public sealed partial class InlineArtifactCreateToolConfiguration + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Vectara.InlineArtifactCreateToolConfiguration? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Vectara.InlineArtifactCreateToolConfiguration), + jsonSerializerContext) as global::Vectara.InlineArtifactCreateToolConfiguration; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Vectara.InlineArtifactCreateToolConfiguration? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Vectara.InlineArtifactCreateToolConfiguration), + jsonSerializerContext).ConfigureAwait(false)) as global::Vectara.InlineArtifactCreateToolConfiguration; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.InlineArtifactCreateToolConfiguration.g.cs b/src/libs/Vectara/Generated/Vectara.Models.InlineArtifactCreateToolConfiguration.g.cs new file mode 100644 index 00000000..6874e8d7 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.InlineArtifactCreateToolConfiguration.g.cs @@ -0,0 +1,74 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// An artifact create tool configuration defined inline in the agent for creating artifacts on-the-fly from text or structured data content. + /// + public sealed partial class InlineArtifactCreateToolConfiguration + { + /// + /// The type of tool configuration, which is always 'artifact_create' for inline artifact create tool configurations.
+ /// Default Value: artifact_create + ///
+ /// "artifact_create" + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Type { get; set; } = "artifact_create"; + + /// + /// Velocity template for generating dynamic tool descriptions. When set, this template is rendered at runtime to produce the tool description.
+ /// Available Velocity variables:
+ /// - `$agent.name` - Agent name
+ /// - `$agent.metadata` - Agent metadata map
+ /// - `$session.key` - Session key
+ /// - `$session.metadata` - Session metadata map
+ /// - `$currentDate` - Current date/time in ISO 8601 format (e.g., "2025-10-24T15:30:45Z")
+ /// Example: "Search tool configured for agent $agent.name on $currentDate" + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("description_template")] + public string? DescriptionTemplate { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The type of tool configuration, which is always 'artifact_create' for inline artifact create tool configurations.
+ /// Default Value: artifact_create + /// + /// + /// Velocity template for generating dynamic tool descriptions. When set, this template is rendered at runtime to produce the tool description.
+ /// Available Velocity variables:
+ /// - `$agent.name` - Agent name
+ /// - `$agent.metadata` - Agent metadata map
+ /// - `$session.key` - Session key
+ /// - `$session.metadata` - Session metadata map
+ /// - `$currentDate` - Current date/time in ISO 8601 format (e.g., "2025-10-24T15:30:45Z")
+ /// Example: "Search tool configured for agent $agent.name on $currentDate" + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public InlineArtifactCreateToolConfiguration( + string type, + string? descriptionTemplate) + { + this.Type = type ?? throw new global::System.ArgumentNullException(nameof(type)); + this.DescriptionTemplate = descriptionTemplate; + } + + /// + /// Initializes a new instance of the class. + /// + public InlineArtifactCreateToolConfiguration() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.InvokeAgentSpanAttributes.Json.g.cs b/src/libs/Vectara/Generated/Vectara.Models.InvokeAgentSpanAttributes.Json.g.cs new file mode 100644 index 00000000..fc5affdc --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.InvokeAgentSpanAttributes.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Vectara +{ + public sealed partial class InvokeAgentSpanAttributes + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Vectara.InvokeAgentSpanAttributes? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Vectara.InvokeAgentSpanAttributes), + jsonSerializerContext) as global::Vectara.InvokeAgentSpanAttributes; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Vectara.InvokeAgentSpanAttributes? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Vectara.InvokeAgentSpanAttributes), + jsonSerializerContext).ConfigureAwait(false)) as global::Vectara.InvokeAgentSpanAttributes; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.InvokeAgentSpanAttributes.g.cs b/src/libs/Vectara/Generated/Vectara.Models.InvokeAgentSpanAttributes.g.cs new file mode 100644 index 00000000..2e74a88b --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.InvokeAgentSpanAttributes.g.cs @@ -0,0 +1,178 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// Attributes for an invoke_agent span. + /// + public sealed partial class InvokeAgentSpanAttributes + { + /// + /// The LLM model used in this invocation. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("model")] + public string? Model { get; set; } + + /// + /// Total input tokens consumed across all LLM calls in this invocation. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("input_tokens")] + public long? InputTokens { get; set; } + + /// + /// Total output tokens produced across all LLM calls in this invocation. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("output_tokens")] + public long? OutputTokens { get; set; } + + /// + /// Number of input tokens read from cache. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("cache_read_input_tokens")] + public long? CacheReadInputTokens { get; set; } + + /// + /// The temperature parameter used for generation. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("temperature")] + public double? Temperature { get; set; } + + /// + /// The maximum tokens parameter used for generation. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("max_tokens")] + public long? MaxTokens { get; set; } + + /// + /// The LLM provider name. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("provider_name")] + public string? ProviderName { get; set; } + + /// + /// The name of the agent. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("agent_name")] + public string? AgentName { get; set; } + + /// + /// The description of the agent. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("agent_description")] + public string? AgentDescription { get; set; } + + /// + /// The requested output format of the agent invocation. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("output_type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Vectara.JsonConverters.InvokeAgentSpanAttributesOutputTypeJsonConverter))] + public global::Vectara.InvokeAgentSpanAttributesOutputType? OutputType { get; set; } + + /// + /// The event ID of the input message. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("input_event_id")] + public string? InputEventId { get; set; } + + /// + /// The event ID of the output message. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("output_event_id")] + public string? OutputEventId { get; set; } + + /// + /// Metadata for files uploaded with the input, if any. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("input_files")] + public global::System.Collections.Generic.IList? InputFiles { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The LLM model used in this invocation. + /// + /// + /// Total input tokens consumed across all LLM calls in this invocation. + /// + /// + /// Total output tokens produced across all LLM calls in this invocation. + /// + /// + /// Number of input tokens read from cache. + /// + /// + /// The temperature parameter used for generation. + /// + /// + /// The maximum tokens parameter used for generation. + /// + /// + /// The LLM provider name. + /// + /// + /// The name of the agent. + /// + /// + /// The description of the agent. + /// + /// + /// The requested output format of the agent invocation. + /// + /// + /// The event ID of the input message. + /// + /// + /// The event ID of the output message. + /// + /// + /// Metadata for files uploaded with the input, if any. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public InvokeAgentSpanAttributes( + string? model, + long? inputTokens, + long? outputTokens, + long? cacheReadInputTokens, + double? temperature, + long? maxTokens, + string? providerName, + string? agentName, + string? agentDescription, + global::Vectara.InvokeAgentSpanAttributesOutputType? outputType, + string? inputEventId, + string? outputEventId, + global::System.Collections.Generic.IList? inputFiles) + { + this.Model = model; + this.InputTokens = inputTokens; + this.OutputTokens = outputTokens; + this.CacheReadInputTokens = cacheReadInputTokens; + this.Temperature = temperature; + this.MaxTokens = maxTokens; + this.ProviderName = providerName; + this.AgentName = agentName; + this.AgentDescription = agentDescription; + this.OutputType = outputType; + this.InputEventId = inputEventId; + this.OutputEventId = outputEventId; + this.InputFiles = inputFiles; + } + + /// + /// Initializes a new instance of the class. + /// + public InvokeAgentSpanAttributes() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.InvokeAgentSpanAttributesOutputType.g.cs b/src/libs/Vectara/Generated/Vectara.Models.InvokeAgentSpanAttributesOutputType.g.cs new file mode 100644 index 00000000..b313b7d4 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.InvokeAgentSpanAttributesOutputType.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// The requested output format of the agent invocation. + /// + public enum InvokeAgentSpanAttributesOutputType + { + /// + /// + /// + Json, + /// + /// + /// + Text, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class InvokeAgentSpanAttributesOutputTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this InvokeAgentSpanAttributesOutputType value) + { + return value switch + { + InvokeAgentSpanAttributesOutputType.Json => "json", + InvokeAgentSpanAttributesOutputType.Text => "text", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static InvokeAgentSpanAttributesOutputType? ToEnum(string value) + { + return value switch + { + "json" => InvokeAgentSpanAttributesOutputType.Json, + "text" => InvokeAgentSpanAttributesOutputType.Text, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.InvokeAgentSpanContent.Json.g.cs b/src/libs/Vectara/Generated/Vectara.Models.InvokeAgentSpanContent.Json.g.cs new file mode 100644 index 00000000..f5542bab --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.InvokeAgentSpanContent.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Vectara +{ + public sealed partial class InvokeAgentSpanContent + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Vectara.InvokeAgentSpanContent? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Vectara.InvokeAgentSpanContent), + jsonSerializerContext) as global::Vectara.InvokeAgentSpanContent; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Vectara.InvokeAgentSpanContent? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Vectara.InvokeAgentSpanContent), + jsonSerializerContext).ConfigureAwait(false)) as global::Vectara.InvokeAgentSpanContent; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.InvokeAgentSpanContent.g.cs b/src/libs/Vectara/Generated/Vectara.Models.InvokeAgentSpanContent.g.cs new file mode 100644 index 00000000..1752815c --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.InvokeAgentSpanContent.g.cs @@ -0,0 +1,78 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// Decrypted content of an invoke_agent span. + /// + public sealed partial class InvokeAgentSpanContent + { + /// + /// Input messages sent to the LLM. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("input_messages")] + public string? InputMessages { get; set; } + + /// + /// Output messages returned by the LLM. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("output_messages")] + public string? OutputMessages { get; set; } + + /// + /// Extended thinking content, if available. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("thinking")] + public string? Thinking { get; set; } + + /// + /// System instructions provided to the LLM. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("system_instructions")] + public string? SystemInstructions { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Input messages sent to the LLM. + /// + /// + /// Output messages returned by the LLM. + /// + /// + /// Extended thinking content, if available. + /// + /// + /// System instructions provided to the LLM. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public InvokeAgentSpanContent( + string? inputMessages, + string? outputMessages, + string? thinking, + string? systemInstructions) + { + this.InputMessages = inputMessages; + this.OutputMessages = outputMessages; + this.Thinking = thinking; + this.SystemInstructions = systemInstructions; + } + + /// + /// Initializes a new instance of the class. + /// + public InvokeAgentSpanContent() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.InvokeAgentTraceSpan.Json.g.cs b/src/libs/Vectara/Generated/Vectara.Models.InvokeAgentTraceSpan.Json.g.cs new file mode 100644 index 00000000..4a03ff31 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.InvokeAgentTraceSpan.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Vectara +{ + public readonly partial struct InvokeAgentTraceSpan + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Vectara.InvokeAgentTraceSpan? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Vectara.InvokeAgentTraceSpan), + jsonSerializerContext) as global::Vectara.InvokeAgentTraceSpan?; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Vectara.InvokeAgentTraceSpan? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Vectara.InvokeAgentTraceSpan), + jsonSerializerContext).ConfigureAwait(false)) as global::Vectara.InvokeAgentTraceSpan?; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.InvokeAgentTraceSpan.g.cs b/src/libs/Vectara/Generated/Vectara.Models.InvokeAgentTraceSpan.g.cs new file mode 100644 index 00000000..4215dd27 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.InvokeAgentTraceSpan.g.cs @@ -0,0 +1,221 @@ +#pragma warning disable CS0618 // Type or member is obsolete + +#nullable enable + +namespace Vectara +{ + /// + /// A span representing a top-level agent invocation. + /// + public readonly partial struct InvokeAgentTraceSpan : global::System.IEquatable + { + /// + /// Common properties shared by all agent trace span types. + /// +#if NET6_0_OR_GREATER + public global::Vectara.AgentTraceSpanBase? Base { get; init; } +#else + public global::Vectara.AgentTraceSpanBase? Base { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Base))] +#endif + public bool IsBase => Base != null; + + /// + /// + /// +#if NET6_0_OR_GREATER + public global::Vectara.InvokeAgentTraceSpanVariant2? InvokeAgentTraceSpanVariant2 { get; init; } +#else + public global::Vectara.InvokeAgentTraceSpanVariant2? InvokeAgentTraceSpanVariant2 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(InvokeAgentTraceSpanVariant2))] +#endif + public bool IsInvokeAgentTraceSpanVariant2 => InvokeAgentTraceSpanVariant2 != null; + /// + /// + /// + public static implicit operator InvokeAgentTraceSpan(global::Vectara.AgentTraceSpanBase value) => new InvokeAgentTraceSpan((global::Vectara.AgentTraceSpanBase?)value); + + /// + /// + /// + public static implicit operator global::Vectara.AgentTraceSpanBase?(InvokeAgentTraceSpan @this) => @this.Base; + + /// + /// + /// + public InvokeAgentTraceSpan(global::Vectara.AgentTraceSpanBase? value) + { + Base = value; + } + + /// + /// + /// + public static implicit operator InvokeAgentTraceSpan(global::Vectara.InvokeAgentTraceSpanVariant2 value) => new InvokeAgentTraceSpan((global::Vectara.InvokeAgentTraceSpanVariant2?)value); + + /// + /// + /// + public static implicit operator global::Vectara.InvokeAgentTraceSpanVariant2?(InvokeAgentTraceSpan @this) => @this.InvokeAgentTraceSpanVariant2; + + /// + /// + /// + public InvokeAgentTraceSpan(global::Vectara.InvokeAgentTraceSpanVariant2? value) + { + InvokeAgentTraceSpanVariant2 = value; + } + + /// + /// + /// + public InvokeAgentTraceSpan( + global::Vectara.AgentTraceSpanBase? @base, + global::Vectara.InvokeAgentTraceSpanVariant2? invokeAgentTraceSpanVariant2 + ) + { + Base = @base; + InvokeAgentTraceSpanVariant2 = invokeAgentTraceSpanVariant2; + } + + /// + /// + /// + public object? Object => + InvokeAgentTraceSpanVariant2 as object ?? + Base as object + ; + + /// + /// + /// + public override string? ToString() => + Base?.ToString() ?? + InvokeAgentTraceSpanVariant2?.ToString() + ; + + /// + /// + /// + public bool Validate() + { + return IsBase && IsInvokeAgentTraceSpanVariant2; + } + + /// + /// + /// + public TResult? Match( + global::System.Func? @base = null, + global::System.Func? invokeAgentTraceSpanVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsBase && @base != null) + { + return @base(Base!); + } + else if (IsInvokeAgentTraceSpanVariant2 && invokeAgentTraceSpanVariant2 != null) + { + return invokeAgentTraceSpanVariant2(InvokeAgentTraceSpanVariant2!); + } + + return default(TResult); + } + + /// + /// + /// + public void Match( + global::System.Action? @base = null, + global::System.Action? invokeAgentTraceSpanVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsBase) + { + @base?.Invoke(Base!); + } + else if (IsInvokeAgentTraceSpanVariant2) + { + invokeAgentTraceSpanVariant2?.Invoke(InvokeAgentTraceSpanVariant2!); + } + } + + /// + /// + /// + public override int GetHashCode() + { + var fields = new object?[] + { + Base, + typeof(global::Vectara.AgentTraceSpanBase), + InvokeAgentTraceSpanVariant2, + typeof(global::Vectara.InvokeAgentTraceSpanVariant2), + }; + const int offset = unchecked((int)2166136261); + const int prime = 16777619; + static int HashCodeAggregator(int hashCode, object? value) => value == null + ? (hashCode ^ 0) * prime + : (hashCode ^ value.GetHashCode()) * prime; + + return global::System.Linq.Enumerable.Aggregate(fields, offset, HashCodeAggregator); + } + + /// + /// + /// + public bool Equals(InvokeAgentTraceSpan other) + { + return + global::System.Collections.Generic.EqualityComparer.Default.Equals(Base, other.Base) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(InvokeAgentTraceSpanVariant2, other.InvokeAgentTraceSpanVariant2) + ; + } + + /// + /// + /// + public static bool operator ==(InvokeAgentTraceSpan obj1, InvokeAgentTraceSpan obj2) + { + return global::System.Collections.Generic.EqualityComparer.Default.Equals(obj1, obj2); + } + + /// + /// + /// + public static bool operator !=(InvokeAgentTraceSpan obj1, InvokeAgentTraceSpan obj2) + { + return !(obj1 == obj2); + } + + /// + /// + /// + public override bool Equals(object? obj) + { + return obj is InvokeAgentTraceSpan o && Equals(o); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.InvokeAgentTraceSpanVariant2.Json.g.cs b/src/libs/Vectara/Generated/Vectara.Models.InvokeAgentTraceSpanVariant2.Json.g.cs new file mode 100644 index 00000000..73f292cd --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.InvokeAgentTraceSpanVariant2.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Vectara +{ + public sealed partial class InvokeAgentTraceSpanVariant2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Vectara.InvokeAgentTraceSpanVariant2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Vectara.InvokeAgentTraceSpanVariant2), + jsonSerializerContext) as global::Vectara.InvokeAgentTraceSpanVariant2; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Vectara.InvokeAgentTraceSpanVariant2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Vectara.InvokeAgentTraceSpanVariant2), + jsonSerializerContext).ConfigureAwait(false)) as global::Vectara.InvokeAgentTraceSpanVariant2; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.InvokeAgentTraceSpanVariant2.g.cs b/src/libs/Vectara/Generated/Vectara.Models.InvokeAgentTraceSpanVariant2.g.cs new file mode 100644 index 00000000..63c281eb --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.InvokeAgentTraceSpanVariant2.g.cs @@ -0,0 +1,74 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// + /// + public sealed partial class InvokeAgentTraceSpanVariant2 + { + /// + /// The operation type for this span.
+ /// Default Value: invoke_agent
+ /// Example: invoke_agent + ///
+ /// "invoke_agent" + /// invoke_agent + [global::System.Text.Json.Serialization.JsonPropertyName("operation")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Operation { get; set; } = "invoke_agent"; + + /// + /// Attributes for an invoke_agent span. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("attributes")] + public global::Vectara.InvokeAgentSpanAttributes? Attributes { get; set; } + + /// + /// Span content, only included when include_content=true is requested. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("content")] + public global::Vectara.InvokeAgentSpanContent? Content { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The operation type for this span.
+ /// Default Value: invoke_agent
+ /// Example: invoke_agent + /// + /// + /// Attributes for an invoke_agent span. + /// + /// + /// Span content, only included when include_content=true is requested. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public InvokeAgentTraceSpanVariant2( + string operation, + global::Vectara.InvokeAgentSpanAttributes? attributes, + global::Vectara.InvokeAgentSpanContent? content) + { + this.Operation = operation ?? throw new global::System.ArgumentNullException(nameof(operation)); + this.Attributes = attributes; + this.Content = content; + } + + /// + /// Initializes a new instance of the class. + /// + public InvokeAgentTraceSpanVariant2() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.ListAgentConnectorsResponse.Json.g.cs b/src/libs/Vectara/Generated/Vectara.Models.ListAgentConnectorsResponse.Json.g.cs new file mode 100644 index 00000000..498b13b6 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.ListAgentConnectorsResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Vectara +{ + public sealed partial class ListAgentConnectorsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Vectara.ListAgentConnectorsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Vectara.ListAgentConnectorsResponse), + jsonSerializerContext) as global::Vectara.ListAgentConnectorsResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Vectara.ListAgentConnectorsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Vectara.ListAgentConnectorsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Vectara.ListAgentConnectorsResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.ListAgentConnectorsResponse.g.cs b/src/libs/Vectara/Generated/Vectara.Models.ListAgentConnectorsResponse.g.cs new file mode 100644 index 00000000..3a3b401d --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.ListAgentConnectorsResponse.g.cs @@ -0,0 +1,61 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// Response containing a list of agent connectors. + /// + public sealed partial class ListAgentConnectorsResponse + { + /// + /// List of agent connectors. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("connectors")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Connectors { get; set; } + + /// + /// The standard metadata in the response of a list operation.
+ /// Example: {"page_key":"eyJvZmZzZXQiOjF9"} + ///
+ /// {"page_key":"eyJvZmZzZXQiOjF9"} + [global::System.Text.Json.Serialization.JsonPropertyName("metadata")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Vectara.ListMetadata Metadata { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// List of agent connectors. + /// + /// + /// The standard metadata in the response of a list operation.
+ /// Example: {"page_key":"eyJvZmZzZXQiOjF9"} + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ListAgentConnectorsResponse( + global::System.Collections.Generic.IList connectors, + global::Vectara.ListMetadata metadata) + { + this.Connectors = connectors ?? throw new global::System.ArgumentNullException(nameof(connectors)); + this.Metadata = metadata ?? throw new global::System.ArgumentNullException(nameof(metadata)); + } + + /// + /// Initializes a new instance of the class. + /// + public ListAgentConnectorsResponse() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.ListAgentConnectorsType.g.cs b/src/libs/Vectara/Generated/Vectara.Models.ListAgentConnectorsType.g.cs new file mode 100644 index 00000000..f1adfe0c --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.ListAgentConnectorsType.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// Example: slack + /// + public enum ListAgentConnectorsType + { + /// + /// + /// + Slack, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class ListAgentConnectorsTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this ListAgentConnectorsType value) + { + return value switch + { + ListAgentConnectorsType.Slack => "slack", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static ListAgentConnectorsType? ToEnum(string value) + { + return value switch + { + "slack" => ListAgentConnectorsType.Slack, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.ListAgentTraceSpansResponse.Json.g.cs b/src/libs/Vectara/Generated/Vectara.Models.ListAgentTraceSpansResponse.Json.g.cs new file mode 100644 index 00000000..abaf28ae --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.ListAgentTraceSpansResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Vectara +{ + public sealed partial class ListAgentTraceSpansResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Vectara.ListAgentTraceSpansResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Vectara.ListAgentTraceSpansResponse), + jsonSerializerContext) as global::Vectara.ListAgentTraceSpansResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Vectara.ListAgentTraceSpansResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Vectara.ListAgentTraceSpansResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Vectara.ListAgentTraceSpansResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.ListAgentTraceSpansResponse.g.cs b/src/libs/Vectara/Generated/Vectara.Models.ListAgentTraceSpansResponse.g.cs new file mode 100644 index 00000000..77bf6f7c --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.ListAgentTraceSpansResponse.g.cs @@ -0,0 +1,60 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// A list of spans for an agent trace. + /// + public sealed partial class ListAgentTraceSpansResponse + { + /// + /// The list of spans. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("spans")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Spans { get; set; } + + /// + /// The standard metadata in the response of a list operation.
+ /// Example: {"page_key":"eyJvZmZzZXQiOjF9"} + ///
+ /// {"page_key":"eyJvZmZzZXQiOjF9"} + [global::System.Text.Json.Serialization.JsonPropertyName("metadata")] + public global::Vectara.ListMetadata? Metadata { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The list of spans. + /// + /// + /// The standard metadata in the response of a list operation.
+ /// Example: {"page_key":"eyJvZmZzZXQiOjF9"} + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ListAgentTraceSpansResponse( + global::System.Collections.Generic.IList spans, + global::Vectara.ListMetadata? metadata) + { + this.Spans = spans ?? throw new global::System.ArgumentNullException(nameof(spans)); + this.Metadata = metadata; + } + + /// + /// Initializes a new instance of the class. + /// + public ListAgentTraceSpansResponse() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.ListAgentTracesResponse.Json.g.cs b/src/libs/Vectara/Generated/Vectara.Models.ListAgentTracesResponse.Json.g.cs new file mode 100644 index 00000000..9bd36323 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.ListAgentTracesResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Vectara +{ + public sealed partial class ListAgentTracesResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Vectara.ListAgentTracesResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Vectara.ListAgentTracesResponse), + jsonSerializerContext) as global::Vectara.ListAgentTracesResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Vectara.ListAgentTracesResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Vectara.ListAgentTracesResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Vectara.ListAgentTracesResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.ListAgentTracesResponse.g.cs b/src/libs/Vectara/Generated/Vectara.Models.ListAgentTracesResponse.g.cs new file mode 100644 index 00000000..a857139f --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.ListAgentTracesResponse.g.cs @@ -0,0 +1,60 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// A list of agent traces. + /// + public sealed partial class ListAgentTracesResponse + { + /// + /// The list of agent traces. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("traces")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Traces { get; set; } + + /// + /// The standard metadata in the response of a list operation.
+ /// Example: {"page_key":"eyJvZmZzZXQiOjF9"} + ///
+ /// {"page_key":"eyJvZmZzZXQiOjF9"} + [global::System.Text.Json.Serialization.JsonPropertyName("metadata")] + public global::Vectara.ListMetadata? Metadata { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The list of agent traces. + /// + /// + /// The standard metadata in the response of a list operation.
+ /// Example: {"page_key":"eyJvZmZzZXQiOjF9"} + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ListAgentTracesResponse( + global::System.Collections.Generic.IList traces, + global::Vectara.ListMetadata? metadata) + { + this.Traces = traces ?? throw new global::System.ArgumentNullException(nameof(traces)); + this.Metadata = metadata; + } + + /// + /// Initializes a new instance of the class. + /// + public ListAgentTracesResponse() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.ListTraceSpansOperation.g.cs b/src/libs/Vectara/Generated/Vectara.Models.ListTraceSpansOperation.g.cs new file mode 100644 index 00000000..a12f2056 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.ListTraceSpansOperation.g.cs @@ -0,0 +1,93 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// + /// + public enum ListTraceSpansOperation + { + /// + /// + /// + Chat, + /// + /// + /// + Compaction, + /// + /// + /// + ExecuteTool, + /// + /// + /// + Guardrail, + /// + /// + /// + ImageRead, + /// + /// + /// + InvokeAgent, + /// + /// + /// + Output, + /// + /// + /// + StepTransition, + /// + /// + /// + Thinking, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class ListTraceSpansOperationExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this ListTraceSpansOperation value) + { + return value switch + { + ListTraceSpansOperation.Chat => "chat", + ListTraceSpansOperation.Compaction => "compaction", + ListTraceSpansOperation.ExecuteTool => "execute_tool", + ListTraceSpansOperation.Guardrail => "guardrail", + ListTraceSpansOperation.ImageRead => "image_read", + ListTraceSpansOperation.InvokeAgent => "invoke_agent", + ListTraceSpansOperation.Output => "output", + ListTraceSpansOperation.StepTransition => "step_transition", + ListTraceSpansOperation.Thinking => "thinking", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static ListTraceSpansOperation? ToEnum(string value) + { + return value switch + { + "chat" => ListTraceSpansOperation.Chat, + "compaction" => ListTraceSpansOperation.Compaction, + "execute_tool" => ListTraceSpansOperation.ExecuteTool, + "guardrail" => ListTraceSpansOperation.Guardrail, + "image_read" => ListTraceSpansOperation.ImageRead, + "invoke_agent" => ListTraceSpansOperation.InvokeAgent, + "output" => ListTraceSpansOperation.Output, + "step_transition" => ListTraceSpansOperation.StepTransition, + "thinking" => ListTraceSpansOperation.Thinking, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.ListTracesErrorType.g.cs b/src/libs/Vectara/Generated/Vectara.Models.ListTracesErrorType.g.cs new file mode 100644 index 00000000..0922dd9c --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.ListTracesErrorType.g.cs @@ -0,0 +1,75 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// + /// + public enum ListTracesErrorType + { + /// + /// + /// + ActionsLimitReached, + /// + /// + /// + ContextLimitExceeded, + /// + /// + /// + Internal, + /// + /// + /// + LlmGenerationError, + /// + /// + /// + StepTransitionLimitExceeded, + /// + /// + /// + StreamError, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class ListTracesErrorTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this ListTracesErrorType value) + { + return value switch + { + ListTracesErrorType.ActionsLimitReached => "actions_limit_reached", + ListTracesErrorType.ContextLimitExceeded => "context_limit_exceeded", + ListTracesErrorType.Internal => "internal", + ListTracesErrorType.LlmGenerationError => "llm_generation_error", + ListTracesErrorType.StepTransitionLimitExceeded => "step_transition_limit_exceeded", + ListTracesErrorType.StreamError => "stream_error", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static ListTracesErrorType? ToEnum(string value) + { + return value switch + { + "actions_limit_reached" => ListTracesErrorType.ActionsLimitReached, + "context_limit_exceeded" => ListTracesErrorType.ContextLimitExceeded, + "internal" => ListTracesErrorType.Internal, + "llm_generation_error" => ListTracesErrorType.LlmGenerationError, + "step_transition_limit_exceeded" => ListTracesErrorType.StepTransitionLimitExceeded, + "stream_error" => ListTracesErrorType.StreamError, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.ListTracesOperation.g.cs b/src/libs/Vectara/Generated/Vectara.Models.ListTracesOperation.g.cs new file mode 100644 index 00000000..e738829f --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.ListTracesOperation.g.cs @@ -0,0 +1,93 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// + /// + public enum ListTracesOperation + { + /// + /// + /// + Chat, + /// + /// + /// + Compaction, + /// + /// + /// + ExecuteTool, + /// + /// + /// + Guardrail, + /// + /// + /// + ImageRead, + /// + /// + /// + InvokeAgent, + /// + /// + /// + Output, + /// + /// + /// + StepTransition, + /// + /// + /// + Thinking, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class ListTracesOperationExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this ListTracesOperation value) + { + return value switch + { + ListTracesOperation.Chat => "chat", + ListTracesOperation.Compaction => "compaction", + ListTracesOperation.ExecuteTool => "execute_tool", + ListTracesOperation.Guardrail => "guardrail", + ListTracesOperation.ImageRead => "image_read", + ListTracesOperation.InvokeAgent => "invoke_agent", + ListTracesOperation.Output => "output", + ListTracesOperation.StepTransition => "step_transition", + ListTracesOperation.Thinking => "thinking", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static ListTracesOperation? ToEnum(string value) + { + return value switch + { + "chat" => ListTracesOperation.Chat, + "compaction" => ListTracesOperation.Compaction, + "execute_tool" => ListTracesOperation.ExecuteTool, + "guardrail" => ListTracesOperation.Guardrail, + "image_read" => ListTracesOperation.ImageRead, + "invoke_agent" => ListTracesOperation.InvokeAgent, + "output" => ListTracesOperation.Output, + "step_transition" => ListTracesOperation.StepTransition, + "thinking" => ListTracesOperation.Thinking, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.ListTracesStatus.g.cs b/src/libs/Vectara/Generated/Vectara.Models.ListTracesStatus.g.cs new file mode 100644 index 00000000..8d4b0af1 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.ListTracesStatus.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// + /// + public enum ListTracesStatus + { + /// + /// + /// + Error, + /// + /// + /// + Ok, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class ListTracesStatusExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this ListTracesStatus value) + { + return value switch + { + ListTracesStatus.Error => "error", + ListTracesStatus.Ok => "ok", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static ListTracesStatus? ToEnum(string value) + { + return value switch + { + "error" => ListTracesStatus.Error, + "ok" => ListTracesStatus.Ok, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.ListTracesToolErrorType.g.cs b/src/libs/Vectara/Generated/Vectara.Models.ListTracesToolErrorType.g.cs new file mode 100644 index 00000000..814a2eac --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.ListTracesToolErrorType.g.cs @@ -0,0 +1,75 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// + /// + public enum ListTracesToolErrorType + { + /// + /// + /// + DependencyFailed, + /// + /// + /// + ExecutionError, + /// + /// + /// + InvalidConfiguration, + /// + /// + /// + InvalidInput, + /// + /// + /// + NotFound, + /// + /// + /// + Timeout, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class ListTracesToolErrorTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this ListTracesToolErrorType value) + { + return value switch + { + ListTracesToolErrorType.DependencyFailed => "dependency_failed", + ListTracesToolErrorType.ExecutionError => "execution_error", + ListTracesToolErrorType.InvalidConfiguration => "invalid_configuration", + ListTracesToolErrorType.InvalidInput => "invalid_input", + ListTracesToolErrorType.NotFound => "not_found", + ListTracesToolErrorType.Timeout => "timeout", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static ListTracesToolErrorType? ToEnum(string value) + { + return value switch + { + "dependency_failed" => ListTracesToolErrorType.DependencyFailed, + "execution_error" => ListTracesToolErrorType.ExecutionError, + "invalid_configuration" => ListTracesToolErrorType.InvalidConfiguration, + "invalid_input" => ListTracesToolErrorType.InvalidInput, + "not_found" => ListTracesToolErrorType.NotFound, + "timeout" => ListTracesToolErrorType.Timeout, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.OutputSpanContent.Json.g.cs b/src/libs/Vectara/Generated/Vectara.Models.OutputSpanContent.Json.g.cs new file mode 100644 index 00000000..e0303e3b --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.OutputSpanContent.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Vectara +{ + public sealed partial class OutputSpanContent + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Vectara.OutputSpanContent? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Vectara.OutputSpanContent), + jsonSerializerContext) as global::Vectara.OutputSpanContent; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Vectara.OutputSpanContent? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Vectara.OutputSpanContent), + jsonSerializerContext).ConfigureAwait(false)) as global::Vectara.OutputSpanContent; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.OutputSpanContent.g.cs b/src/libs/Vectara/Generated/Vectara.Models.OutputSpanContent.g.cs new file mode 100644 index 00000000..c43b371f --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.OutputSpanContent.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// Decrypted content of an output span. + /// + public sealed partial class OutputSpanContent + { + /// + /// The text output produced by the agent. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("output_text")] + public string? OutputText { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The text output produced by the agent. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public OutputSpanContent( + string? outputText) + { + this.OutputText = outputText; + } + + /// + /// Initializes a new instance of the class. + /// + public OutputSpanContent() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.OutputTraceSpan.Json.g.cs b/src/libs/Vectara/Generated/Vectara.Models.OutputTraceSpan.Json.g.cs new file mode 100644 index 00000000..633fb7e2 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.OutputTraceSpan.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Vectara +{ + public readonly partial struct OutputTraceSpan + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Vectara.OutputTraceSpan? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Vectara.OutputTraceSpan), + jsonSerializerContext) as global::Vectara.OutputTraceSpan?; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Vectara.OutputTraceSpan? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Vectara.OutputTraceSpan), + jsonSerializerContext).ConfigureAwait(false)) as global::Vectara.OutputTraceSpan?; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.OutputTraceSpan.g.cs b/src/libs/Vectara/Generated/Vectara.Models.OutputTraceSpan.g.cs new file mode 100644 index 00000000..41bc386e --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.OutputTraceSpan.g.cs @@ -0,0 +1,221 @@ +#pragma warning disable CS0618 // Type or member is obsolete + +#nullable enable + +namespace Vectara +{ + /// + /// A span representing the final text output of an agent turn. + /// + public readonly partial struct OutputTraceSpan : global::System.IEquatable + { + /// + /// Common properties shared by all agent trace span types. + /// +#if NET6_0_OR_GREATER + public global::Vectara.AgentTraceSpanBase? AgentBase { get; init; } +#else + public global::Vectara.AgentTraceSpanBase? AgentBase { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(AgentBase))] +#endif + public bool IsAgentBase => AgentBase != null; + + /// + /// + /// +#if NET6_0_OR_GREATER + public global::Vectara.OutputTraceSpanVariant2? OutputTraceSpanVariant2 { get; init; } +#else + public global::Vectara.OutputTraceSpanVariant2? OutputTraceSpanVariant2 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(OutputTraceSpanVariant2))] +#endif + public bool IsOutputTraceSpanVariant2 => OutputTraceSpanVariant2 != null; + /// + /// + /// + public static implicit operator OutputTraceSpan(global::Vectara.AgentTraceSpanBase value) => new OutputTraceSpan((global::Vectara.AgentTraceSpanBase?)value); + + /// + /// + /// + public static implicit operator global::Vectara.AgentTraceSpanBase?(OutputTraceSpan @this) => @this.AgentBase; + + /// + /// + /// + public OutputTraceSpan(global::Vectara.AgentTraceSpanBase? value) + { + AgentBase = value; + } + + /// + /// + /// + public static implicit operator OutputTraceSpan(global::Vectara.OutputTraceSpanVariant2 value) => new OutputTraceSpan((global::Vectara.OutputTraceSpanVariant2?)value); + + /// + /// + /// + public static implicit operator global::Vectara.OutputTraceSpanVariant2?(OutputTraceSpan @this) => @this.OutputTraceSpanVariant2; + + /// + /// + /// + public OutputTraceSpan(global::Vectara.OutputTraceSpanVariant2? value) + { + OutputTraceSpanVariant2 = value; + } + + /// + /// + /// + public OutputTraceSpan( + global::Vectara.AgentTraceSpanBase? agentBase, + global::Vectara.OutputTraceSpanVariant2? outputTraceSpanVariant2 + ) + { + AgentBase = agentBase; + OutputTraceSpanVariant2 = outputTraceSpanVariant2; + } + + /// + /// + /// + public object? Object => + OutputTraceSpanVariant2 as object ?? + AgentBase as object + ; + + /// + /// + /// + public override string? ToString() => + AgentBase?.ToString() ?? + OutputTraceSpanVariant2?.ToString() + ; + + /// + /// + /// + public bool Validate() + { + return IsAgentBase && IsOutputTraceSpanVariant2; + } + + /// + /// + /// + public TResult? Match( + global::System.Func? agentBase = null, + global::System.Func? outputTraceSpanVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsAgentBase && agentBase != null) + { + return agentBase(AgentBase!); + } + else if (IsOutputTraceSpanVariant2 && outputTraceSpanVariant2 != null) + { + return outputTraceSpanVariant2(OutputTraceSpanVariant2!); + } + + return default(TResult); + } + + /// + /// + /// + public void Match( + global::System.Action? agentBase = null, + global::System.Action? outputTraceSpanVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsAgentBase) + { + agentBase?.Invoke(AgentBase!); + } + else if (IsOutputTraceSpanVariant2) + { + outputTraceSpanVariant2?.Invoke(OutputTraceSpanVariant2!); + } + } + + /// + /// + /// + public override int GetHashCode() + { + var fields = new object?[] + { + AgentBase, + typeof(global::Vectara.AgentTraceSpanBase), + OutputTraceSpanVariant2, + typeof(global::Vectara.OutputTraceSpanVariant2), + }; + const int offset = unchecked((int)2166136261); + const int prime = 16777619; + static int HashCodeAggregator(int hashCode, object? value) => value == null + ? (hashCode ^ 0) * prime + : (hashCode ^ value.GetHashCode()) * prime; + + return global::System.Linq.Enumerable.Aggregate(fields, offset, HashCodeAggregator); + } + + /// + /// + /// + public bool Equals(OutputTraceSpan other) + { + return + global::System.Collections.Generic.EqualityComparer.Default.Equals(AgentBase, other.AgentBase) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(OutputTraceSpanVariant2, other.OutputTraceSpanVariant2) + ; + } + + /// + /// + /// + public static bool operator ==(OutputTraceSpan obj1, OutputTraceSpan obj2) + { + return global::System.Collections.Generic.EqualityComparer.Default.Equals(obj1, obj2); + } + + /// + /// + /// + public static bool operator !=(OutputTraceSpan obj1, OutputTraceSpan obj2) + { + return !(obj1 == obj2); + } + + /// + /// + /// + public override bool Equals(object? obj) + { + return obj is OutputTraceSpan o && Equals(o); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.OutputTraceSpanVariant2.Json.g.cs b/src/libs/Vectara/Generated/Vectara.Models.OutputTraceSpanVariant2.Json.g.cs new file mode 100644 index 00000000..01fc1943 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.OutputTraceSpanVariant2.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Vectara +{ + public sealed partial class OutputTraceSpanVariant2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Vectara.OutputTraceSpanVariant2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Vectara.OutputTraceSpanVariant2), + jsonSerializerContext) as global::Vectara.OutputTraceSpanVariant2; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Vectara.OutputTraceSpanVariant2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Vectara.OutputTraceSpanVariant2), + jsonSerializerContext).ConfigureAwait(false)) as global::Vectara.OutputTraceSpanVariant2; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.OutputTraceSpanVariant2.g.cs b/src/libs/Vectara/Generated/Vectara.Models.OutputTraceSpanVariant2.g.cs new file mode 100644 index 00000000..c64d4e9b --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.OutputTraceSpanVariant2.g.cs @@ -0,0 +1,75 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// + /// + public sealed partial class OutputTraceSpanVariant2 + { + /// + /// The operation type for this span.
+ /// Default Value: output
+ /// Example: output + ///
+ /// "output" + /// output + [global::System.Text.Json.Serialization.JsonPropertyName("operation")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Operation { get; set; } = "output"; + + /// + /// Session event that this span was generated by. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("event_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string EventId { get; set; } + + /// + /// Span content, only included when include_content=true is requested. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("content")] + public global::Vectara.OutputSpanContent? Content { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The operation type for this span.
+ /// Default Value: output
+ /// Example: output + /// + /// + /// Session event that this span was generated by. + /// + /// + /// Span content, only included when include_content=true is requested. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public OutputTraceSpanVariant2( + string operation, + string eventId, + global::Vectara.OutputSpanContent? content) + { + this.Operation = operation ?? throw new global::System.ArgumentNullException(nameof(operation)); + this.EventId = eventId ?? throw new global::System.ArgumentNullException(nameof(eventId)); + this.Content = content; + } + + /// + /// Initializes a new instance of the class. + /// + public OutputTraceSpanVariant2() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.SlackConnectorConfiguration.Json.g.cs b/src/libs/Vectara/Generated/Vectara.Models.SlackConnectorConfiguration.Json.g.cs new file mode 100644 index 00000000..7f1f48fa --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.SlackConnectorConfiguration.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Vectara +{ + public sealed partial class SlackConnectorConfiguration + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Vectara.SlackConnectorConfiguration? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Vectara.SlackConnectorConfiguration), + jsonSerializerContext) as global::Vectara.SlackConnectorConfiguration; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Vectara.SlackConnectorConfiguration? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Vectara.SlackConnectorConfiguration), + jsonSerializerContext).ConfigureAwait(false)) as global::Vectara.SlackConnectorConfiguration; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.SlackConnectorConfiguration.g.cs b/src/libs/Vectara/Generated/Vectara.Models.SlackConnectorConfiguration.g.cs new file mode 100644 index 00000000..3bdd648a --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.SlackConnectorConfiguration.g.cs @@ -0,0 +1,111 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// Configuration for Slack connectors. + /// + public sealed partial class SlackConnectorConfiguration + { + /// + /// The type of connector configuration.
+ /// Default Value: slack
+ /// Example: slack + ///
+ /// "slack" + /// slack + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Type { get; set; } = "slack"; + + /// + /// Slack bot token (xoxb-) for API access. Will be encrypted when stored.
+ /// Example: xoxb-1234567890-1234567890123-abcdefghijklmnopqrstuvwx + ///
+ /// xoxb-1234567890-1234567890123-abcdefghijklmnopqrstuvwx + [global::System.Text.Json.Serialization.JsonPropertyName("bot_token")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string BotToken { get; set; } + + /// + /// Slack signing secret for webhook verification. Will be encrypted when stored.
+ /// Example: abcdef1234567890abcdef1234567890abcdef12 + ///
+ /// abcdef1234567890abcdef1234567890abcdef12 + [global::System.Text.Json.Serialization.JsonPropertyName("signing_secret")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string SigningSecret { get; set; } + + /// + /// Slack App ID for customer lookup in webhooks.
+ /// Example: A1234567890 + ///
+ /// A1234567890 + [global::System.Text.Json.Serialization.JsonPropertyName("api_app_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string ApiAppId { get; set; } + + /// + /// The webhook path for this Slack connector to receive events.
+ /// Example: /v2/agents/customer_support/connectors/con_slack_support/input + ///
+ /// /v2/agents/customer_support/connectors/con_slack_support/input + [global::System.Text.Json.Serialization.JsonPropertyName("webhook_path")] + public string? WebhookPath { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The type of connector configuration.
+ /// Default Value: slack
+ /// Example: slack + /// + /// + /// Slack bot token (xoxb-) for API access. Will be encrypted when stored.
+ /// Example: xoxb-1234567890-1234567890123-abcdefghijklmnopqrstuvwx + /// + /// + /// Slack signing secret for webhook verification. Will be encrypted when stored.
+ /// Example: abcdef1234567890abcdef1234567890abcdef12 + /// + /// + /// Slack App ID for customer lookup in webhooks.
+ /// Example: A1234567890 + /// + /// + /// The webhook path for this Slack connector to receive events.
+ /// Example: /v2/agents/customer_support/connectors/con_slack_support/input + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public SlackConnectorConfiguration( + string type, + string botToken, + string signingSecret, + string apiAppId, + string? webhookPath) + { + this.Type = type ?? throw new global::System.ArgumentNullException(nameof(type)); + this.BotToken = botToken ?? throw new global::System.ArgumentNullException(nameof(botToken)); + this.SigningSecret = signingSecret ?? throw new global::System.ArgumentNullException(nameof(signingSecret)); + this.ApiAppId = apiAppId ?? throw new global::System.ArgumentNullException(nameof(apiAppId)); + this.WebhookPath = webhookPath; + } + + /// + /// Initializes a new instance of the class. + /// + public SlackConnectorConfiguration() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.StepTransitionSpanAttributes.Json.g.cs b/src/libs/Vectara/Generated/Vectara.Models.StepTransitionSpanAttributes.Json.g.cs new file mode 100644 index 00000000..c9f1a3a5 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.StepTransitionSpanAttributes.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Vectara +{ + public sealed partial class StepTransitionSpanAttributes + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Vectara.StepTransitionSpanAttributes? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Vectara.StepTransitionSpanAttributes), + jsonSerializerContext) as global::Vectara.StepTransitionSpanAttributes; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Vectara.StepTransitionSpanAttributes? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Vectara.StepTransitionSpanAttributes), + jsonSerializerContext).ConfigureAwait(false)) as global::Vectara.StepTransitionSpanAttributes; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.StepTransitionSpanAttributes.g.cs b/src/libs/Vectara/Generated/Vectara.Models.StepTransitionSpanAttributes.g.cs new file mode 100644 index 00000000..e974f0c3 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.StepTransitionSpanAttributes.g.cs @@ -0,0 +1,56 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// Attributes for a step_transition span. + /// + public sealed partial class StepTransitionSpanAttributes + { + /// + /// The name of the step being transitioned from. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("from_step")] + public string? FromStep { get; set; } + + /// + /// The name of the step being transitioned to. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("to_step")] + public string? ToStep { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The name of the step being transitioned from. + /// + /// + /// The name of the step being transitioned to. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public StepTransitionSpanAttributes( + string? fromStep, + string? toStep) + { + this.FromStep = fromStep; + this.ToStep = toStep; + } + + /// + /// Initializes a new instance of the class. + /// + public StepTransitionSpanAttributes() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.StepTransitionTraceSpan.Json.g.cs b/src/libs/Vectara/Generated/Vectara.Models.StepTransitionTraceSpan.Json.g.cs new file mode 100644 index 00000000..113e58bd --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.StepTransitionTraceSpan.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Vectara +{ + public readonly partial struct StepTransitionTraceSpan + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Vectara.StepTransitionTraceSpan? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Vectara.StepTransitionTraceSpan), + jsonSerializerContext) as global::Vectara.StepTransitionTraceSpan?; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Vectara.StepTransitionTraceSpan? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Vectara.StepTransitionTraceSpan), + jsonSerializerContext).ConfigureAwait(false)) as global::Vectara.StepTransitionTraceSpan?; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.StepTransitionTraceSpan.g.cs b/src/libs/Vectara/Generated/Vectara.Models.StepTransitionTraceSpan.g.cs new file mode 100644 index 00000000..443487c7 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.StepTransitionTraceSpan.g.cs @@ -0,0 +1,221 @@ +#pragma warning disable CS0618 // Type or member is obsolete + +#nullable enable + +namespace Vectara +{ + /// + /// A span representing a transition between agent steps. + /// + public readonly partial struct StepTransitionTraceSpan : global::System.IEquatable + { + /// + /// Common properties shared by all agent trace span types. + /// +#if NET6_0_OR_GREATER + public global::Vectara.AgentTraceSpanBase? AgentBase { get; init; } +#else + public global::Vectara.AgentTraceSpanBase? AgentBase { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(AgentBase))] +#endif + public bool IsAgentBase => AgentBase != null; + + /// + /// + /// +#if NET6_0_OR_GREATER + public global::Vectara.StepTransitionTraceSpanVariant2? StepTransitionTraceSpanVariant2 { get; init; } +#else + public global::Vectara.StepTransitionTraceSpanVariant2? StepTransitionTraceSpanVariant2 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(StepTransitionTraceSpanVariant2))] +#endif + public bool IsStepTransitionTraceSpanVariant2 => StepTransitionTraceSpanVariant2 != null; + /// + /// + /// + public static implicit operator StepTransitionTraceSpan(global::Vectara.AgentTraceSpanBase value) => new StepTransitionTraceSpan((global::Vectara.AgentTraceSpanBase?)value); + + /// + /// + /// + public static implicit operator global::Vectara.AgentTraceSpanBase?(StepTransitionTraceSpan @this) => @this.AgentBase; + + /// + /// + /// + public StepTransitionTraceSpan(global::Vectara.AgentTraceSpanBase? value) + { + AgentBase = value; + } + + /// + /// + /// + public static implicit operator StepTransitionTraceSpan(global::Vectara.StepTransitionTraceSpanVariant2 value) => new StepTransitionTraceSpan((global::Vectara.StepTransitionTraceSpanVariant2?)value); + + /// + /// + /// + public static implicit operator global::Vectara.StepTransitionTraceSpanVariant2?(StepTransitionTraceSpan @this) => @this.StepTransitionTraceSpanVariant2; + + /// + /// + /// + public StepTransitionTraceSpan(global::Vectara.StepTransitionTraceSpanVariant2? value) + { + StepTransitionTraceSpanVariant2 = value; + } + + /// + /// + /// + public StepTransitionTraceSpan( + global::Vectara.AgentTraceSpanBase? agentBase, + global::Vectara.StepTransitionTraceSpanVariant2? stepTransitionTraceSpanVariant2 + ) + { + AgentBase = agentBase; + StepTransitionTraceSpanVariant2 = stepTransitionTraceSpanVariant2; + } + + /// + /// + /// + public object? Object => + StepTransitionTraceSpanVariant2 as object ?? + AgentBase as object + ; + + /// + /// + /// + public override string? ToString() => + AgentBase?.ToString() ?? + StepTransitionTraceSpanVariant2?.ToString() + ; + + /// + /// + /// + public bool Validate() + { + return IsAgentBase && IsStepTransitionTraceSpanVariant2; + } + + /// + /// + /// + public TResult? Match( + global::System.Func? agentBase = null, + global::System.Func? stepTransitionTraceSpanVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsAgentBase && agentBase != null) + { + return agentBase(AgentBase!); + } + else if (IsStepTransitionTraceSpanVariant2 && stepTransitionTraceSpanVariant2 != null) + { + return stepTransitionTraceSpanVariant2(StepTransitionTraceSpanVariant2!); + } + + return default(TResult); + } + + /// + /// + /// + public void Match( + global::System.Action? agentBase = null, + global::System.Action? stepTransitionTraceSpanVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsAgentBase) + { + agentBase?.Invoke(AgentBase!); + } + else if (IsStepTransitionTraceSpanVariant2) + { + stepTransitionTraceSpanVariant2?.Invoke(StepTransitionTraceSpanVariant2!); + } + } + + /// + /// + /// + public override int GetHashCode() + { + var fields = new object?[] + { + AgentBase, + typeof(global::Vectara.AgentTraceSpanBase), + StepTransitionTraceSpanVariant2, + typeof(global::Vectara.StepTransitionTraceSpanVariant2), + }; + const int offset = unchecked((int)2166136261); + const int prime = 16777619; + static int HashCodeAggregator(int hashCode, object? value) => value == null + ? (hashCode ^ 0) * prime + : (hashCode ^ value.GetHashCode()) * prime; + + return global::System.Linq.Enumerable.Aggregate(fields, offset, HashCodeAggregator); + } + + /// + /// + /// + public bool Equals(StepTransitionTraceSpan other) + { + return + global::System.Collections.Generic.EqualityComparer.Default.Equals(AgentBase, other.AgentBase) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(StepTransitionTraceSpanVariant2, other.StepTransitionTraceSpanVariant2) + ; + } + + /// + /// + /// + public static bool operator ==(StepTransitionTraceSpan obj1, StepTransitionTraceSpan obj2) + { + return global::System.Collections.Generic.EqualityComparer.Default.Equals(obj1, obj2); + } + + /// + /// + /// + public static bool operator !=(StepTransitionTraceSpan obj1, StepTransitionTraceSpan obj2) + { + return !(obj1 == obj2); + } + + /// + /// + /// + public override bool Equals(object? obj) + { + return obj is StepTransitionTraceSpan o && Equals(o); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.StepTransitionTraceSpanVariant2.Json.g.cs b/src/libs/Vectara/Generated/Vectara.Models.StepTransitionTraceSpanVariant2.Json.g.cs new file mode 100644 index 00000000..05326c7c --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.StepTransitionTraceSpanVariant2.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Vectara +{ + public sealed partial class StepTransitionTraceSpanVariant2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Vectara.StepTransitionTraceSpanVariant2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Vectara.StepTransitionTraceSpanVariant2), + jsonSerializerContext) as global::Vectara.StepTransitionTraceSpanVariant2; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Vectara.StepTransitionTraceSpanVariant2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Vectara.StepTransitionTraceSpanVariant2), + jsonSerializerContext).ConfigureAwait(false)) as global::Vectara.StepTransitionTraceSpanVariant2; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.StepTransitionTraceSpanVariant2.g.cs b/src/libs/Vectara/Generated/Vectara.Models.StepTransitionTraceSpanVariant2.g.cs new file mode 100644 index 00000000..a0b75af2 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.StepTransitionTraceSpanVariant2.g.cs @@ -0,0 +1,75 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// + /// + public sealed partial class StepTransitionTraceSpanVariant2 + { + /// + /// The operation type for this span.
+ /// Default Value: step_transition
+ /// Example: step_transition + ///
+ /// "step_transition" + /// step_transition + [global::System.Text.Json.Serialization.JsonPropertyName("operation")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Operation { get; set; } = "step_transition"; + + /// + /// Session event that this span was generated by. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("event_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string EventId { get; set; } + + /// + /// Attributes for a step_transition span. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("attributes")] + public global::Vectara.StepTransitionSpanAttributes? Attributes { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The operation type for this span.
+ /// Default Value: step_transition
+ /// Example: step_transition + /// + /// + /// Session event that this span was generated by. + /// + /// + /// Attributes for a step_transition span. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public StepTransitionTraceSpanVariant2( + string operation, + string eventId, + global::Vectara.StepTransitionSpanAttributes? attributes) + { + this.Operation = operation ?? throw new global::System.ArgumentNullException(nameof(operation)); + this.EventId = eventId ?? throw new global::System.ArgumentNullException(nameof(eventId)); + this.Attributes = attributes; + } + + /// + /// Initializes a new instance of the class. + /// + public StepTransitionTraceSpanVariant2() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.ThinkingSpanContent.Json.g.cs b/src/libs/Vectara/Generated/Vectara.Models.ThinkingSpanContent.Json.g.cs new file mode 100644 index 00000000..b79076e3 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.ThinkingSpanContent.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Vectara +{ + public sealed partial class ThinkingSpanContent + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Vectara.ThinkingSpanContent? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Vectara.ThinkingSpanContent), + jsonSerializerContext) as global::Vectara.ThinkingSpanContent; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Vectara.ThinkingSpanContent? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Vectara.ThinkingSpanContent), + jsonSerializerContext).ConfigureAwait(false)) as global::Vectara.ThinkingSpanContent; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.ThinkingSpanContent.g.cs b/src/libs/Vectara/Generated/Vectara.Models.ThinkingSpanContent.g.cs new file mode 100644 index 00000000..c389563b --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.ThinkingSpanContent.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// Decrypted content of a thinking span. + /// + public sealed partial class ThinkingSpanContent + { + /// + /// Extended thinking content. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("thinking")] + public string? Thinking { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Extended thinking content. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ThinkingSpanContent( + string? thinking) + { + this.Thinking = thinking; + } + + /// + /// Initializes a new instance of the class. + /// + public ThinkingSpanContent() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.ThinkingTraceSpan.Json.g.cs b/src/libs/Vectara/Generated/Vectara.Models.ThinkingTraceSpan.Json.g.cs new file mode 100644 index 00000000..6df00b43 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.ThinkingTraceSpan.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Vectara +{ + public readonly partial struct ThinkingTraceSpan + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Vectara.ThinkingTraceSpan? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Vectara.ThinkingTraceSpan), + jsonSerializerContext) as global::Vectara.ThinkingTraceSpan?; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Vectara.ThinkingTraceSpan? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Vectara.ThinkingTraceSpan), + jsonSerializerContext).ConfigureAwait(false)) as global::Vectara.ThinkingTraceSpan?; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.ThinkingTraceSpan.g.cs b/src/libs/Vectara/Generated/Vectara.Models.ThinkingTraceSpan.g.cs new file mode 100644 index 00000000..946ec52f --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.ThinkingTraceSpan.g.cs @@ -0,0 +1,221 @@ +#pragma warning disable CS0618 // Type or member is obsolete + +#nullable enable + +namespace Vectara +{ + /// + /// A span representing extended thinking output from the LLM. + /// + public readonly partial struct ThinkingTraceSpan : global::System.IEquatable + { + /// + /// Common properties shared by all agent trace span types. + /// +#if NET6_0_OR_GREATER + public global::Vectara.AgentTraceSpanBase? AgentBase { get; init; } +#else + public global::Vectara.AgentTraceSpanBase? AgentBase { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(AgentBase))] +#endif + public bool IsAgentBase => AgentBase != null; + + /// + /// + /// +#if NET6_0_OR_GREATER + public global::Vectara.ThinkingTraceSpanVariant2? ThinkingTraceSpanVariant2 { get; init; } +#else + public global::Vectara.ThinkingTraceSpanVariant2? ThinkingTraceSpanVariant2 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ThinkingTraceSpanVariant2))] +#endif + public bool IsThinkingTraceSpanVariant2 => ThinkingTraceSpanVariant2 != null; + /// + /// + /// + public static implicit operator ThinkingTraceSpan(global::Vectara.AgentTraceSpanBase value) => new ThinkingTraceSpan((global::Vectara.AgentTraceSpanBase?)value); + + /// + /// + /// + public static implicit operator global::Vectara.AgentTraceSpanBase?(ThinkingTraceSpan @this) => @this.AgentBase; + + /// + /// + /// + public ThinkingTraceSpan(global::Vectara.AgentTraceSpanBase? value) + { + AgentBase = value; + } + + /// + /// + /// + public static implicit operator ThinkingTraceSpan(global::Vectara.ThinkingTraceSpanVariant2 value) => new ThinkingTraceSpan((global::Vectara.ThinkingTraceSpanVariant2?)value); + + /// + /// + /// + public static implicit operator global::Vectara.ThinkingTraceSpanVariant2?(ThinkingTraceSpan @this) => @this.ThinkingTraceSpanVariant2; + + /// + /// + /// + public ThinkingTraceSpan(global::Vectara.ThinkingTraceSpanVariant2? value) + { + ThinkingTraceSpanVariant2 = value; + } + + /// + /// + /// + public ThinkingTraceSpan( + global::Vectara.AgentTraceSpanBase? agentBase, + global::Vectara.ThinkingTraceSpanVariant2? thinkingTraceSpanVariant2 + ) + { + AgentBase = agentBase; + ThinkingTraceSpanVariant2 = thinkingTraceSpanVariant2; + } + + /// + /// + /// + public object? Object => + ThinkingTraceSpanVariant2 as object ?? + AgentBase as object + ; + + /// + /// + /// + public override string? ToString() => + AgentBase?.ToString() ?? + ThinkingTraceSpanVariant2?.ToString() + ; + + /// + /// + /// + public bool Validate() + { + return IsAgentBase && IsThinkingTraceSpanVariant2; + } + + /// + /// + /// + public TResult? Match( + global::System.Func? agentBase = null, + global::System.Func? thinkingTraceSpanVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsAgentBase && agentBase != null) + { + return agentBase(AgentBase!); + } + else if (IsThinkingTraceSpanVariant2 && thinkingTraceSpanVariant2 != null) + { + return thinkingTraceSpanVariant2(ThinkingTraceSpanVariant2!); + } + + return default(TResult); + } + + /// + /// + /// + public void Match( + global::System.Action? agentBase = null, + global::System.Action? thinkingTraceSpanVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsAgentBase) + { + agentBase?.Invoke(AgentBase!); + } + else if (IsThinkingTraceSpanVariant2) + { + thinkingTraceSpanVariant2?.Invoke(ThinkingTraceSpanVariant2!); + } + } + + /// + /// + /// + public override int GetHashCode() + { + var fields = new object?[] + { + AgentBase, + typeof(global::Vectara.AgentTraceSpanBase), + ThinkingTraceSpanVariant2, + typeof(global::Vectara.ThinkingTraceSpanVariant2), + }; + const int offset = unchecked((int)2166136261); + const int prime = 16777619; + static int HashCodeAggregator(int hashCode, object? value) => value == null + ? (hashCode ^ 0) * prime + : (hashCode ^ value.GetHashCode()) * prime; + + return global::System.Linq.Enumerable.Aggregate(fields, offset, HashCodeAggregator); + } + + /// + /// + /// + public bool Equals(ThinkingTraceSpan other) + { + return + global::System.Collections.Generic.EqualityComparer.Default.Equals(AgentBase, other.AgentBase) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(ThinkingTraceSpanVariant2, other.ThinkingTraceSpanVariant2) + ; + } + + /// + /// + /// + public static bool operator ==(ThinkingTraceSpan obj1, ThinkingTraceSpan obj2) + { + return global::System.Collections.Generic.EqualityComparer.Default.Equals(obj1, obj2); + } + + /// + /// + /// + public static bool operator !=(ThinkingTraceSpan obj1, ThinkingTraceSpan obj2) + { + return !(obj1 == obj2); + } + + /// + /// + /// + public override bool Equals(object? obj) + { + return obj is ThinkingTraceSpan o && Equals(o); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.ThinkingTraceSpanVariant2.Json.g.cs b/src/libs/Vectara/Generated/Vectara.Models.ThinkingTraceSpanVariant2.Json.g.cs new file mode 100644 index 00000000..a4ec58eb --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.ThinkingTraceSpanVariant2.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Vectara +{ + public sealed partial class ThinkingTraceSpanVariant2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Vectara.ThinkingTraceSpanVariant2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Vectara.ThinkingTraceSpanVariant2), + jsonSerializerContext) as global::Vectara.ThinkingTraceSpanVariant2; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Vectara.ThinkingTraceSpanVariant2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Vectara.ThinkingTraceSpanVariant2), + jsonSerializerContext).ConfigureAwait(false)) as global::Vectara.ThinkingTraceSpanVariant2; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.ThinkingTraceSpanVariant2.g.cs b/src/libs/Vectara/Generated/Vectara.Models.ThinkingTraceSpanVariant2.g.cs new file mode 100644 index 00000000..f1e1b503 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.ThinkingTraceSpanVariant2.g.cs @@ -0,0 +1,63 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// + /// + public sealed partial class ThinkingTraceSpanVariant2 + { + /// + /// The operation type for this span.
+ /// Default Value: thinking
+ /// Example: thinking + ///
+ /// "thinking" + /// thinking + [global::System.Text.Json.Serialization.JsonPropertyName("operation")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Operation { get; set; } = "thinking"; + + /// + /// Span content, only included when include_content=true is requested. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("content")] + public global::Vectara.ThinkingSpanContent? Content { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The operation type for this span.
+ /// Default Value: thinking
+ /// Example: thinking + /// + /// + /// Span content, only included when include_content=true is requested. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ThinkingTraceSpanVariant2( + string operation, + global::Vectara.ThinkingSpanContent? content) + { + this.Operation = operation ?? throw new global::System.ArgumentNullException(nameof(operation)); + this.Content = content; + } + + /// + /// Initializes a new instance of the class. + /// + public ThinkingTraceSpanVariant2() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.UpdateAgentConnectorRequest.Json.g.cs b/src/libs/Vectara/Generated/Vectara.Models.UpdateAgentConnectorRequest.Json.g.cs new file mode 100644 index 00000000..c7927da2 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.UpdateAgentConnectorRequest.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Vectara +{ + public sealed partial class UpdateAgentConnectorRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Vectara.UpdateAgentConnectorRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Vectara.UpdateAgentConnectorRequest), + jsonSerializerContext) as global::Vectara.UpdateAgentConnectorRequest; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Vectara.UpdateAgentConnectorRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Vectara.UpdateAgentConnectorRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Vectara.UpdateAgentConnectorRequest; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.UpdateAgentConnectorRequest.g.cs b/src/libs/Vectara/Generated/Vectara.Models.UpdateAgentConnectorRequest.g.cs new file mode 100644 index 00000000..04ba87af --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.UpdateAgentConnectorRequest.g.cs @@ -0,0 +1,101 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// Request object for updating an existing agent connector. + /// + public sealed partial class UpdateAgentConnectorRequest + { + /// + /// The human-readable name of the connector.
+ /// Example: Updated Customer Support Slack Channel + ///
+ /// Updated Customer Support Slack Channel + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// A detailed description of what this connector does.
+ /// Example: Updated description for the Slack connector + ///
+ /// Updated description for the Slack connector + [global::System.Text.Json.Serialization.JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// Arbitrary metadata associated with the connector.
+ /// Example: {"priority":"medium","department":"customer_service","last_reviewed":"2024-01-15"} + ///
+ /// {"priority":"medium","department":"customer_service","last_reviewed":"2024-01-15"} + [global::System.Text.Json.Serialization.JsonPropertyName("metadata")] + public object? Metadata { get; set; } + + /// + /// Whether the connector is enabled.
+ /// Example: false + ///
+ /// false + [global::System.Text.Json.Serialization.JsonPropertyName("enabled")] + public bool? Enabled { get; set; } + + /// + /// Configuration for different types of connectors. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("configuration")] + public global::Vectara.SlackConnectorConfiguration? Configuration { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The human-readable name of the connector.
+ /// Example: Updated Customer Support Slack Channel + /// + /// + /// A detailed description of what this connector does.
+ /// Example: Updated description for the Slack connector + /// + /// + /// Arbitrary metadata associated with the connector.
+ /// Example: {"priority":"medium","department":"customer_service","last_reviewed":"2024-01-15"} + /// + /// + /// Whether the connector is enabled.
+ /// Example: false + /// + /// + /// Configuration for different types of connectors. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public UpdateAgentConnectorRequest( + string? name, + string? description, + object? metadata, + bool? enabled, + global::Vectara.SlackConnectorConfiguration? configuration) + { + this.Name = name; + this.Description = description; + this.Metadata = metadata; + this.Enabled = enabled; + this.Configuration = configuration; + } + + /// + /// Initializes a new instance of the class. + /// + public UpdateAgentConnectorRequest() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.UpdateAgentConnectorRequestMetadata.Json.g.cs b/src/libs/Vectara/Generated/Vectara.Models.UpdateAgentConnectorRequestMetadata.Json.g.cs new file mode 100644 index 00000000..ece37191 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.UpdateAgentConnectorRequestMetadata.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Vectara +{ + public sealed partial class UpdateAgentConnectorRequestMetadata + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Vectara.UpdateAgentConnectorRequestMetadata? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Vectara.UpdateAgentConnectorRequestMetadata), + jsonSerializerContext) as global::Vectara.UpdateAgentConnectorRequestMetadata; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Vectara.UpdateAgentConnectorRequestMetadata? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Vectara.UpdateAgentConnectorRequestMetadata), + jsonSerializerContext).ConfigureAwait(false)) as global::Vectara.UpdateAgentConnectorRequestMetadata; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.Models.UpdateAgentConnectorRequestMetadata.g.cs b/src/libs/Vectara/Generated/Vectara.Models.UpdateAgentConnectorRequestMetadata.g.cs new file mode 100644 index 00000000..613e10a2 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.UpdateAgentConnectorRequestMetadata.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// Arbitrary metadata associated with the connector.
+ /// Example: {"priority":"medium","department":"customer_service","last_reviewed":"2024-01-15"} + ///
+ public sealed partial class UpdateAgentConnectorRequestMetadata + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.VectaraClient.g.cs b/src/libs/Vectara/Generated/Vectara.VectaraClient.g.cs index 37d9ccad..58acdccc 100644 --- a/src/libs/Vectara/Generated/Vectara.VectaraClient.g.cs +++ b/src/libs/Vectara/Generated/Vectara.VectaraClient.g.cs @@ -57,6 +57,16 @@ public sealed partial class VectaraClient : global::Vectara.IVectaraClient, glob public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Vectara.SourceGenerationContext.Default; + /// + /// + /// + public AgentAnalyticsClient AgentAnalytics => new AgentAnalyticsClient(HttpClient, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContext = JsonSerializerContext, + AutoSDKOAuth2State = AutoSDKOAuth2State, + }; + /// /// /// diff --git a/src/libs/Vectara/openapi.yaml b/src/libs/Vectara/openapi.yaml index bea09a40..80ada597 100644 --- a/src/libs/Vectara/openapi.yaml +++ b/src/libs/Vectara/openapi.yaml @@ -83,6 +83,9 @@ tags: like Slack). - name: Pipeline Runs description: Monitor pipeline execution runs and their processing outcomes. +- name: Agent Analytics + description: Inspect traces emitted by agent executions and retrieve evaluation + data. - name: Pipeline Dead Letters description: View and manage dead letters (failed records) for a pipeline. Dead letters are pipeline-scoped and can be retried individually or in bulk. @@ -10441,6 +10444,321 @@ paths: $ref: '#/components/schemas/NotFoundError' x-fern-sdk-group-name: agents x-fern-sdk-method-name: updateIdentity + /v2/agents/{agent_key}/connectors: + post: + tags: + - Agent Connectors + summary: Create agent connector + x-required-roles: + - type: AgentRole + roles: + - agent_administrator + - type: ApiRole + roles: + - agent_administrator + - administrator + - owner + description: Create a new connector for an agent to receive events from external + platforms like Slack. + operationId: createAgentConnector + parameters: + - $ref: '#/components/parameters/RequestTimeout' + - $ref: '#/components/parameters/RequestTimeoutMillis' + - in: path + name: agent_key + description: The unique identifier of the agent to create a connector for. + required: true + schema: + $ref: '#/components/schemas/AgentKey' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateAgentConnectorRequest' + responses: + '201': + description: The connector has been created successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/AgentConnector' + '400': + description: Connector creation request was malformed or contains invalid + configuration. + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestError' + '403': + description: Permissions do not allow creating connectors for this agent. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Agent not found. + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundError' + x-fern-sdk-group-name: agents + x-fern-sdk-method-name: createConnector + get: + tags: + - Agent Connectors + summary: List agent connectors + x-required-roles: + - type: AgentRole + roles: + - agent_administrator + - type: ApiRole + roles: + - agent_administrator + - administrator + - owner + description: List all connectors for a specific agent, with optional filtering + and pagination. + operationId: listAgentConnectors + parameters: + - $ref: '#/components/parameters/RequestTimeout' + - $ref: '#/components/parameters/RequestTimeoutMillis' + - in: path + name: agent_key + description: The unique identifier of the agent to list connectors for. + required: true + schema: + $ref: '#/components/schemas/AgentKey' + - in: query + name: type + description: Filter connectors by type. + required: false + schema: + type: string + enum: + - slack + example: slack + - in: query + name: enabled + description: Filter connectors by enabled status. + required: false + schema: + type: boolean + example: true + - in: query + name: limit + description: The maximum number of connectors to return in the list. + required: false + schema: + type: integer + format: int32 + minimum: 1 + maximum: 100 + default: 10 + - name: page_key + in: query + description: Used to retrieve the next page of connectors after the limit + has been reached. + required: false + schema: + type: string + responses: + '200': + description: List of available connectors for the agent. + content: + application/json: + schema: + $ref: '#/components/schemas/ListAgentConnectorsResponse' + '403': + description: Permissions do not allow listing connectors for this agent. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Agent not found. + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundError' + x-fern-sdk-group-name: agents + x-fern-sdk-method-name: listConnectors + x-fern-pagination: + cursor: $request.page_key + next_cursor: $response.metadata.page_key + results: $response.connectors + /v2/agents/{agent_key}/connectors/{connector_id}: + get: + tags: + - Agent Connectors + summary: Get agent connector + x-required-roles: + - type: AgentRole + roles: + - agent_administrator + - type: ApiRole + roles: + - agent_administrator + - administrator + - owner + description: Retrieve the details of a specific agent connector by its ID, including + its configuration and status. + operationId: getAgentConnector + parameters: + - $ref: '#/components/parameters/RequestTimeout' + - $ref: '#/components/parameters/RequestTimeoutMillis' + - in: path + name: agent_key + description: The unique identifier of the agent. + required: true + schema: + $ref: '#/components/schemas/AgentKey' + - in: path + name: connector_id + description: The unique identifier of the connector to retrieve. + required: true + schema: + type: string + pattern: con_[0-9a-zA-Z_-]+$ + example: con_slack_support + responses: + '200': + description: The requested connector details. + content: + application/json: + schema: + $ref: '#/components/schemas/AgentConnector' + '403': + description: Permissions do not allow accessing this connector. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Agent or connector not found. + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundError' + x-fern-sdk-group-name: agents + x-fern-sdk-method-name: getConnector + patch: + tags: + - Agent Connectors + summary: Update agent connector + x-required-roles: + - type: AgentRole + roles: + - agent_administrator + - type: ApiRole + roles: + - agent_administrator + - administrator + - owner + description: Update an existing agent connector's configuration, status, or + other properties. + operationId: updateAgentConnector + parameters: + - $ref: '#/components/parameters/RequestTimeout' + - $ref: '#/components/parameters/RequestTimeoutMillis' + - in: path + name: agent_key + description: The unique identifier of the agent. + required: true + schema: + $ref: '#/components/schemas/AgentKey' + - in: path + name: connector_id + description: The unique identifier of the connector to update. + required: true + schema: + type: string + pattern: con_[0-9a-zA-Z_-]+$ + example: con_slack_support + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateAgentConnectorRequest' + responses: + '200': + description: The connector has been updated successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/AgentConnector' + '400': + description: Connector update request was malformed or contains invalid + configuration. + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestError' + '403': + description: Permissions do not allow updating this connector. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Agent or connector not found. + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundError' + x-fern-sdk-group-name: agents + x-fern-sdk-method-name: updateConnector + delete: + tags: + - Agent Connectors + summary: Delete agent connector + x-required-roles: + - type: AgentRole + roles: + - agent_administrator + - type: ApiRole + roles: + - agent_administrator + - administrator + - owner + description: Permanently delete an agent connector and all its associated configuration. + This action cannot be undone. + operationId: deleteAgentConnector + parameters: + - $ref: '#/components/parameters/RequestTimeout' + - $ref: '#/components/parameters/RequestTimeoutMillis' + - in: path + name: agent_key + description: The unique identifier of the agent. + required: true + schema: + $ref: '#/components/schemas/AgentKey' + - in: path + name: connector_id + description: The unique identifier of the connector to delete. + required: true + schema: + type: string + pattern: con_[0-9a-zA-Z_-]+$ + example: con_slack_support + responses: + '204': + description: The connector has been deleted successfully. + '403': + description: Permissions do not allow deleting this connector. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Agent or connector not found. + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundError' + x-fern-sdk-group-name: agents + x-fern-sdk-method-name: deleteConnector /v2/pipelines: post: tags: @@ -11263,19 +11581,392 @@ paths: $ref: '#/components/schemas/NotFoundError' x-fern-sdk-group-name: pipeline_runs x-fern-sdk-method-name: get - /v2/glossaries: - post: + /v2/agent_analytics/traces: + get: tags: - - Glossaries - summary: Create glossary + - Agent Analytics + summary: List agent traces x-required-roles: + - type: AgentRole + roles: + - agent_viewer + - agent_developer + - agent_administrator - type: ApiRole roles: + - agent_viewer + - agent_developer - agent_administrator + - viewer - administrator - owner - description: Create a new glossary. A glossary is a reusable mapping of terms - to expanded forms that agents use to expand abbreviations and acronyms in + description: List agent traces with optional filtering by agent, session, status, + and time range. + operationId: listTraces + parameters: + - $ref: '#/components/parameters/RequestTimeout' + - $ref: '#/components/parameters/RequestTimeoutMillis' + - name: agent_key + in: query + description: Filter traces by agent key. + required: false + schema: + type: string + - name: session_key + in: query + description: Filter traces by session key. + required: false + schema: + type: string + - name: status + in: query + description: Filter traces by status. + required: false + schema: + type: string + enum: + - ok + - error + - name: error_type + in: query + description: Filter to traces containing a span with this exact error type. + required: false + schema: + type: string + enum: + - context_limit_exceeded + - step_transition_limit_exceeded + - actions_limit_reached + - llm_generation_error + - stream_error + - internal + - name: operation + in: query + description: Filter to traces containing at least one span with this operation. + required: false + schema: + type: string + enum: + - invoke_agent + - chat + - execute_tool + - thinking + - output + - guardrail + - step_transition + - image_read + - compaction + - name: tool_name + in: query + description: Filter to traces containing a tool execution span with this exact + tool name. + required: false + schema: + type: string + - name: tool_error_type + in: query + description: Filter to traces containing a tool span with this exact error + type. + required: false + schema: + type: string + enum: + - invalid_input + - not_found + - invalid_configuration + - timeout + - execution_error + - dependency_failed + - name: started_after + in: query + description: Return only traces started after this time (ISO 8601). + required: false + schema: + type: string + format: date-time + - name: started_before + in: query + description: Return only traces started before this time (ISO 8601). + required: false + schema: + type: string + format: date-time + - name: min_duration_ms + in: query + description: Return only traces with duration at or above this threshold in + milliseconds. + required: false + schema: + type: integer + format: int64 + - name: max_duration_ms + in: query + description: Return only traces with duration at or below this threshold in + milliseconds. + required: false + schema: + type: integer + format: int64 + - name: limit + in: query + description: The maximum number of traces to return. + required: false + schema: + type: integer + format: int32 + minimum: 1 + maximum: 100 + default: 10 + - name: page_key + in: query + description: Used to retrieve the next page of results. + required: false + schema: + type: string + responses: + '200': + description: List of agent traces. + content: + application/json: + schema: + $ref: '#/components/schemas/ListAgentTracesResponse' + '403': + description: Permissions do not allow listing traces. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + x-fern-sdk-group-name: agent_analytics + x-fern-sdk-method-name: list_traces + x-fern-pagination: + cursor: $request.page_key + next_cursor: $response.metadata.page_key + results: $response.traces + /v2/agent_analytics/traces/{trace_id}: + get: + tags: + - Agent Analytics + summary: Get agent trace + x-required-roles: + - type: AgentRole + roles: + - agent_viewer + - agent_developer + - agent_administrator + - type: ApiRole + roles: + - agent_viewer + - agent_developer + - agent_administrator + - viewer + - administrator + - owner + description: Retrieve the summary of a specific agent trace by its trace ID. + operationId: getTrace + parameters: + - $ref: '#/components/parameters/RequestTimeout' + - $ref: '#/components/parameters/RequestTimeoutMillis' + - in: path + name: trace_id + description: The unique identifier of the trace. + required: true + schema: + type: string + example: 0af7651916cd43dd8448eb211c80319c + responses: + '200': + description: The requested agent trace. + content: + application/json: + schema: + $ref: '#/components/schemas/AgentTrace' + '403': + description: Permissions do not allow accessing this trace. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Trace not found. + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundError' + x-fern-sdk-group-name: agent_analytics + x-fern-sdk-method-name: get_trace + /v2/agent_analytics/traces/{trace_id}/spans: + get: + tags: + - Agent Analytics + summary: List spans in a trace + x-required-roles: + - type: AgentRole + roles: + - agent_viewer + - agent_developer + - agent_administrator + - type: ApiRole + roles: + - agent_viewer + - agent_developer + - agent_administrator + - viewer + - administrator + - owner + description: Retrieve the flat list of spans for a given trace, each with its + parent_span_id for reconstructing the tree. + operationId: listTraceSpans + parameters: + - $ref: '#/components/parameters/RequestTimeout' + - $ref: '#/components/parameters/RequestTimeoutMillis' + - in: path + name: trace_id + description: The unique identifier of the trace. + required: true + schema: + type: string + - name: include_content + in: query + description: When true, include decrypted span content such as input/output + messages and tool arguments. + required: false + schema: + type: boolean + default: false + - name: operation + in: query + description: Restrict to spans with this operation. + required: false + schema: + type: string + enum: + - invoke_agent + - chat + - execute_tool + - thinking + - output + - guardrail + - step_transition + - image_read + - compaction + - name: limit + in: query + description: The maximum number of spans to return. + required: false + schema: + type: integer + format: int32 + minimum: 1 + maximum: 500 + default: 100 + - name: page_key + in: query + description: Used to retrieve the next page of results. + required: false + schema: + type: string + responses: + '200': + description: List of spans in the trace. + content: + application/json: + schema: + $ref: '#/components/schemas/ListAgentTraceSpansResponse' + '403': + description: Permissions do not allow accessing this trace. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Trace not found. + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundError' + x-fern-sdk-group-name: agent_analytics + x-fern-sdk-method-name: list_trace_spans + x-fern-pagination: + cursor: $request.page_key + next_cursor: $response.metadata.page_key + results: $response.spans + /v2/agent_analytics/traces/{trace_id}/spans/{span_id}: + get: + tags: + - Agent Analytics + summary: Get span in a trace + x-required-roles: + - type: AgentRole + roles: + - agent_viewer + - agent_developer + - agent_administrator + - type: ApiRole + roles: + - agent_viewer + - agent_developer + - agent_administrator + - viewer + - administrator + - owner + description: Retrieve the details of a specific span within a trace. + operationId: getTraceSpan + parameters: + - $ref: '#/components/parameters/RequestTimeout' + - $ref: '#/components/parameters/RequestTimeoutMillis' + - in: path + name: trace_id + description: The unique identifier of the trace. + required: true + schema: + type: string + - in: path + name: span_id + description: The unique identifier of the span. + required: true + schema: + type: string + - name: include_content + in: query + description: When true, include decrypted span content. + required: false + schema: + type: boolean + default: false + responses: + '200': + description: The requested span. + content: + application/json: + schema: + $ref: '#/components/schemas/AgentTraceSpan' + '403': + description: Permissions do not allow accessing this span. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Trace or span not found. + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundError' + x-fern-sdk-group-name: agent_analytics + x-fern-sdk-method-name: get_trace_span + /v2/glossaries: + post: + tags: + - Glossaries + summary: Create glossary + x-required-roles: + - type: ApiRole + roles: + - agent_administrator + - administrator + - owner + description: 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. operationId: createGlossary parameters: @@ -18665,17 +19356,34 @@ components: - sub_agent_configuration x-vectaraParents: - AgentToolConfiguration - ArtifactReadToolParameters: - description: Configurable parameters for the artifact read tool. If not overridden, - they will be required by the LLM to fill in. + InlineArtifactCreateToolConfiguration: + title: InlineArtifactCreateToolConfiguration + description: An artifact create tool configuration defined inline in the agent + for creating artifacts on-the-fly from text or structured data content. type: object properties: - artifact_id: - description: The ID of the artifact to read. + type: type: string - example: art_abc123 - encoding: - description: The encoding format for the content. + description: The type of tool configuration, which is always 'artifact_create' + for inline artifact create tool configurations. + default: artifact_create + description_template: + $ref: '#/components/schemas/ToolDescriptionTemplate' + required: + - type + x-vectaraParents: + - AgentToolConfiguration + ArtifactReadToolParameters: + description: Configurable parameters for the artifact read tool. If not overridden, + they will be required by the LLM to fill in. + type: object + properties: + artifact_id: + description: The ID of the artifact to read. + type: string + example: art_abc123 + encoding: + description: The encoding format for the content. type: string enum: - raw @@ -18928,6 +19636,7 @@ components: web_get: '#/components/schemas/InlineWebGetToolConfiguration' lambda: '#/components/schemas/InlineLambdaToolConfiguration' sub_agent: '#/components/schemas/InlineSubAgentToolConfiguration' + artifact_create: '#/components/schemas/InlineArtifactCreateToolConfiguration' artifact_read: '#/components/schemas/InlineArtifactReadToolConfiguration' artifact_grep: '#/components/schemas/InlineArtifactGrepToolConfiguration' image_read: '#/components/schemas/InlineImageReadToolConfiguration' @@ -18941,6 +19650,7 @@ components: - $ref: '#/components/schemas/InlineWebGetToolConfiguration' - $ref: '#/components/schemas/InlineLambdaToolConfiguration' - $ref: '#/components/schemas/InlineSubAgentToolConfiguration' + - $ref: '#/components/schemas/InlineArtifactCreateToolConfiguration' - $ref: '#/components/schemas/InlineArtifactReadToolConfiguration' - $ref: '#/components/schemas/InlineArtifactGrepToolConfiguration' - $ref: '#/components/schemas/InlineImageReadToolConfiguration' @@ -21847,6 +22557,199 @@ components: type: array items: $ref: '#/components/schemas/AgentRole' + SlackConnectorConfiguration: + description: Configuration for Slack connectors. + type: object + x-vectaraParents: + - ConnectorConfiguration + properties: + type: + description: The type of connector configuration. + type: string + default: slack + example: slack + bot_token: + description: Slack bot token (xoxb-) for API access. Will be encrypted when + stored. + type: string + example: xoxb-1234567890-1234567890123-abcdefghijklmnopqrstuvwx + signing_secret: + description: Slack signing secret for webhook verification. Will be encrypted + when stored. + type: string + example: abcdef1234567890abcdef1234567890abcdef12 + api_app_id: + description: Slack App ID for customer lookup in webhooks. + type: string + example: A1234567890 + webhook_path: + description: The webhook path for this Slack connector to receive events. + type: string + example: /v2/agents/customer_support/connectors/con_slack_support/input + required: + - type + - bot_token + - signing_secret + - api_app_id + ConnectorConfiguration: + description: Configuration for different types of connectors. + discriminator: + propertyName: type + mapping: + slack: '#/components/schemas/SlackConnectorConfiguration' + oneOf: + - $ref: '#/components/schemas/SlackConnectorConfiguration' + AgentConnector: + description: A connector that allows an agent to receive events from external + platforms like Slack. + type: object + properties: + id: + description: The unique identifier for the connector. + type: string + pattern: con_[0-9a-zA-Z_-]+$ + example: con_slack_support + agent_key: + $ref: '#/components/schemas/AgentKey' + name: + description: The human-readable name of the connector. + type: string + example: Customer Support Slack Channel + description: + description: A detailed description of what this connector does. + type: string + example: Receives customer support messages from the + type: + description: The type of connector. + type: string + enum: + - slack + example: slack + status: + description: The current status of the connector. + type: string + enum: + - active + - inactive + - error + default: active + example: active + status_message: + description: Detailed status message (e.g., error description or success + confirmation). + type: string + example: Slack authentication successful + metadata: + description: Arbitrary metadata associated with the connector. + type: object + additionalProperties: true + example: + priority: high + department: customer_service + enabled: + description: Whether the connector is currently enabled and can receive + events. + type: boolean + default: true + example: true + configuration: + $ref: '#/components/schemas/ConnectorConfiguration' + created_at: + description: Timestamp when the connector was created. + type: string + format: date-time + example: '2024-01-15T10:30:00Z' + updated_at: + description: Timestamp when the connector was last updated. + type: string + format: date-time + example: '2024-01-16T14:45:00Z' + required: + - id + - agent_key + - name + - type + - status + - enabled + - configuration + - created_at + ListAgentConnectorsResponse: + description: Response containing a list of agent connectors. + type: object + properties: + connectors: + description: List of agent connectors. + type: array + items: + $ref: '#/components/schemas/AgentConnector' + metadata: + $ref: '#/components/schemas/ListMetadata' + required: + - connectors + - metadata + CreateAgentConnectorRequest: + description: Request object for creating a new agent connector. + type: object + properties: + name: + description: The human-readable name of the connector. + type: string + example: Customer Support Slack Channel + description: + description: A detailed description of what this connector does. + type: string + example: Receives customer support messages from the + type: + description: The type of connector. + type: string + enum: + - slack + example: slack + metadata: + description: Arbitrary metadata associated with the connector. + type: object + additionalProperties: true + default: {} + example: + priority: high + department: customer_service + enabled: + description: Whether the connector should be enabled upon creation. + type: boolean + default: true + example: true + configuration: + $ref: '#/components/schemas/ConnectorConfiguration' + required: + - name + - type + - configuration + UpdateAgentConnectorRequest: + description: Request object for updating an existing agent connector. + type: object + properties: + name: + description: The human-readable name of the connector. + type: string + example: Updated Customer Support Slack Channel + description: + description: A detailed description of what this connector does. + type: string + example: Updated description for the Slack connector + metadata: + description: Arbitrary metadata associated with the connector. + type: object + additionalProperties: true + example: + priority: medium + department: customer_service + last_reviewed: '2024-01-15' + enabled: + description: Whether the connector is enabled. + type: boolean + example: false + configuration: + $ref: '#/components/schemas/ConnectorConfiguration' PipelineStatus: description: The current operational status of the pipeline. type: string @@ -22524,6 +23427,568 @@ components: required: - runs - metadata + AgentTrace: + description: A summary of an agent trace representing one complete agent invocation. + type: object + properties: + trace_id: + description: The unique identifier of the trace. + type: string + example: 0af7651916cd43dd8448eb211c80319c + agent_key: + $ref: '#/components/schemas/AgentKey' + session_key: + $ref: '#/components/schemas/AgentSessionKey' + started_at: + description: The time the trace started. + type: string + format: date-time + duration_ms: + description: Total duration of the trace in milliseconds. + type: integer + format: int64 + status: + description: The final status of the trace. + type: string + enum: + - ok + - error + input_tokens: + description: Total input tokens consumed across all spans. + type: integer + format: int64 + output_tokens: + description: Total output tokens produced across all spans. + type: integer + format: int64 + required: + - trace_id + - started_at + - status + ListAgentTracesResponse: + description: A list of agent traces. + type: object + properties: + traces: + description: The list of agent traces. + type: array + items: + $ref: '#/components/schemas/AgentTrace' + metadata: + $ref: '#/components/schemas/ListMetadata' + required: + - traces + AgentTraceSpanStatus: + description: The status of an agent trace span. + type: string + enum: + - ok + - error + AgentTraceSpanBase: + description: Common properties shared by all agent trace span types. + type: object + properties: + span_id: + description: The unique identifier of the span. + type: string + example: b7ad6b7169203331 + parent_span_id: + description: The identifier of the parent span, if any. + type: string + nullable: true + trace_id: + description: The identifier of the trace this span belongs to. + type: string + started_at: + description: The time this span started. + type: string + format: date-time + duration_ms: + description: Duration of this span in milliseconds. + type: integer + format: int64 + status: + $ref: '#/components/schemas/AgentTraceSpanStatus' + error_message: + description: Error message if the span status is error. + type: string + nullable: true + step_name: + description: The name of the agent step active when this span was created. + type: string + nullable: true + required: + - span_id + - trace_id + - started_at + - status + AgentTraceInputFile: + description: Metadata for a file uploaded alongside an agent input message. + type: object + properties: + name: + description: The original filename. + type: string + size_bytes: + description: The file size in bytes. + type: integer + format: int64 + required: + - name + - size_bytes + InvokeAgentSpanAttributes: + description: Attributes for an invoke_agent span. + type: object + properties: + model: + description: The LLM model used in this invocation. + type: string + input_tokens: + description: Total input tokens consumed across all LLM calls in this invocation. + type: integer + format: int64 + output_tokens: + description: Total output tokens produced across all LLM calls in this invocation. + type: integer + format: int64 + cache_read_input_tokens: + description: Number of input tokens read from cache. + type: integer + format: int64 + temperature: + description: The temperature parameter used for generation. + type: number + format: double + max_tokens: + description: The maximum tokens parameter used for generation. + type: integer + format: int64 + provider_name: + description: The LLM provider name. + type: string + agent_name: + description: The name of the agent. + type: string + agent_description: + description: The description of the agent. + type: string + output_type: + description: The requested output format of the agent invocation. + type: string + enum: + - text + - json + input_event_id: + description: The event ID of the input message. + type: string + output_event_id: + description: The event ID of the output message. + type: string + input_files: + description: Metadata for files uploaded with the input, if any. + type: array + items: + $ref: '#/components/schemas/AgentTraceInputFile' + InvokeAgentSpanContent: + description: Decrypted content of an invoke_agent span. + type: object + properties: + input_messages: + description: Input messages sent to the LLM. + type: string + output_messages: + description: Output messages returned by the LLM. + type: string + thinking: + description: Extended thinking content, if available. + type: string + system_instructions: + description: System instructions provided to the LLM. + type: string + InvokeAgentTraceSpan: + description: A span representing a top-level agent invocation. + allOf: + - $ref: '#/components/schemas/AgentTraceSpanBase' + - type: object + properties: + operation: + description: The operation type for this span. + type: string + default: invoke_agent + example: invoke_agent + attributes: + $ref: '#/components/schemas/InvokeAgentSpanAttributes' + content: + description: Span content, only included when include_content=true is + requested. + allOf: + - $ref: '#/components/schemas/InvokeAgentSpanContent' + nullable: true + required: + - operation + x-vectaraParents: + - AgentTraceSpan + ChatSpanAttributes: + description: Attributes for a chat (LLM completion) span. + type: object + properties: + model: + description: The LLM model used for this completion. + type: string + input_tokens: + description: Number of input tokens in this completion. + type: integer + format: int64 + output_tokens: + description: Number of output tokens in this completion. + type: integer + format: int64 + cache_read_input_tokens: + description: Number of input tokens read from cache. + type: integer + format: int64 + finish_reasons: + description: 'The reasons the LLM generation finished, one per returned + completion. Typically a single-element array + + (e.g., `["stop"]`), but providers may return multiple entries when batching + completions. + + ' + type: array + items: + type: string + temperature: + description: The temperature parameter used for generation. + type: number + format: double + max_tokens: + description: The maximum tokens parameter used for generation. + type: integer + format: int64 + provider_name: + description: The LLM provider name. + type: string + response_id: + description: The provider response identifier. + type: string + ChatTraceSpan: + description: A span representing a single LLM chat completion call within an + agent turn. + allOf: + - $ref: '#/components/schemas/AgentTraceSpanBase' + - type: object + properties: + operation: + description: The operation type for this span. + type: string + default: chat + example: chat + attributes: + $ref: '#/components/schemas/ChatSpanAttributes' + required: + - operation + x-vectaraParents: + - AgentTraceSpan + ExecuteToolSpanAttributes: + description: Attributes for an execute_tool span. + type: object + properties: + tool_name: + description: The name of the tool called. + type: string + tool_key: + description: The configuration key of the tool called. + type: string + tool_call_id: + description: The LLM-assigned tool call identifier. + type: string + tool_type: + description: The type of the tool (e.g. corpora_search, web_search). + type: string + tool_input_event_id: + description: The event ID for the tool input. + type: string + tool_output_event_id: + description: The event ID for the tool output. + type: string + corpus_keys: + description: Corpus keys accessed by the tool. + type: array + items: + type: string + ExecuteToolSpanContent: + description: Decrypted content of an execute_tool span. + type: object + properties: + tool_arguments: + description: Arguments passed to the tool call. + type: string + tool_result: + description: Result returned by the tool call. + type: string + ExecuteToolTraceSpan: + description: A span representing a tool execution within an agent turn. + allOf: + - $ref: '#/components/schemas/AgentTraceSpanBase' + - type: object + properties: + operation: + description: The operation type for this span. + type: string + default: execute_tool + example: execute_tool + attributes: + $ref: '#/components/schemas/ExecuteToolSpanAttributes' + content: + description: Span content, only included when include_content=true is + requested. + allOf: + - $ref: '#/components/schemas/ExecuteToolSpanContent' + nullable: true + required: + - operation + x-vectaraParents: + - AgentTraceSpan + ThinkingSpanContent: + description: Decrypted content of a thinking span. + type: object + properties: + thinking: + description: Extended thinking content. + type: string + ThinkingTraceSpan: + description: A span representing extended thinking output from the LLM. + allOf: + - $ref: '#/components/schemas/AgentTraceSpanBase' + - type: object + properties: + operation: + description: The operation type for this span. + type: string + default: thinking + example: thinking + content: + description: Span content, only included when include_content=true is + requested. + allOf: + - $ref: '#/components/schemas/ThinkingSpanContent' + nullable: true + required: + - operation + x-vectaraParents: + - AgentTraceSpan + OutputSpanContent: + description: Decrypted content of an output span. + type: object + properties: + output_text: + description: The text output produced by the agent. + type: string + OutputTraceSpan: + description: A span representing the final text output of an agent turn. + allOf: + - $ref: '#/components/schemas/AgentTraceSpanBase' + - type: object + properties: + operation: + description: The operation type for this span. + type: string + default: output + example: output + event_id: + description: Session event that this span was generated by. + type: string + content: + description: Span content, only included when include_content=true is + requested. + allOf: + - $ref: '#/components/schemas/OutputSpanContent' + nullable: true + required: + - operation + - event_id + x-vectaraParents: + - AgentTraceSpan + GuardrailSpanAttributes: + description: Attributes for a guardrail span. + type: object + properties: + guardrail_passed: + description: Whether the guardrail check passed. + type: boolean + retry_attempt: + description: The retry attempt number, if this span was retried. + type: integer + format: int32 + GuardrailSpanContent: + description: Decrypted content of a guardrail span. + type: object + properties: + guardrail_issues: + description: Details of guardrail violations found, if any. + type: string + GuardrailTraceSpan: + description: A span representing a guardrail safety check on tool call results. + allOf: + - $ref: '#/components/schemas/AgentTraceSpanBase' + - type: object + properties: + operation: + description: The operation type for this span. + type: string + default: guardrail + example: guardrail + attributes: + $ref: '#/components/schemas/GuardrailSpanAttributes' + content: + description: Span content, only included when include_content=true is + requested. + allOf: + - $ref: '#/components/schemas/GuardrailSpanContent' + nullable: true + required: + - operation + x-vectaraParents: + - AgentTraceSpan + StepTransitionSpanAttributes: + description: Attributes for a step_transition span. + type: object + properties: + from_step: + description: The name of the step being transitioned from. + type: string + to_step: + description: The name of the step being transitioned to. + type: string + StepTransitionTraceSpan: + description: A span representing a transition between agent steps. + allOf: + - $ref: '#/components/schemas/AgentTraceSpanBase' + - type: object + properties: + operation: + description: The operation type for this span. + type: string + default: step_transition + example: step_transition + event_id: + description: Session event that this span was generated by. + type: string + attributes: + $ref: '#/components/schemas/StepTransitionSpanAttributes' + required: + - operation + - event_id + x-vectaraParents: + - AgentTraceSpan + ImageReadSpanAttributes: + description: Attributes for an image_read span. + type: object + properties: + artifact_id: + description: The ID of the image artifact being loaded. + type: string + detail: + description: The detail level used for image processing. + type: string + ImageReadTraceSpan: + description: A span representing an image being loaded into conversation context. + allOf: + - $ref: '#/components/schemas/AgentTraceSpanBase' + - type: object + properties: + operation: + description: The operation type for this span. + type: string + default: image_read + example: image_read + event_id: + description: Session event that this span was generated by. + type: string + attributes: + $ref: '#/components/schemas/ImageReadSpanAttributes' + required: + - operation + - event_id + x-vectaraParents: + - AgentTraceSpan + CompactionSpanAttributes: + description: Attributes for a compaction span. + type: object + properties: + turns_compacted: + description: Number of conversation turns compacted. + type: integer + format: int64 + events_compacted: + description: Number of events hidden by compaction. + type: integer + format: int64 + summary_key: + description: Key of the summary created by compaction. + type: string + CompactionTraceSpan: + description: A span representing context compaction (summarization of older + conversation turns). + allOf: + - $ref: '#/components/schemas/AgentTraceSpanBase' + - type: object + properties: + operation: + description: The operation type for this span. + type: string + default: compaction + example: compaction + event_id: + description: Session event that this span was generated by. + type: string + attributes: + $ref: '#/components/schemas/CompactionSpanAttributes' + required: + - operation + - event_id + x-vectaraParents: + - AgentTraceSpan + AgentTraceSpan: + description: A single span within an agent trace. The shape of attributes and + content varies by operation type. + x-vectara-base-schema: '#/AgentTraceSpanBase' + discriminator: + propertyName: operation + mapping: + invoke_agent: '#/components/schemas/InvokeAgentTraceSpan' + chat: '#/components/schemas/ChatTraceSpan' + execute_tool: '#/components/schemas/ExecuteToolTraceSpan' + thinking: '#/components/schemas/ThinkingTraceSpan' + output: '#/components/schemas/OutputTraceSpan' + guardrail: '#/components/schemas/GuardrailTraceSpan' + step_transition: '#/components/schemas/StepTransitionTraceSpan' + image_read: '#/components/schemas/ImageReadTraceSpan' + compaction: '#/components/schemas/CompactionTraceSpan' + oneOf: + - $ref: '#/components/schemas/InvokeAgentTraceSpan' + - $ref: '#/components/schemas/ChatTraceSpan' + - $ref: '#/components/schemas/ExecuteToolTraceSpan' + - $ref: '#/components/schemas/ThinkingTraceSpan' + - $ref: '#/components/schemas/OutputTraceSpan' + - $ref: '#/components/schemas/GuardrailTraceSpan' + - $ref: '#/components/schemas/StepTransitionTraceSpan' + - $ref: '#/components/schemas/ImageReadTraceSpan' + - $ref: '#/components/schemas/CompactionTraceSpan' + ListAgentTraceSpansResponse: + description: A list of spans for an agent trace. + type: object + properties: + spans: + description: The list of spans. + type: array + items: + $ref: '#/components/schemas/AgentTraceSpan' + metadata: + $ref: '#/components/schemas/ListMetadata' + required: + - spans Glossary: description: 'A glossary is a reusable mapping of terms to their expanded forms. Agents are reminded by @@ -22727,6 +24192,7 @@ x-tagGroups: - Users - name: Analytics tags: + - Agent Analytics - Query History - Jobs - name: Platform