OpenAiEmbeddingModel

constructor(client: HttpClient, apiKey: String?, model: String = DEFAULT_MODEL, dimensions: Int? = null, headers: Map<String, String> = emptyMap(), baseUrl: String = OpenAiChatModel.OPENAI_BASE_URL, timeout: Duration? = 1.minutes)

Parameters

client

the Ktor client that sends the requests.

apiKey

the key, sent as a bearer token. null for a server that needs none.

model

the id of the model.

dimensions

how long the vectors are, for a model that can make shorter ones, such as the text-embedding-3 models. null leaves the length of the model.

headers

more headers for every request.

baseUrl

where the API lives, up to and including the version: this class adds /embeddings to it.

timeout

how long one call may take. null leaves the limits of client in place.