The Perl Toolchain Summit 2025 Needs You: You can help 🙏 Learn more

NAME

OpenAI::API::Request::Embedding - embeddings endpoint

SYNOPSIS

my $request = OpenAI::API::Request::Embedding->new(
model => "text-embedding-ada-002",
input => 'The quick brown fox jumps over the lazy dog.',
);
my $res = $request->send(); # or: my $res = $request->send(%args);

DESCRIPTION

This module provides a request class for interacting with the OpenAI API's embedding endpoint. It inherits from OpenAI::API::Request.

Get a vector representation of a given input that can be easily consumed by machine learning models and algorithms.

ATTRIBUTES

model

The model to use for generating embeddings.

input

The input content for which to generate embeddings.

user [optional]

The user identifier for the request.

INHERITED METHODS

This module inherits the following methods from OpenAI::API::Request:

send

send_async

SEE ALSO

OpenAI::API::Request, OpenAI::API::Config