Class EmbeddingsRequest
- Namespace
- OpenAI.Embeddings
- Assembly
- OpenAI-DotNet.dll
public sealed class EmbeddingsRequest
- Inheritance
-
EmbeddingsRequest
- Inherited Members
Constructors
EmbeddingsRequest(IEnumerable<string>, string, string, int?)
Constructor.
public EmbeddingsRequest(IEnumerable<string> input, string model = null, string user = null, int? dimensions = null)
Parameters
input
IEnumerable<string>Input text to get embeddings for, encoded as a string or array of tokens. To get embeddings for multiple inputs in a single request, pass an array of strings or array of token arrays. Each input must not exceed 8192 tokens in length.
model
stringThe model id to use.
Defaults to: Embedding_Ada_002user
stringA unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse.
dimensions
int?The number of dimensions the resulting output embeddings should have. Only supported in text-embedding-3 and later models
Exceptions
- ArgumentNullException
A valid input string is a Required parameter.
EmbeddingsRequest(string, string, string, int?)
Constructor.
public EmbeddingsRequest(string input, string model = null, string user = null, int? dimensions = null)
Parameters
input
stringInput text to get embeddings for, encoded as a string or array of tokens. To get embeddings for multiple inputs in a single request, pass an array of strings or array of token arrays. Each input must not exceed 8192 tokens in length.
model
stringID of the model to use.
Defaults to: Embedding_Ada_002user
stringA unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse.
dimensions
int?The number of dimensions the resulting output embeddings should have. Only supported in text-embedding-3 and later models
Exceptions
- ArgumentNullException
A valid input string is a Required parameter.
Properties
Dimensions
[JsonPropertyName("dimensions")]
public int? Dimensions { get; }
Property Value
- int?
Input
[JsonPropertyName("input")]
public IReadOnlyList<string> Input { get; }
Property Value
Model
[JsonPropertyName("model")]
public string Model { get; }
Property Value
User
[JsonPropertyName("user")]
public string User { get; }