openai-async/lib/Net/Async/xLM/API/Server/API/v1/Image.pm
Ryan Voots 502433f9a1
Some checks failed
ci/woodpecker/push/author-tests/1 Pipeline failed
ci/woodpecker/push/author-tests/2 Pipeline failed
ci/woodpecker/push/author-tests/3 Pipeline failed
ci/woodpecker/push/author-tests/4 Pipeline failed
beginning rename of things
2024-12-18 11:07:10 -05:00

40 lines
No EOL
1.1 KiB
Perl

package OpenAIAsync::Server::API::v1::Image;
use v5.36.0;
use Object::Pad;
use IO::Async::SSL; # We're not directly using it but I want to enforce that we pull it in when detecting dependencies, since openai itself is always https
use Future::AsyncAwait;
use IO::Async;
use OpenAIAsync::Types::Results;
use OpenAIAsync::Types::Requests;
our $VERSION = '0.02';
# ABSTRACT: Async server for OpenAI style REST API for various AI systems (LLMs, Images, Video, etc.)
=pod
=head1 NAME
OpenAIAsync::Server::API::Image - Basic image role, consumed to implement the OpenAI image api. Does not provide an implementation, you are expected to override them in your class
=head1 SYNOPSIS
...
=cut
role OpenAIAsync::Server::API::v1::Image :strict(params) {
ADJUST {
$self->register_url(
method => 'GET',
url => qr{^/v1/files$},
handle => "create_image",
request_class => "OpenAIAsync::Type::Requests::GenerateImage",
result_class => "OpenAIAsync::Type::Results::RawFile", # TOOD image class?
);
}
async method create_image($future_status, $queue, $ctx, $obj, $params);
}