Skip to content

EmbeddingsParameters

MarcoDotIO edited this page Dec 5, 2022 · 1 revision

EmbeddingsParameters

Parameter used for the Embeddings endpoint.

public struct EmbeddingsParameters 

Initializers

init(model:input:user:)

public init(model: String, input: String, user: String? = nil) 

Properties

model

ID of the model to use.

public var model: String

You can use the List models API to see all of your available models, or see our Model overview for descriptions of them.

input

Input text to get embeddings for, encoded as a string or array of tokens.

public var input: String

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 2048 tokens in length.

Unless you are embedding code, we suggest replacing newlines (\n) in your input with a single space, as we have observed inferior results when newlines are present.

user

A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. Learn more.

public var user: String?

body

The body of the URL used for OpenAI API requests.

public var body: [String: Any] 
Types
Global Functions
Clone this wiki locally