Skip to contents

The openai() function acts as an interface for interacting with the OpenAI API through main tidyllm verbs such as chat(), embed(), and send_batch(). It dynamically routes requests to OpenAI-specific functions like openai_chat() and openai_embedding() based on the context of the call.

Usage

openai(..., .called_from = NULL)

openai(..., .called_from = NULL)

Arguments

...

Parameters passed to the appropriate OpenAI-specific function.

.called_from

Internal routing argument; do not set manually.

Value

The result of the requested action, depending on the specific function invoked (e.g., an updated LLMMessage object for chat(), or a matrix for embed()).

Result of the requested action.