embeddings {openaistream}R Documentation

embeddings Class

Description

embeddings Class

embeddings Class

Super class

openaistream::openai -> embeddings

Methods

Public methods

Inherited methods

Method create()

Creates an embedding vector representing the input text.

Usage
embeddings$create(model, input, ..., verbosity = 0)
Arguments
model

character Required. 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.

input

character Required. 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), cannot be an empty string, and any array must be 2048 dimensions or less.

...

Additional parameters as required by the OpenAI API.For example:encoding_format;user....

verbosity

numeric. Verbosity level for the API call(0:no output;1:show headers; 2:show headers and bodies;3: show headers, bodies, and curl status messages.).

Returns

Embeddings for the input data.


Method clone()

The objects of this class are cloneable with this method.

Usage
embeddings$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


[Package openaistream version 0.3.0 Index]