Skip to content

Commit

Permalink
feat: Updated OpenAPI spec
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Sep 18, 2024
1 parent 34957ec commit e843e1b
Show file tree
Hide file tree
Showing 24 changed files with 1,664 additions and 466 deletions.
127 changes: 127 additions & 0 deletions src/libs/Cohere/Generated/Cohere.CohereApi.Embedv2.g.cs
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);
}
}
}
35 changes: 35 additions & 0 deletions src/libs/Cohere/Generated/Cohere.ICohereApi.Embedv2.g.cs
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 src/libs/Cohere/Generated/Cohere.Models.Embedv2Response.g.cs
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 src/libs/Cohere/Generated/Cohere.Models.Embedv2Response10.g.cs
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 src/libs/Cohere/Generated/Cohere.Models.Embedv2Response11.g.cs
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 src/libs/Cohere/Generated/Cohere.Models.Embedv2Response12.g.cs
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 src/libs/Cohere/Generated/Cohere.Models.Embedv2Response2.g.cs
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 src/libs/Cohere/Generated/Cohere.Models.Embedv2Response3.g.cs
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 src/libs/Cohere/Generated/Cohere.Models.Embedv2Response4.g.cs
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 src/libs/Cohere/Generated/Cohere.Models.Embedv2Response5.g.cs
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 src/libs/Cohere/Generated/Cohere.Models.Embedv2Response6.g.cs
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>();
}
}
Loading

0 comments on commit e843e1b

Please sign in to comment.