laravel google bard
v1.1.1
適用於 Google Bard AI 聊天機器人的 Laravel 軟體包
composer require adityadees/laravel-google-bard
php artisan vendor:publish --tag=laravel-bard
laravel-bard.php
將在config
資料夾下創建bard_token
造訪 https://bard.google.com/ 進入開發者工具或按 F12 應用程式 → Cookies → 複製 __Secure-1PSID cookie 的值。
$ 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 " ];
$ bard = ( new LaravelBard ())-> get_answer ( ' hello whats your name ' );
dd ( $ bard [ " content " ]);
歡迎幫忙改進這個包
注意:該套件包含來自儲存庫 https://github.com/dsdanielpark/Bard-API 的資源