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 food was delicious and the waiter...",
    );

    my $res = $request->send();

DESCRIPTION

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

METHODS

new()

  • model

  • input

  • user [optional]

send()

send($openai_config)

Sends the request and returns a data structured similar to the one documented in the API reference.

SEE ALSO

OpenAI API Reference: Embeddings