openai/openai-dotnet
Publicmirrored from https://github.com/openai/openai-dotnetAvailable
src/Generated/Models/Embeddings/InternalCreateEmbeddingRequestModel.cs
47lines · modecode
| 1 | // <auto-generated/> |
| 2 | |
| 3 | #nullable disable |
| 4 | |
| 5 | using System; |
| 6 | using System.ComponentModel; |
| 7 | using OpenAI; |
| 8 | |
| 9 | namespace OpenAI.Embeddings |
| 10 | { |
| 11 | internal readonly partial struct InternalCreateEmbeddingRequestModel : IEquatable<InternalCreateEmbeddingRequestModel> |
| 12 | { |
| 13 | private readonly string _value; |
| 14 | private const string TextEmbeddingAda002Value = "text-embedding-ada-002"; |
| 15 | private const string TextEmbedding3SmallValue = "text-embedding-3-small"; |
| 16 | private const string TextEmbedding3LargeValue = "text-embedding-3-large"; |
| 17 | |
| 18 | public InternalCreateEmbeddingRequestModel(string value) |
| 19 | { |
| 20 | Argument.AssertNotNull(value, nameof(value)); |
| 21 | |
| 22 | _value = value; |
| 23 | } |
| 24 | |
| 25 | internal static InternalCreateEmbeddingRequestModel TextEmbeddingAda002 { get; } = new InternalCreateEmbeddingRequestModel(TextEmbeddingAda002Value); |
| 26 | |
| 27 | internal static InternalCreateEmbeddingRequestModel TextEmbedding3Small { get; } = new InternalCreateEmbeddingRequestModel(TextEmbedding3SmallValue); |
| 28 | |
| 29 | internal static InternalCreateEmbeddingRequestModel TextEmbedding3Large { get; } = new InternalCreateEmbeddingRequestModel(TextEmbedding3LargeValue); |
| 30 | |
| 31 | public static bool operator ==(InternalCreateEmbeddingRequestModel left, InternalCreateEmbeddingRequestModel right) => left.Equals(right); |
| 32 | |
| 33 | public static bool operator !=(InternalCreateEmbeddingRequestModel left, InternalCreateEmbeddingRequestModel right) => !left.Equals(right); |
| 34 | |
| 35 | public static implicit operator InternalCreateEmbeddingRequestModel(string value) => new InternalCreateEmbeddingRequestModel(value); |
| 36 | |
| 37 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 38 | public override bool Equals(object obj) => obj is InternalCreateEmbeddingRequestModel other && Equals(other); |
| 39 | |
| 40 | public bool Equals(InternalCreateEmbeddingRequestModel other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); |
| 41 | |
| 42 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 43 | public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; |
| 44 | |
| 45 | public override string ToString() => _value; |
| 46 | } |
| 47 | } |
| 48 | |