Skip to content

Commit

Permalink
Merge pull request #50 from tryAGI/bot/update-openapi_202409171825
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Sep 17, 2024
2 parents 02f126d + 3c05b7e commit ef6ce5e
Show file tree
Hide file tree
Showing 16 changed files with 1,180 additions and 598 deletions.
5 changes: 5 additions & 0 deletions src/libs/Cohere/Generated/Cohere.CohereApi.Chatv2.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ partial void ProcessChatv2ResponseContent(
/// A list of available tools (functions) that the model may suggest invoking before producing a text response.<br/>
/// When `tools` is passed (without `tool_results`), the `text` content in the response will be empty and the `tool_calls` field in the response will be populated with a list of tool calls that need to be made. If no calls need to be made, the `tool_calls` array will be empty.
/// </param>
/// <param name="documents">
/// A list of relevant documents that the model can cite to generate a more accurate reply. Each document is either a string or document object with content and metadata.
/// </param>
/// <param name="citationMode">
/// Defaults to `"accurate"`.<br/>
/// Dictates the approach taken to generating citations as part of the RAG flow by allowing the user to specify whether they want `"accurate"` results, `"fast"` results or no results.
Expand Down Expand Up @@ -169,6 +172,7 @@ partial void ProcessChatv2ResponseContent(
string model,
global::System.Collections.Generic.IList<global::Cohere.ChatMessage2> messages,
global::System.Collections.Generic.IList<global::Cohere.Tool2>? tools = default,
global::System.Collections.Generic.IList<global::Cohere.OneOf<string, global::Cohere.Document>>? documents = default,
global::Cohere.Chatv2RequestCitationMode? citationMode = default,
global::Cohere.ResponseFormat2? responseFormat = default,
global::Cohere.Chatv2RequestSafetyMode? safetyMode = default,
Expand All @@ -187,6 +191,7 @@ partial void ProcessChatv2ResponseContent(
Model = model,
Messages = messages,
Tools = tools,
Documents = documents,
CitationMode = citationMode,
ResponseFormat = responseFormat,
SafetyMode = safetyMode,
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 @@ -30,6 +30,9 @@ public partial interface ICohereApi
/// A list of available tools (functions) that the model may suggest invoking before producing a text response.<br/>
/// When `tools` is passed (without `tool_results`), the `text` content in the response will be empty and the `tool_calls` field in the response will be populated with a list of tool calls that need to be made. If no calls need to be made, the `tool_calls` array will be empty.
/// </param>
/// <param name="documents">
/// A list of relevant documents that the model can cite to generate a more accurate reply. Each document is either a string or document object with content and metadata.
/// </param>
/// <param name="citationMode">
/// Defaults to `"accurate"`.<br/>
/// Dictates the approach taken to generating citations as part of the RAG flow by allowing the user to specify whether they want `"accurate"` results, `"fast"` results or no results.
Expand Down Expand Up @@ -89,6 +92,7 @@ public partial interface ICohereApi
string model,
global::System.Collections.Generic.IList<global::Cohere.ChatMessage2> messages,
global::System.Collections.Generic.IList<global::Cohere.Tool2>? tools = default,
global::System.Collections.Generic.IList<global::Cohere.OneOf<string, global::Cohere.Document>>? documents = default,
global::Cohere.Chatv2RequestCitationMode? citationMode = default,
global::Cohere.ResponseFormat2? responseFormat = default,
global::Cohere.Chatv2RequestSafetyMode? safetyMode = default,
Expand Down
8 changes: 8 additions & 0 deletions src/libs/Cohere/Generated/Cohere.Models.Chatv2Request.g.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@

#pragma warning disable CS0618 // Type or member is obsolete

#nullable enable

namespace Cohere
Expand Down Expand Up @@ -30,6 +32,12 @@ public sealed partial class Chatv2Request
[global::System.Text.Json.Serialization.JsonPropertyName("tools")]
public global::System.Collections.Generic.IList<global::Cohere.Tool2>? Tools { get; set; }

/// <summary>
/// A list of relevant documents that the model can cite to generate a more accurate reply. Each document is either a string or document object with content and metadata.
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("documents")]
public global::System.Collections.Generic.IList<global::Cohere.OneOf<string, global::Cohere.Document>>? Documents { get; set; }

/// <summary>
/// Defaults to `"accurate"`.<br/>
/// Dictates the approach taken to generating citations as part of the RAG flow by allowing the user to specify whether they want `"accurate"` results, `"fast"` results or no results.
Expand Down
32 changes: 32 additions & 0 deletions src/libs/Cohere/Generated/Cohere.Models.Document.g.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

#nullable enable

namespace Cohere
{
/// <summary>
/// Relevant information that could be used by the model to generate a more accurate reply.<br/>
/// The content of each document are generally short (should be under 300 words). Metadata should be used to provide additional information, both the key name and the value will be<br/>
/// passed to the model.
/// </summary>
public sealed partial class Document
{
/// <summary>
/// A relevant documents that the model can cite to generate a more accurate reply. Each document is a string-string dictionary.
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("data")]
[global::System.Text.Json.Serialization.JsonRequired]
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
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("id")]
public string? Id { 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>();
}
}
33 changes: 33 additions & 0 deletions src/libs/Cohere/Generated/Cohere.Models.DocumentContent.g.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@

#nullable enable

namespace Cohere
{
/// <summary>
/// Document content.
/// </summary>
public sealed partial class DocumentContent
{
/// <summary>
///
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("type")]
[global::System.Text.Json.Serialization.JsonConverter(typeof(global::Cohere.JsonConverters.DocumentContentTypeJsonConverter))]
public global::Cohere.DocumentContentType Type { get; set; }

/// <summary>
/// Relevant information that could be used by the model to generate a more accurate reply.<br/>
/// The content of each document are generally short (should be under 300 words). Metadata should be used to provide additional information, both the key name and the value will be<br/>
/// passed to the model.
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("document")]
[global::System.Text.Json.Serialization.JsonRequired]
public required global::Cohere.Document Document { 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>();
}
}
45 changes: 45 additions & 0 deletions src/libs/Cohere/Generated/Cohere.Models.DocumentContentType.g.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@

#nullable enable

namespace Cohere
{
/// <summary>
///
/// </summary>
public enum DocumentContentType
{
/// <summary>
///
/// </summary>
Document,
}

/// <summary>
/// Enum extensions to do fast conversions without the reflection.
/// </summary>
public static class DocumentContentTypeExtensions
{
/// <summary>
/// Converts an enum to a string.
/// </summary>
public static string ToValueString(this DocumentContentType value)
{
return value switch
{
DocumentContentType.Document => "document",
_ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null),
};
}
/// <summary>
/// Converts an string to a enum.
/// </summary>
public static DocumentContentType? ToEnum(string value)
{
return value switch
{
"document" => DocumentContentType.Document,
_ => null,
};
}
}
}
18 changes: 18 additions & 0 deletions src/libs/Cohere/Generated/Cohere.Models.DocumentData.g.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

#nullable enable

namespace Cohere
{
/// <summary>
/// A relevant documents that the model can cite to generate a more accurate reply. Each document is a string-string dictionary.
/// </summary>
public sealed partial class DocumentData
{

/// <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>();
}
}
166 changes: 166 additions & 0 deletions src/libs/Cohere/Generated/Cohere.Models.ToolContent.g.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
using System.Linq;
#pragma warning disable CS0618 // Type or member is obsolete

#nullable enable

namespace Cohere
{
/// <summary>
/// A content block which contains information about the content of a tool result
/// </summary>
public readonly partial struct ToolContent : global::System.IEquatable<ToolContent>
{
/// <summary>
/// Text content of the message.
/// </summary>
#if NET6_0_OR_GREATER
public global::Cohere.TextContent? Text { get; init; }
#else
public global::Cohere.TextContent? Text { get; }
#endif

/// <summary>
///
/// </summary>
#if NET6_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Text))]
#endif
public bool IsText => Text != null;

/// <summary>
///
/// </summary>
public static implicit operator ToolContent(global::Cohere.TextContent value) => new ToolContent(value);

/// <summary>
///
/// </summary>
public static implicit operator global::Cohere.TextContent?(ToolContent @this) => @this.Text;

/// <summary>
///
/// </summary>
public ToolContent(global::Cohere.TextContent? value)
{
Text = value;
}

/// <summary>
/// Document content.
/// </summary>
#if NET6_0_OR_GREATER
public global::Cohere.DocumentContent? Document { get; init; }
#else
public global::Cohere.DocumentContent? Document { get; }
#endif

/// <summary>
///
/// </summary>
#if NET6_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Document))]
#endif
public bool IsDocument => Document != null;

/// <summary>
///
/// </summary>
public static implicit operator ToolContent(global::Cohere.DocumentContent value) => new ToolContent(value);

/// <summary>
///
/// </summary>
public static implicit operator global::Cohere.DocumentContent?(ToolContent @this) => @this.Document;

/// <summary>
///
/// </summary>
public ToolContent(global::Cohere.DocumentContent? value)
{
Document = value;
}

/// <summary>
///
/// </summary>
public ToolContent(
global::Cohere.TextContent? text,
global::Cohere.DocumentContent? document
)
{
Text = text;
Document = document;
}

/// <summary>
///
/// </summary>
public object? Object =>
Document as object ??
Text as object
;

/// <summary>
///
/// </summary>
public bool Validate()
{
return IsText && !IsDocument || !IsText && IsDocument;
}

/// <summary>
///
/// </summary>
public override int GetHashCode()
{
var fields = new object?[]
{
Text,
typeof(global::Cohere.TextContent),
Document,
typeof(global::Cohere.DocumentContent),
};
const int offset = unchecked((int)2166136261);
const int prime = 16777619;
static int HashCodeAggregator(int hashCode, object? value) => value == null
? (hashCode ^ 0) * prime
: (hashCode ^ value.GetHashCode()) * prime;
return fields.Aggregate(offset, HashCodeAggregator);
}

/// <summary>
///
/// </summary>
public bool Equals(ToolContent other)
{
return
global::System.Collections.Generic.EqualityComparer<global::Cohere.TextContent?>.Default.Equals(Text, other.Text) &&
global::System.Collections.Generic.EqualityComparer<global::Cohere.DocumentContent?>.Default.Equals(Document, other.Document)
;
}

/// <summary>
///
/// </summary>
public static bool operator ==(ToolContent obj1, ToolContent obj2)
{
return global::System.Collections.Generic.EqualityComparer<ToolContent>.Default.Equals(obj1, obj2);
}

/// <summary>
///
/// </summary>
public static bool operator !=(ToolContent obj1, ToolContent obj2)
{
return !(obj1 == obj2);
}

/// <summary>
///
/// </summary>
public override bool Equals(object? obj)
{
return obj is ToolContent o && Equals(o);
}
}
}
7 changes: 5 additions & 2 deletions src/libs/Cohere/Generated/Cohere.Models.ToolMessage2.g.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@

#pragma warning disable CS0618 // Type or member is obsolete

#nullable enable

namespace Cohere
Expand All @@ -23,11 +25,12 @@ public sealed partial class ToolMessage2
public required string ToolCallId { get; set; }

/// <summary>
/// A list of outputs from a tool. The content should formatted as a JSON object string
/// A single or list of outputs from a tool. The content should formatted as a JSON object string, or a list of tool content blocks
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("tool_content")]
[global::System.Text.Json.Serialization.JsonConverter(typeof(global::Cohere.JsonConverters.OneOfJsonConverterFactory2))]
[global::System.Text.Json.Serialization.JsonRequired]
public required global::System.Collections.Generic.IList<string> ToolContent { get; set; }
public required global::Cohere.OneOf<string, global::System.Collections.Generic.IList<global::Cohere.ToolContent>> ToolContent { get; set; }

/// <summary>
/// Additional properties that are not explicitly defined in the schema
Expand Down
Loading

0 comments on commit ef6ce5e

Please sign in to comment.