Skip to content

OpenAIEmbeddings #

Bases: object

OpenAI-compatible embedding configuration. Pass an instance of this to VectorCache(...) to drive vectorise(...).

Parameters:

Name Type Description Default
model str

The OpenAI embedding model to use. Defaults to "text-embedding-3-small".

required
api_base str

Base URL for the OpenAI-compatible API. If None, falls back to OpenAI's default endpoint. Defaults to None.

required
api_key_env str

Environment variable name to read the API key from. If None, reads from OPENAI_API_KEY. Defaults to None.

required
org_id str

OpenAI organization id. If None, no org id is sent. Defaults to None.

required
project_id str

OpenAI project id. If None, no project id is sent. Defaults to None.

required
dim int

Embedding dimension override. If None, the model's native dimension is used. Defaults to None.

required

__new__(model='text-embedding-3-small', api_base=None, api_key_env=None, org_id=None, project_id=None, dim=None) #

Create and return a new object. See help(type) for accurate signature.