OpenAILikeEmbeddingsOptions interface

Options for configuring an embeddings object that calls an OpenAI compliant endpoint.

Extends

Remarks

The endpoint should comply with the OpenAPI spec for OpenAI's API: https://github.com/openai/openai-openapi And an example of a compliant endpoint is LLaMA.cpp's reference server: https://github.com/ggerganov/llama.cpp/blob/master/examples/server/README.md

Properties

apiKey

Optional. API key to use when calling the embeddings server.

endpoint

Endpoint of the embeddings server to call.

model

Embeddings Model to use.

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

Optional. API key to use when calling the embeddings server.

apiKey?: string

Property Value

string

endpoint

Endpoint of the embeddings server to call.

endpoint: string

Property Value

string

model

Embeddings Model to use.

model: 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