kawamurashingo / OpenAIGPT4

perl module for gpt-3,4 api
Artistic License 2.0
3 stars 2 forks source link

SSL error? #34

Open dmd opened 9 months ago

dmd commented 9 months ago

Any idea what I'm doing wrong here?

use strict;
use OpenAIGPT4;
my $gpt = OpenAIGPT4->new('my key here');
my $response = $gpt->generate_text('what is 2+2', 'gpt-4');
print $response;

I get:

$ ./gpt.pl
500 Can't verify SSL peers without knowing which Certificate Authorities to trust Error decoding response body: malformed JSON string, neither tag, array, object, number, string or atom, at character offset 0 (before "Can't verify SSL pee...") at /System/Library/Perl/Extras/5.30/JSON.pm line 190.
dmd commented 9 months ago

That's on MacOS. On Linux, I get:

$ ./gpt.pl
400 Bad Request Response body: {"error":{"message":"0 is not of type 'string' - 'messages.0.content'","param":null,"type":"invalid_request_error","code":null}} at /usr/local/share/perl/5.26.1/OpenAIGPT4.pm line 138.