-
-
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 #50 from tryAGI/bot/update-openapi_202409171825
feat:@coderabbitai
- Loading branch information
Showing
16 changed files
with
1,180 additions
and
598 deletions.
There are no files selected for viewing
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
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
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
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,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
33
src/libs/Cohere/Generated/Cohere.Models.DocumentContent.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,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
45
src/libs/Cohere/Generated/Cohere.Models.DocumentContentType.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,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, | ||
}; | ||
} | ||
} | ||
} |
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,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
166
src/libs/Cohere/Generated/Cohere.Models.ToolContent.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,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); | ||
} | ||
} | ||
} |
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
Oops, something went wrong.