ion number
use LWP::UserAgent;
use LWP::Protocol::https;
use HTTP::Request::Common qw(POST);
use JSON;
=head1 NAME
OpenAIGPT4 - Interact with the OpenAI GPT-3,4 API
=head1 VERSION
Version 0.18
=
POST $self->{api_host}.'/v1/chat/completions',
Content_Type => 'application/json',
Content => to_json({
model => $model,
messages => $self->{history},
t "Response: ", $res->as_string, "\n";
}
if ($res->is_success) {
my $data = from_json($res->decoded_content);
my $reply = $data->{choices}[0]{message}{content};
# Add