openai/openai-dotnet

Public

mirrored from https://github.com/openai/openai-dotnetAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
fe4d6cf1ccfea48fa5c2baf67103495ac9b459dd

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

OpenAI/src/Custom/Embeddings/EmbeddingGenerationOptions.cs

38lines · modecode

1using Microsoft.TypeSpec.Generator.Customizations;
2using System;
3using System.ClientModel;
4
5namespace OpenAI.Embeddings;
6
7// CUSTOM: Renamed.
8[CodeGenType("CreateEmbeddingRequest")]
9[CodeGenVisibility(nameof(EmbeddingGenerationOptions), CodeGenVisibility.Public)]
10[CodeGenSuppress(nameof(EmbeddingGenerationOptions), typeof(BinaryData), typeof(InternalCreateEmbeddingRequestModel))]
11public 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}