Skip to content

0.0.1 Release

Latest
Compare
Choose a tag to compare
@crilleaz crilleaz released this 12 May 22:02
· 1 commit to main since this release
f3fee4d

PHP-ChatGPTClass

A highly customizable ChatGPTClass written in PHP.

Installation

  1. Clone the repository
git clone https://github.com/crilleaz/PHP-ChatGPTClass
  1. Import class and use it
<?php
require 'ChatGPTClass.php';

$chatGPT = new ChatGPT('YOUR_OPENAI_API_KEY', 'gpt-3.5-turbo', 'You are a helpful assistance bot.');
$response = $chatGPT->sendMessage('who is the president in USA?');
echo $response;

//Print the json content
//$content = json_decode($response, true)['choices'][0]['message']['content'];
//echo $content;
?>

For support, i'm on Discord

Crille#6623