From 9ff0d205bd7355170340e4d2d635df99eec8890c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 20 Sep 2024 03:21:43 +0000 Subject: [PATCH] feat: Updated OpenAPI spec --- .../Generated/Cohere.CohereApi.Chat.g.cs | 6 +- .../Generated/Cohere.CohereApi.Chatv2.g.cs | 6 +- .../Cohere.CohereApi.CheckAPIKey.g.cs | 6 +- .../Generated/Cohere.CohereApi.Classify.g.cs | 6 +- .../Cohere.CohereApi.Detokenize.g.cs | 6 +- .../Generated/Cohere.CohereApi.Embed.g.cs | 6 +- .../Generated/Cohere.CohereApi.Embedv2.g.cs | 6 +- .../Generated/Cohere.CohereApi.Generate.g.cs | 6 +- .../Generated/Cohere.CohereApi.Rerank.g.cs | 6 +- .../Generated/Cohere.CohereApi.Rerankv2.g.cs | 6 +- .../Generated/Cohere.CohereApi.Summarize.g.cs | 6 +- .../Generated/Cohere.CohereApi.Tokenize.g.cs | 6 +- ...here.ConnectorsClient.CreateConnector.g.cs | 6 +- ...here.ConnectorsClient.DeleteConnector.g.cs | 6 +- .../Cohere.ConnectorsClient.GetConnector.g.cs | 6 +- ...ohere.ConnectorsClient.ListConnectors.g.cs | 10 +- ...nectorsClient.OAuthAuthorizeConnector.g.cs | 9 +- ...here.ConnectorsClient.UpdateConnector.g.cs | 6 +- .../Cohere.DatasetsClient.CreateDataset.g.cs | 21 +- .../Cohere.DatasetsClient.DeleteDataset.g.cs | 6 +- .../Cohere.DatasetsClient.GetDataset.g.cs | 6 +- ...Cohere.DatasetsClient.GetDatasetUsage.g.cs | 6 +- .../Cohere.DatasetsClient.ListDatasets.g.cs | 14 +- ...Cohere.EmbedJobsClient.CancelEmbedJob.g.cs | 6 +- ...Cohere.EmbedJobsClient.CreateEmbedJob.g.cs | 6 +- .../Cohere.EmbedJobsClient.GetEmbedJob.g.cs | 6 +- .../Cohere.EmbedJobsClient.ListEmbedJobs.g.cs | 6 +- ...FinetuningClient.CreateFinetunedModel.g.cs | 6 +- ...FinetuningClient.DeleteFinetunedModel.g.cs | 6 +- ...re.FinetuningClient.GetFinetunedModel.g.cs | 6 +- .../Cohere.FinetuningClient.ListEvents.g.cs | 11 +- ....FinetuningClient.ListFinetunedModels.g.cs | 11 +- ...etuningClient.ListTrainingStepMetrics.g.cs | 10 +- ...FinetuningClient.UpdateFinetunedModel.g.cs | 6 +- .../Cohere.ModelsClient.GetModel.g.cs | 6 +- .../Cohere.ModelsClient.ListModels.g.cs | 12 +- .../Cohere/Generated/Cohere.PathBuilder.g.cs | 227 ++++++++++++++++++ 37 files changed, 454 insertions(+), 39 deletions(-) create mode 100644 src/libs/Cohere/Generated/Cohere.PathBuilder.g.cs diff --git a/src/libs/Cohere/Generated/Cohere.CohereApi.Chat.g.cs b/src/libs/Cohere/Generated/Cohere.CohereApi.Chat.g.cs index ae27dc5..0825e0b 100644 --- a/src/libs/Cohere/Generated/Cohere.CohereApi.Chat.g.cs +++ b/src/libs/Cohere/Generated/Cohere.CohereApi.Chat.g.cs @@ -51,9 +51,13 @@ partial void ProcessChatResponseContent( accepts: ref accepts, request: request); + var __pathBuilder = new PathBuilder( + path: "/v1/chat", + 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(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + "/v1/chat", global::System.UriKind.RelativeOrAbsolute)); + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); var __httpRequestContentBody = global::System.Text.Json.JsonSerializer.Serialize(request, request.GetType(), JsonSerializerContext); var __httpRequestContent = new global::System.Net.Http.StringContent( content: __httpRequestContentBody, diff --git a/src/libs/Cohere/Generated/Cohere.CohereApi.Chatv2.g.cs b/src/libs/Cohere/Generated/Cohere.CohereApi.Chatv2.g.cs index 0c78dd9..5847d53 100644 --- a/src/libs/Cohere/Generated/Cohere.CohereApi.Chatv2.g.cs +++ b/src/libs/Cohere/Generated/Cohere.CohereApi.Chatv2.g.cs @@ -40,9 +40,13 @@ partial void ProcessChatv2ResponseContent( httpClient: _httpClient, request: request); + var __pathBuilder = new PathBuilder( + path: "/v2/chat", + 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(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + "/v2/chat", global::System.UriKind.RelativeOrAbsolute)); + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); var __httpRequestContentBody = global::System.Text.Json.JsonSerializer.Serialize(request, request.GetType(), JsonSerializerContext); var __httpRequestContent = new global::System.Net.Http.StringContent( content: __httpRequestContentBody, diff --git a/src/libs/Cohere/Generated/Cohere.CohereApi.CheckAPIKey.g.cs b/src/libs/Cohere/Generated/Cohere.CohereApi.CheckAPIKey.g.cs index ce4a983..42161f2 100644 --- a/src/libs/Cohere/Generated/Cohere.CohereApi.CheckAPIKey.g.cs +++ b/src/libs/Cohere/Generated/Cohere.CohereApi.CheckAPIKey.g.cs @@ -38,9 +38,13 @@ partial void ProcessCheckAPIKeyResponseContent( httpClient: _httpClient, xClientName: ref xClientName); + var __pathBuilder = new PathBuilder( + path: "/v1/check-api-key", + 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(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + "/v1/check-api-key", global::System.UriKind.RelativeOrAbsolute)); + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); PrepareRequest( client: _httpClient, diff --git a/src/libs/Cohere/Generated/Cohere.CohereApi.Classify.g.cs b/src/libs/Cohere/Generated/Cohere.CohereApi.Classify.g.cs index c7eb883..77e3896 100644 --- a/src/libs/Cohere/Generated/Cohere.CohereApi.Classify.g.cs +++ b/src/libs/Cohere/Generated/Cohere.CohereApi.Classify.g.cs @@ -46,9 +46,13 @@ partial void ProcessClassifyResponseContent( xClientName: ref xClientName, request: request); + var __pathBuilder = new PathBuilder( + path: "/v1/classify", + 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(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + "/v1/classify", global::System.UriKind.RelativeOrAbsolute)); + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); var __httpRequestContentBody = global::System.Text.Json.JsonSerializer.Serialize(request, request.GetType(), JsonSerializerContext); var __httpRequestContent = new global::System.Net.Http.StringContent( content: __httpRequestContentBody, diff --git a/src/libs/Cohere/Generated/Cohere.CohereApi.Detokenize.g.cs b/src/libs/Cohere/Generated/Cohere.CohereApi.Detokenize.g.cs index d325d84..aaa3588 100644 --- a/src/libs/Cohere/Generated/Cohere.CohereApi.Detokenize.g.cs +++ b/src/libs/Cohere/Generated/Cohere.CohereApi.Detokenize.g.cs @@ -45,9 +45,13 @@ partial void ProcessDetokenizeResponseContent( xClientName: ref xClientName, request: request); + var __pathBuilder = new PathBuilder( + path: "/v1/detokenize", + 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(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + "/v1/detokenize", global::System.UriKind.RelativeOrAbsolute)); + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); var __httpRequestContentBody = global::System.Text.Json.JsonSerializer.Serialize(request, request.GetType(), JsonSerializerContext); var __httpRequestContent = new global::System.Net.Http.StringContent( content: __httpRequestContentBody, diff --git a/src/libs/Cohere/Generated/Cohere.CohereApi.Embed.g.cs b/src/libs/Cohere/Generated/Cohere.CohereApi.Embed.g.cs index 9287d20..9f681ee 100644 --- a/src/libs/Cohere/Generated/Cohere.CohereApi.Embed.g.cs +++ b/src/libs/Cohere/Generated/Cohere.CohereApi.Embed.g.cs @@ -47,9 +47,13 @@ partial void ProcessEmbedResponseContent( xClientName: ref xClientName, request: request); + var __pathBuilder = new PathBuilder( + path: "/v1/embed", + 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(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + "/v1/embed", global::System.UriKind.RelativeOrAbsolute)); + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); var __httpRequestContentBody = global::System.Text.Json.JsonSerializer.Serialize(request, request.GetType(), JsonSerializerContext); var __httpRequestContent = new global::System.Net.Http.StringContent( content: __httpRequestContentBody, diff --git a/src/libs/Cohere/Generated/Cohere.CohereApi.Embedv2.g.cs b/src/libs/Cohere/Generated/Cohere.CohereApi.Embedv2.g.cs index 5d80be9..c7c5000 100644 --- a/src/libs/Cohere/Generated/Cohere.CohereApi.Embedv2.g.cs +++ b/src/libs/Cohere/Generated/Cohere.CohereApi.Embedv2.g.cs @@ -47,9 +47,13 @@ partial void ProcessEmbedv2ResponseContent( xClientName: ref xClientName, request: request); + var __pathBuilder = new PathBuilder( + path: "/v2/embed", + 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(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + "/v2/embed", global::System.UriKind.RelativeOrAbsolute)); + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); var __httpRequestContentBody = global::System.Text.Json.JsonSerializer.Serialize(request, request.GetType(), JsonSerializerContext); var __httpRequestContent = new global::System.Net.Http.StringContent( content: __httpRequestContentBody, diff --git a/src/libs/Cohere/Generated/Cohere.CohereApi.Generate.g.cs b/src/libs/Cohere/Generated/Cohere.CohereApi.Generate.g.cs index 9ea1d67..418288a 100644 --- a/src/libs/Cohere/Generated/Cohere.CohereApi.Generate.g.cs +++ b/src/libs/Cohere/Generated/Cohere.CohereApi.Generate.g.cs @@ -48,9 +48,13 @@ partial void ProcessGenerateResponseContent( xClientName: ref xClientName, request: request); + var __pathBuilder = new PathBuilder( + path: "/v1/generate", + 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(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + "/v1/generate", global::System.UriKind.RelativeOrAbsolute)); + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); var __httpRequestContentBody = global::System.Text.Json.JsonSerializer.Serialize(request, request.GetType(), JsonSerializerContext); var __httpRequestContent = new global::System.Net.Http.StringContent( content: __httpRequestContentBody, diff --git a/src/libs/Cohere/Generated/Cohere.CohereApi.Rerank.g.cs b/src/libs/Cohere/Generated/Cohere.CohereApi.Rerank.g.cs index 281b43c..75912a1 100644 --- a/src/libs/Cohere/Generated/Cohere.CohereApi.Rerank.g.cs +++ b/src/libs/Cohere/Generated/Cohere.CohereApi.Rerank.g.cs @@ -45,9 +45,13 @@ partial void ProcessRerankResponseContent( xClientName: ref xClientName, request: request); + var __pathBuilder = new PathBuilder( + path: "/v1/rerank", + 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(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + "/v1/rerank", global::System.UriKind.RelativeOrAbsolute)); + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); var __httpRequestContentBody = global::System.Text.Json.JsonSerializer.Serialize(request, request.GetType(), JsonSerializerContext); var __httpRequestContent = new global::System.Net.Http.StringContent( content: __httpRequestContentBody, diff --git a/src/libs/Cohere/Generated/Cohere.CohereApi.Rerankv2.g.cs b/src/libs/Cohere/Generated/Cohere.CohereApi.Rerankv2.g.cs index 747624e..1305cc3 100644 --- a/src/libs/Cohere/Generated/Cohere.CohereApi.Rerankv2.g.cs +++ b/src/libs/Cohere/Generated/Cohere.CohereApi.Rerankv2.g.cs @@ -45,9 +45,13 @@ partial void ProcessRerankv2ResponseContent( xClientName: ref xClientName, request: request); + var __pathBuilder = new PathBuilder( + path: "/v2/rerank", + 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(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + "/v2/rerank", global::System.UriKind.RelativeOrAbsolute)); + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); var __httpRequestContentBody = global::System.Text.Json.JsonSerializer.Serialize(request, request.GetType(), JsonSerializerContext); var __httpRequestContent = new global::System.Net.Http.StringContent( content: __httpRequestContentBody, diff --git a/src/libs/Cohere/Generated/Cohere.CohereApi.Summarize.g.cs b/src/libs/Cohere/Generated/Cohere.CohereApi.Summarize.g.cs index 911fa62..aaedf8e 100644 --- a/src/libs/Cohere/Generated/Cohere.CohereApi.Summarize.g.cs +++ b/src/libs/Cohere/Generated/Cohere.CohereApi.Summarize.g.cs @@ -48,9 +48,13 @@ partial void ProcessSummarizeResponseContent( xClientName: ref xClientName, request: request); + var __pathBuilder = new PathBuilder( + path: "/v1/summarize", + 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(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + "/v1/summarize", global::System.UriKind.RelativeOrAbsolute)); + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); var __httpRequestContentBody = global::System.Text.Json.JsonSerializer.Serialize(request, request.GetType(), JsonSerializerContext); var __httpRequestContent = new global::System.Net.Http.StringContent( content: __httpRequestContentBody, diff --git a/src/libs/Cohere/Generated/Cohere.CohereApi.Tokenize.g.cs b/src/libs/Cohere/Generated/Cohere.CohereApi.Tokenize.g.cs index c8cd6a7..efdbc94 100644 --- a/src/libs/Cohere/Generated/Cohere.CohereApi.Tokenize.g.cs +++ b/src/libs/Cohere/Generated/Cohere.CohereApi.Tokenize.g.cs @@ -45,9 +45,13 @@ partial void ProcessTokenizeResponseContent( xClientName: ref xClientName, request: request); + var __pathBuilder = new PathBuilder( + path: "/v1/tokenize", + 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(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + "/v1/tokenize", global::System.UriKind.RelativeOrAbsolute)); + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); var __httpRequestContentBody = global::System.Text.Json.JsonSerializer.Serialize(request, request.GetType(), JsonSerializerContext); var __httpRequestContent = new global::System.Net.Http.StringContent( content: __httpRequestContentBody, diff --git a/src/libs/Cohere/Generated/Cohere.ConnectorsClient.CreateConnector.g.cs b/src/libs/Cohere/Generated/Cohere.ConnectorsClient.CreateConnector.g.cs index 3f6459b..14ebd2e 100644 --- a/src/libs/Cohere/Generated/Cohere.ConnectorsClient.CreateConnector.g.cs +++ b/src/libs/Cohere/Generated/Cohere.ConnectorsClient.CreateConnector.g.cs @@ -45,9 +45,13 @@ partial void ProcessCreateConnectorResponseContent( xClientName: ref xClientName, request: request); + var __pathBuilder = new PathBuilder( + path: "/v1/connectors", + 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(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + "/v1/connectors", global::System.UriKind.RelativeOrAbsolute)); + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); var __httpRequestContentBody = global::System.Text.Json.JsonSerializer.Serialize(request, request.GetType(), JsonSerializerContext); var __httpRequestContent = new global::System.Net.Http.StringContent( content: __httpRequestContentBody, diff --git a/src/libs/Cohere/Generated/Cohere.ConnectorsClient.DeleteConnector.g.cs b/src/libs/Cohere/Generated/Cohere.ConnectorsClient.DeleteConnector.g.cs index 06b1ef9..59aca4b 100644 --- a/src/libs/Cohere/Generated/Cohere.ConnectorsClient.DeleteConnector.g.cs +++ b/src/libs/Cohere/Generated/Cohere.ConnectorsClient.DeleteConnector.g.cs @@ -43,9 +43,13 @@ partial void ProcessDeleteConnectorResponseContent( id: ref id, xClientName: ref xClientName); + var __pathBuilder = new PathBuilder( + path: $"/v1/connectors/{id}", + baseUri: _httpClient.BaseAddress); + var __path = __pathBuilder.ToString(); using var httpRequest = new global::System.Net.Http.HttpRequestMessage( method: global::System.Net.Http.HttpMethod.Delete, - requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + $"/v1/connectors/{id}", global::System.UriKind.RelativeOrAbsolute)); + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); PrepareRequest( client: _httpClient, diff --git a/src/libs/Cohere/Generated/Cohere.ConnectorsClient.GetConnector.g.cs b/src/libs/Cohere/Generated/Cohere.ConnectorsClient.GetConnector.g.cs index 763db75..145add5 100644 --- a/src/libs/Cohere/Generated/Cohere.ConnectorsClient.GetConnector.g.cs +++ b/src/libs/Cohere/Generated/Cohere.ConnectorsClient.GetConnector.g.cs @@ -43,9 +43,13 @@ partial void ProcessGetConnectorResponseContent( id: ref id, xClientName: ref xClientName); + var __pathBuilder = new PathBuilder( + path: $"/v1/connectors/{id}", + 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(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + $"/v1/connectors/{id}", global::System.UriKind.RelativeOrAbsolute)); + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); PrepareRequest( client: _httpClient, diff --git a/src/libs/Cohere/Generated/Cohere.ConnectorsClient.ListConnectors.g.cs b/src/libs/Cohere/Generated/Cohere.ConnectorsClient.ListConnectors.g.cs index c6981a7..be9ea9b 100644 --- a/src/libs/Cohere/Generated/Cohere.ConnectorsClient.ListConnectors.g.cs +++ b/src/libs/Cohere/Generated/Cohere.ConnectorsClient.ListConnectors.g.cs @@ -52,9 +52,17 @@ partial void ProcessListConnectorsResponseContent( offset: ref offset, xClientName: ref xClientName); + var __pathBuilder = new PathBuilder( + path: "/v1/connectors", + baseUri: _httpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("limit", limit?.ToString()) + .AddOptionalParameter("offset", offset?.ToString()) + ; + 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(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + $"/v1/connectors?limit={limit}&offset={offset}", global::System.UriKind.RelativeOrAbsolute)); + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); PrepareRequest( client: _httpClient, diff --git a/src/libs/Cohere/Generated/Cohere.ConnectorsClient.OAuthAuthorizeConnector.g.cs b/src/libs/Cohere/Generated/Cohere.ConnectorsClient.OAuthAuthorizeConnector.g.cs index 264381d..f6c6e5d 100644 --- a/src/libs/Cohere/Generated/Cohere.ConnectorsClient.OAuthAuthorizeConnector.g.cs +++ b/src/libs/Cohere/Generated/Cohere.ConnectorsClient.OAuthAuthorizeConnector.g.cs @@ -48,9 +48,16 @@ partial void ProcessOAuthAuthorizeConnectorResponseContent( afterTokenRedirect: ref afterTokenRedirect, xClientName: ref xClientName); + var __pathBuilder = new PathBuilder( + path: $"/v1/connectors/{id}/oauth/authorize", + baseUri: _httpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("after_token_redirect", afterTokenRedirect) + ; + 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(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + $"/v1/connectors/{id}/oauth/authorize?after_token_redirect={afterTokenRedirect}", global::System.UriKind.RelativeOrAbsolute)); + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); PrepareRequest( client: _httpClient, diff --git a/src/libs/Cohere/Generated/Cohere.ConnectorsClient.UpdateConnector.g.cs b/src/libs/Cohere/Generated/Cohere.ConnectorsClient.UpdateConnector.g.cs index 06a664e..9f82bce 100644 --- a/src/libs/Cohere/Generated/Cohere.ConnectorsClient.UpdateConnector.g.cs +++ b/src/libs/Cohere/Generated/Cohere.ConnectorsClient.UpdateConnector.g.cs @@ -50,9 +50,13 @@ partial void ProcessUpdateConnectorResponseContent( xClientName: ref xClientName, request: request); + var __pathBuilder = new PathBuilder( + path: $"/v1/connectors/{id}", + baseUri: _httpClient.BaseAddress); + var __path = __pathBuilder.ToString(); using var httpRequest = new global::System.Net.Http.HttpRequestMessage( method: new global::System.Net.Http.HttpMethod("PATCH"), - requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + $"/v1/connectors/{id}", global::System.UriKind.RelativeOrAbsolute)); + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); var __httpRequestContentBody = global::System.Text.Json.JsonSerializer.Serialize(request, request.GetType(), JsonSerializerContext); var __httpRequestContent = new global::System.Net.Http.StringContent( content: __httpRequestContentBody, diff --git a/src/libs/Cohere/Generated/Cohere.DatasetsClient.CreateDataset.g.cs b/src/libs/Cohere/Generated/Cohere.DatasetsClient.CreateDataset.g.cs index 675c266..d223f3b 100644 --- a/src/libs/Cohere/Generated/Cohere.DatasetsClient.CreateDataset.g.cs +++ b/src/libs/Cohere/Generated/Cohere.DatasetsClient.CreateDataset.g.cs @@ -1,4 +1,3 @@ -using System.Linq; #nullable enable @@ -88,9 +87,23 @@ partial void ProcessCreateDatasetResponseContent( xClientName: ref xClientName, request: request); + var __pathBuilder = new PathBuilder( + path: "/v1/datasets", + baseUri: _httpClient.BaseAddress); + __pathBuilder + .AddRequiredParameter("name", name) + .AddRequiredParameter("type", type.ToValueString()) + .AddOptionalParameter("keep_original_file", keepOriginalFile?.ToString()) + .AddOptionalParameter("skip_malformed_input", skipMalformedInput?.ToString()) + .AddOptionalParameter("keep_fields", keepFields, delimiter: ",", explode: true) + .AddOptionalParameter("optional_fields", optionalFields, delimiter: ",", explode: true) + .AddOptionalParameter("text_separator", textSeparator) + .AddOptionalParameter("csv_delimiter", csvDelimiter) + ; + 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(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + $"/v1/datasets?name={name}&type={(global::System.Uri.EscapeDataString(type.ToValueString() ?? string.Empty))}&keep_original_file={keepOriginalFile}&skip_malformed_input={skipMalformedInput}&{string.Join("&", keepFields?.Select(static x => $"keepFields={x}") ?? global::System.Array.Empty())}&{string.Join("&", optionalFields?.Select(static x => $"optionalFields={x}") ?? global::System.Array.Empty())}&text_separator={textSeparator}&csv_delimiter={csvDelimiter}", global::System.UriKind.RelativeOrAbsolute)); + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); using var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); __httpRequestContent.Add( content: new global::System.Net.Http.StringContent($"{name}"), @@ -113,13 +126,13 @@ partial void ProcessCreateDatasetResponseContent( if (keepFields != default) { __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", keepFields.Select(x => x))}]"), + content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(keepFields, x => x))}]"), name: "keep_fields"); } if (optionalFields != default) { __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", optionalFields.Select(x => x))}]"), + content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(optionalFields, x => x))}]"), name: "optional_fields"); } if (textSeparator != default) diff --git a/src/libs/Cohere/Generated/Cohere.DatasetsClient.DeleteDataset.g.cs b/src/libs/Cohere/Generated/Cohere.DatasetsClient.DeleteDataset.g.cs index ea894dc..cd65411 100644 --- a/src/libs/Cohere/Generated/Cohere.DatasetsClient.DeleteDataset.g.cs +++ b/src/libs/Cohere/Generated/Cohere.DatasetsClient.DeleteDataset.g.cs @@ -43,9 +43,13 @@ partial void ProcessDeleteDatasetResponseContent( id: ref id, xClientName: ref xClientName); + var __pathBuilder = new PathBuilder( + path: $"/v1/datasets/{id}", + baseUri: _httpClient.BaseAddress); + var __path = __pathBuilder.ToString(); using var httpRequest = new global::System.Net.Http.HttpRequestMessage( method: global::System.Net.Http.HttpMethod.Delete, - requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + $"/v1/datasets/{id}", global::System.UriKind.RelativeOrAbsolute)); + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); PrepareRequest( client: _httpClient, diff --git a/src/libs/Cohere/Generated/Cohere.DatasetsClient.GetDataset.g.cs b/src/libs/Cohere/Generated/Cohere.DatasetsClient.GetDataset.g.cs index 815d84c..0c3909e 100644 --- a/src/libs/Cohere/Generated/Cohere.DatasetsClient.GetDataset.g.cs +++ b/src/libs/Cohere/Generated/Cohere.DatasetsClient.GetDataset.g.cs @@ -43,9 +43,13 @@ partial void ProcessGetDatasetResponseContent( id: ref id, xClientName: ref xClientName); + var __pathBuilder = new PathBuilder( + path: $"/v1/datasets/{id}", + 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(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + $"/v1/datasets/{id}", global::System.UriKind.RelativeOrAbsolute)); + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); PrepareRequest( client: _httpClient, diff --git a/src/libs/Cohere/Generated/Cohere.DatasetsClient.GetDatasetUsage.g.cs b/src/libs/Cohere/Generated/Cohere.DatasetsClient.GetDatasetUsage.g.cs index fd247ad..4e20b7e 100644 --- a/src/libs/Cohere/Generated/Cohere.DatasetsClient.GetDatasetUsage.g.cs +++ b/src/libs/Cohere/Generated/Cohere.DatasetsClient.GetDatasetUsage.g.cs @@ -38,9 +38,13 @@ partial void ProcessGetDatasetUsageResponseContent( httpClient: _httpClient, xClientName: ref xClientName); + var __pathBuilder = new PathBuilder( + path: "/v1/datasets/usage", + 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(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + "/v1/datasets/usage", global::System.UriKind.RelativeOrAbsolute)); + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); PrepareRequest( client: _httpClient, diff --git a/src/libs/Cohere/Generated/Cohere.DatasetsClient.ListDatasets.g.cs b/src/libs/Cohere/Generated/Cohere.DatasetsClient.ListDatasets.g.cs index 341ad2f..bff78e4 100644 --- a/src/libs/Cohere/Generated/Cohere.DatasetsClient.ListDatasets.g.cs +++ b/src/libs/Cohere/Generated/Cohere.DatasetsClient.ListDatasets.g.cs @@ -70,9 +70,21 @@ partial void ProcessListDatasetsResponseContent( validationStatus: ref validationStatus, xClientName: ref xClientName); + var __pathBuilder = new PathBuilder( + path: "/v1/datasets", + baseUri: _httpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("datasetType", datasetType) + .AddOptionalParameter("before", before?.ToString("yyyy-MM-ddTHH:mm:ssZ")) + .AddOptionalParameter("after", after?.ToString("yyyy-MM-ddTHH:mm:ssZ")) + .AddOptionalParameter("limit", limit?.ToString()) + .AddOptionalParameter("offset", offset?.ToString()) + .AddOptionalParameter("validationStatus", validationStatus?.ToValueString()) + ; + 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(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + $"/v1/datasets?datasetType={datasetType}&before={before:yyyy-MM-ddTHH:mm:ssZ}&after={after:yyyy-MM-ddTHH:mm:ssZ}&limit={limit}&offset={offset}&validationStatus={(global::System.Uri.EscapeDataString(validationStatus?.ToValueString() ?? string.Empty))}", global::System.UriKind.RelativeOrAbsolute)); + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); PrepareRequest( client: _httpClient, diff --git a/src/libs/Cohere/Generated/Cohere.EmbedJobsClient.CancelEmbedJob.g.cs b/src/libs/Cohere/Generated/Cohere.EmbedJobsClient.CancelEmbedJob.g.cs index 13e5dd2..1e35d19 100644 --- a/src/libs/Cohere/Generated/Cohere.EmbedJobsClient.CancelEmbedJob.g.cs +++ b/src/libs/Cohere/Generated/Cohere.EmbedJobsClient.CancelEmbedJob.g.cs @@ -43,9 +43,13 @@ partial void ProcessCancelEmbedJobResponseContent( id: ref id, xClientName: ref xClientName); + var __pathBuilder = new PathBuilder( + path: $"/v1/embed-jobs/{id}/cancel", + 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(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + $"/v1/embed-jobs/{id}/cancel", global::System.UriKind.RelativeOrAbsolute)); + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); PrepareRequest( client: _httpClient, diff --git a/src/libs/Cohere/Generated/Cohere.EmbedJobsClient.CreateEmbedJob.g.cs b/src/libs/Cohere/Generated/Cohere.EmbedJobsClient.CreateEmbedJob.g.cs index 0609fcc..0bf7802 100644 --- a/src/libs/Cohere/Generated/Cohere.EmbedJobsClient.CreateEmbedJob.g.cs +++ b/src/libs/Cohere/Generated/Cohere.EmbedJobsClient.CreateEmbedJob.g.cs @@ -45,9 +45,13 @@ partial void ProcessCreateEmbedJobResponseContent( xClientName: ref xClientName, request: request); + var __pathBuilder = new PathBuilder( + path: "/v1/embed-jobs", + 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(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + "/v1/embed-jobs", global::System.UriKind.RelativeOrAbsolute)); + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); var __httpRequestContentBody = global::System.Text.Json.JsonSerializer.Serialize(request, request.GetType(), JsonSerializerContext); var __httpRequestContent = new global::System.Net.Http.StringContent( content: __httpRequestContentBody, diff --git a/src/libs/Cohere/Generated/Cohere.EmbedJobsClient.GetEmbedJob.g.cs b/src/libs/Cohere/Generated/Cohere.EmbedJobsClient.GetEmbedJob.g.cs index bb15ed9..daacfd1 100644 --- a/src/libs/Cohere/Generated/Cohere.EmbedJobsClient.GetEmbedJob.g.cs +++ b/src/libs/Cohere/Generated/Cohere.EmbedJobsClient.GetEmbedJob.g.cs @@ -43,9 +43,13 @@ partial void ProcessGetEmbedJobResponseContent( id: ref id, xClientName: ref xClientName); + var __pathBuilder = new PathBuilder( + path: $"/v1/embed-jobs/{id}", + 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(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + $"/v1/embed-jobs/{id}", global::System.UriKind.RelativeOrAbsolute)); + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); PrepareRequest( client: _httpClient, diff --git a/src/libs/Cohere/Generated/Cohere.EmbedJobsClient.ListEmbedJobs.g.cs b/src/libs/Cohere/Generated/Cohere.EmbedJobsClient.ListEmbedJobs.g.cs index 95e0a05..1f6fb98 100644 --- a/src/libs/Cohere/Generated/Cohere.EmbedJobsClient.ListEmbedJobs.g.cs +++ b/src/libs/Cohere/Generated/Cohere.EmbedJobsClient.ListEmbedJobs.g.cs @@ -38,9 +38,13 @@ partial void ProcessListEmbedJobsResponseContent( httpClient: _httpClient, xClientName: ref xClientName); + var __pathBuilder = new PathBuilder( + path: "/v1/embed-jobs", + 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(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + "/v1/embed-jobs", global::System.UriKind.RelativeOrAbsolute)); + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); PrepareRequest( client: _httpClient, diff --git a/src/libs/Cohere/Generated/Cohere.FinetuningClient.CreateFinetunedModel.g.cs b/src/libs/Cohere/Generated/Cohere.FinetuningClient.CreateFinetunedModel.g.cs index 845ad24..1e583fc 100644 --- a/src/libs/Cohere/Generated/Cohere.FinetuningClient.CreateFinetunedModel.g.cs +++ b/src/libs/Cohere/Generated/Cohere.FinetuningClient.CreateFinetunedModel.g.cs @@ -44,9 +44,13 @@ partial void ProcessCreateFinetunedModelResponseContent( xClientName: ref xClientName, request: request); + var __pathBuilder = new PathBuilder( + path: "/v1/finetuning/finetuned-models", + 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(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + "/v1/finetuning/finetuned-models", global::System.UriKind.RelativeOrAbsolute)); + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); var __httpRequestContentBody = global::System.Text.Json.JsonSerializer.Serialize(request, request.GetType(), JsonSerializerContext); var __httpRequestContent = new global::System.Net.Http.StringContent( content: __httpRequestContentBody, diff --git a/src/libs/Cohere/Generated/Cohere.FinetuningClient.DeleteFinetunedModel.g.cs b/src/libs/Cohere/Generated/Cohere.FinetuningClient.DeleteFinetunedModel.g.cs index 890f19d..fc5fb64 100644 --- a/src/libs/Cohere/Generated/Cohere.FinetuningClient.DeleteFinetunedModel.g.cs +++ b/src/libs/Cohere/Generated/Cohere.FinetuningClient.DeleteFinetunedModel.g.cs @@ -42,9 +42,13 @@ partial void ProcessDeleteFinetunedModelResponseContent( id: ref id, xClientName: ref xClientName); + var __pathBuilder = new PathBuilder( + path: $"/v1/finetuning/finetuned-models/{id}", + baseUri: _httpClient.BaseAddress); + var __path = __pathBuilder.ToString(); using var httpRequest = new global::System.Net.Http.HttpRequestMessage( method: global::System.Net.Http.HttpMethod.Delete, - requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + $"/v1/finetuning/finetuned-models/{id}", global::System.UriKind.RelativeOrAbsolute)); + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); PrepareRequest( client: _httpClient, diff --git a/src/libs/Cohere/Generated/Cohere.FinetuningClient.GetFinetunedModel.g.cs b/src/libs/Cohere/Generated/Cohere.FinetuningClient.GetFinetunedModel.g.cs index 4647783..6c65b4b 100644 --- a/src/libs/Cohere/Generated/Cohere.FinetuningClient.GetFinetunedModel.g.cs +++ b/src/libs/Cohere/Generated/Cohere.FinetuningClient.GetFinetunedModel.g.cs @@ -42,9 +42,13 @@ partial void ProcessGetFinetunedModelResponseContent( id: ref id, xClientName: ref xClientName); + var __pathBuilder = new PathBuilder( + path: $"/v1/finetuning/finetuned-models/{id}", + 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(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + $"/v1/finetuning/finetuned-models/{id}", global::System.UriKind.RelativeOrAbsolute)); + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); PrepareRequest( client: _httpClient, diff --git a/src/libs/Cohere/Generated/Cohere.FinetuningClient.ListEvents.g.cs b/src/libs/Cohere/Generated/Cohere.FinetuningClient.ListEvents.g.cs index d7a8e54..7718bb5 100644 --- a/src/libs/Cohere/Generated/Cohere.FinetuningClient.ListEvents.g.cs +++ b/src/libs/Cohere/Generated/Cohere.FinetuningClient.ListEvents.g.cs @@ -57,9 +57,18 @@ partial void ProcessListEventsResponseContent( orderBy: ref orderBy, xClientName: ref xClientName); + var __pathBuilder = new PathBuilder( + path: $"/v1/finetuning/finetuned-models/{finetunedModelId}/events", + baseUri: _httpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("page_size", pageSize?.ToString()) + .AddOptionalParameter("page_token", pageToken) + .AddOptionalParameter("order_by", orderBy) + ; + 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(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + $"/v1/finetuning/finetuned-models/{finetunedModelId}/events?page_size={pageSize}&page_token={pageToken}&order_by={orderBy}", global::System.UriKind.RelativeOrAbsolute)); + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); PrepareRequest( client: _httpClient, diff --git a/src/libs/Cohere/Generated/Cohere.FinetuningClient.ListFinetunedModels.g.cs b/src/libs/Cohere/Generated/Cohere.FinetuningClient.ListFinetunedModels.g.cs index 1a0f98e..5fa5f92 100644 --- a/src/libs/Cohere/Generated/Cohere.FinetuningClient.ListFinetunedModels.g.cs +++ b/src/libs/Cohere/Generated/Cohere.FinetuningClient.ListFinetunedModels.g.cs @@ -52,9 +52,18 @@ partial void ProcessListFinetunedModelsResponseContent( orderBy: ref orderBy, xClientName: ref xClientName); + var __pathBuilder = new PathBuilder( + path: "/v1/finetuning/finetuned-models", + baseUri: _httpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("page_size", pageSize?.ToString()) + .AddOptionalParameter("page_token", pageToken) + .AddOptionalParameter("order_by", orderBy) + ; + 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(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + $"/v1/finetuning/finetuned-models?page_size={pageSize}&page_token={pageToken}&order_by={orderBy}", global::System.UriKind.RelativeOrAbsolute)); + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); PrepareRequest( client: _httpClient, diff --git a/src/libs/Cohere/Generated/Cohere.FinetuningClient.ListTrainingStepMetrics.g.cs b/src/libs/Cohere/Generated/Cohere.FinetuningClient.ListTrainingStepMetrics.g.cs index 9f0596c..d1de740 100644 --- a/src/libs/Cohere/Generated/Cohere.FinetuningClient.ListTrainingStepMetrics.g.cs +++ b/src/libs/Cohere/Generated/Cohere.FinetuningClient.ListTrainingStepMetrics.g.cs @@ -52,9 +52,17 @@ partial void ProcessListTrainingStepMetricsResponseContent( pageToken: ref pageToken, xClientName: ref xClientName); + var __pathBuilder = new PathBuilder( + path: $"/v1/finetuning/finetuned-models/{finetunedModelId}/training-step-metrics", + baseUri: _httpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("page_size", pageSize?.ToString()) + .AddOptionalParameter("page_token", pageToken) + ; + 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(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + $"/v1/finetuning/finetuned-models/{finetunedModelId}/training-step-metrics?page_size={pageSize}&page_token={pageToken}", global::System.UriKind.RelativeOrAbsolute)); + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); PrepareRequest( client: _httpClient, diff --git a/src/libs/Cohere/Generated/Cohere.FinetuningClient.UpdateFinetunedModel.g.cs b/src/libs/Cohere/Generated/Cohere.FinetuningClient.UpdateFinetunedModel.g.cs index b705c02..969a567 100644 --- a/src/libs/Cohere/Generated/Cohere.FinetuningClient.UpdateFinetunedModel.g.cs +++ b/src/libs/Cohere/Generated/Cohere.FinetuningClient.UpdateFinetunedModel.g.cs @@ -49,9 +49,13 @@ partial void ProcessUpdateFinetunedModelResponseContent( xClientName: ref xClientName, request: request); + var __pathBuilder = new PathBuilder( + path: $"/v1/finetuning/finetuned-models/{id}", + baseUri: _httpClient.BaseAddress); + var __path = __pathBuilder.ToString(); using var httpRequest = new global::System.Net.Http.HttpRequestMessage( method: new global::System.Net.Http.HttpMethod("PATCH"), - requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + $"/v1/finetuning/finetuned-models/{id}", global::System.UriKind.RelativeOrAbsolute)); + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); var __httpRequestContentBody = global::System.Text.Json.JsonSerializer.Serialize(request, request.GetType(), JsonSerializerContext); var __httpRequestContent = new global::System.Net.Http.StringContent( content: __httpRequestContentBody, diff --git a/src/libs/Cohere/Generated/Cohere.ModelsClient.GetModel.g.cs b/src/libs/Cohere/Generated/Cohere.ModelsClient.GetModel.g.cs index 065aeb5..d1e1ccc 100644 --- a/src/libs/Cohere/Generated/Cohere.ModelsClient.GetModel.g.cs +++ b/src/libs/Cohere/Generated/Cohere.ModelsClient.GetModel.g.cs @@ -45,9 +45,13 @@ partial void ProcessGetModelResponseContent( model: ref model, xClientName: ref xClientName); + var __pathBuilder = new PathBuilder( + path: $"/v1/models/{model}", + 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(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + $"/v1/models/{model}", global::System.UriKind.RelativeOrAbsolute)); + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); PrepareRequest( client: _httpClient, diff --git a/src/libs/Cohere/Generated/Cohere.ModelsClient.ListModels.g.cs b/src/libs/Cohere/Generated/Cohere.ModelsClient.ListModels.g.cs index 3b134aa..0637e5c 100644 --- a/src/libs/Cohere/Generated/Cohere.ModelsClient.ListModels.g.cs +++ b/src/libs/Cohere/Generated/Cohere.ModelsClient.ListModels.g.cs @@ -55,9 +55,19 @@ partial void ProcessListModelsResponseContent( endpoint: ref endpoint, defaultOnly: ref defaultOnly); + var __pathBuilder = new PathBuilder( + path: "/v1/models", + baseUri: _httpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("page_size", pageSize?.ToString()) + .AddOptionalParameter("page_token", pageToken) + .AddOptionalParameter("endpoint", endpoint?.ToValueString()) + .AddOptionalParameter("default_only", defaultOnly?.ToString()) + ; + 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(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + $"/v1/models?page_size={pageSize}&page_token={pageToken}&endpoint={(global::System.Uri.EscapeDataString(endpoint?.ToValueString() ?? string.Empty))}&default_only={defaultOnly}", global::System.UriKind.RelativeOrAbsolute)); + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); PrepareRequest( client: _httpClient, diff --git a/src/libs/Cohere/Generated/Cohere.PathBuilder.g.cs b/src/libs/Cohere/Generated/Cohere.PathBuilder.g.cs new file mode 100644 index 0000000..9afa541 --- /dev/null +++ b/src/libs/Cohere/Generated/Cohere.PathBuilder.g.cs @@ -0,0 +1,227 @@ +using System.Linq; + +#nullable enable + +namespace Cohere +{ + /// + /// A helper class to build URL paths with optional and required parameters. + /// + public class PathBuilder + { + private readonly global::System.Text.StringBuilder _stringBuilder = + new global::System.Text.StringBuilder(capacity: 256); + private bool _firstParameter = true; + + /// + /// Initializes a new instance of the class. + /// + /// The base path for the URL. + /// The base URI to prepend to the path, if any. + public PathBuilder( + string path, + global::System.Uri? baseUri = null) + { + if (baseUri is not null) + { + _stringBuilder.Append(baseUri.AbsoluteUri.TrimEnd('/')); + } + + _stringBuilder.Append(path); + } + + /// + /// Adds a required parameter to the URL. + /// + /// The name of the parameter. + /// The value of the parameter. + /// The current instance. + public PathBuilder AddRequiredParameter( + string name, + string value) + { + if (_firstParameter) + { + _stringBuilder.Append('?'); + _firstParameter = false; + } + else + { + _stringBuilder.Append('&'); + } + + _stringBuilder.Append(global::System.Uri.EscapeDataString(name)); + _stringBuilder.Append('='); + _stringBuilder.Append(global::System.Uri.EscapeDataString(value)); + + return this; + } + + /// + /// Adds a required parameter with multiple values to the URL. + /// + /// The name of the parameter. + /// The values of the parameter. + /// The delimiter to use between values. + /// Whether to explode the values into separate parameters. + /// The current instance. + public PathBuilder AddRequiredParameter( + string name, + global::System.Collections.Generic.IEnumerable value, + string delimiter = ",", + bool explode = false) + { + if (explode) + { + foreach (var item in value) + { + AddRequiredParameter($"{name}", item); + } + + return this; + } + + AddRequiredParameter(name, string.Join(delimiter, value)); + + return this; + } + + /// + /// Adds a required parameter with multiple values to the URL, using a selector function. + /// + /// The type of the values. + /// The name of the parameter. + /// The values of the parameter. + /// The function to select the string representation of each value. + /// The delimiter to use between values. + /// Whether to explode the values into separate parameters. + /// The current instance. + public PathBuilder AddRequiredParameter( + string name, + global::System.Collections.Generic.IEnumerable value, + global::System.Func selector, + string delimiter = ",", + bool explode = false) + { + AddRequiredParameter(name, value.Select(selector).ToArray(), delimiter, explode); + + return this; + } + + /// + /// Adds an optional parameter to the URL. + /// + /// The name of the parameter. + /// The value of the parameter, or null if not present. + /// The current instance. + public PathBuilder AddOptionalParameter( + string name, + string? value) + { + if (value is not null) + { + AddRequiredParameter(name, value); + } + + return this; + } + + /// + /// Adds an optional parameter with multiple values to the URL. + /// + /// The name of the parameter. + /// The values of the parameter, or null if not present. + /// The delimiter to use between values. + /// Whether to explode the values into separate parameters. + /// The current instance. + public PathBuilder AddOptionalParameter( + string name, + global::System.Collections.Generic.IEnumerable? value, + string delimiter = ",", + bool explode = false) + { + if (value is not null) + { + AddRequiredParameter(name, value, delimiter, explode); + } + + return this; + } + + /// + /// Adds an optional parameter with multiple values to the URL, using a selector function. + /// + /// The type of the values. + /// The name of the parameter. + /// The values of the parameter, or null if not present. + /// The function to select the string representation of each value. + /// The delimiter to use between values. + /// Whether to explode the values into separate parameters. + /// The current instance. + public PathBuilder AddOptionalParameter( + string name, + global::System.Collections.Generic.IEnumerable? value, + global::System.Func selector, + string delimiter = ",", + bool explode = false) + { + if (value is not null) + { + AddRequiredParameter(name, value.Select(selector).ToArray(), delimiter, explode); + } + + return this; + } + + /// + /// Adds a required parameter to the URL, using a formattable value. + /// + /// The type of the value. + /// The name of the parameter. + /// The value of the parameter. + /// The format string. + /// The format provider. + /// The current instance. + public PathBuilder AddRequiredParameter( + string name, + T value, + string? format = null, + global::System.IFormatProvider? formatProvider = null) + where T : global::System.IFormattable + { + AddRequiredParameter(name, value.ToString(format, formatProvider)); + + return this; + } + + /// + /// Adds an optional parameter to the URL, using a formattable value. + /// + /// The type of the value. + /// The name of the parameter. + /// The value of the parameter, or null if not present. + /// The format string. + /// The format provider. + /// The current instance. + public PathBuilder AddOptionalParameter( + string name, + T? value, + string? format = null, + global::System.IFormatProvider? formatProvider = null) + where T : global::System.IFormattable + { + if (value is not null) + { + AddOptionalParameter(name, value.ToString(format, formatProvider)); + } + + return this; + } + + /// + /// Returns the constructed URL as a string. + /// + /// The constructed URL. + public override string ToString() => _stringBuilder.ToString(); + } +} \ No newline at end of file