khaiphan/bard-reverse

A PHP library for Reverse Google Bard AI

dev-main 2023-06-04 18:28 UTC

This package is auto-updated.

Last update: 2024-06-04 20:35:39 UTC


README

Bard-AI-Reverse is a Composer package that allows you to interact with Google Bard AI using PHP code.

Language

Installation

Minimum PHP version required is 7.2.5

Use Composer to install the package.

Run the following command in the terminal:

composer require khaiphan/bard-reverse:dev-main

Usage

  1. First, you need to include the autoloader in your PHP code:
require 'vendor/autoload.php';
  1. Next, create an instance of the Bard class and provide cookie Google Bard AI:
use KhaiPhan\Google\Bard;

$bard = new Bard('__Secure-1PSID');

Make sure you replace '__Secure-1PSID' with the value of the __Secure-1PSID cookie obtained from the Google Bard AI website.

  1. Then, call the getAnswer() method to retrieve the response from Bard AI:
$answer = $bard->getAnswer('Hello');
  1. You can access the answer from Bard AI through the $answer['content'] variable. For example:
$content = $bard['content'];
echo $content;

License

This package is open-source and available under the MIT License.