package AI::Chat;
use strict;
use warnings;
use Carp;
use HTTP::Tiny;
use JSON::PP;
our $VERSION = '0.6';
$VERSION = eval $VERSION;
my $http = HTTP::Tiny->new;
# Create Chat object
'Authorization' => 'Bearer ' . $self->{'key'},
'Content-type' => 'application/json'
};
}
# Get a reply from a single prompt
sub prompt {
my ($self, $prompt, $t
'Bearer ' . $self->{'key'},
'Content-type' => 'application/json'
},
content => encode_json {
model => $self->{'model'},
message