khaiphan / bard-reverse
A PHP library for Reverse Google Bard AI
dev-main
2023-06-04 18:28 UTC
Requires
- php: ^7.2.5 || ^8.0
- guzzlehttp/guzzle: ^7.0
This package is auto-updated.
Last update: 2025-01-04 22:03:28 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
- First, you need to include the autoloader in your PHP code:
require 'vendor/autoload.php';
- 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.
- Then, call the
getAnswer()
method to retrieve the response from Bard AI:
$answer = $bard->getAnswer('Hello');
- 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.