openai/openai-dotnet
Publicmirrored from https://github.com/openai/openai-dotnetAvailable
OpenAI/src/Custom/Embeddings/EmbeddingGenerationOptions.cs
38lines · modecode
| 1 | using Microsoft.TypeSpec.Generator.Customizations; |
| 2 | using System; |
| 3 | using System.ClientModel; |
| 4 | |
| 5 | namespace OpenAI.Embeddings; |
| 6 | |
| 7 | // CUSTOM: Renamed. |
| 8 | [CodeGenType("CreateEmbeddingRequest")] |
| 9 | [CodeGenVisibility(nameof(EmbeddingGenerationOptions), CodeGenVisibility.Public)] |
| 10 | [CodeGenSuppress(nameof(EmbeddingGenerationOptions), typeof(BinaryData), typeof(InternalCreateEmbeddingRequestModel))] |
| 11 | public partial class EmbeddingGenerationOptions |
| 12 | { |
| 13 | // CUSTOM: |
| 14 | // - Made internal. This value comes from a parameter on the client method. |
| 15 | // - Added setter. |
| 16 | [CodeGenMember("Input")] |
| 17 | internal BinaryData Input { get; set; } |
| 18 | |
| 19 | // CUSTOM: |
| 20 | // - Made internal. The model is specified by the client. |
| 21 | // - Added setter. |
| 22 | [CodeGenMember("Model")] |
| 23 | internal InternalCreateEmbeddingRequestModel Model { get; set; } |
| 24 | |
| 25 | // CUSTOM: Made internal. We always request the embedding as a base64-encoded string for better performance. |
| 26 | [CodeGenMember("EncodingFormat")] |
| 27 | internal InternalCreateEmbeddingRequestEncodingFormat? EncodingFormat { get; set; } |
| 28 | |
| 29 | // CUSTOM: Renamed. |
| 30 | /// <summary> |
| 31 | /// A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. |
| 32 | /// <see href="https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids">Learn more</see>. |
| 33 | /// </summary> |
| 34 | [CodeGenMember("User")] |
| 35 | public string EndUserId { get; set; } |
| 36 | |
| 37 | internal BinaryContent ToBinaryContent() => BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); |
| 38 | } |