create_embeddings: Create Embeddings

View source: R/functions.R

create_embeddingsR Documentation

Create Embeddings

Description

Creates an embedding vector representing the input text.

Usage

create_embeddings(
  input,
  model,
  encoding_format = NULL,
  user = NULL,
  return_response = F
)

Arguments

input

(string or array) Input text to embed, encoded as a string or array of tokens. To embed multiple inputs in a single request, pass an array of strings or array of token arrays. The input must not exceed the max input tokens for the model (8192 tokens for text-embedding-ada-002) and cannot be an empty string. Example Python code for counting tokens. Required

model

(string) 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. Required

encoding_format

(string) The format to return the embeddings in. Can be either float or base64.

user

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

return_response

(boolean) Whether to return the API response or parse the contents of the response. Defaults to FALSE (parse the response).

See Also

Open AI Documentation


samterfa/openai documentation built on Oct. 9, 2024, 5:18 p.m.