-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from tryAGI/bot/update-openapi_202409181824
feat:@coderabbitai
- Loading branch information
Showing
24 changed files
with
1,664 additions
and
466 deletions.
There are no files selected for viewing
127 changes: 127 additions & 0 deletions
127
src/libs/Cohere/Generated/Cohere.CohereApi.Embedv2.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
|
||
#nullable enable | ||
|
||
namespace Cohere | ||
{ | ||
public partial class CohereApi | ||
{ | ||
partial void PrepareEmbedv2Arguments( | ||
global::System.Net.Http.HttpClient httpClient, | ||
ref string? xClientName, | ||
global::Cohere.V2EmbedRequest request); | ||
partial void PrepareEmbedv2Request( | ||
global::System.Net.Http.HttpClient httpClient, | ||
global::System.Net.Http.HttpRequestMessage httpRequestMessage, | ||
string? xClientName, | ||
global::Cohere.V2EmbedRequest request); | ||
partial void ProcessEmbedv2Response( | ||
global::System.Net.Http.HttpClient httpClient, | ||
global::System.Net.Http.HttpResponseMessage httpResponseMessage); | ||
|
||
partial void ProcessEmbedv2ResponseContent( | ||
global::System.Net.Http.HttpClient httpClient, | ||
global::System.Net.Http.HttpResponseMessage httpResponseMessage, | ||
ref string content); | ||
|
||
/// <summary> | ||
/// Embed<br/> | ||
/// This endpoint returns text embeddings. An embedding is a list of floating point numbers that captures semantic information about the text that it represents.<br/> | ||
/// Embeddings can be used to create text classifiers as well as empower semantic search. To learn more about embeddings, see the embedding page.<br/> | ||
/// If you want to learn more how to use the embedding model, have a look at the [Semantic Search Guide](/docs/semantic-search). | ||
/// </summary> | ||
/// <param name="xClientName"></param> | ||
/// <param name="request"></param> | ||
/// <param name="cancellationToken">The token to cancel the operation with</param> | ||
/// <exception cref="global::System.InvalidOperationException"></exception> | ||
public async global::System.Threading.Tasks.Task<global::Cohere.EmbedByTypeResponse> Embedv2Async( | ||
global::Cohere.V2EmbedRequest request, | ||
string? xClientName = default, | ||
global::System.Threading.CancellationToken cancellationToken = default) | ||
{ | ||
PrepareArguments( | ||
client: _httpClient); | ||
PrepareEmbedv2Arguments( | ||
httpClient: _httpClient, | ||
xClientName: ref xClientName, | ||
request: request); | ||
|
||
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)); | ||
var __httpRequestContentBody = global::System.Text.Json.JsonSerializer.Serialize(request, request.GetType(), 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); | ||
PrepareEmbedv2Request( | ||
httpClient: _httpClient, | ||
httpRequestMessage: httpRequest, | ||
xClientName: xClientName, | ||
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); | ||
ProcessEmbedv2Response( | ||
httpClient: _httpClient, | ||
httpResponseMessage: response); | ||
|
||
var __content = await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); | ||
|
||
ProcessResponseContent( | ||
client: _httpClient, | ||
response: response, | ||
content: ref __content); | ||
ProcessEmbedv2ResponseContent( | ||
httpClient: _httpClient, | ||
httpResponseMessage: response, | ||
content: ref __content); | ||
|
||
try | ||
{ | ||
response.EnsureSuccessStatusCode(); | ||
} | ||
catch (global::System.Net.Http.HttpRequestException ex) | ||
{ | ||
throw new global::System.InvalidOperationException(__content, ex); | ||
} | ||
|
||
return | ||
global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::Cohere.EmbedByTypeResponse), JsonSerializerContext) as global::Cohere.EmbedByTypeResponse ?? | ||
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); | ||
} | ||
|
||
/// <summary> | ||
/// Embed<br/> | ||
/// This endpoint returns text embeddings. An embedding is a list of floating point numbers that captures semantic information about the text that it represents.<br/> | ||
/// Embeddings can be used to create text classifiers as well as empower semantic search. To learn more about embeddings, see the embedding page.<br/> | ||
/// If you want to learn more how to use the embedding model, have a look at the [Semantic Search Guide](/docs/semantic-search). | ||
/// </summary> | ||
/// <param name="xClientName"></param> | ||
/// <param name="cancellationToken">The token to cancel the operation with</param> | ||
/// <exception cref="global::System.InvalidOperationException"></exception> | ||
public async global::System.Threading.Tasks.Task<global::Cohere.EmbedByTypeResponse> Embedv2Async( | ||
string? xClientName = default, | ||
global::System.Threading.CancellationToken cancellationToken = default) | ||
{ | ||
var request = new global::Cohere.V2EmbedRequest | ||
{ | ||
}; | ||
|
||
return await Embedv2Async( | ||
xClientName: xClientName, | ||
request: request, | ||
cancellationToken: cancellationToken).ConfigureAwait(false); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#nullable enable | ||
|
||
namespace Cohere | ||
{ | ||
public partial interface ICohereApi | ||
{ | ||
/// <summary> | ||
/// Embed<br/> | ||
/// This endpoint returns text embeddings. An embedding is a list of floating point numbers that captures semantic information about the text that it represents.<br/> | ||
/// Embeddings can be used to create text classifiers as well as empower semantic search. To learn more about embeddings, see the embedding page.<br/> | ||
/// If you want to learn more how to use the embedding model, have a look at the [Semantic Search Guide](/docs/semantic-search). | ||
/// </summary> | ||
/// <param name="xClientName"></param> | ||
/// <param name="request"></param> | ||
/// <param name="cancellationToken">The token to cancel the operation with</param> | ||
/// <exception cref="global::System.InvalidOperationException"></exception> | ||
global::System.Threading.Tasks.Task<global::Cohere.EmbedByTypeResponse> Embedv2Async( | ||
global::Cohere.V2EmbedRequest request, | ||
string? xClientName = default, | ||
global::System.Threading.CancellationToken cancellationToken = default); | ||
|
||
/// <summary> | ||
/// Embed<br/> | ||
/// This endpoint returns text embeddings. An embedding is a list of floating point numbers that captures semantic information about the text that it represents.<br/> | ||
/// Embeddings can be used to create text classifiers as well as empower semantic search. To learn more about embeddings, see the embedding page.<br/> | ||
/// If you want to learn more how to use the embedding model, have a look at the [Semantic Search Guide](/docs/semantic-search). | ||
/// </summary> | ||
/// <param name="xClientName"></param> | ||
/// <param name="cancellationToken">The token to cancel the operation with</param> | ||
/// <exception cref="global::System.InvalidOperationException"></exception> | ||
global::System.Threading.Tasks.Task<global::Cohere.EmbedByTypeResponse> Embedv2Async( | ||
string? xClientName = default, | ||
global::System.Threading.CancellationToken cancellationToken = default); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
src/libs/Cohere/Generated/Cohere.Models.Embedv2Response.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
|
||
#nullable enable | ||
|
||
namespace Cohere | ||
{ | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
public sealed partial class Embedv2Response | ||
{ | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
[global::System.Text.Json.Serialization.JsonPropertyName("data")] | ||
public string? Data { get; set; } | ||
|
||
/// <summary> | ||
/// Additional properties that are not explicitly defined in the schema | ||
/// </summary> | ||
[global::System.Text.Json.Serialization.JsonExtensionData] | ||
public global::System.Collections.Generic.IDictionary<string, object> AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary<string, object>(); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
src/libs/Cohere/Generated/Cohere.Models.Embedv2Response10.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
|
||
#nullable enable | ||
|
||
namespace Cohere | ||
{ | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
public sealed partial class Embedv2Response10 | ||
{ | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
[global::System.Text.Json.Serialization.JsonPropertyName("data")] | ||
public string? Data { get; set; } | ||
|
||
/// <summary> | ||
/// Additional properties that are not explicitly defined in the schema | ||
/// </summary> | ||
[global::System.Text.Json.Serialization.JsonExtensionData] | ||
public global::System.Collections.Generic.IDictionary<string, object> AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary<string, object>(); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
src/libs/Cohere/Generated/Cohere.Models.Embedv2Response11.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
|
||
#nullable enable | ||
|
||
namespace Cohere | ||
{ | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
public sealed partial class Embedv2Response11 | ||
{ | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
[global::System.Text.Json.Serialization.JsonPropertyName("data")] | ||
public string? Data { get; set; } | ||
|
||
/// <summary> | ||
/// Additional properties that are not explicitly defined in the schema | ||
/// </summary> | ||
[global::System.Text.Json.Serialization.JsonExtensionData] | ||
public global::System.Collections.Generic.IDictionary<string, object> AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary<string, object>(); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
src/libs/Cohere/Generated/Cohere.Models.Embedv2Response12.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
|
||
#nullable enable | ||
|
||
namespace Cohere | ||
{ | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
public sealed partial class Embedv2Response12 | ||
{ | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
[global::System.Text.Json.Serialization.JsonPropertyName("data")] | ||
public string? Data { get; set; } | ||
|
||
/// <summary> | ||
/// Additional properties that are not explicitly defined in the schema | ||
/// </summary> | ||
[global::System.Text.Json.Serialization.JsonExtensionData] | ||
public global::System.Collections.Generic.IDictionary<string, object> AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary<string, object>(); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
src/libs/Cohere/Generated/Cohere.Models.Embedv2Response2.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
|
||
#nullable enable | ||
|
||
namespace Cohere | ||
{ | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
public sealed partial class Embedv2Response2 | ||
{ | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
[global::System.Text.Json.Serialization.JsonPropertyName("data")] | ||
public string? Data { get; set; } | ||
|
||
/// <summary> | ||
/// Additional properties that are not explicitly defined in the schema | ||
/// </summary> | ||
[global::System.Text.Json.Serialization.JsonExtensionData] | ||
public global::System.Collections.Generic.IDictionary<string, object> AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary<string, object>(); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
src/libs/Cohere/Generated/Cohere.Models.Embedv2Response3.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
|
||
#nullable enable | ||
|
||
namespace Cohere | ||
{ | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
public sealed partial class Embedv2Response3 | ||
{ | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
[global::System.Text.Json.Serialization.JsonPropertyName("data")] | ||
public string? Data { get; set; } | ||
|
||
/// <summary> | ||
/// Additional properties that are not explicitly defined in the schema | ||
/// </summary> | ||
[global::System.Text.Json.Serialization.JsonExtensionData] | ||
public global::System.Collections.Generic.IDictionary<string, object> AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary<string, object>(); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
src/libs/Cohere/Generated/Cohere.Models.Embedv2Response4.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
|
||
#nullable enable | ||
|
||
namespace Cohere | ||
{ | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
public sealed partial class Embedv2Response4 | ||
{ | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
[global::System.Text.Json.Serialization.JsonPropertyName("data")] | ||
public string? Data { get; set; } | ||
|
||
/// <summary> | ||
/// Additional properties that are not explicitly defined in the schema | ||
/// </summary> | ||
[global::System.Text.Json.Serialization.JsonExtensionData] | ||
public global::System.Collections.Generic.IDictionary<string, object> AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary<string, object>(); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
src/libs/Cohere/Generated/Cohere.Models.Embedv2Response5.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
|
||
#nullable enable | ||
|
||
namespace Cohere | ||
{ | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
public sealed partial class Embedv2Response5 | ||
{ | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
[global::System.Text.Json.Serialization.JsonPropertyName("data")] | ||
public string? Data { get; set; } | ||
|
||
/// <summary> | ||
/// Additional properties that are not explicitly defined in the schema | ||
/// </summary> | ||
[global::System.Text.Json.Serialization.JsonExtensionData] | ||
public global::System.Collections.Generic.IDictionary<string, object> AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary<string, object>(); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
src/libs/Cohere/Generated/Cohere.Models.Embedv2Response6.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
|
||
#nullable enable | ||
|
||
namespace Cohere | ||
{ | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
public sealed partial class Embedv2Response6 | ||
{ | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
[global::System.Text.Json.Serialization.JsonPropertyName("data")] | ||
public string? Data { get; set; } | ||
|
||
/// <summary> | ||
/// Additional properties that are not explicitly defined in the schema | ||
/// </summary> | ||
[global::System.Text.Json.Serialization.JsonExtensionData] | ||
public global::System.Collections.Generic.IDictionary<string, object> AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary<string, object>(); | ||
} | ||
} |
Oops, something went wrong.