Skip to content

The PHP package that returns response of Google Bard through API.

License

Notifications You must be signed in to change notification settings

aliqorbani/php-bard-api

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

php-bard-api

composer bard package bard api composer version

A package that returns Response of Google Bard through API

Install

composer require pj8912/php-bard-api

Get Your Key

Follow the gif to get your key

Use

require_once 'vendor/autoload.php';
use Pj8912\PhpBardApi\Bard;
$_ENV['_BARD_API_KEY'] = "Your Key";
$bard = new Bard();
$input_text = "Hello, Bard!";  // Input text for the conversation
$result = $bard->get_answer($input_text);  // Get the response from Bard
// Access the result data
$conversation_id = $result["conversation_id"];
$response_id = $result["response_id"];
$factualityQueries = $result["factualityQueries"];
$textQuery = $result["textQuery"];
$choices = $result["choices"];
// reply
$content = $result["content"];
print($content);

License

This project is licensed under the MIT License

Reference

Important Notice

The user assumes all legal responsibilities associated with using the BardAPI package. This PHP package merely facilitates easy access to Google Bard for developers. Users are solely responsible for managing data and using the package appropriately. For further information, please consult the Google Bard Official Document.

🤝 Support

Hello there! If you've found my work helpful or useful in any way, please consider supporting me by donating. Your support helps me continue to create and share useful projects with the community. Thank you for your generosity and support! 🤝

Buy Me A Coffee

About

The PHP package that returns response of Google Bard through API.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%