From 656be6d7347b252e3505df5b1b3b1bfe1acbfd5b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 28 Aug 2025 01:50:33 +0000 Subject: [PATCH] feat: Updated OpenAPI spec --- .../Vectara..JsonSerializerContext.g.cs | 6 + .../Vectara.AgentConnectorsClient.g.cs | 87 ++++ .../Generated/Vectara.AgentsClient.g.cs | 87 ++++ .../Vectara.DocumentsClient.GetImage.g.cs | 272 +++++++++++ .../Vectara.IAgentConnectorsClient.g.cs | 41 ++ .../Generated/Vectara.IAgentsClient.g.cs | 41 ++ .../Vectara.IDocumentsClient.GetImage.g.cs | 29 ++ .../Vectara.IInstructionsClient.g.cs | 41 ++ ...ra.IMetadataQueryClient.QueryMetadata.g.cs | 71 +++ .../Vectara.IMetadataQueryClient.g.cs | 41 ++ ...IQueryHistoryClient.GetQueryHistories.g.cs | 2 + .../Generated/Vectara.IToolsClient.g.cs | 41 ++ .../Vectara.IUsersClient.CreateUser.g.cs | 10 +- .../Vectara.IUsersClient.UpdateUser.g.cs | 10 +- .../Generated/Vectara.IVectaraClient.g.cs | 25 + .../Generated/Vectara.InstructionsClient.g.cs | 87 ++++ .../Vectara.JsonConverters.AgentRoleRole.g.cs | 53 ++ ....JsonConverters.AgentRoleRoleNullable.g.cs | 60 +++ ...Vectara.JsonConverters.CorpusRoleRole.g.cs | 53 ++ ...JsonConverters.CorpusRoleRoleNullable.g.cs | 60 +++ ...nConverters.MetadataQueryRequestLevel.g.cs | 53 ++ ...ers.MetadataQueryRequestLevelNullable.g.cs | 60 +++ .../Vectara.JsonSerializerContextTypes.g.cs | 458 ++++++++++-------- ...ara.MetadataQueryClient.QueryMetadata.g.cs | 372 ++++++++++++++ .../Vectara.MetadataQueryClient.g.cs | 87 ++++ .../Vectara.Models.AgentRole.Json.g.cs | 92 ++++ .../Generated/Vectara.Models.AgentRole.g.cs | 59 +++ .../Vectara.Models.AgentRoleRole.g.cs | 57 +++ .../Generated/Vectara.Models.ApiRole.g.cs | 24 + .../Vectara.Models.CoreDocument.g.cs | 13 +- .../Vectara.Models.CoreDocumentPart.g.cs | 14 + .../Vectara.Models.CorpusRole.Json.g.cs | 92 ++++ .../Generated/Vectara.Models.CorpusRole.g.cs | 59 +++ .../Vectara.Models.CorpusRoleRole.g.cs | 63 +++ .../Vectara.Models.CreateUserRequest.g.cs | 28 +- .../Generated/Vectara.Models.Document.g.cs | 11 + .../Vectara.Models.FieldQuery.Json.g.cs | 92 ++++ .../Generated/Vectara.Models.FieldQuery.g.cs | 71 +++ .../Generated/Vectara.Models.Image.Json.g.cs | 92 ++++ .../Generated/Vectara.Models.Image.g.cs | 103 ++++ .../Vectara.Models.ImageData.Json.g.cs | 92 ++++ .../Generated/Vectara.Models.ImageData.g.cs | 61 +++ .../Vectara.Models.ImageMetadata.Json.g.cs | 92 ++++ .../Vectara.Models.ImageMetadata.g.cs | 106 ++++ ...Vectara.Models.IndividualSearchResult.g.cs | 11 + ...tara.Models.MetadataQueryRequest.Json.g.cs | 92 ++++ .../Vectara.Models.MetadataQueryRequest.g.cs | 105 ++++ ...tara.Models.MetadataQueryRequestLevel.g.cs | 52 ++ ...ara.Models.MetadataQueryResponse.Json.g.cs | 92 ++++ .../Vectara.Models.MetadataQueryResponse.g.cs | 59 +++ .../Vectara.Models.ScoredDocument.Json.g.cs | 92 ++++ .../Vectara.Models.ScoredDocument.g.cs | 73 +++ ...ra.Models.ScoredDocumentMetadata.Json.g.cs | 92 ++++ ...Vectara.Models.ScoredDocumentMetadata.g.cs | 18 + ...tara.Models.StructuredDocumentSection.g.cs | 11 + .../Vectara.Models.UpdateUserRequest.g.cs | 26 +- .../Generated/Vectara.Models.User.g.cs | 26 +- ....QueryHistoryClient.GetQueryHistories.g.cs | 7 + .../Generated/Vectara.ToolsClient.g.cs | 87 ++++ .../Vectara.UsersClient.CreateUser.g.cs | 12 +- .../Vectara.UsersClient.UpdateUser.g.cs | 12 +- .../Generated/Vectara.VectaraClient.g.cs | 45 ++ src/libs/Vectara/openapi.yaml | 419 +++++++++++++++- 63 files changed, 4480 insertions(+), 219 deletions(-) create mode 100644 src/libs/Vectara/Generated/Vectara.AgentConnectorsClient.g.cs create mode 100644 src/libs/Vectara/Generated/Vectara.AgentsClient.g.cs create mode 100644 src/libs/Vectara/Generated/Vectara.DocumentsClient.GetImage.g.cs create mode 100644 src/libs/Vectara/Generated/Vectara.IAgentConnectorsClient.g.cs create mode 100644 src/libs/Vectara/Generated/Vectara.IAgentsClient.g.cs create mode 100644 src/libs/Vectara/Generated/Vectara.IDocumentsClient.GetImage.g.cs create mode 100644 src/libs/Vectara/Generated/Vectara.IInstructionsClient.g.cs create mode 100644 src/libs/Vectara/Generated/Vectara.IMetadataQueryClient.QueryMetadata.g.cs create mode 100644 src/libs/Vectara/Generated/Vectara.IMetadataQueryClient.g.cs create mode 100644 src/libs/Vectara/Generated/Vectara.IToolsClient.g.cs create mode 100644 src/libs/Vectara/Generated/Vectara.InstructionsClient.g.cs create mode 100644 src/libs/Vectara/Generated/Vectara.JsonConverters.AgentRoleRole.g.cs create mode 100644 src/libs/Vectara/Generated/Vectara.JsonConverters.AgentRoleRoleNullable.g.cs create mode 100644 src/libs/Vectara/Generated/Vectara.JsonConverters.CorpusRoleRole.g.cs create mode 100644 src/libs/Vectara/Generated/Vectara.JsonConverters.CorpusRoleRoleNullable.g.cs create mode 100644 src/libs/Vectara/Generated/Vectara.JsonConverters.MetadataQueryRequestLevel.g.cs create mode 100644 src/libs/Vectara/Generated/Vectara.JsonConverters.MetadataQueryRequestLevelNullable.g.cs create mode 100644 src/libs/Vectara/Generated/Vectara.MetadataQueryClient.QueryMetadata.g.cs create mode 100644 src/libs/Vectara/Generated/Vectara.MetadataQueryClient.g.cs create mode 100644 src/libs/Vectara/Generated/Vectara.Models.AgentRole.Json.g.cs create mode 100644 src/libs/Vectara/Generated/Vectara.Models.AgentRole.g.cs create mode 100644 src/libs/Vectara/Generated/Vectara.Models.AgentRoleRole.g.cs create mode 100644 src/libs/Vectara/Generated/Vectara.Models.CorpusRole.Json.g.cs create mode 100644 src/libs/Vectara/Generated/Vectara.Models.CorpusRole.g.cs create mode 100644 src/libs/Vectara/Generated/Vectara.Models.CorpusRoleRole.g.cs create mode 100644 src/libs/Vectara/Generated/Vectara.Models.FieldQuery.Json.g.cs create mode 100644 src/libs/Vectara/Generated/Vectara.Models.FieldQuery.g.cs create mode 100644 src/libs/Vectara/Generated/Vectara.Models.Image.Json.g.cs create mode 100644 src/libs/Vectara/Generated/Vectara.Models.Image.g.cs create mode 100644 src/libs/Vectara/Generated/Vectara.Models.ImageData.Json.g.cs create mode 100644 src/libs/Vectara/Generated/Vectara.Models.ImageData.g.cs create mode 100644 src/libs/Vectara/Generated/Vectara.Models.ImageMetadata.Json.g.cs create mode 100644 src/libs/Vectara/Generated/Vectara.Models.ImageMetadata.g.cs create mode 100644 src/libs/Vectara/Generated/Vectara.Models.MetadataQueryRequest.Json.g.cs create mode 100644 src/libs/Vectara/Generated/Vectara.Models.MetadataQueryRequest.g.cs create mode 100644 src/libs/Vectara/Generated/Vectara.Models.MetadataQueryRequestLevel.g.cs create mode 100644 src/libs/Vectara/Generated/Vectara.Models.MetadataQueryResponse.Json.g.cs create mode 100644 src/libs/Vectara/Generated/Vectara.Models.MetadataQueryResponse.g.cs create mode 100644 src/libs/Vectara/Generated/Vectara.Models.ScoredDocument.Json.g.cs create mode 100644 src/libs/Vectara/Generated/Vectara.Models.ScoredDocument.g.cs create mode 100644 src/libs/Vectara/Generated/Vectara.Models.ScoredDocumentMetadata.Json.g.cs create mode 100644 src/libs/Vectara/Generated/Vectara.Models.ScoredDocumentMetadata.g.cs create mode 100644 src/libs/Vectara/Generated/Vectara.ToolsClient.g.cs diff --git a/src/libs/Vectara/Generated/Vectara..JsonSerializerContext.g.cs b/src/libs/Vectara/Generated/Vectara..JsonSerializerContext.g.cs index 7db777a..93a35e6 100644 --- a/src/libs/Vectara/Generated/Vectara..JsonSerializerContext.g.cs +++ b/src/libs/Vectara/Generated/Vectara..JsonSerializerContext.g.cs @@ -23,6 +23,8 @@ namespace Vectara typeof(global::Vectara.JsonConverters.CreateDocumentRequestDiscriminatorTypeNullableJsonConverter), typeof(global::Vectara.JsonConverters.SummarizeDocumentStreamedResponseDiscriminatorTypeJsonConverter), typeof(global::Vectara.JsonConverters.SummarizeDocumentStreamedResponseDiscriminatorTypeNullableJsonConverter), + typeof(global::Vectara.JsonConverters.MetadataQueryRequestLevelJsonConverter), + typeof(global::Vectara.JsonConverters.MetadataQueryRequestLevelNullableJsonConverter), typeof(global::Vectara.JsonConverters.LanguageJsonConverter), typeof(global::Vectara.JsonConverters.LanguageNullableJsonConverter), typeof(global::Vectara.JsonConverters.QueryWarningJsonConverter), @@ -57,6 +59,10 @@ namespace Vectara typeof(global::Vectara.JsonConverters.JobTypeNullableJsonConverter), typeof(global::Vectara.JsonConverters.ApiRoleJsonConverter), typeof(global::Vectara.JsonConverters.ApiRoleNullableJsonConverter), + typeof(global::Vectara.JsonConverters.CorpusRoleRoleJsonConverter), + typeof(global::Vectara.JsonConverters.CorpusRoleRoleNullableJsonConverter), + typeof(global::Vectara.JsonConverters.AgentRoleRoleJsonConverter), + typeof(global::Vectara.JsonConverters.AgentRoleRoleNullableJsonConverter), typeof(global::Vectara.JsonConverters.ApiKeyRoleJsonConverter), typeof(global::Vectara.JsonConverters.ApiKeyRoleNullableJsonConverter), typeof(global::Vectara.JsonConverters.CreateAppClientRequestDiscriminatorTypeJsonConverter), diff --git a/src/libs/Vectara/Generated/Vectara.AgentConnectorsClient.g.cs b/src/libs/Vectara/Generated/Vectara.AgentConnectorsClient.g.cs new file mode 100644 index 0000000..8be3853 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.AgentConnectorsClient.g.cs @@ -0,0 +1,87 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// Create and manage connectors that allow agents to receive events from external platforms like Slack
+ /// 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 AgentConnectorsClient : global::Vectara.IAgentConnectorsClient, 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::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Vectara.SourceGenerationContext.Default; + + + /// + /// Creates a new instance of the AgentConnectorsClient. + /// 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 AgentConnectorsClient( + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = 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(); + _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.g.cs b/src/libs/Vectara/Generated/Vectara.AgentsClient.g.cs new file mode 100644 index 0000000..997373c --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.AgentsClient.g.cs @@ -0,0 +1,87 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// Create and interact with AI agents that can use tools and corpora to perform complex queries
+ /// 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 AgentsClient : global::Vectara.IAgentsClient, 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::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Vectara.SourceGenerationContext.Default; + + + /// + /// Creates a new instance of the AgentsClient. + /// 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 AgentsClient( + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = 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(); + _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.DocumentsClient.GetImage.g.cs b/src/libs/Vectara/Generated/Vectara.DocumentsClient.GetImage.g.cs new file mode 100644 index 0000000..522d13e --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.DocumentsClient.GetImage.g.cs @@ -0,0 +1,272 @@ + +#nullable enable + +namespace Vectara +{ + public partial class DocumentsClient + { + partial void PrepareGetImageArguments( + global::System.Net.Http.HttpClient httpClient, + ref int? requestTimeout, + ref int? requestTimeoutMillis, + ref string corpusKey, + ref string documentId, + ref string imageId); + partial void PrepareGetImageRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + int? requestTimeout, + int? requestTimeoutMillis, + string corpusKey, + string documentId, + string imageId); + partial void ProcessGetImageResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGetImageResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Retrieve an image from a document
+ /// Returns a specific image that is embedded within a document. The `image_id` uniquely identifies the image within the document. Use this endpoint to fetch the raw image data and associated metadata. + ///
+ /// + /// + /// + /// A user-provided key for a corpus.
+ /// Example: my-corpus + /// + /// + /// + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task GetImageAsync( + string corpusKey, + string documentId, + string imageId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetImageArguments( + httpClient: HttpClient, + requestTimeout: ref requestTimeout, + requestTimeoutMillis: ref requestTimeoutMillis, + corpusKey: ref corpusKey, + documentId: ref documentId, + imageId: ref imageId); + + var __pathBuilder = new global::Vectara.PathBuilder( + path: $"/v2/corpora/{corpusKey}/documents/{documentId}/images/{imageId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + using 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") + { + __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()); + } + + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetImageRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + corpusKey: corpusKey, + documentId: documentId, + imageId: imageId); + + using var __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: cancellationToken).ConfigureAwait(false); + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessGetImageResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + // Permissions do not allow retrieving the image. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::Vectara.Error? __value_403 = null; + try + { + if (ReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_403 = global::Vectara.Error.FromJson(__content_403, JsonSerializerContext); + } + else + { + var __contentStream_403 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_403 = await global::Vectara.Error.FromJsonStreamAsync(__contentStream_403, JsonSerializerContext).ConfigureAwait(false); + } + } + 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), + }; + } + // Image 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 (ReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_404 = global::Vectara.NotFoundError.FromJson(__content_404, JsonSerializerContext); + } + else + { + var __contentStream_404 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_404 = await global::Vectara.NotFoundError.FromJsonStreamAsync(__contentStream_404, JsonSerializerContext).ConfigureAwait(false); + } + } + 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 (ReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessGetImageResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Vectara.Image.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 + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::Vectara.Image.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + throw new global::Vectara.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IAgentConnectorsClient.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentConnectorsClient.g.cs new file mode 100644 index 0000000..9db46b5 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.IAgentConnectorsClient.g.cs @@ -0,0 +1,41 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// Create and manage connectors that allow agents to receive events from external platforms like Slack
+ /// 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 IAgentConnectorsClient : 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. + /// + public bool ReadResponseAsString { get; set; } + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IAgentsClient.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentsClient.g.cs new file mode 100644 index 0000000..67594d1 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.IAgentsClient.g.cs @@ -0,0 +1,41 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// Create and interact with AI agents that can use tools and corpora to perform complex queries
+ /// 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 IAgentsClient : 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. + /// + public bool ReadResponseAsString { get; set; } + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IDocumentsClient.GetImage.g.cs b/src/libs/Vectara/Generated/Vectara.IDocumentsClient.GetImage.g.cs new file mode 100644 index 0000000..0c32eec --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.IDocumentsClient.GetImage.g.cs @@ -0,0 +1,29 @@ +#nullable enable + +namespace Vectara +{ + public partial interface IDocumentsClient + { + /// + /// Retrieve an image from a document
+ /// Returns a specific image that is embedded within a document. The `image_id` uniquely identifies the image within the document. Use this endpoint to fetch the raw image data and associated metadata. + ///
+ /// + /// + /// + /// A user-provided key for a corpus.
+ /// Example: my-corpus + /// + /// + /// + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task GetImageAsync( + string corpusKey, + string documentId, + string imageId, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IInstructionsClient.g.cs b/src/libs/Vectara/Generated/Vectara.IInstructionsClient.g.cs new file mode 100644 index 0000000..81fef77 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.IInstructionsClient.g.cs @@ -0,0 +1,41 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// Create and manage instructions that guide agent behavior
+ /// 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 IInstructionsClient : 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. + /// + public bool ReadResponseAsString { get; set; } + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IMetadataQueryClient.QueryMetadata.g.cs b/src/libs/Vectara/Generated/Vectara.IMetadataQueryClient.QueryMetadata.g.cs new file mode 100644 index 0000000..e4399cd --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.IMetadataQueryClient.QueryMetadata.g.cs @@ -0,0 +1,71 @@ +#nullable enable + +namespace Vectara +{ + public partial interface IMetadataQueryClient + { + /// + /// Query across metadata fields in a corpus
+ /// Query for documents in a specific corpus using fuzzy matching across specified metadata fields. The search first applies any exact metadata filters to narrow the results, then performs fuzzy matching on the remaining documents using the specified field queries. + ///
+ /// + /// + /// + /// A user-provided key for a corpus.
+ /// Example: my-corpus + /// + /// + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task QueryMetadataAsync( + string corpusKey, + global::Vectara.MetadataQueryRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Query across metadata fields in a corpus
+ /// Query for documents in a specific corpus using fuzzy matching across specified metadata fields. The search first applies any exact metadata filters to narrow the results, then performs fuzzy matching on the remaining documents using the specified field queries. + ///
+ /// + /// + /// + /// A user-provided key for a corpus.
+ /// Example: my-corpus + /// + /// + /// Whether to search document-level or part-level metadata. Document-level returns unique documents, part-level can return multiple parts from the same document.
+ /// Default Value: document + /// + /// + /// List of field-specific queries to apply fuzzy matching.
+ /// Example: [, ] + /// + /// + /// Optional filter expression to narrow down results before fuzzy matching is applied.
+ /// This uses the same expression format as document listing filters and applies exact matching.
+ /// Example: doc.Status = 'Active' + /// + /// + /// Sets the maximum number of documents to return.
+ /// Default Value: 10 + /// + /// + /// Starting position for pagination.
+ /// Default Value: 0 + /// + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task QueryMetadataAsync( + string corpusKey, + global::System.Collections.Generic.IList queries, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.MetadataQueryRequestLevel? level = default, + string? metadataFilter = default, + int? limit = default, + int? offset = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IMetadataQueryClient.g.cs b/src/libs/Vectara/Generated/Vectara.IMetadataQueryClient.g.cs new file mode 100644 index 0000000..93f8ce4 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.IMetadataQueryClient.g.cs @@ -0,0 +1,41 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// Query across arbitrary metadata fields in a corpus
+ /// 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 IMetadataQueryClient : 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. + /// + public bool ReadResponseAsString { get; set; } + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IQueryHistoryClient.GetQueryHistories.g.cs b/src/libs/Vectara/Generated/Vectara.IQueryHistoryClient.GetQueryHistories.g.cs index f700e50..c7a824d 100644 --- a/src/libs/Vectara/Generated/Vectara.IQueryHistoryClient.GetQueryHistories.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IQueryHistoryClient.GetQueryHistories.g.cs @@ -14,6 +14,7 @@ public partial interface IQueryHistoryClient /// /// /// + /// /// /// Default Value: 10 /// @@ -27,6 +28,7 @@ public partial interface IQueryHistoryClient global::System.DateTime? startedAfter = default, global::System.DateTime? startedBefore = default, string? chatId = default, + string? historyId = default, int? limit = default, string? pageKey = default, global::System.Threading.CancellationToken cancellationToken = default); diff --git a/src/libs/Vectara/Generated/Vectara.IToolsClient.g.cs b/src/libs/Vectara/Generated/Vectara.IToolsClient.g.cs new file mode 100644 index 0000000..cefd64d --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.IToolsClient.g.cs @@ -0,0 +1,41 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// Manage and discover tools available for AI agents to use in their workflows
+ /// 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 IToolsClient : 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. + /// + public bool ReadResponseAsString { get; set; } + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IUsersClient.CreateUser.g.cs b/src/libs/Vectara/Generated/Vectara.IUsersClient.CreateUser.g.cs index fee4aaf..2808479 100644 --- a/src/libs/Vectara/Generated/Vectara.IUsersClient.CreateUser.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IUsersClient.CreateUser.g.cs @@ -35,7 +35,13 @@ public partial interface IUsersClient /// The description of the user. /// /// - /// The role names assigned to the user. + /// The customer-level role names assigned to the user. + /// + /// + /// Corpus-specific role assignments for the user. + /// + /// + /// Agent-specific role assignments for the user. /// /// The token to cancel the operation with /// @@ -46,6 +52,8 @@ public partial interface IUsersClient string? username = default, string? description = default, global::System.Collections.Generic.IList? apiRoles = default, + global::System.Collections.Generic.IList? corpusRoles = default, + global::System.Collections.Generic.IList? agentRoles = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.IUsersClient.UpdateUser.g.cs b/src/libs/Vectara/Generated/Vectara.IUsersClient.UpdateUser.g.cs index 24152d5..6c2ec49 100644 --- a/src/libs/Vectara/Generated/Vectara.IUsersClient.UpdateUser.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IUsersClient.UpdateUser.g.cs @@ -32,7 +32,13 @@ public partial interface IUsersClient /// Indicates whether to enable or disable the user. /// /// - /// The new role names of the user. + /// The new customer-level role names of the user. + /// + /// + /// New corpus-specific role assignments for the user. + /// + /// + /// New agent-specific role assignments for the user. /// /// /// The description of the user. @@ -45,6 +51,8 @@ public partial interface IUsersClient int? requestTimeoutMillis = default, bool? enabled = default, global::System.Collections.Generic.IList? apiRoles = default, + global::System.Collections.Generic.IList? corpusRoles = default, + global::System.Collections.Generic.IList? agentRoles = default, string? description = default, global::System.Threading.CancellationToken cancellationToken = default); } diff --git a/src/libs/Vectara/Generated/Vectara.IVectaraClient.g.cs b/src/libs/Vectara/Generated/Vectara.IVectaraClient.g.cs index 5dad0e7..f7f59d7 100644 --- a/src/libs/Vectara/Generated/Vectara.IVectaraClient.g.cs +++ b/src/libs/Vectara/Generated/Vectara.IVectaraClient.g.cs @@ -41,6 +41,16 @@ public partial interface IVectaraClient : global::System.IDisposable global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + /// + /// Create and interact with AI agents that can use tools and corpora to perform complex queries + /// + public AgentsClient Agents { get; } + + /// + /// Create and manage connectors that allow agents to receive events from external platforms like Slack + /// + public AgentConnectorsClient AgentConnectors { get; } + /// /// Authenticate with the API using OAuth 2.0 or API keys /// @@ -141,5 +151,20 @@ public partial interface IVectaraClient : global::System.IDisposable /// public FactualConsistencyEvaluationClient FactualConsistencyEvaluation { get; } + /// + /// Query across arbitrary metadata fields in a corpus + /// + public MetadataQueryClient MetadataQuery { get; } + + /// + /// Manage and discover tools available for AI agents to use in their workflows + /// + public ToolsClient Tools { get; } + + /// + /// Create and manage instructions that guide agent behavior + /// + public InstructionsClient Instructions { get; } + } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.InstructionsClient.g.cs b/src/libs/Vectara/Generated/Vectara.InstructionsClient.g.cs new file mode 100644 index 0000000..cc8b314 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.InstructionsClient.g.cs @@ -0,0 +1,87 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// Create and manage instructions that guide agent behavior
+ /// 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 InstructionsClient : global::Vectara.IInstructionsClient, 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::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Vectara.SourceGenerationContext.Default; + + + /// + /// Creates a new instance of the InstructionsClient. + /// 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 InstructionsClient( + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = 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(); + _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.JsonConverters.AgentRoleRole.g.cs b/src/libs/Vectara/Generated/Vectara.JsonConverters.AgentRoleRole.g.cs new file mode 100644 index 0000000..16b74ea --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.JsonConverters.AgentRoleRole.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Vectara.JsonConverters +{ + /// + public sealed class AgentRoleRoleJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Vectara.AgentRoleRole 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.AgentRoleRoleExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Vectara.AgentRoleRole)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Vectara.AgentRoleRole); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Vectara.AgentRoleRole value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Vectara.AgentRoleRoleExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.JsonConverters.AgentRoleRoleNullable.g.cs b/src/libs/Vectara/Generated/Vectara.JsonConverters.AgentRoleRoleNullable.g.cs new file mode 100644 index 0000000..9ddff5c --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.JsonConverters.AgentRoleRoleNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Vectara.JsonConverters +{ + /// + public sealed class AgentRoleRoleNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Vectara.AgentRoleRole? 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.AgentRoleRoleExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Vectara.AgentRoleRole)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Vectara.AgentRoleRole?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Vectara.AgentRoleRole? 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.AgentRoleRoleExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.JsonConverters.CorpusRoleRole.g.cs b/src/libs/Vectara/Generated/Vectara.JsonConverters.CorpusRoleRole.g.cs new file mode 100644 index 0000000..fdb5bcb --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.JsonConverters.CorpusRoleRole.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Vectara.JsonConverters +{ + /// + public sealed class CorpusRoleRoleJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Vectara.CorpusRoleRole 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.CorpusRoleRoleExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Vectara.CorpusRoleRole)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Vectara.CorpusRoleRole); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Vectara.CorpusRoleRole value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Vectara.CorpusRoleRoleExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.JsonConverters.CorpusRoleRoleNullable.g.cs b/src/libs/Vectara/Generated/Vectara.JsonConverters.CorpusRoleRoleNullable.g.cs new file mode 100644 index 0000000..7f40cc9 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.JsonConverters.CorpusRoleRoleNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Vectara.JsonConverters +{ + /// + public sealed class CorpusRoleRoleNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Vectara.CorpusRoleRole? 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.CorpusRoleRoleExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Vectara.CorpusRoleRole)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Vectara.CorpusRoleRole?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Vectara.CorpusRoleRole? 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.CorpusRoleRoleExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.JsonConverters.MetadataQueryRequestLevel.g.cs b/src/libs/Vectara/Generated/Vectara.JsonConverters.MetadataQueryRequestLevel.g.cs new file mode 100644 index 0000000..40fbf46 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.JsonConverters.MetadataQueryRequestLevel.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Vectara.JsonConverters +{ + /// + public sealed class MetadataQueryRequestLevelJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Vectara.MetadataQueryRequestLevel 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.MetadataQueryRequestLevelExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Vectara.MetadataQueryRequestLevel)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Vectara.MetadataQueryRequestLevel); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Vectara.MetadataQueryRequestLevel value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Vectara.MetadataQueryRequestLevelExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.JsonConverters.MetadataQueryRequestLevelNullable.g.cs b/src/libs/Vectara/Generated/Vectara.JsonConverters.MetadataQueryRequestLevelNullable.g.cs new file mode 100644 index 0000000..0a518ad --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.JsonConverters.MetadataQueryRequestLevelNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Vectara.JsonConverters +{ + /// + public sealed class MetadataQueryRequestLevelNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Vectara.MetadataQueryRequestLevel? 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.MetadataQueryRequestLevelExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Vectara.MetadataQueryRequestLevel)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Vectara.MetadataQueryRequestLevel?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Vectara.MetadataQueryRequestLevel? 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.MetadataQueryRequestLevelExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Vectara/Generated/Vectara.JsonSerializerContextTypes.g.cs b/src/libs/Vectara/Generated/Vectara.JsonSerializerContextTypes.g.cs index 5e5659b..848b334 100644 --- a/src/libs/Vectara/Generated/Vectara.JsonSerializerContextTypes.g.cs +++ b/src/libs/Vectara/Generated/Vectara.JsonSerializerContextTypes.g.cs @@ -198,774 +198,846 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::System.Collections.Generic.Dictionary? Type43 { get; set; } + public global::Vectara.ImageMetadata? Type43 { get; set; } /// /// /// - public global::Vectara.DocumentPart? Type44 { get; set; } + public global::System.Collections.Generic.Dictionary? Type44 { get; set; } /// /// /// - public global::Vectara.DocumentStorageUsage? Type45 { get; set; } + public global::Vectara.DocumentPart? Type45 { get; set; } /// /// /// - public global::Vectara.ExtractionUsage? Type46 { get; set; } + public global::Vectara.DocumentStorageUsage? Type46 { get; set; } /// /// /// - public global::Vectara.Document? Type47 { get; set; } + public global::Vectara.ExtractionUsage? Type47 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type48 { get; set; } + public global::Vectara.Document? Type48 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type49 { get; set; } + public global::System.Collections.Generic.IList? Type49 { get; set; } /// /// /// - public global::Vectara.ListDocumentsResponse? Type50 { get; set; } + public global::System.Collections.Generic.IList? Type50 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type51 { get; set; } + public global::System.Collections.Generic.IList? Type51 { get; set; } /// /// /// - public global::Vectara.CoreDocumentPart? Type52 { get; set; } + public global::Vectara.ListDocumentsResponse? Type52 { get; set; } /// /// /// - public global::Vectara.CoreDocument? Type53 { get; set; } + public global::System.Collections.Generic.IList? Type53 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type54 { get; set; } + public global::Vectara.ImageData? Type54 { get; set; } /// /// /// - public global::Vectara.StructuredDocumentSection? Type55 { get; set; } + public global::Vectara.Image? Type55 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type56 { get; set; } + public global::Vectara.CoreDocumentPart? Type56 { get; set; } /// /// /// - public global::Vectara.StructuredDocument? Type57 { get; set; } + public global::Vectara.CoreDocument? Type57 { get; set; } /// /// /// - public global::Vectara.CreateDocumentRequest? Type58 { get; set; } + public global::System.Collections.Generic.IList? Type58 { get; set; } /// /// /// - public global::Vectara.CreateDocumentRequestDiscriminator? Type59 { get; set; } + public global::System.Collections.Generic.IList? Type59 { get; set; } /// /// /// - public global::Vectara.CreateDocumentRequestDiscriminatorType? Type60 { get; set; } + public global::Vectara.StructuredDocumentSection? Type60 { get; set; } /// /// /// - public global::Vectara.UpdateDocumentRequest? Type61 { get; set; } + public global::System.Collections.Generic.IList? Type61 { get; set; } /// /// /// - public global::Vectara.SummarizeDocumentRequest? Type62 { get; set; } + public global::Vectara.StructuredDocument? Type62 { get; set; } /// /// /// - public global::Vectara.SummarizeDocumentResponse? Type63 { get; set; } + public global::Vectara.CreateDocumentRequest? Type63 { get; set; } /// /// /// - public global::Vectara.StreamGenerationChunk? Type64 { get; set; } + public global::Vectara.CreateDocumentRequestDiscriminator? Type64 { get; set; } /// /// /// - public global::Vectara.GenerationInfo? Type65 { get; set; } + public global::Vectara.CreateDocumentRequestDiscriminatorType? Type65 { get; set; } /// /// /// - public global::Vectara.StreamGenerationEnd? Type66 { get; set; } + public global::Vectara.UpdateDocumentRequest? Type66 { get; set; } /// /// /// - public global::Vectara.StreamError? Type67 { get; set; } + public global::Vectara.SummarizeDocumentRequest? Type67 { get; set; } /// /// /// - public global::Vectara.StreamResponseEnd? Type68 { get; set; } + public global::Vectara.SummarizeDocumentResponse? Type68 { get; set; } /// /// /// - public global::Vectara.SummarizeDocumentStreamedResponse? Type69 { get; set; } + public global::Vectara.StreamGenerationChunk? Type69 { get; set; } /// /// /// - public global::Vectara.SummarizeDocumentStreamedResponseDiscriminator? Type70 { get; set; } + public global::Vectara.GenerationInfo? Type70 { get; set; } /// /// /// - public global::Vectara.SummarizeDocumentStreamedResponseDiscriminatorType? Type71 { get; set; } + public global::Vectara.StreamGenerationEnd? Type71 { get; set; } /// /// /// - public global::Vectara.Language? Type72 { get; set; } + public global::Vectara.StreamError? Type72 { get; set; } /// /// /// - public global::Vectara.IndividualSearchResult? Type73 { get; set; } + public global::Vectara.StreamResponseEnd? Type73 { get; set; } /// /// /// - public global::Vectara.QueryWarning? Type74 { get; set; } + public global::Vectara.SummarizeDocumentStreamedResponse? Type74 { get; set; } /// /// /// - public global::Vectara.FilterExtraction? Type75 { get; set; } + public global::Vectara.SummarizeDocumentStreamedResponseDiscriminator? Type75 { get; set; } /// /// /// - public global::Vectara.RewrittenQuery? Type76 { get; set; } + public global::Vectara.SummarizeDocumentStreamedResponseDiscriminatorType? Type76 { get; set; } /// /// /// - public global::Vectara.QueryFullResponse? Type77 { get; set; } + public global::Vectara.FieldQuery? Type77 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type78 { get; set; } + public float? Type78 { get; set; } /// /// /// - public float? Type79 { get; set; } + public global::Vectara.MetadataQueryRequest? Type79 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type80 { get; set; } + public global::Vectara.MetadataQueryRequestLevel? Type80 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type81 { get; set; } + public global::System.Collections.Generic.IList? Type81 { get; set; } /// /// /// - public global::Vectara.SearchSemantics? Type82 { get; set; } + public global::Vectara.ScoredDocument? Type82 { get; set; } /// /// /// - public global::Vectara.SearchCorpus? Type83 { get; set; } + public global::Vectara.MetadataQueryResponse? Type83 { get; set; } /// /// /// - public global::Vectara.ContextConfiguration? Type84 { get; set; } + public global::System.Collections.Generic.IList? Type84 { get; set; } /// /// /// - public global::Vectara.CustomerSpecificReranker? Type85 { get; set; } + public global::Vectara.Language? Type85 { get; set; } /// /// /// - public global::Vectara.UserFunctionReranker? Type86 { get; set; } + public global::Vectara.IndividualSearchResult? Type86 { get; set; } /// /// /// - public global::Vectara.MMRReranker? Type87 { get; set; } + public global::Vectara.QueryWarning? Type87 { get; set; } /// /// /// - public global::Vectara.SearchReranker? Type88 { get; set; } + public global::Vectara.FilterExtraction? Type88 { get; set; } /// /// /// - public global::Vectara.ChainReranker? Type89 { get; set; } + public global::Vectara.RewrittenQuery? Type89 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type90 { get; set; } + public global::Vectara.QueryFullResponse? Type90 { get; set; } /// /// /// - public global::Vectara.NoneReranker? Type91 { get; set; } + public global::System.Collections.Generic.IList? Type91 { get; set; } /// /// /// - public global::Vectara.SearchRerankerDiscriminator? Type92 { get; set; } + public global::System.Collections.Generic.IList? Type92 { get; set; } /// /// /// - public global::Vectara.SearchRerankerDiscriminatorType? Type93 { get; set; } + public global::System.Collections.Generic.IList? Type93 { get; set; } /// /// /// - public global::Vectara.SearchParameters? Type94 { get; set; } + public global::Vectara.SearchSemantics? Type94 { get; set; } /// /// /// - public global::Vectara.CitationParameters? Type95 { get; set; } + public global::Vectara.SearchCorpus? Type95 { get; set; } /// /// /// - public global::Vectara.CitationParametersStyle? Type96 { get; set; } + public global::Vectara.ContextConfiguration? Type96 { get; set; } /// /// /// - public global::Vectara.GenerationParameters? Type97 { get; set; } + public global::Vectara.CustomerSpecificReranker? Type97 { get; set; } /// /// /// - public global::Vectara.GenerationParametersModelParameters? Type98 { get; set; } + public global::Vectara.UserFunctionReranker? Type98 { get; set; } /// /// /// - public global::Vectara.QueryCorpusRequest? Type99 { get; set; } + public global::Vectara.MMRReranker? Type99 { get; set; } /// /// /// - public global::Vectara.AllOf? Type100 { get; set; } + public global::Vectara.SearchReranker? Type100 { get; set; } /// /// /// - public global::Vectara.StreamSearchResponse? Type101 { get; set; } + public global::Vectara.ChainReranker? Type101 { get; set; } /// /// /// - public global::Vectara.FactualConsistencyScore? Type102 { get; set; } + public global::System.Collections.Generic.IList? Type102 { get; set; } /// /// /// - public global::Vectara.QueryStreamedResponse? Type103 { get; set; } + public global::Vectara.NoneReranker? Type103 { get; set; } /// /// /// - public global::Vectara.QueryStreamedResponseDiscriminator? Type104 { get; set; } + public global::Vectara.SearchRerankerDiscriminator? Type104 { get; set; } /// /// /// - public global::Vectara.QueryStreamedResponseDiscriminatorType? Type105 { get; set; } + public global::Vectara.SearchRerankerDiscriminatorType? Type105 { get; set; } /// /// /// - public global::Vectara.KeyedSearchCorpus? Type106 { get; set; } + public global::Vectara.SearchParameters? Type106 { get; set; } /// /// /// - public global::Vectara.KeyedSearchCorpusVariant2? Type107 { get; set; } + public global::Vectara.CitationParameters? Type107 { get; set; } /// /// /// - public global::Vectara.SearchCorporaParameters? Type108 { get; set; } + public global::Vectara.CitationParametersStyle? Type108 { get; set; } /// /// /// - public global::Vectara.SearchCorporaParametersVariant1? Type109 { get; set; } + public global::Vectara.GenerationParameters? Type109 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type110 { get; set; } + public global::Vectara.GenerationParametersModelParameters? Type110 { get; set; } /// /// /// - public global::Vectara.QueryRequest? Type111 { get; set; } + public global::Vectara.QueryCorpusRequest? Type111 { get; set; } /// /// /// - public global::Vectara.RephraseSpan? Type112 { get; set; } + public global::Vectara.AllOf? Type112 { get; set; } /// /// /// - public global::Vectara.SearchSpan? Type113 { get; set; } + public global::Vectara.StreamSearchResponse? Type113 { get; set; } /// /// /// - public global::Vectara.RerankedSearchResult? Type114 { get; set; } + public global::Vectara.FactualConsistencyScore? Type114 { get; set; } /// /// /// - public global::Vectara.RerankSpan? Type115 { get; set; } + public global::Vectara.QueryStreamedResponse? Type115 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type116 { get; set; } + public global::Vectara.QueryStreamedResponseDiscriminator? Type116 { get; set; } /// /// /// - public global::Vectara.GenerationSpan? Type117 { get; set; } + public global::Vectara.QueryStreamedResponseDiscriminatorType? Type117 { get; set; } /// /// /// - public global::Vectara.FactualConsistencyScoreSpan? Type118 { get; set; } + public global::Vectara.KeyedSearchCorpus? Type118 { get; set; } /// /// /// - public global::Vectara.RewrittenQueryWarning? Type119 { get; set; } + public global::Vectara.KeyedSearchCorpusVariant2? Type119 { get; set; } /// /// /// - public global::Vectara.RewrittenQuerySpan? Type120 { get; set; } + public global::Vectara.SearchCorporaParameters? Type120 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type121 { get; set; } + public global::Vectara.SearchCorporaParametersVariant1? Type121 { get; set; } /// /// /// - public global::Vectara.QueryHistorySpan? Type122 { get; set; } + public global::System.Collections.Generic.IList? Type122 { get; set; } /// /// /// - public global::Vectara.QueryHistorySpanDiscriminator? Type123 { get; set; } + public global::Vectara.QueryRequest? Type123 { get; set; } /// /// /// - public global::Vectara.QueryHistorySpanDiscriminatorType? Type124 { get; set; } + public global::Vectara.RephraseSpan? Type124 { get; set; } /// /// /// - public global::Vectara.QueryHistory? Type125 { get; set; } + public global::Vectara.SearchSpan? Type125 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type126 { get; set; } + public global::Vectara.RerankedSearchResult? Type126 { get; set; } /// /// /// - public global::Vectara.QueryHistorySummary? Type127 { get; set; } + public global::Vectara.RerankSpan? Type127 { get; set; } /// /// /// - public global::Vectara.ListQueryHistoriesResponse? Type128 { get; set; } + public global::System.Collections.Generic.IList? Type128 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type129 { get; set; } + public global::Vectara.GenerationSpan? Type129 { get; set; } /// /// /// - public global::Vectara.ListQueryHistoriesResponseMetadata? Type130 { get; set; } + public global::Vectara.FactualConsistencyScoreSpan? Type130 { get; set; } /// /// /// - public global::Vectara.Chat? Type131 { get; set; } + public global::Vectara.RewrittenQueryWarning? Type131 { get; set; } /// /// /// - public global::Vectara.ListChatsResponse? Type132 { get; set; } + public global::Vectara.RewrittenQuerySpan? Type132 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type133 { get; set; } + public global::System.Collections.Generic.IList? Type133 { get; set; } /// /// /// - public global::Vectara.ChatParameters? Type134 { get; set; } + public global::Vectara.QueryHistorySpan? Type134 { get; set; } /// /// /// - public global::Vectara.ChatRequest? Type135 { get; set; } + public global::Vectara.QueryHistorySpanDiscriminator? Type135 { get; set; } /// /// /// - public global::Vectara.ChatFullResponse? Type136 { get; set; } + public global::Vectara.QueryHistorySpanDiscriminatorType? Type136 { get; set; } /// /// /// - public global::Vectara.ChatInfoResponse? Type137 { get; set; } + public global::Vectara.QueryHistory? Type137 { get; set; } /// /// /// - public global::Vectara.ChatStreamedResponse? Type138 { get; set; } + public global::System.Collections.Generic.IList? Type138 { get; set; } /// /// /// - public global::Vectara.ChatStreamedResponseDiscriminator? Type139 { get; set; } + public global::Vectara.QueryHistorySummary? Type139 { get; set; } /// /// /// - public global::Vectara.ChatStreamedResponseDiscriminatorType? Type140 { get; set; } + public global::Vectara.ListQueryHistoriesResponse? Type140 { get; set; } /// /// /// - public global::Vectara.Turn? Type141 { get; set; } + public global::System.Collections.Generic.IList? Type141 { get; set; } /// /// /// - public global::Vectara.ListChatTurnsResponse? Type142 { get; set; } + public global::Vectara.ListQueryHistoriesResponseMetadata? Type142 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type143 { get; set; } + public global::Vectara.Chat? Type143 { get; set; } /// /// /// - public global::Vectara.UpdateTurnRequest? Type144 { get; set; } + public global::Vectara.ListChatsResponse? Type144 { get; set; } /// /// /// - public global::Vectara.Prompt? Type145 { get; set; } + public global::System.Collections.Generic.IList? Type145 { get; set; } /// /// /// - public global::Vectara.LLM? Type146 { get; set; } + public global::Vectara.ChatParameters? Type146 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type147 { get; set; } + public global::Vectara.ChatRequest? Type147 { get; set; } /// /// /// - public global::Vectara.ListLLMsResponse? Type148 { get; set; } + public global::Vectara.ChatFullResponse? Type148 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type149 { get; set; } + public global::Vectara.ChatInfoResponse? Type149 { get; set; } /// /// /// - public global::Vectara.BearerAuth? Type150 { get; set; } + public global::Vectara.ChatStreamedResponse? Type150 { get; set; } /// /// /// - public global::Vectara.HeaderAuth? Type151 { get; set; } + public global::Vectara.ChatStreamedResponseDiscriminator? Type151 { get; set; } /// /// /// - public global::Vectara.RemoteAuth? Type152 { get; set; } + public global::Vectara.ChatStreamedResponseDiscriminatorType? Type152 { get; set; } /// /// /// - public global::Vectara.RemoteAuthDiscriminator? Type153 { get; set; } + public global::Vectara.Turn? Type153 { get; set; } /// /// /// - public global::Vectara.RemoteAuthDiscriminatorType? Type154 { get; set; } + public global::Vectara.ListChatTurnsResponse? Type154 { get; set; } /// /// /// - public global::Vectara.CreateOpenAILLMRequest? Type155 { get; set; } + public global::System.Collections.Generic.IList? Type155 { get; set; } /// /// /// - public global::Vectara.CreateLLMRequest? Type156 { get; set; } + public global::Vectara.UpdateTurnRequest? Type156 { get; set; } /// /// /// - public global::Vectara.CreateLLMRequestDiscriminator? Type157 { get; set; } + public global::Vectara.Prompt? Type157 { get; set; } /// /// /// - public global::Vectara.CreateLLMRequestDiscriminatorType? Type158 { get; set; } + public global::Vectara.LLM? Type158 { get; set; } /// /// /// - public global::Vectara.ChatCompletionRequestMessage? Type159 { get; set; } + public global::System.Collections.Generic.IList? Type159 { get; set; } /// /// /// - public global::Vectara.CreateChatCompletionRequest? Type160 { get; set; } + public global::Vectara.ListLLMsResponse? Type160 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type161 { get; set; } + public global::System.Collections.Generic.IList? Type161 { get; set; } /// /// /// - public global::Vectara.ChatCompletionResponseMessage? Type162 { get; set; } + public global::Vectara.BearerAuth? Type162 { get; set; } /// /// /// - public global::Vectara.ChatCompletionResponseChoice? Type163 { get; set; } + public global::Vectara.HeaderAuth? Type163 { get; set; } /// /// /// - public global::Vectara.CreateChatCompletionResponse? Type164 { get; set; } + public global::Vectara.RemoteAuth? Type164 { get; set; } /// /// /// - public global::Vectara.CreateChatCompletionResponseObject? Type165 { get; set; } + public global::Vectara.RemoteAuthDiscriminator? Type165 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type166 { get; set; } + public global::Vectara.RemoteAuthDiscriminatorType? Type166 { get; set; } /// /// /// - public global::Vectara.ChatCompletionStreamResponseDelta? Type167 { get; set; } + public global::Vectara.CreateOpenAILLMRequest? Type167 { get; set; } /// /// /// - public global::Vectara.ChatCompletionStreamResponseChoice? Type168 { get; set; } + public global::Vectara.CreateLLMRequest? Type168 { get; set; } /// /// /// - public global::Vectara.CreateChatCompletionStreamResponse? Type169 { get; set; } + public global::Vectara.CreateLLMRequestDiscriminator? Type169 { get; set; } /// /// /// - public global::Vectara.CreateChatCompletionStreamResponseObject? Type170 { get; set; } + public global::Vectara.CreateLLMRequestDiscriminatorType? Type170 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type171 { get; set; } + public global::Vectara.ChatCompletionRequestMessage? Type171 { get; set; } /// /// /// - public global::Vectara.GenerationPreset? Type172 { get; set; } + public global::Vectara.CreateChatCompletionRequest? Type172 { get; set; } /// /// /// - public global::Vectara.ListGenerationPresetsResponse? Type173 { get; set; } + public global::System.Collections.Generic.IList? Type173 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type174 { get; set; } + public global::Vectara.ChatCompletionResponseMessage? Type174 { get; set; } /// /// /// - public global::Vectara.EvaluateFactualConsistencyRequest? Type175 { get; set; } + public global::Vectara.ChatCompletionResponseChoice? Type175 { get; set; } /// /// /// - public global::Vectara.EvaluateFactualConsistencyRequestModelParameters? Type176 { get; set; } + public global::Vectara.CreateChatCompletionResponse? Type176 { get; set; } /// /// /// - public global::Vectara.EvaluateFactualConsistencyResponse? Type177 { get; set; } + public global::Vectara.CreateChatCompletionResponseObject? Type177 { get; set; } /// /// /// - public global::Vectara.Encoder? Type178 { get; set; } + public global::System.Collections.Generic.IList? Type178 { get; set; } /// /// /// - public global::Vectara.ListEncodersResponse? Type179 { get; set; } + public global::Vectara.ChatCompletionStreamResponseDelta? Type179 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type180 { get; set; } + public global::Vectara.ChatCompletionStreamResponseChoice? Type180 { get; set; } /// /// /// - public global::Vectara.CreateOpenAIEncoderRequest? Type181 { get; set; } + public global::Vectara.CreateChatCompletionStreamResponse? Type181 { get; set; } /// /// /// - public global::Vectara.CreateEncoderRequest? Type182 { get; set; } + public global::Vectara.CreateChatCompletionStreamResponseObject? Type182 { get; set; } /// /// /// - public global::Vectara.CreateEncoderRequestDiscriminator? Type183 { get; set; } + public global::System.Collections.Generic.IList? Type183 { get; set; } /// /// /// - public global::Vectara.CreateEncoderRequestDiscriminatorType? Type184 { get; set; } + public global::Vectara.GenerationPreset? Type184 { get; set; } /// /// /// - public global::Vectara.Reranker? Type185 { get; set; } + public global::Vectara.ListGenerationPresetsResponse? Type185 { get; set; } /// /// /// - public global::Vectara.ListRerankersResponse? Type186 { get; set; } + public global::System.Collections.Generic.IList? Type186 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type187 { get; set; } + public global::Vectara.EvaluateFactualConsistencyRequest? Type187 { get; set; } /// /// /// - public global::Vectara.TableExtractor? Type188 { get; set; } + public global::Vectara.EvaluateFactualConsistencyRequestModelParameters? Type188 { get; set; } /// /// /// - public global::Vectara.ListTableExtractorsResponse? Type189 { get; set; } + public global::Vectara.EvaluateFactualConsistencyResponse? Type189 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type190 { get; set; } + public global::Vectara.Encoder? Type190 { get; set; } /// /// /// - public global::Vectara.HallucinationCorrector? Type191 { get; set; } + public global::Vectara.ListEncodersResponse? Type191 { get; set; } /// /// /// - public global::Vectara.ListHallucinationCorrectorsResponse? Type192 { get; set; } + public global::System.Collections.Generic.IList? Type192 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type193 { get; set; } + public global::Vectara.CreateOpenAIEncoderRequest? Type193 { get; set; } /// /// /// - public global::Vectara.HcmSourceDocument? Type194 { get; set; } + public global::Vectara.CreateEncoderRequest? Type194 { get; set; } /// /// /// - public global::Vectara.HallucinationCorrectionRequest? Type195 { get; set; } + public global::Vectara.CreateEncoderRequestDiscriminator? Type195 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type196 { get; set; } + public global::Vectara.CreateEncoderRequestDiscriminatorType? Type196 { get; set; } /// /// /// - public global::Vectara.CorrectionItem? Type197 { get; set; } + public global::Vectara.Reranker? Type197 { get; set; } /// /// /// - public global::Vectara.HallucinationCorrectionResponse? Type198 { get; set; } + public global::Vectara.ListRerankersResponse? Type198 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type199 { get; set; } + public global::System.Collections.Generic.IList? Type199 { get; set; } /// /// /// - public global::Vectara.JobState? Type200 { get; set; } + public global::Vectara.TableExtractor? Type200 { get; set; } /// /// /// - public global::Vectara.Job? Type201 { get; set; } + public global::Vectara.ListTableExtractorsResponse? Type201 { get; set; } /// /// /// - public global::Vectara.JobType? Type202 { get; set; } + public global::System.Collections.Generic.IList? Type202 { get; set; } /// /// /// - public global::Vectara.ListJobsResponse? Type203 { get; set; } + public global::Vectara.HallucinationCorrector? Type203 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type204 { get; set; } + public global::Vectara.ListHallucinationCorrectorsResponse? Type204 { get; set; } /// /// /// - public global::Vectara.ApiRole? Type205 { get; set; } + public global::System.Collections.Generic.IList? Type205 { get; set; } /// /// /// - public global::Vectara.ApiOperationPolicy? Type206 { get; set; } + public global::Vectara.HcmSourceDocument? Type206 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary>? Type207 { get; set; } + public global::Vectara.HallucinationCorrectionRequest? Type207 { get; set; } /// /// /// - public global::Vectara.ApiPolicy? Type208 { get; set; } + public global::System.Collections.Generic.IList? Type208 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary? Type209 { get; set; } + public global::Vectara.CorrectionItem? Type209 { get; set; } /// /// /// - public global::Vectara.User? Type210 { get; set; } + public global::Vectara.HallucinationCorrectionResponse? Type210 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type211 { get; set; } + public global::System.Collections.Generic.IList? Type211 { get; set; } /// /// /// - public global::Vectara.ListUsersResponse? Type212 { get; set; } + public global::Vectara.JobState? Type212 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type213 { get; set; } + public global::Vectara.Job? Type213 { get; set; } /// /// /// - public global::Vectara.CreateUserRequest? Type214 { get; set; } + public global::Vectara.JobType? Type214 { get; set; } /// /// /// - public global::Vectara.UpdateUserRequest? Type215 { get; set; } + public global::Vectara.ListJobsResponse? Type215 { get; set; } /// /// /// - public global::Vectara.ApiKeyRole? Type216 { get; set; } + public global::System.Collections.Generic.IList? Type216 { get; set; } /// /// /// - public global::Vectara.ApiKey? Type217 { get; set; } + public global::Vectara.ApiRole? Type217 { get; set; } /// /// /// - public global::Vectara.ListApiKeysResponse? Type218 { get; set; } + public global::Vectara.CorpusRole? Type218 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type219 { get; set; } + public global::Vectara.CorpusRoleRole? Type219 { get; set; } /// /// /// - public global::Vectara.CreateApiKeyRequest? Type220 { get; set; } + public global::Vectara.AgentRole? Type220 { get; set; } /// /// /// - public global::Vectara.UpdateApiKeyRequest? Type221 { get; set; } + public global::Vectara.AgentRoleRole? Type221 { get; set; } /// /// /// - public global::Vectara.AppClient? Type222 { get; set; } + public global::Vectara.ApiOperationPolicy? Type222 { get; set; } /// /// /// - public global::Vectara.ListAppClientsResponse? Type223 { get; set; } + public global::System.Collections.Generic.Dictionary>? Type223 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type224 { get; set; } + public global::Vectara.ApiPolicy? Type224 { get; set; } /// /// /// - public global::Vectara.CreateClientCredentialsRequest? Type225 { get; set; } + public global::System.Collections.Generic.Dictionary? Type225 { get; set; } /// /// /// - public global::Vectara.CreateAppClientRequest? Type226 { get; set; } + public global::Vectara.User? Type226 { get; set; } /// /// /// - public global::Vectara.CreateAppClientRequestDiscriminator? Type227 { get; set; } + public global::System.Collections.Generic.IList? Type227 { get; set; } /// /// /// - public global::Vectara.CreateAppClientRequestDiscriminatorType? Type228 { get; set; } + public global::System.Collections.Generic.IList? Type228 { get; set; } /// /// /// - public global::Vectara.UpdateAppClientRequest? Type229 { get; set; } + public global::System.Collections.Generic.IList? Type229 { get; set; } /// /// /// - public global::Vectara.GetOAuthTokenRequest? Type230 { get; set; } + public global::Vectara.ListUsersResponse? Type230 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type231 { get; set; } + public global::System.Collections.Generic.IList? Type231 { get; set; } /// /// /// - public global::Vectara.AllOf? Type232 { get; set; } + public global::Vectara.CreateUserRequest? Type232 { get; set; } /// /// /// - public global::Vectara.CreateUserResponse2? Type233 { get; set; } + public global::Vectara.UpdateUserRequest? Type233 { get; set; } /// /// /// - public global::Vectara.ResetUserPasswordResponse? Type234 { get; set; } + public global::Vectara.ApiKeyRole? Type234 { get; set; } /// /// /// - public global::Vectara.GetOAuthTokenResponse? Type235 { get; set; } + public global::Vectara.ApiKey? Type235 { get; set; } + /// + /// + /// + public global::Vectara.ListApiKeysResponse? Type236 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type237 { get; set; } + /// + /// + /// + public global::Vectara.CreateApiKeyRequest? Type238 { get; set; } + /// + /// + /// + public global::Vectara.UpdateApiKeyRequest? Type239 { get; set; } + /// + /// + /// + public global::Vectara.AppClient? Type240 { get; set; } + /// + /// + /// + public global::Vectara.ListAppClientsResponse? Type241 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type242 { get; set; } + /// + /// + /// + public global::Vectara.CreateClientCredentialsRequest? Type243 { get; set; } + /// + /// + /// + public global::Vectara.CreateAppClientRequest? Type244 { get; set; } + /// + /// + /// + public global::Vectara.CreateAppClientRequestDiscriminator? Type245 { get; set; } + /// + /// + /// + public global::Vectara.CreateAppClientRequestDiscriminatorType? Type246 { get; set; } + /// + /// + /// + public global::Vectara.UpdateAppClientRequest? Type247 { get; set; } + /// + /// + /// + public global::Vectara.GetOAuthTokenRequest? Type248 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type249 { get; set; } + /// + /// + /// + public global::Vectara.AllOf? Type250 { get; set; } + /// + /// + /// + public global::Vectara.CreateUserResponse2? Type251 { get; set; } + /// + /// + /// + public global::Vectara.ResetUserPasswordResponse? Type252 { get; set; } + /// + /// + /// + public global::Vectara.GetOAuthTokenResponse? Type253 { get; set; } } } \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.MetadataQueryClient.QueryMetadata.g.cs b/src/libs/Vectara/Generated/Vectara.MetadataQueryClient.QueryMetadata.g.cs new file mode 100644 index 0000000..e934619 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.MetadataQueryClient.QueryMetadata.g.cs @@ -0,0 +1,372 @@ + +#nullable enable + +namespace Vectara +{ + public partial class MetadataQueryClient + { + partial void PrepareQueryMetadataArguments( + global::System.Net.Http.HttpClient httpClient, + ref int? requestTimeout, + ref int? requestTimeoutMillis, + ref string corpusKey, + global::Vectara.MetadataQueryRequest request); + partial void PrepareQueryMetadataRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + int? requestTimeout, + int? requestTimeoutMillis, + string corpusKey, + global::Vectara.MetadataQueryRequest request); + partial void ProcessQueryMetadataResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessQueryMetadataResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Query across metadata fields in a corpus
+ /// Query for documents in a specific corpus using fuzzy matching across specified metadata fields. The search first applies any exact metadata filters to narrow the results, then performs fuzzy matching on the remaining documents using the specified field queries. + ///
+ /// + /// + /// + /// A user-provided key for a corpus.
+ /// Example: my-corpus + /// + /// + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task QueryMetadataAsync( + string corpusKey, + global::Vectara.MetadataQueryRequest request, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareQueryMetadataArguments( + httpClient: HttpClient, + requestTimeout: ref requestTimeout, + requestTimeoutMillis: ref requestTimeoutMillis, + corpusKey: ref corpusKey, + request: request); + + var __pathBuilder = new global::Vectara.PathBuilder( + path: $"/v2/corpora/{corpusKey}/metadata_query", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + using 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") + { + __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; + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareQueryMetadataRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + corpusKey: corpusKey, + request: request); + + using var __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: cancellationToken).ConfigureAwait(false); + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessQueryMetadataResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + // Metadata query request was malformed. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::Vectara.BadRequestError? __value_400 = null; + try + { + if (ReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_400 = global::Vectara.BadRequestError.FromJson(__content_400, JsonSerializerContext); + } + else + { + var __contentStream_400 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_400 = await global::Vectara.BadRequestError.FromJsonStreamAsync(__contentStream_400, JsonSerializerContext).ConfigureAwait(false); + } + } + 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 querying metadata in the corpus. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::Vectara.Error? __value_403 = null; + try + { + if (ReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_403 = global::Vectara.Error.FromJson(__content_403, JsonSerializerContext); + } + else + { + var __contentStream_403 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_403 = await global::Vectara.Error.FromJsonStreamAsync(__contentStream_403, JsonSerializerContext).ConfigureAwait(false); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + throw new global::Vectara.ApiException( + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + statusCode: __response.StatusCode) + { + ResponseBody = __content_403, + ResponseObject = __value_403, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Corpus not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::Vectara.NotFoundError? __value_404 = null; + try + { + if (ReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_404 = global::Vectara.NotFoundError.FromJson(__content_404, JsonSerializerContext); + } + else + { + var __contentStream_404 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_404 = await global::Vectara.NotFoundError.FromJsonStreamAsync(__contentStream_404, JsonSerializerContext).ConfigureAwait(false); + } + } + 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 (ReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessQueryMetadataResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Vectara.MetadataQueryResponse.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 + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::Vectara.MetadataQueryResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + throw new global::Vectara.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + } + + /// + /// Query across metadata fields in a corpus
+ /// Query for documents in a specific corpus using fuzzy matching across specified metadata fields. The search first applies any exact metadata filters to narrow the results, then performs fuzzy matching on the remaining documents using the specified field queries. + ///
+ /// + /// + /// + /// A user-provided key for a corpus.
+ /// Example: my-corpus + /// + /// + /// Whether to search document-level or part-level metadata. Document-level returns unique documents, part-level can return multiple parts from the same document.
+ /// Default Value: document + /// + /// + /// List of field-specific queries to apply fuzzy matching.
+ /// Example: [, ] + /// + /// + /// Optional filter expression to narrow down results before fuzzy matching is applied.
+ /// This uses the same expression format as document listing filters and applies exact matching.
+ /// Example: doc.Status = 'Active' + /// + /// + /// Sets the maximum number of documents to return.
+ /// Default Value: 10 + /// + /// + /// Starting position for pagination.
+ /// Default Value: 0 + /// + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task QueryMetadataAsync( + string corpusKey, + global::System.Collections.Generic.IList queries, + int? requestTimeout = default, + int? requestTimeoutMillis = default, + global::Vectara.MetadataQueryRequestLevel? level = default, + string? metadataFilter = default, + int? limit = default, + int? offset = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Vectara.MetadataQueryRequest + { + Level = level, + Queries = queries, + MetadataFilter = metadataFilter, + Limit = limit, + Offset = offset, + }; + + return await QueryMetadataAsync( + requestTimeout: requestTimeout, + requestTimeoutMillis: requestTimeoutMillis, + corpusKey: corpusKey, + request: __request, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.MetadataQueryClient.g.cs b/src/libs/Vectara/Generated/Vectara.MetadataQueryClient.g.cs new file mode 100644 index 0000000..0c4e5ae --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.MetadataQueryClient.g.cs @@ -0,0 +1,87 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// Query across arbitrary metadata fields in a corpus
+ /// 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 MetadataQueryClient : global::Vectara.IMetadataQueryClient, 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::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Vectara.SourceGenerationContext.Default; + + + /// + /// Creates a new instance of the MetadataQueryClient. + /// 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 MetadataQueryClient( + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = 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(); + _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.Models.AgentRole.Json.g.cs b/src/libs/Vectara/Generated/Vectara.Models.AgentRole.Json.g.cs new file mode 100644 index 0000000..8014eee --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.AgentRole.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Vectara +{ + public sealed partial class AgentRole + { + /// + /// 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.AgentRole? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Vectara.AgentRole), + jsonSerializerContext) as global::Vectara.AgentRole; + } + + /// + /// 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.AgentRole? 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.AgentRole), + jsonSerializerContext).ConfigureAwait(false)) as global::Vectara.AgentRole; + } + + /// + /// 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.AgentRole.g.cs b/src/libs/Vectara/Generated/Vectara.Models.AgentRole.g.cs new file mode 100644 index 0000000..04161a2 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.AgentRole.g.cs @@ -0,0 +1,59 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// Agent-specific role assignment. + /// + public sealed partial class AgentRole + { + /// + /// The ID of the agent this role applies to. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("agent_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string AgentId { get; set; } + + /// + /// The role assigned for this specific agent. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("role")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Vectara.JsonConverters.AgentRoleRoleJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Vectara.AgentRoleRole Role { 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 agent this role applies to. + /// + /// + /// The role assigned for this specific agent. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public AgentRole( + string agentId, + global::Vectara.AgentRoleRole role) + { + this.AgentId = agentId ?? throw new global::System.ArgumentNullException(nameof(agentId)); + this.Role = role; + } + + /// + /// Initializes a new instance of the class. + /// + public AgentRole() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.AgentRoleRole.g.cs b/src/libs/Vectara/Generated/Vectara.Models.AgentRoleRole.g.cs new file mode 100644 index 0000000..c503c1a --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.AgentRoleRole.g.cs @@ -0,0 +1,57 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// The role assigned for this specific agent. + /// + public enum AgentRoleRole + { + /// + /// + /// + AgentAdmin, + /// + /// + /// + AgentViewer, + /// + /// + /// + AgentDeveloper, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class AgentRoleRoleExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this AgentRoleRole value) + { + return value switch + { + AgentRoleRole.AgentAdmin => "agent_admin", + AgentRoleRole.AgentViewer => "agent_viewer", + AgentRoleRole.AgentDeveloper => "agent_developer", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static AgentRoleRole? ToEnum(string value) + { + return value switch + { + "agent_admin" => AgentRoleRole.AgentAdmin, + "agent_viewer" => AgentRoleRole.AgentViewer, + "agent_developer" => AgentRoleRole.AgentDeveloper, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.ApiRole.g.cs b/src/libs/Vectara/Generated/Vectara.Models.ApiRole.g.cs index b56c89f..474a3a2 100644 --- a/src/libs/Vectara/Generated/Vectara.Models.ApiRole.g.cs +++ b/src/libs/Vectara/Generated/Vectara.Models.ApiRole.g.cs @@ -24,6 +24,22 @@ public enum ApiRole /// /// CorpusAdministrator, + /// + /// + /// + CorpusDeveloper, + /// + /// + /// + AgentAdministrator, + /// + /// + /// + AgentViewer, + /// + /// + /// + AgentDeveloper, } /// @@ -42,6 +58,10 @@ public static string ToValueString(this ApiRole value) ApiRole.Administrator => "administrator", ApiRole.BillingAdministrator => "billing_administrator", ApiRole.CorpusAdministrator => "corpus_administrator", + ApiRole.CorpusDeveloper => "corpus_developer", + ApiRole.AgentAdministrator => "agent_administrator", + ApiRole.AgentViewer => "agent_viewer", + ApiRole.AgentDeveloper => "agent_developer", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), }; } @@ -56,6 +76,10 @@ public static string ToValueString(this ApiRole value) "administrator" => ApiRole.Administrator, "billing_administrator" => ApiRole.BillingAdministrator, "corpus_administrator" => ApiRole.CorpusAdministrator, + "corpus_developer" => ApiRole.CorpusDeveloper, + "agent_administrator" => ApiRole.AgentAdministrator, + "agent_viewer" => ApiRole.AgentViewer, + "agent_developer" => ApiRole.AgentDeveloper, _ => null, }; } diff --git a/src/libs/Vectara/Generated/Vectara.Models.CoreDocument.g.cs b/src/libs/Vectara/Generated/Vectara.Models.CoreDocument.g.cs index a88e2ce..ad3d2e3 100644 --- a/src/libs/Vectara/Generated/Vectara.Models.CoreDocument.g.cs +++ b/src/libs/Vectara/Generated/Vectara.Models.CoreDocument.g.cs @@ -38,6 +38,12 @@ public sealed partial class CoreDocument [global::System.Text.Json.Serialization.JsonPropertyName("tables")] public global::System.Collections.Generic.IList? Tables { get; set; } + /// + /// The images that this document contains. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("images")] + public global::System.Collections.Generic.IList? Images { get; set; } + /// /// Parts of the document that make up the document. /// @@ -68,6 +74,9 @@ public sealed partial class CoreDocument /// /// The tables that this document contains. /// + /// + /// The images that this document contains. + /// /// /// Parts of the document that make up the document. /// @@ -79,13 +88,15 @@ public CoreDocument( string type, global::System.Collections.Generic.IList documentParts, object? metadata, - global::System.Collections.Generic.IList? tables) + global::System.Collections.Generic.IList? tables, + global::System.Collections.Generic.IList? images) { this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); this.Type = type ?? throw new global::System.ArgumentNullException(nameof(type)); this.DocumentParts = documentParts ?? throw new global::System.ArgumentNullException(nameof(documentParts)); this.Metadata = metadata; this.Tables = tables; + this.Images = images; } /// diff --git a/src/libs/Vectara/Generated/Vectara.Models.CoreDocumentPart.g.cs b/src/libs/Vectara/Generated/Vectara.Models.CoreDocumentPart.g.cs index 02b9dc5..ae32c8d 100644 --- a/src/libs/Vectara/Generated/Vectara.Models.CoreDocumentPart.g.cs +++ b/src/libs/Vectara/Generated/Vectara.Models.CoreDocumentPart.g.cs @@ -31,6 +31,14 @@ public sealed partial class CoreDocumentPart [global::System.Text.Json.Serialization.JsonPropertyName("table_id")] public string? TableId { get; set; } + /// + /// The ID of the image that this document part belongs to.
+ /// Example: image_1 + ///
+ /// image_1 + [global::System.Text.Json.Serialization.JsonPropertyName("image_id")] + public string? ImageId { get; set; } + /// /// The context text for the document part.
/// Example: This document part is part of the table Customer Billing Info. @@ -65,6 +73,10 @@ public sealed partial class CoreDocumentPart /// The ID of the table that this document part belongs to.
/// Example: billing_table_111 /// + /// + /// The ID of the image that this document part belongs to.
+ /// Example: image_1 + /// /// /// The context text for the document part.
/// Example: This document part is part of the table Customer Billing Info. @@ -79,12 +91,14 @@ public CoreDocumentPart( string text, object? metadata, string? tableId, + string? imageId, string? context, global::System.Collections.Generic.Dictionary? customDimensions) { this.Text = text ?? throw new global::System.ArgumentNullException(nameof(text)); this.Metadata = metadata; this.TableId = tableId; + this.ImageId = imageId; this.Context = context; this.CustomDimensions = customDimensions; } diff --git a/src/libs/Vectara/Generated/Vectara.Models.CorpusRole.Json.g.cs b/src/libs/Vectara/Generated/Vectara.Models.CorpusRole.Json.g.cs new file mode 100644 index 0000000..1ee958a --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.CorpusRole.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Vectara +{ + public sealed partial class CorpusRole + { + /// + /// 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.CorpusRole? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Vectara.CorpusRole), + jsonSerializerContext) as global::Vectara.CorpusRole; + } + + /// + /// 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.CorpusRole? 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.CorpusRole), + jsonSerializerContext).ConfigureAwait(false)) as global::Vectara.CorpusRole; + } + + /// + /// 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.CorpusRole.g.cs b/src/libs/Vectara/Generated/Vectara.Models.CorpusRole.g.cs new file mode 100644 index 0000000..9916751 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.CorpusRole.g.cs @@ -0,0 +1,59 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// Corpus-specific role assignment. + /// + public sealed partial class CorpusRole + { + /// + /// The key of the corpus this role applies to. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("corpus_key")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string CorpusKey { get; set; } + + /// + /// The role assigned for this specific corpus. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("role")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Vectara.JsonConverters.CorpusRoleRoleJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Vectara.CorpusRoleRole Role { 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 key of the corpus this role applies to. + /// + /// + /// The role assigned for this specific corpus. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public CorpusRole( + string corpusKey, + global::Vectara.CorpusRoleRole role) + { + this.CorpusKey = corpusKey ?? throw new global::System.ArgumentNullException(nameof(corpusKey)); + this.Role = role; + } + + /// + /// Initializes a new instance of the class. + /// + public CorpusRole() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.CorpusRoleRole.g.cs b/src/libs/Vectara/Generated/Vectara.Models.CorpusRoleRole.g.cs new file mode 100644 index 0000000..40dcf37 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.CorpusRoleRole.g.cs @@ -0,0 +1,63 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// The role assigned for this specific corpus. + /// + public enum CorpusRoleRole + { + /// + /// + /// + Owner, + /// + /// + /// + Administrator, + /// + /// + /// + Viewer, + /// + /// + /// + Editor, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class CorpusRoleRoleExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this CorpusRoleRole value) + { + return value switch + { + CorpusRoleRole.Owner => "owner", + CorpusRoleRole.Administrator => "administrator", + CorpusRoleRole.Viewer => "viewer", + CorpusRoleRole.Editor => "editor", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static CorpusRoleRole? ToEnum(string value) + { + return value switch + { + "owner" => CorpusRoleRole.Owner, + "administrator" => CorpusRoleRole.Administrator, + "viewer" => CorpusRoleRole.Viewer, + "editor" => CorpusRoleRole.Editor, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.CreateUserRequest.g.cs b/src/libs/Vectara/Generated/Vectara.Models.CreateUserRequest.g.cs index 34719a7..1543212 100644 --- a/src/libs/Vectara/Generated/Vectara.Models.CreateUserRequest.g.cs +++ b/src/libs/Vectara/Generated/Vectara.Models.CreateUserRequest.g.cs @@ -28,11 +28,23 @@ public sealed partial class CreateUserRequest public string? Description { get; set; } /// - /// The role names assigned to the user. + /// The customer-level role names assigned to the user. /// [global::System.Text.Json.Serialization.JsonPropertyName("api_roles")] public global::System.Collections.Generic.IList? ApiRoles { get; set; } + /// + /// Corpus-specific role assignments for the user. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("corpus_roles")] + public global::System.Collections.Generic.IList? CorpusRoles { get; set; } + + /// + /// Agent-specific role assignments for the user. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("agent_roles")] + public global::System.Collections.Generic.IList? AgentRoles { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -52,7 +64,13 @@ public sealed partial class CreateUserRequest /// The description of the user. /// /// - /// The role names assigned to the user. + /// The customer-level role names assigned to the user. + /// + /// + /// Corpus-specific role assignments for the user. + /// + /// + /// Agent-specific role assignments for the user. /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -61,12 +79,16 @@ public CreateUserRequest( string email, string? username, string? description, - global::System.Collections.Generic.IList? apiRoles) + global::System.Collections.Generic.IList? apiRoles, + global::System.Collections.Generic.IList? corpusRoles, + global::System.Collections.Generic.IList? agentRoles) { this.Email = email ?? throw new global::System.ArgumentNullException(nameof(email)); this.Username = username; this.Description = description; this.ApiRoles = apiRoles; + this.CorpusRoles = corpusRoles; + this.AgentRoles = agentRoles; } /// diff --git a/src/libs/Vectara/Generated/Vectara.Models.Document.g.cs b/src/libs/Vectara/Generated/Vectara.Models.Document.g.cs index a154dac..ff6c5db 100644 --- a/src/libs/Vectara/Generated/Vectara.Models.Document.g.cs +++ b/src/libs/Vectara/Generated/Vectara.Models.Document.g.cs @@ -28,6 +28,12 @@ public sealed partial class Document [global::System.Text.Json.Serialization.JsonPropertyName("tables")] public global::System.Collections.Generic.IList? Tables { get; set; } + /// + /// The images that this document contains. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("images")] + public global::System.Collections.Generic.IList? Images { get; set; } + /// /// Parts of the document that make up the document. However, parts are not available when retrieving a list of documents or when creating a document. This property is only available when retrieving a document by ID. /// @@ -65,6 +71,9 @@ public sealed partial class Document /// /// The tables that this document contains. Tables are not available when table extraction is not enabled. /// + /// + /// The images that this document contains. + /// /// /// Parts of the document that make up the document. However, parts are not available when retrieving a list of documents or when creating a document. This property is only available when retrieving a document by ID. /// @@ -81,6 +90,7 @@ public Document( string? id, object? metadata, global::System.Collections.Generic.IList? tables, + global::System.Collections.Generic.IList? images, global::System.Collections.Generic.IList? parts, global::Vectara.DocumentStorageUsage? storageUsage, global::Vectara.ExtractionUsage? extractionUsage) @@ -88,6 +98,7 @@ public Document( this.Id = id; this.Metadata = metadata; this.Tables = tables; + this.Images = images; this.Parts = parts; this.StorageUsage = storageUsage; this.ExtractionUsage = extractionUsage; diff --git a/src/libs/Vectara/Generated/Vectara.Models.FieldQuery.Json.g.cs b/src/libs/Vectara/Generated/Vectara.Models.FieldQuery.Json.g.cs new file mode 100644 index 0000000..ac04b86 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.FieldQuery.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Vectara +{ + public sealed partial class FieldQuery + { + /// + /// 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.FieldQuery? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Vectara.FieldQuery), + jsonSerializerContext) as global::Vectara.FieldQuery; + } + + /// + /// 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.FieldQuery? 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.FieldQuery), + jsonSerializerContext).ConfigureAwait(false)) as global::Vectara.FieldQuery; + } + + /// + /// 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.FieldQuery.g.cs b/src/libs/Vectara/Generated/Vectara.Models.FieldQuery.g.cs new file mode 100644 index 0000000..4b2bde3 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.FieldQuery.g.cs @@ -0,0 +1,71 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// Defines a field-specific query for fuzzy matching. + /// + public sealed partial class FieldQuery + { + /// + /// Name of the metadata field to search (without doc/part prefix). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("field")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Field { get; set; } + + /// + /// The text to search for in this field. Fuzzy matching is applied automatically. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("query")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Query { get; set; } + + /// + /// Weight to apply to this field during scoring (higher values increase importance of this field).
+ /// Default Value: 1F + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("weight")] + public float? Weight { 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. + /// + /// + /// Name of the metadata field to search (without doc/part prefix). + /// + /// + /// The text to search for in this field. Fuzzy matching is applied automatically. + /// + /// + /// Weight to apply to this field during scoring (higher values increase importance of this field).
+ /// Default Value: 1F + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public FieldQuery( + string field, + string query, + float? weight) + { + this.Field = field ?? throw new global::System.ArgumentNullException(nameof(field)); + this.Query = query ?? throw new global::System.ArgumentNullException(nameof(query)); + this.Weight = weight; + } + + /// + /// Initializes a new instance of the class. + /// + public FieldQuery() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.Image.Json.g.cs b/src/libs/Vectara/Generated/Vectara.Models.Image.Json.g.cs new file mode 100644 index 0000000..44012d9 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.Image.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Vectara +{ + public sealed partial class Image + { + /// + /// 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.Image? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Vectara.Image), + jsonSerializerContext) as global::Vectara.Image; + } + + /// + /// 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.Image? 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.Image), + jsonSerializerContext).ConfigureAwait(false)) as global::Vectara.Image; + } + + /// + /// 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.Image.g.cs b/src/libs/Vectara/Generated/Vectara.Models.Image.g.cs new file mode 100644 index 0000000..1c69be7 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.Image.g.cs @@ -0,0 +1,103 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// An image element within a document, containing its identifying information, optional metadata, and the actual image data. + /// + public sealed partial class Image + { + /// + /// The unique identifier of the image within the document, used to reference it in related content.
+ /// Example: chart_1 + ///
+ /// chart_1 + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Id { get; set; } + + /// + /// A short, human-readable title for the image, often displayed above or alongside it.
+ /// Example: Quarterly Sales Performance + ///
+ /// Quarterly Sales Performance + [global::System.Text.Json.Serialization.JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// A brief caption providing context or an explanation for the image, typically displayed below it.
+ /// Example: Sales growth trends for Q1 to Q4 of 2024 + ///
+ /// Sales growth trends for Q1 to Q4 of 2024 + [global::System.Text.Json.Serialization.JsonPropertyName("caption")] + public string? Caption { get; set; } + + /// + /// An object containing an image's binary data and format information. The image data is provided as a Base64-encoded string along with its MIME type. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("image_data")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Vectara.ImageData ImageData { get; set; } + + /// + /// A longer, detailed description of the image for accessibility or additional context.
+ /// Example: A bar chart showing quarterly sales growth, with Q4 outperforming all previous quarters by 15% + ///
+ /// A bar chart showing quarterly sales growth, with Q4 outperforming all previous quarters by 15% + [global::System.Text.Json.Serialization.JsonPropertyName("description")] + public string? Description { 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 image within the document, used to reference it in related content.
+ /// Example: chart_1 + /// + /// + /// A short, human-readable title for the image, often displayed above or alongside it.
+ /// Example: Quarterly Sales Performance + /// + /// + /// A brief caption providing context or an explanation for the image, typically displayed below it.
+ /// Example: Sales growth trends for Q1 to Q4 of 2024 + /// + /// + /// An object containing an image's binary data and format information. The image data is provided as a Base64-encoded string along with its MIME type. + /// + /// + /// A longer, detailed description of the image for accessibility or additional context.
+ /// Example: A bar chart showing quarterly sales growth, with Q4 outperforming all previous quarters by 15% + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public Image( + string id, + global::Vectara.ImageData imageData, + string? title, + string? caption, + string? description) + { + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.ImageData = imageData ?? throw new global::System.ArgumentNullException(nameof(imageData)); + this.Title = title; + this.Caption = caption; + this.Description = description; + } + + /// + /// Initializes a new instance of the class. + /// + public Image() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.ImageData.Json.g.cs b/src/libs/Vectara/Generated/Vectara.Models.ImageData.Json.g.cs new file mode 100644 index 0000000..caa4551 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.ImageData.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Vectara +{ + public sealed partial class ImageData + { + /// + /// 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.ImageData? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Vectara.ImageData), + jsonSerializerContext) as global::Vectara.ImageData; + } + + /// + /// 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.ImageData? 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.ImageData), + jsonSerializerContext).ConfigureAwait(false)) as global::Vectara.ImageData; + } + + /// + /// 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.ImageData.g.cs b/src/libs/Vectara/Generated/Vectara.Models.ImageData.g.cs new file mode 100644 index 0000000..6711d85 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.ImageData.g.cs @@ -0,0 +1,61 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// An object containing an image's binary data and format information. The image data is provided as a Base64-encoded string along with its MIME type. + /// + public sealed partial class ImageData + { + /// + /// Base64-encoded representation of the image data. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + [global::System.Text.Json.Serialization.JsonRequired] + public required byte[] Data { get; set; } + + /// + /// The MIME type of the image, indicating the format of the binary data (e.g., image/jpeg for JPEG images).
+ /// Example: image/png + ///
+ /// image/png + [global::System.Text.Json.Serialization.JsonPropertyName("mime_type")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string MimeType { 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. + /// + /// + /// Base64-encoded representation of the image data. + /// + /// + /// The MIME type of the image, indicating the format of the binary data (e.g., image/jpeg for JPEG images).
+ /// Example: image/png + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ImageData( + byte[] data, + string mimeType) + { + this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); + this.MimeType = mimeType ?? throw new global::System.ArgumentNullException(nameof(mimeType)); + } + + /// + /// Initializes a new instance of the class. + /// + public ImageData() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.ImageMetadata.Json.g.cs b/src/libs/Vectara/Generated/Vectara.Models.ImageMetadata.Json.g.cs new file mode 100644 index 0000000..a8d17ee --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.ImageMetadata.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Vectara +{ + public sealed partial class ImageMetadata + { + /// + /// 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.ImageMetadata? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Vectara.ImageMetadata), + jsonSerializerContext) as global::Vectara.ImageMetadata; + } + + /// + /// 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.ImageMetadata? 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.ImageMetadata), + jsonSerializerContext).ConfigureAwait(false)) as global::Vectara.ImageMetadata; + } + + /// + /// 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.ImageMetadata.g.cs b/src/libs/Vectara/Generated/Vectara.Models.ImageMetadata.g.cs new file mode 100644 index 0000000..51e6863 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.ImageMetadata.g.cs @@ -0,0 +1,106 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// An image element within a document, containing its identifying information and optional metadata. + /// + public sealed partial class ImageMetadata + { + /// + /// The unique identifier of the image within the document, used to reference it in related content.
+ /// Example: chart_1 + ///
+ /// chart_1 + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Id { get; set; } + + /// + /// A short, human-readable title for the image, often displayed above or alongside it.
+ /// Example: Quarterly Sales Performance + ///
+ /// Quarterly Sales Performance + [global::System.Text.Json.Serialization.JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// A brief caption providing context or an explanation for the image, typically displayed below it.
+ /// Example: Sales growth trends for Q1 to Q4 of 2024 + ///
+ /// Sales growth trends for Q1 to Q4 of 2024 + [global::System.Text.Json.Serialization.JsonPropertyName("caption")] + public string? Caption { get; set; } + + /// + /// A longer, detailed description of the image for accessibility or additional context.
+ /// Example: A bar chart showing quarterly sales growth, with Q4 outperforming all previous quarters by 15% + ///
+ /// A bar chart showing quarterly sales growth, with Q4 outperforming all previous quarters by 15% + [global::System.Text.Json.Serialization.JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// The MIME type of the image, indicating the format of the binary data (e.g., image/jpeg for JPEG images).
+ /// Example: image/jpeg + ///
+ /// image/jpeg + [global::System.Text.Json.Serialization.JsonPropertyName("mime_type")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string MimeType { 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 image within the document, used to reference it in related content.
+ /// Example: chart_1 + /// + /// + /// A short, human-readable title for the image, often displayed above or alongside it.
+ /// Example: Quarterly Sales Performance + /// + /// + /// A brief caption providing context or an explanation for the image, typically displayed below it.
+ /// Example: Sales growth trends for Q1 to Q4 of 2024 + /// + /// + /// A longer, detailed description of the image for accessibility or additional context.
+ /// Example: A bar chart showing quarterly sales growth, with Q4 outperforming all previous quarters by 15% + /// + /// + /// The MIME type of the image, indicating the format of the binary data (e.g., image/jpeg for JPEG images).
+ /// Example: image/jpeg + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ImageMetadata( + string id, + string mimeType, + string? title, + string? caption, + string? description) + { + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.MimeType = mimeType ?? throw new global::System.ArgumentNullException(nameof(mimeType)); + this.Title = title; + this.Caption = caption; + this.Description = description; + } + + /// + /// Initializes a new instance of the class. + /// + public ImageMetadata() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.IndividualSearchResult.g.cs b/src/libs/Vectara/Generated/Vectara.Models.IndividualSearchResult.g.cs index 8f07ca2..2f3b999 100644 --- a/src/libs/Vectara/Generated/Vectara.Models.IndividualSearchResult.g.cs +++ b/src/libs/Vectara/Generated/Vectara.Models.IndividualSearchResult.g.cs @@ -50,6 +50,12 @@ public sealed partial class IndividualSearchResult [global::System.Text.Json.Serialization.JsonPropertyName("table")] public global::Vectara.Table? Table { get; set; } + /// + /// An image element within a document, containing its identifying information and optional metadata. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("image")] + public global::Vectara.ImageMetadata? Image { get; set; } + /// /// A query request can search over multiple corpora at a time. This property is set to the index in the list of corpora in the original search request that this search result originated from. If the query request is only over one corpus, this property is 0.
/// Example: 0 @@ -88,6 +94,9 @@ public sealed partial class IndividualSearchResult /// /// A table in a document. /// + /// + /// An image element within a document, containing its identifying information and optional metadata. + /// /// /// A query request can search over multiple corpora at a time. This property is set to the index in the list of corpora in the original search request that this search result originated from. If the query request is only over one corpus, this property is 0.
/// Example: 0 @@ -102,6 +111,7 @@ public IndividualSearchResult( object? documentMetadata, string? documentId, global::Vectara.Table? table, + global::Vectara.ImageMetadata? image, int? requestCorporaIndex) { this.Text = text; @@ -110,6 +120,7 @@ public IndividualSearchResult( this.DocumentMetadata = documentMetadata; this.DocumentId = documentId; this.Table = table; + this.Image = image; this.RequestCorporaIndex = requestCorporaIndex; } diff --git a/src/libs/Vectara/Generated/Vectara.Models.MetadataQueryRequest.Json.g.cs b/src/libs/Vectara/Generated/Vectara.Models.MetadataQueryRequest.Json.g.cs new file mode 100644 index 0000000..f70f367 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.MetadataQueryRequest.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Vectara +{ + public sealed partial class MetadataQueryRequest + { + /// + /// 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.MetadataQueryRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Vectara.MetadataQueryRequest), + jsonSerializerContext) as global::Vectara.MetadataQueryRequest; + } + + /// + /// 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.MetadataQueryRequest? 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.MetadataQueryRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Vectara.MetadataQueryRequest; + } + + /// + /// 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.MetadataQueryRequest.g.cs b/src/libs/Vectara/Generated/Vectara.Models.MetadataQueryRequest.g.cs new file mode 100644 index 0000000..8e3d66c --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.MetadataQueryRequest.g.cs @@ -0,0 +1,105 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// Defines parameters for fuzzy searching across metadata fields in a corpus. + /// + public sealed partial class MetadataQueryRequest + { + /// + /// Whether to search document-level or part-level metadata. Document-level returns unique documents, part-level can return multiple parts from the same document.
+ /// Default Value: document + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("level")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Vectara.JsonConverters.MetadataQueryRequestLevelJsonConverter))] + public global::Vectara.MetadataQueryRequestLevel? Level { get; set; } + + /// + /// List of field-specific queries to apply fuzzy matching.
+ /// Example: [, ] + ///
+ /// [, ] + [global::System.Text.Json.Serialization.JsonPropertyName("queries")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Queries { get; set; } + + /// + /// Optional filter expression to narrow down results before fuzzy matching is applied.
+ /// This uses the same expression format as document listing filters and applies exact matching.
+ /// Example: doc.Status = 'Active' + ///
+ /// doc.Status = 'Active' + [global::System.Text.Json.Serialization.JsonPropertyName("metadata_filter")] + public string? MetadataFilter { get; set; } + + /// + /// Sets the maximum number of documents to return.
+ /// Default Value: 10 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("limit")] + public int? Limit { get; set; } + + /// + /// Starting position for pagination.
+ /// Default Value: 0 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("offset")] + public int? Offset { 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 to search document-level or part-level metadata. Document-level returns unique documents, part-level can return multiple parts from the same document.
+ /// Default Value: document + /// + /// + /// List of field-specific queries to apply fuzzy matching.
+ /// Example: [, ] + /// + /// + /// Optional filter expression to narrow down results before fuzzy matching is applied.
+ /// This uses the same expression format as document listing filters and applies exact matching.
+ /// Example: doc.Status = 'Active' + /// + /// + /// Sets the maximum number of documents to return.
+ /// Default Value: 10 + /// + /// + /// Starting position for pagination.
+ /// Default Value: 0 + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public MetadataQueryRequest( + global::System.Collections.Generic.IList queries, + global::Vectara.MetadataQueryRequestLevel? level, + string? metadataFilter, + int? limit, + int? offset) + { + this.Queries = queries ?? throw new global::System.ArgumentNullException(nameof(queries)); + this.Level = level; + this.MetadataFilter = metadataFilter; + this.Limit = limit; + this.Offset = offset; + } + + /// + /// Initializes a new instance of the class. + /// + public MetadataQueryRequest() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.MetadataQueryRequestLevel.g.cs b/src/libs/Vectara/Generated/Vectara.Models.MetadataQueryRequestLevel.g.cs new file mode 100644 index 0000000..c19a3d8 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.MetadataQueryRequestLevel.g.cs @@ -0,0 +1,52 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// Whether to search document-level or part-level metadata. Document-level returns unique documents, part-level can return multiple parts from the same document.
+ /// Default Value: document + ///
+ public enum MetadataQueryRequestLevel + { + /// + /// + /// + Document, + /// + /// + /// + Part, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class MetadataQueryRequestLevelExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this MetadataQueryRequestLevel value) + { + return value switch + { + MetadataQueryRequestLevel.Document => "document", + MetadataQueryRequestLevel.Part => "part", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static MetadataQueryRequestLevel? ToEnum(string value) + { + return value switch + { + "document" => MetadataQueryRequestLevel.Document, + "part" => MetadataQueryRequestLevel.Part, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.MetadataQueryResponse.Json.g.cs b/src/libs/Vectara/Generated/Vectara.Models.MetadataQueryResponse.Json.g.cs new file mode 100644 index 0000000..797b4ed --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.MetadataQueryResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Vectara +{ + public sealed partial class MetadataQueryResponse + { + /// + /// 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.MetadataQueryResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Vectara.MetadataQueryResponse), + jsonSerializerContext) as global::Vectara.MetadataQueryResponse; + } + + /// + /// 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.MetadataQueryResponse? 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.MetadataQueryResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Vectara.MetadataQueryResponse; + } + + /// + /// 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.MetadataQueryResponse.g.cs b/src/libs/Vectara/Generated/Vectara.Models.MetadataQueryResponse.g.cs new file mode 100644 index 0000000..45b3eda --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.MetadataQueryResponse.g.cs @@ -0,0 +1,59 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// Returns document search results with relevance scores. + /// + public sealed partial class MetadataQueryResponse + { + /// + /// Matched documents ordered by relevance score (highest first). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("documents")] + public global::System.Collections.Generic.IList? Documents { get; set; } + + /// + /// Total number of matching documents (for pagination).
+ /// Example: 42 + ///
+ /// 42 + [global::System.Text.Json.Serialization.JsonPropertyName("total_count")] + public int? TotalCount { 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. + /// + /// + /// Matched documents ordered by relevance score (highest first). + /// + /// + /// Total number of matching documents (for pagination).
+ /// Example: 42 + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public MetadataQueryResponse( + global::System.Collections.Generic.IList? documents, + int? totalCount) + { + this.Documents = documents; + this.TotalCount = totalCount; + } + + /// + /// Initializes a new instance of the class. + /// + public MetadataQueryResponse() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.ScoredDocument.Json.g.cs b/src/libs/Vectara/Generated/Vectara.Models.ScoredDocument.Json.g.cs new file mode 100644 index 0000000..0182ae3 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.ScoredDocument.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Vectara +{ + public sealed partial class ScoredDocument + { + /// + /// 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.ScoredDocument? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Vectara.ScoredDocument), + jsonSerializerContext) as global::Vectara.ScoredDocument; + } + + /// + /// 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.ScoredDocument? 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.ScoredDocument), + jsonSerializerContext).ConfigureAwait(false)) as global::Vectara.ScoredDocument; + } + + /// + /// 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.ScoredDocument.g.cs b/src/libs/Vectara/Generated/Vectara.Models.ScoredDocument.g.cs new file mode 100644 index 0000000..18b4229 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.ScoredDocument.g.cs @@ -0,0 +1,73 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// A document with its relevance score and metadata. + /// + public sealed partial class ScoredDocument + { + /// + /// The document ID.
+ /// Example: document123 + ///
+ /// document123 + [global::System.Text.Json.Serialization.JsonPropertyName("doc_id")] + public string? DocId { get; set; } + + /// + /// The overall relevance score for this document.
+ /// Example: 0.92F + ///
+ /// 0.92F + [global::System.Text.Json.Serialization.JsonPropertyName("score")] + public float? Score { get; set; } + + /// + /// Document metadata object containing all document metadata fields. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("metadata")] + public object? 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 document ID.
+ /// Example: document123 + /// + /// + /// The overall relevance score for this document.
+ /// Example: 0.92F + /// + /// + /// Document metadata object containing all document metadata fields. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ScoredDocument( + string? docId, + float? score, + object? metadata) + { + this.DocId = docId; + this.Score = score; + this.Metadata = metadata; + } + + /// + /// Initializes a new instance of the class. + /// + public ScoredDocument() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Vectara/Generated/Vectara.Models.ScoredDocumentMetadata.Json.g.cs b/src/libs/Vectara/Generated/Vectara.Models.ScoredDocumentMetadata.Json.g.cs new file mode 100644 index 0000000..54b490a --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.ScoredDocumentMetadata.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Vectara +{ + public sealed partial class ScoredDocumentMetadata + { + /// + /// 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.ScoredDocumentMetadata? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Vectara.ScoredDocumentMetadata), + jsonSerializerContext) as global::Vectara.ScoredDocumentMetadata; + } + + /// + /// 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.ScoredDocumentMetadata? 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.ScoredDocumentMetadata), + jsonSerializerContext).ConfigureAwait(false)) as global::Vectara.ScoredDocumentMetadata; + } + + /// + /// 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.ScoredDocumentMetadata.g.cs b/src/libs/Vectara/Generated/Vectara.Models.ScoredDocumentMetadata.g.cs new file mode 100644 index 0000000..04921f5 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.Models.ScoredDocumentMetadata.g.cs @@ -0,0 +1,18 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// Document metadata object containing all document metadata fields. + /// + public sealed partial class ScoredDocumentMetadata + { + + /// + /// 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.StructuredDocumentSection.g.cs b/src/libs/Vectara/Generated/Vectara.Models.StructuredDocumentSection.g.cs index 51f7b1c..699a2e9 100644 --- a/src/libs/Vectara/Generated/Vectara.Models.StructuredDocumentSection.g.cs +++ b/src/libs/Vectara/Generated/Vectara.Models.StructuredDocumentSection.g.cs @@ -45,6 +45,12 @@ public sealed partial class StructuredDocumentSection [global::System.Text.Json.Serialization.JsonPropertyName("tables")] public global::System.Collections.Generic.IList? Tables { get; set; } + /// + /// The images that this section contains. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("images")] + public global::System.Collections.Generic.IList? Images { get; set; } + /// /// The sections that this section contains. /// @@ -78,6 +84,9 @@ public sealed partial class StructuredDocumentSection /// /// The tables that this section contains. /// + /// + /// The images that this section contains. + /// /// /// The sections that this section contains. /// @@ -90,6 +99,7 @@ public StructuredDocumentSection( string? title, object? metadata, global::System.Collections.Generic.IList? tables, + global::System.Collections.Generic.IList? images, global::System.Collections.Generic.IList? sections) { this.Text = text ?? throw new global::System.ArgumentNullException(nameof(text)); @@ -97,6 +107,7 @@ public StructuredDocumentSection( this.Title = title; this.Metadata = metadata; this.Tables = tables; + this.Images = images; this.Sections = sections; } diff --git a/src/libs/Vectara/Generated/Vectara.Models.UpdateUserRequest.g.cs b/src/libs/Vectara/Generated/Vectara.Models.UpdateUserRequest.g.cs index 3d98adb..e7d1bf9 100644 --- a/src/libs/Vectara/Generated/Vectara.Models.UpdateUserRequest.g.cs +++ b/src/libs/Vectara/Generated/Vectara.Models.UpdateUserRequest.g.cs @@ -15,11 +15,23 @@ public sealed partial class UpdateUserRequest public bool? Enabled { get; set; } /// - /// The new role names of the user. + /// The new customer-level role names of the user. /// [global::System.Text.Json.Serialization.JsonPropertyName("api_roles")] public global::System.Collections.Generic.IList? ApiRoles { get; set; } + /// + /// New corpus-specific role assignments for the user. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("corpus_roles")] + public global::System.Collections.Generic.IList? CorpusRoles { get; set; } + + /// + /// New agent-specific role assignments for the user. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("agent_roles")] + public global::System.Collections.Generic.IList? AgentRoles { get; set; } + /// /// The description of the user. /// @@ -39,7 +51,13 @@ public sealed partial class UpdateUserRequest /// Indicates whether to enable or disable the user. /// /// - /// The new role names of the user. + /// The new customer-level role names of the user. + /// + /// + /// New corpus-specific role assignments for the user. + /// + /// + /// New agent-specific role assignments for the user. /// /// /// The description of the user. @@ -50,10 +68,14 @@ public sealed partial class UpdateUserRequest public UpdateUserRequest( bool? enabled, global::System.Collections.Generic.IList? apiRoles, + global::System.Collections.Generic.IList? corpusRoles, + global::System.Collections.Generic.IList? agentRoles, string? description) { this.Enabled = enabled; this.ApiRoles = apiRoles; + this.CorpusRoles = corpusRoles; + this.AgentRoles = agentRoles; this.Description = description; } diff --git a/src/libs/Vectara/Generated/Vectara.Models.User.g.cs b/src/libs/Vectara/Generated/Vectara.Models.User.g.cs index aedd1f4..74ec3c3 100644 --- a/src/libs/Vectara/Generated/Vectara.Models.User.g.cs +++ b/src/libs/Vectara/Generated/Vectara.Models.User.g.cs @@ -51,11 +51,23 @@ public sealed partial class User public global::System.DateTime? UpdatedAt { get; set; } /// - /// The role names of the user. + /// The customer-level role names of the user. /// [global::System.Text.Json.Serialization.JsonPropertyName("api_roles")] public global::System.Collections.Generic.IList? ApiRoles { get; set; } + /// + /// Corpus-specific role assignments for the user. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("corpus_roles")] + public global::System.Collections.Generic.IList? CorpusRoles { get; set; } + + /// + /// Agent-specific role assignments for the user. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("agent_roles")] + public global::System.Collections.Generic.IList? AgentRoles { get; set; } + /// /// What actions a principal can take on the Vectara platform. /// @@ -93,7 +105,13 @@ public sealed partial class User /// When a user property was last updated. /// /// - /// The role names of the user. + /// The customer-level role names of the user. + /// + /// + /// Corpus-specific role assignments for the user. + /// + /// + /// Agent-specific role assignments for the user. /// /// /// What actions a principal can take on the Vectara platform. @@ -110,6 +128,8 @@ public User( global::System.DateTime? createdAt, global::System.DateTime? updatedAt, global::System.Collections.Generic.IList? apiRoles, + global::System.Collections.Generic.IList? corpusRoles, + global::System.Collections.Generic.IList? agentRoles, global::Vectara.ApiPolicy? apiPolicy) { this.Id = id; @@ -120,6 +140,8 @@ public User( this.CreatedAt = createdAt; this.UpdatedAt = updatedAt; this.ApiRoles = apiRoles; + this.CorpusRoles = corpusRoles; + this.AgentRoles = agentRoles; this.ApiPolicy = apiPolicy; } diff --git a/src/libs/Vectara/Generated/Vectara.QueryHistoryClient.GetQueryHistories.g.cs b/src/libs/Vectara/Generated/Vectara.QueryHistoryClient.GetQueryHistories.g.cs index 9bcafb3..f7ff8b4 100644 --- a/src/libs/Vectara/Generated/Vectara.QueryHistoryClient.GetQueryHistories.g.cs +++ b/src/libs/Vectara/Generated/Vectara.QueryHistoryClient.GetQueryHistories.g.cs @@ -13,6 +13,7 @@ partial void PrepareGetQueryHistoriesArguments( ref global::System.DateTime? startedAfter, ref global::System.DateTime? startedBefore, ref string? chatId, + ref string? historyId, ref int? limit, ref string? pageKey); partial void PrepareGetQueryHistoriesRequest( @@ -24,6 +25,7 @@ partial void PrepareGetQueryHistoriesRequest( global::System.DateTime? startedAfter, global::System.DateTime? startedBefore, string? chatId, + string? historyId, int? limit, string? pageKey); partial void ProcessGetQueryHistoriesResponse( @@ -45,6 +47,7 @@ partial void ProcessGetQueryHistoriesResponseContent( /// /// /// + /// /// /// Default Value: 10 /// @@ -58,6 +61,7 @@ partial void ProcessGetQueryHistoriesResponseContent( global::System.DateTime? startedAfter = default, global::System.DateTime? startedBefore = default, string? chatId = default, + string? historyId = default, int? limit = default, string? pageKey = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -72,6 +76,7 @@ partial void ProcessGetQueryHistoriesResponseContent( startedAfter: ref startedAfter, startedBefore: ref startedBefore, chatId: ref chatId, + historyId: ref historyId, limit: ref limit, pageKey: ref pageKey); @@ -83,6 +88,7 @@ partial void ProcessGetQueryHistoriesResponseContent( .AddOptionalParameter("started_after", startedAfter?.ToString("yyyy-MM-ddTHH:mm:ssZ")) .AddOptionalParameter("started_before", startedBefore?.ToString("yyyy-MM-ddTHH:mm:ssZ")) .AddOptionalParameter("chat_id", chatId) + .AddOptionalParameter("history_id", historyId) .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("page_key", pageKey) ; @@ -133,6 +139,7 @@ partial void ProcessGetQueryHistoriesResponseContent( startedAfter: startedAfter, startedBefore: startedBefore, chatId: chatId, + historyId: historyId, limit: limit, pageKey: pageKey); diff --git a/src/libs/Vectara/Generated/Vectara.ToolsClient.g.cs b/src/libs/Vectara/Generated/Vectara.ToolsClient.g.cs new file mode 100644 index 0000000..176f2e5 --- /dev/null +++ b/src/libs/Vectara/Generated/Vectara.ToolsClient.g.cs @@ -0,0 +1,87 @@ + +#nullable enable + +namespace Vectara +{ + /// + /// Manage and discover tools available for AI agents to use in their workflows
+ /// 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 ToolsClient : global::Vectara.IToolsClient, 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::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Vectara.SourceGenerationContext.Default; + + + /// + /// Creates a new instance of the ToolsClient. + /// 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 ToolsClient( + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = 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(); + _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.UsersClient.CreateUser.g.cs b/src/libs/Vectara/Generated/Vectara.UsersClient.CreateUser.g.cs index d5fd39f..33e086f 100644 --- a/src/libs/Vectara/Generated/Vectara.UsersClient.CreateUser.g.cs +++ b/src/libs/Vectara/Generated/Vectara.UsersClient.CreateUser.g.cs @@ -278,7 +278,13 @@ partial void ProcessCreateUserResponseContent( /// The description of the user. /// /// - /// The role names assigned to the user. + /// The customer-level role names assigned to the user. + /// + /// + /// Corpus-specific role assignments for the user. + /// + /// + /// Agent-specific role assignments for the user. /// /// The token to cancel the operation with /// @@ -289,6 +295,8 @@ partial void ProcessCreateUserResponseContent( string? username = default, string? description = default, global::System.Collections.Generic.IList? apiRoles = default, + global::System.Collections.Generic.IList? corpusRoles = default, + global::System.Collections.Generic.IList? agentRoles = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::Vectara.CreateUserRequest @@ -297,6 +305,8 @@ partial void ProcessCreateUserResponseContent( Username = username, Description = description, ApiRoles = apiRoles, + CorpusRoles = corpusRoles, + AgentRoles = agentRoles, }; return await CreateUserAsync( diff --git a/src/libs/Vectara/Generated/Vectara.UsersClient.UpdateUser.g.cs b/src/libs/Vectara/Generated/Vectara.UsersClient.UpdateUser.g.cs index 6cde5a2..cf1ff7d 100644 --- a/src/libs/Vectara/Generated/Vectara.UsersClient.UpdateUser.g.cs +++ b/src/libs/Vectara/Generated/Vectara.UsersClient.UpdateUser.g.cs @@ -279,7 +279,13 @@ partial void ProcessUpdateUserResponseContent( /// Indicates whether to enable or disable the user. /// /// - /// The new role names of the user. + /// The new customer-level role names of the user. + /// + /// + /// New corpus-specific role assignments for the user. + /// + /// + /// New agent-specific role assignments for the user. /// /// /// The description of the user. @@ -292,6 +298,8 @@ partial void ProcessUpdateUserResponseContent( int? requestTimeoutMillis = default, bool? enabled = default, global::System.Collections.Generic.IList? apiRoles = default, + global::System.Collections.Generic.IList? corpusRoles = default, + global::System.Collections.Generic.IList? agentRoles = default, string? description = default, global::System.Threading.CancellationToken cancellationToken = default) { @@ -299,6 +307,8 @@ partial void ProcessUpdateUserResponseContent( { Enabled = enabled, ApiRoles = apiRoles, + CorpusRoles = corpusRoles, + AgentRoles = agentRoles, Description = description, }; diff --git a/src/libs/Vectara/Generated/Vectara.VectaraClient.g.cs b/src/libs/Vectara/Generated/Vectara.VectaraClient.g.cs index e5d7e11..bad6c95 100644 --- a/src/libs/Vectara/Generated/Vectara.VectaraClient.g.cs +++ b/src/libs/Vectara/Generated/Vectara.VectaraClient.g.cs @@ -41,6 +41,24 @@ public sealed partial class VectaraClient : global::Vectara.IVectaraClient, glob public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Vectara.SourceGenerationContext.Default; + /// + /// Create and interact with AI agents that can use tools and corpora to perform complex queries + /// + public AgentsClient Agents => new AgentsClient(HttpClient, authorizations: Authorizations) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContext = JsonSerializerContext, + }; + + /// + /// Create and manage connectors that allow agents to receive events from external platforms like Slack + /// + public AgentConnectorsClient AgentConnectors => new AgentConnectorsClient(HttpClient, authorizations: Authorizations) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContext = JsonSerializerContext, + }; + /// /// Authenticate with the API using OAuth 2.0 or API keys /// @@ -221,6 +239,33 @@ public sealed partial class VectaraClient : global::Vectara.IVectaraClient, glob JsonSerializerContext = JsonSerializerContext, }; + /// + /// Query across arbitrary metadata fields in a corpus + /// + public MetadataQueryClient MetadataQuery => new MetadataQueryClient(HttpClient, authorizations: Authorizations) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContext = JsonSerializerContext, + }; + + /// + /// Manage and discover tools available for AI agents to use in their workflows + /// + public ToolsClient Tools => new ToolsClient(HttpClient, authorizations: Authorizations) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContext = JsonSerializerContext, + }; + + /// + /// Create and manage instructions that guide agent behavior + /// + public InstructionsClient Instructions => new InstructionsClient(HttpClient, authorizations: Authorizations) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContext = JsonSerializerContext, + }; + /// /// Creates a new instance of the VectaraClient. /// If no httpClient is provided, a new one will be created. diff --git a/src/libs/Vectara/openapi.yaml b/src/libs/Vectara/openapi.yaml index ef6830a..f9ebc57 100644 --- a/src/libs/Vectara/openapi.yaml +++ b/src/libs/Vectara/openapi.yaml @@ -260,8 +260,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - x-required-api-key-type: - - Personal x-fern-sdk-group-name: corpora x-fern-sdk-method-name: create get: @@ -313,9 +311,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - x-required-api-key-type: - - QueryService - - Personal x-fern-sdk-group-name: corpora x-fern-sdk-method-name: list x-fern-pagination: @@ -1066,9 +1061,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - x-required-api-key-type: - - IndexService - - Personal x-fern-sdk-group-name: documents x-fern-sdk-method-name: update_metadata '/v2/corpora/{corpus_key}/documents/{document_id}/summarize': @@ -1123,6 +1115,111 @@ paths: x-stream-based-on-body: streamResponse() x-fern-sdk-group-name: documents x-fern-sdk-method-name: summarize + '/v2/corpora/{corpus_key}/documents/{document_id}/images/{image_id}': + get: + tags: + - Documents + summary: Retrieve an image from a document + description: Returns a specific image that is embedded within a document. The `image_id` uniquely identifies the image within the document. Use this endpoint to fetch the raw image data and associated metadata. + operationId: getImage + parameters: + - $ref: '#/components/parameters/RequestTimeout' + - $ref: '#/components/parameters/RequestTimeoutMillis' + - name: corpus_key + in: path + description: A unique identifier for the corpus that contains the target document. + required: true + schema: + $ref: '#/components/schemas/CorpusKey' + - name: document_id + in: path + description: The identifier of the document containing the image. This `document_id` must be percent encoded. + required: true + schema: + type: string + - name: image_id + in: path + description: The identifier of the image to retrieve from the specified document. Each image within a document has a unique `image_id`. This value must be percent-encoded when passed in the request URL. + required: true + schema: + type: string + responses: + '200': + description: An image including raw image data and associated metadata. + content: + application/json: + schema: + $ref: '#/components/schemas/Image' + example: + id: image_1 + title: Quarterly Sales Performance + caption: Sales growth trends for Q1 to Q4 of 2024 + description: 'A bar chart showing quarterly sales growth, with Q4 outperforming all previous quarters by 15%' + image_data: + data: iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVR4nGP4//8/AAX+Av4N70a4AAAAAElFTkSuQmCC + mime_type: image/png + '403': + description: Permissions do not allow retrieving the image. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Image not found. + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundError' + x-fern-sdk-group-name: documents + x-fern-sdk-method-name: get + '/v2/corpora/{corpus_key}/metadata_query': + post: + tags: + - Metadata Query + summary: Query across metadata fields in a corpus + description: 'Query for documents in a specific corpus using fuzzy matching across specified metadata fields. The search first applies any exact metadata filters to narrow the results, then performs fuzzy matching on the remaining documents using the specified field queries.' + operationId: queryMetadata + parameters: + - $ref: '#/components/parameters/RequestTimeout' + - $ref: '#/components/parameters/RequestTimeoutMillis' + - name: corpus_key + in: path + description: The unique key identifying the corpus to search for metadata. + required: true + schema: + $ref: '#/components/schemas/CorpusKey' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MetadataQueryRequest' + responses: + '200': + description: List of matching documents with relevance scores and field-level match details. + content: + application/json: + schema: + $ref: '#/components/schemas/MetadataQueryResponse' + '400': + description: Metadata query request was malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestError' + '403': + description: Permissions do not allow querying metadata in the corpus. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Corpus not found. + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundError' + x-fern-sdk-group-name: metadata + x-fern-sdk-method-name: queryMetadata '/v2/corpora/{corpus_key}/query': get: tags: @@ -1964,6 +2061,11 @@ paths: description: 'Specifies the chat_id of the query, this will return all queries in the specified chat.' schema: type: string + - name: history_id + in: query + description: Specifies the history_id of the query that you want to use as a filter. + schema: + type: string - name: limit in: query description: Specifies the maximum number of query history listed. @@ -3437,7 +3539,7 @@ paths: x-fern-pagination: cursor: $request.page_key next_cursor: $response.metadata.page_key - results: $response.hallucination_correctors + results: $response.hallucinationCorrectionModels /v2/hallucination_correctors/correct_hallucinations: post: tags: @@ -4754,6 +4856,34 @@ components: description: The description of the table. example: Summary of carbon reduction efforts by EU banks in 2023. description: A table in a document. + ImageMetadata: + required: + - id + - image_data + - mime_type + type: object + properties: + id: + type: string + description: 'The unique identifier of the image within the document, used to reference it in related content.' + example: chart_1 + title: + type: string + description: 'A short, human-readable title for the image, often displayed above or alongside it.' + example: Quarterly Sales Performance + caption: + type: string + description: 'A brief caption providing context or an explanation for the image, typically displayed below it.' + example: Sales growth trends for Q1 to Q4 of 2024 + description: + type: string + description: 'A longer, detailed description of the image for accessibility or additional context.' + example: 'A bar chart showing quarterly sales growth, with Q4 outperforming all previous quarters by 15%' + mime_type: + type: string + description: 'The MIME type of the image, indicating the format of the binary data (e.g., image/jpeg for JPEG images).' + example: image/jpeg + description: 'An image element within a document, containing its identifying information and optional metadata.' CustomDimensions: type: object additionalProperties: @@ -4821,6 +4951,11 @@ components: items: $ref: '#/components/schemas/Table' description: The tables that this document contains. Tables are not available when table extraction is not enabled. + images: + type: array + items: + $ref: '#/components/schemas/ImageMetadata' + description: The images that this document contains. parts: type: array items: @@ -4859,6 +4994,14 @@ components: - text_value: Zeta Manufacturing - float_value: 13499.99 - text_value: '2023-06-30' + images: + - id: image_1 + title: Quarterly Sales Performance + caption: Sales growth trends for Q1 to Q4 of 2024 + description: 'A bar chart showing quarterly sales growth, with Q4 outperforming all previous quarters by 15%' + image_data: + data: iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVR4nGP4//8/AAX+Av4N70a4AAAAAElFTkSuQmCC + mime_type: image/png parts: - text: This invoice includes customer billing history for Q1. metadata: @@ -4879,6 +5022,47 @@ components: metadata: $ref: '#/components/schemas/ListMetadata' description: Response containing a list of documents stored in a corpus. + ImageData: + required: + - data + - mime_type + type: object + properties: + data: + type: string + description: Base64-encoded representation of the image data. + format: byte + example: iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVR4nGP4//8/AAX+Av4N70a4AAAAAElFTkSuQmCC + mime_type: + type: string + description: 'The MIME type of the image, indicating the format of the binary data (e.g., image/jpeg for JPEG images).' + example: image/png + description: An object containing an image's binary data and format information. The image data is provided as a Base64-encoded string along with its MIME type. + Image: + required: + - id + - image_data + type: object + properties: + id: + type: string + description: 'The unique identifier of the image within the document, used to reference it in related content.' + example: chart_1 + title: + type: string + description: 'A short, human-readable title for the image, often displayed above or alongside it.' + example: Quarterly Sales Performance + caption: + type: string + description: 'A brief caption providing context or an explanation for the image, typically displayed below it.' + example: Sales growth trends for Q1 to Q4 of 2024 + image_data: + $ref: '#/components/schemas/ImageData' + description: + type: string + description: 'A longer, detailed description of the image for accessibility or additional context.' + example: 'A bar chart showing quarterly sales growth, with Q4 outperforming all previous quarters by 15%' + description: 'An image element within a document, containing its identifying information, optional metadata, and the actual image data.' CoreDocumentPart: required: - text @@ -4897,6 +5081,10 @@ components: type: string description: The ID of the table that this document part belongs to. example: billing_table_111 + image_id: + type: string + description: The ID of the image that this document part belongs to. + example: image_1 context: type: string description: The context text for the document part. @@ -4930,6 +5118,11 @@ components: items: $ref: '#/components/schemas/Table' description: The tables that this document contains. + images: + type: array + items: + $ref: '#/components/schemas/Image' + description: The images that this document contains. document_parts: minItems: 1 type: array @@ -4939,6 +5132,7 @@ components: description: The document structure that most closely corresponds to Vectara's internal document data model. example: id: invoice-001 + type: core metadata: doc_type: invoice industry: manufacturing @@ -4965,7 +5159,15 @@ components: - text_value: Zeta Manufacturing - float_value: 13499.99 - text_value: '2023-06-30' - parts: + images: + - id: image_1 + title: Quarterly Sales Performance + caption: Sales growth trends for Q1 to Q4 of 2024 + description: 'A bar chart showing quarterly sales growth, with Q4 outperforming all previous quarters by 15%' + image_data: + data: iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVR4nGP4//8/AAX+Av4N70a4AAAAAElFTkSuQmCC + mime_type: image/jpeg + document_parts: - text: This invoice includes customer billing history for Q1. metadata: quarter: 1 @@ -5006,6 +5208,11 @@ components: items: $ref: '#/components/schemas/Table' description: The tables that this section contains. + images: + type: array + items: + $ref: '#/components/schemas/Image' + description: The images that this section contains. sections: type: array items: @@ -5019,6 +5226,14 @@ components: metadata: section_type: summary priority: high + images: + - id: image_1 + title: Quarterly Sales Performance + caption: Sales growth trends for Q1 to Q4 of 2024 + description: 'A bar chart showing quarterly sales growth, with Q4 outperforming all previous quarters by 15%' + image_data: + data: iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVR4nGP4//8/AAX+Av4N70a4AAAAAElFTkSuQmCC + mime_type: image/png tables: - id: billing_table_1 title: Invoice Line Items @@ -5229,6 +5444,7 @@ components: - QueryStreamedResponse - ChatStreamedResponse - SummarizeDocumentStreamedResponse + - AgentStreamedResponse StreamResponseEnd: type: object properties: @@ -5241,6 +5457,7 @@ components: - QueryStreamedResponse - ChatStreamedResponse - SummarizeDocumentStreamedResponse + - AgentStreamedResponse SummarizeDocumentStreamedResponse: type: object oneOf: @@ -5258,6 +5475,93 @@ components: generation_end: '#/components/schemas/StreamGenerationEnd' error: '#/components/schemas/StreamError' end: '#/components/schemas/StreamResponseEnd' + FieldQuery: + required: + - field + - query + type: object + properties: + field: + type: string + description: Name of the metadata field to search (without doc/part prefix). + query: + type: string + description: The text to search for in this field. Fuzzy matching is applied automatically. + weight: + type: number + description: Weight to apply to this field during scoring (higher values increase importance of this field). + format: float + default: 1 + description: Defines a field-specific query for fuzzy matching. + MetadataQueryRequest: + required: + - queries + type: object + properties: + level: + enum: + - document + - part + type: string + description: 'Whether to search document-level or part-level metadata. Document-level returns unique documents, part-level can return multiple parts from the same document.' + default: document + queries: + type: array + items: + $ref: '#/components/schemas/FieldQuery' + description: List of field-specific queries to apply fuzzy matching. + example: + - field: title + query: lease agreement + weight: 2 + - field: category + query: contract + weight: 1 + metadata_filter: + type: string + description: "Optional filter expression to narrow down results before fuzzy matching is applied. \nThis uses the same expression format as document listing filters and applies exact matching.\n" + example: doc.Status = 'Active' + limit: + maximum: 100 + minimum: 1 + type: integer + description: Sets the maximum number of documents to return. + default: 10 + offset: + minimum: 0 + type: integer + description: Starting position for pagination. + default: 0 + description: Defines parameters for fuzzy searching across metadata fields in a corpus. + ScoredDocument: + type: object + properties: + doc_id: + type: string + description: The document ID. + example: document123 + score: + type: number + description: The overall relevance score for this document. + format: float + example: 0.92 + metadata: + type: object + description: Document metadata object containing all document metadata fields. + description: A document with its relevance score and metadata. + MetadataQueryResponse: + type: object + properties: + documents: + type: array + items: + $ref: '#/components/schemas/ScoredDocument' + description: Matched documents ordered by relevance score (highest first). + total_count: + type: integer + description: Total number of matching documents (for pagination). + example: 42 + description: Returns document search results with relevance scores. Language: enum: - auto @@ -5322,6 +5626,8 @@ components: example: financial-report-2023 table: $ref: '#/components/schemas/Table' + image: + $ref: '#/components/schemas/ImageMetadata' request_corpora_index: minimum: 0 type: integer @@ -5706,6 +6012,7 @@ components: type: object properties: query: + maxLength: 5000 type: string description: 'The search query string, which is the question the user is asking.' search: @@ -5829,6 +6136,7 @@ components: corpus_key: $ref: '#/components/schemas/CorpusKey' query: + maxLength: 5000 type: string description: Query for a particular corpus that will override the overall query if present. example: What are some important facts in my-corpus? @@ -5854,6 +6162,7 @@ components: type: object properties: query: + maxLength: 5000 type: string description: 'The search query string, which is the question the user is asking.' example: Am I allowed to bring pets to work? @@ -6097,6 +6406,7 @@ components: type: string description: The ID of the query history. query: + maxLength: 5000 type: string description: The actual query made. corpus_key: @@ -6186,6 +6496,7 @@ components: type: object properties: query: + maxLength: 5000 type: string description: The chat message or question. example: What are the carbon reduction efforts by EU banks in 2023? @@ -6319,6 +6630,7 @@ components: description: The ID of the chat the turn resides in. example: cht_123456789 query: + maxLength: 5000 type: string description: The query made to produce this turn. example: How do you turn this widget? @@ -7024,8 +7336,47 @@ components: - administrator - billing_administrator - corpus_administrator + - corpus_developer + - agent_administrator + - agent_viewer + - agent_developer type: string description: Roles that a user or an app client can take on. + CorpusRole: + required: + - corpus_key + - role + type: object + properties: + corpus_key: + type: string + description: The key of the corpus this role applies to. + role: + enum: + - owner + - administrator + - viewer + - editor + type: string + description: The role assigned for this specific corpus. + description: Corpus-specific role assignment. + AgentRole: + required: + - agent_id + - role + type: object + properties: + agent_id: + type: string + description: The ID of the agent this role applies to. + role: + enum: + - agent_admin + - agent_viewer + - agent_developer + type: string + description: The role assigned for this specific agent. + description: Agent-specific role assignment. ApiOperationPolicy: required: - allow_any_resource @@ -7090,7 +7441,17 @@ components: type: array items: $ref: '#/components/schemas/ApiRole' - description: The role names of the user. + description: The customer-level role names of the user. + corpus_roles: + type: array + items: + $ref: '#/components/schemas/CorpusRole' + description: Corpus-specific role assignments for the user. + agent_roles: + type: array + items: + $ref: '#/components/schemas/AgentRole' + description: Agent-specific role assignments for the user. api_policy: $ref: '#/components/schemas/ApiPolicy' description: A user account with associated profile information and permissions. @@ -7124,7 +7485,17 @@ components: type: array items: $ref: '#/components/schemas/ApiRole' - description: The role names assigned to the user. + description: The customer-level role names assigned to the user. + corpus_roles: + type: array + items: + $ref: '#/components/schemas/CorpusRole' + description: Corpus-specific role assignments for the user. + agent_roles: + type: array + items: + $ref: '#/components/schemas/AgentRole' + description: Agent-specific role assignments for the user. description: Request to create a new user account in the system. UpdateUserRequest: type: object @@ -7136,7 +7507,17 @@ components: type: array items: $ref: '#/components/schemas/ApiRole' - description: The new role names of the user. + description: The new customer-level role names of the user. + corpus_roles: + type: array + items: + $ref: '#/components/schemas/CorpusRole' + description: New corpus-specific role assignments for the user. + agent_roles: + type: array + items: + $ref: '#/components/schemas/AgentRole' + description: New agent-specific role assignments for the user. description: type: string description: The description of the user. @@ -7320,6 +7701,10 @@ security: - ApiKeyAuth: [ ] - OAuth2: [ ] tags: + - name: Agents + description: Create and interact with AI agents that can use tools and corpora to perform complex queries + - name: Agent Connectors + description: Create and manage connectors that allow agents to receive events from external platforms like Slack - name: Authentication description: Authenticate with the API using OAuth 2.0 or API keys - name: Queries @@ -7359,4 +7744,10 @@ tags: - name: LLM Chat Completions description: Create model responses for chat conversations using OpenAI-compatible endpoints - name: Factual Consistency Evaluation - description: Evaluate text quality metrics like factual consistency and hallucination detection \ No newline at end of file + description: Evaluate text quality metrics like factual consistency and hallucination detection + - name: Metadata Query + description: Query across arbitrary metadata fields in a corpus + - name: Tools + description: Manage and discover tools available for AI agents to use in their workflows + - name: Instructions + description: Create and manage instructions that guide agent behavior \ No newline at end of file