php bard api
1.0.1
このレポはアーカイブされています
https://ai.google.dev/
APIを介してGoogleバードの応答を返すパッケージ
composer require pj8912/php-bard-api
ApplicationタブをクリックしますStorageの下でのアプリケーションでは、 cookiesドロップダウンが見つかりますhttps://bard.google.comをクリックしてください。これは、 NameとValueとして使用されているすべてのCookieを表示する__Secure-1PSIDおよび__Secure-1PSIDTS値をコピーします
__Secure-1PSIDTSの値は頻繁に変更する必要があります(Googleが変更します)
require_once ' vendor/autoload.php ' ;
use Pj8912 PhpBardApi Bard ;
//two keys are required which are two cookies values
$ _ENV [ ' BARD_API_KEY_X ' ] = " value of cookie '__Secure-1PSID' " ;
$ _ENV [ ' BARD_API_KEY_Y ' ] = " value of cookie '__Secure-1PSIDTS' "
$ bard = new Bard();
$ input_text = " Hello , Bard !"; // Input text for the conversation
$ result = $ bard -> get_answer ( $ input_text ); // Get the response from Bard
// bard reply
print( $ result [ ' choices ' ][ 0 ][ ' content ' ][ 0 ]);このプロジェクトは、MITライセンスの下でライセンスされています
ユーザーは、Bardapiパッケージの使用に関連するすべての法的責任を想定しています。このPHPパッケージは、開発者向けのGoogle Bardへの簡単なアクセスを容易にするだけです。ユーザーは、データの管理とパッケージを適切に使用する責任を負います。詳細については、Google Bardの公式文書を参照してください。