AI-Chat

 view release on metacpan or  search on metacpan

t/01-openai.t  view on Meta::CPAN

#!perl
use 5.006;
use strict;
use warnings;
use Test::More;

use AI::Chat;

my $chat_fai11 = AI::Chat->new();

ok( $chat_fai11->isa( 'AI::Chat' ),  'Instantiation' );
ok( !$chat_fai11->success, 'Key Error during object creation' );

my $chat_fail2 = AI::Chat->new(
    'key'   => '0123456789',
    'api'   => 'Not Allowed',
);

ok( $chat_fail2->isa( 'AI::Chat' ),  'Instantiation' );
ok( !$chat_fail2->success, 'API Error during object creation' );

my $chat_pass = AI::Chat->new(
    'key'   => '0123456789',
    'api'   => 'OpenAI',
);

ok( $chat_pass->isa( 'AI::Chat' ), 'Instantiation' );
ok( $chat_pass->success, 'Successful object creation' );

done_testing(6);


    

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 0.516 second using v1.00-cache-2.02-grep-82fe00e-cpan-2c419f77a38b )