langchain-hs-0.0.2.0: Haskell implementation of Langchain
Copyright(c) 2025 Tushar Adhatrao
LicenseMIT
MaintainerTushar Adhatrao <[email protected]>
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Langchain.Embeddings.OpenAI

Description

OpenAI implementation of LangChain's embedding interface. Supports document and query embedding generation through OpenAI's API. Checkout docs here: https://platform.openai.com/docs/guides/embeddings

Synopsis

Types

data OpenAIEmbeddings Source #

Embeddings type for OpenAI, can be used for embed documents with OpenAI.

Constructors

OpenAIEmbeddings 

Fields

  • apiKey :: Text

    OpenAI API Key

  • model :: Text

    Model name for embeddings

  • dimensions :: Maybe Int

    The number of dimensions the resulting output embeddings should have. ^ Only supported in text-embedding-3 or later

  • encodingFormat :: Maybe EncodingFormat

    The format to return the embeddings in. ^ For now, only float is supported

  • embeddingsUser :: Maybe Text

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

  • timeout :: Maybe Int

    Override default responsetime out. unit = seconds.

Helper model name functions

defaultOpenAIEmbeddings :: OpenAIEmbeddings Source #

Default values OpenAIEmbeddings, api-key is empty

textEmbedding3Small :: Text Source #

Small embedding model

textEmbedding3Large :: Text Source #

Most capable embedding model

textEmbeddingAda :: Text Source #

Older embedding model