ExOpenAI.Embeddings.create_embedding

You're seeing just the function create_embedding, go back to ExOpenAI.Embeddings module for more information.
Link to this function

create_embedding(input, model, opts \\ [])

View Source

Specs

create_embedding(any(), String.t(), [{:user, String.t()}]) ::
  {:ok, ExOpenAI.Components.CreateEmbeddingResponse.t()} | {:error, any()}

Creates an embedding vector representing the input text.

Endpoint: https://api.openai.com/v1/embeddings

Method: POST

Docs: https://platform.openai.com/docs/api-reference/embeddings


Required Arguments:

  • input: Input text to get embeddings for, encoded as a string or array of tokens. To get embeddings for multiple inputs in a single request, pass an array of strings or array of token arrays. Each input must not exceed 8192 tokens in length.

  • model: ID of the model to use. You can use the List models API to see all of your available models, or see our Model overview for descriptions of them.

Optional Arguments:

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

Example: "user-1234"