Skip to content

adityadees/laravel-google-bard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

laravel-bard

A Laravel Package for Google Bard AI Chatbot

INSTALATION

  • composer require adityadees/laravel-google-bard
  • php artisan vendor:publish --tag=laravel-bard
  • New file laravel-bard.php will created under config folder
  • Fill the bard_token with your token

BARD TOKEN

Visit https://bard.google.com/ Go to Developer tools or press F12 Application → Cookies → Copy the value of __Secure-1PSID cookie.

image

RUN

$bard = (new LaravelBard())->get_answer('type_your_text_here');

# to get the reply just access this array
$bard["content"];

# you can access others array like this
$bard["conversation_id"];
$bard["response_id"];
$bard["factualityQueries"];
$bard["textQuery"];
$bard["choices"];

Example

$bard = (new LaravelBard())->get_answer('hello whats your name');
dd($bard["content"]);
image

Feel free to help improve this package

Note: The package contain resources from repository https://github.com/dsdanielpark/Bard-API