The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

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

SYNOPSIS

    use OpenAI::API::Request::Embedding;

    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