Skip to content

Commit

Permalink
Merge pull request #60 from tryAGI/bot/update-openapi_202409260125
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Sep 26, 2024
2 parents 3bd1aa7 + 57a60d2 commit 2cb6e78
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 2 deletions.
14 changes: 14 additions & 0 deletions src/libs/Cohere/Generated/Cohere.CohereApi.Chatv2.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ public partial class CohereApi
{
partial void PrepareChatv2Arguments(
global::System.Net.Http.HttpClient httpClient,
ref string? xClientName,
global::Cohere.Chatv2Request request);
partial void PrepareChatv2Request(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpRequestMessage httpRequestMessage,
string? xClientName,
global::Cohere.Chatv2Request request);
partial void ProcessChatv2Response(
global::System.Net.Http.HttpClient httpClient,
Expand All @@ -25,11 +27,13 @@ partial void ProcessChatv2ResponseContent(
/// Chat with the model<br/>
/// Generates a message from the model in response to a provided conversation. To learn how to use the Chat API with Streaming and RAG follow our Text Generation guides.
/// </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.OneOf<global::Cohere.ChatResponse, global::Cohere.StreamedChatResponseV2?>> Chatv2Async(
global::Cohere.Chatv2Request request,
string? xClientName = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
request = request ?? throw new global::System.ArgumentNullException(nameof(request));
Expand All @@ -38,8 +42,14 @@ partial void ProcessChatv2ResponseContent(
client: _httpClient);
PrepareChatv2Arguments(
httpClient: _httpClient,
xClientName: ref xClientName,
request: request);

if (xClientName != default)
{
_httpClient.DefaultRequestHeaders.TryAddWithoutValidation("X-Client-Name", xClientName);
}

var __pathBuilder = new PathBuilder(
path: "/v2/chat",
baseUri: _httpClient.BaseAddress);
Expand All @@ -60,6 +70,7 @@ partial void ProcessChatv2ResponseContent(
PrepareChatv2Request(
httpClient: _httpClient,
httpRequestMessage: httpRequest,
xClientName: xClientName,
request: request);

using var response = await _httpClient.SendAsync(
Expand Down Expand Up @@ -103,6 +114,7 @@ partial void ProcessChatv2ResponseContent(
/// Chat with the model<br/>
/// Generates a message from the model in response to a provided conversation. To learn how to use the Chat API with Streaming and RAG follow our Text Generation guides.
/// </summary>
/// <param name="xClientName"></param>
/// <param name="model">
/// The name of a compatible [Cohere model](https://docs.cohere.com/docs/models) (such as command-r or command-r-plus) or the ID of a [fine-tuned](https://docs.cohere.com/docs/chat-fine-tuning) model.
/// </param>
Expand Down Expand Up @@ -174,6 +186,7 @@ partial void ProcessChatv2ResponseContent(
public async global::System.Threading.Tasks.Task<global::Cohere.OneOf<global::Cohere.ChatResponse, global::Cohere.StreamedChatResponseV2?>> Chatv2Async(
string model,
global::System.Collections.Generic.IList<global::Cohere.ChatMessageV2> messages,
string? xClientName = default,
global::System.Collections.Generic.IList<global::Cohere.ToolV2>? tools = default,
global::System.Collections.Generic.IList<global::Cohere.OneOf<string, global::Cohere.Document>>? documents = default,
global::Cohere.CitationOptions? citationOptions = default,
Expand Down Expand Up @@ -209,6 +222,7 @@ partial void ProcessChatv2ResponseContent(
};

return await Chatv2Async(
xClientName: xClientName,
request: request,
cancellationToken: cancellationToken).ConfigureAwait(false);
}
Expand Down
4 changes: 4 additions & 0 deletions src/libs/Cohere/Generated/Cohere.ICohereApi.Chatv2.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,20 @@ public partial interface ICohereApi
/// Chat with the model<br/>
/// Generates a message from the model in response to a provided conversation. To learn how to use the Chat API with Streaming and RAG follow our Text Generation guides.
/// </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.OneOf<global::Cohere.ChatResponse, global::Cohere.StreamedChatResponseV2?>> Chatv2Async(
global::Cohere.Chatv2Request request,
string? xClientName = default,
global::System.Threading.CancellationToken cancellationToken = default);

/// <summary>
/// Chat with the model<br/>
/// Generates a message from the model in response to a provided conversation. To learn how to use the Chat API with Streaming and RAG follow our Text Generation guides.
/// </summary>
/// <param name="xClientName"></param>
/// <param name="model">
/// The name of a compatible [Cohere model](https://docs.cohere.com/docs/models) (such as command-r or command-r-plus) or the ID of a [fine-tuned](https://docs.cohere.com/docs/chat-fine-tuning) model.
/// </param>
Expand Down Expand Up @@ -90,6 +93,7 @@ public partial interface ICohereApi
global::System.Threading.Tasks.Task<global::Cohere.OneOf<global::Cohere.ChatResponse, global::Cohere.StreamedChatResponseV2?>> Chatv2Async(
string model,
global::System.Collections.Generic.IList<global::Cohere.ChatMessageV2> messages,
string? xClientName = default,
global::System.Collections.Generic.IList<global::Cohere.ToolV2>? tools = default,
global::System.Collections.Generic.IList<global::Cohere.OneOf<string, global::Cohere.Document>>? documents = default,
global::Cohere.CitationOptions? citationOptions = default,
Expand Down
2 changes: 1 addition & 1 deletion src/libs/Cohere/Generated/Cohere.Models.Document.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public sealed partial class Document
public required global::Cohere.DocumentData Data { get; set; }

/// <summary>
/// Unique identifier for this document which will be referenced in citations. If not provided an ID will be automatically generated
/// Unique identifier for this document which will be referenced in citations. If not provided an ID will be automatically generated.
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("id")]
public string? Id { get; set; }
Expand Down
Loading

0 comments on commit 2cb6e78

Please sign in to comment.