OpenAIEmbeddingsOptions interface

Options for configuring an OpenAIEmbeddings to generate embeddings using an OpenAI hosted model.

Extends

Properties

apiKey

API key to use when calling the OpenAI API.

endpoint

Optional. Endpoint to use when calling the OpenAI API.

model

Embeddings Model to use.

organization

Optional. Organization to use when calling the OpenAI API.

Inherited Properties

dimensions

Optional. Number of dimensions to use when generating embeddings.

logRequests

Optional. Whether to log requests to the console.

requestConfig

Optional. Request options to use when calling the OpenAI API.

retryPolicy

Optional. Retry policy to use when calling the OpenAI API.

Property Details

apiKey

API key to use when calling the OpenAI API.

apiKey: string

Property Value

string

Remarks

A new API key can be created at https://platform.openai.com/account/api-keys.

endpoint

Optional. Endpoint to use when calling the OpenAI API.

endpoint?: string

Property Value

string

Remarks

For Azure OpenAI this is the deployment endpoint.

model

Embeddings Model to use.

model: string

Property Value

string

organization

Optional. Organization to use when calling the OpenAI API.

organization?: string

Property Value

string

Inherited Property Details

dimensions

Optional. Number of dimensions to use when generating embeddings.

dimensions?: number

Property Value

number

Remarks

Only valid for embedding models that support dynamic dimensionality.

Inherited From BaseOpenAIEmbeddingsOptions.dimensions

logRequests

Optional. Whether to log requests to the console.

logRequests?: boolean

Property Value

boolean

Remarks

This is useful for debugging prompts and defaults to false.

Inherited From BaseOpenAIEmbeddingsOptions.logRequests

requestConfig

Optional. Request options to use when calling the OpenAI API.

requestConfig?: AxiosRequestConfig<any>

Property Value

AxiosRequestConfig<any>

Inherited From BaseOpenAIEmbeddingsOptions.requestConfig

retryPolicy

Optional. Retry policy to use when calling the OpenAI API.

retryPolicy?: number[]

Property Value

number[]

Remarks

The default retry policy is [2000, 5000] which means that the first retry will be after 2 seconds and the second retry will be after 5 seconds.

Inherited From BaseOpenAIEmbeddingsOptions.retryPolicy