/OpenAIGPT4

perl module for gpt4 api

Primary LanguageMakefileArtistic License 2.0Artistic-2.0

OpenAIGPT4 Perl Module

OpenAIGPT4 is a Perl module that enables developers to interface with the OpenAI GPT-4 API. With this module, you can easily generate natural language text. https://metacpan.org/pod/OpenAIGPT4

Features

  • Generate text that sounds like natural language with the OpenAI GPT-4 API.

Installation

You can install this module from CPAN using one of the following commands:

With CPAN:

cpan OpenAIGPT4

With CPANM:

cpanm OpenAIGPT4

Usage

Here is a basic example of using this module:

First, import the module and create a new OpenAIGPT4 object:

use OpenAIGPT4;
my $gpt = OpenAIGPT4->new('<your_api_key>');

Then, generate text by providing a prompt:

my $prompt = "Once upon a time";
my $generated_text = $gpt4->generate_text($prompt);
print $generated_text;

Dependencies

This module depends on the following Perl modules:

  • LWP::UserAgent
  • LWP::Protocol::https
  • HTTP::Request::Common
  • JSON

License

This module is distributed under the terms of the Artistic License 2.0.

Please see LICENSE for more details.