環境
ウィンドウズ10 64ビット
グーグル吟遊詩人
Python 3.8
序章
この記事ではオープンソースのGoogle
チャットロボットBard
のAPI
リバースを紹介します、これを利用すればBard
無料でサービスを利用できます プロジェクトアドレス:https://github.com/acheong08/Bard
インストールと使用
pip
インストール方法
pip <span class="hljs-keyword" style="color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;" style="font-size: inherit;color: inherit;line-height: inherit;overflow-wrap: inherit !important;word-break: inherit !important;">install <span class="hljs-comment" style="color: rgb(128, 128, 128); word-wrap: inherit !important; word-break: inherit !important;" style="font-size: inherit;color: inherit;line-height: inherit;overflow-wrap: inherit !important;word-break: inherit !important;">--upgrade GoogleBard
</span class="hljs-comment" style="color: rgb(128, 128, 128); word-wrap: inherit !important; word-break: inherit !important;"></span class="hljs-keyword" style="color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">
次に、セッション キーを取得し、ブラウザで URL https://bard.google.com/ を開き、キーボードを押し、コンソールに入り、-->F12
に移動し、 を検索し、文字列をフィルタリングし、価値Application
Cookies
url
Secure-1PSID
次に、ターミナルに移動してサービスを開始します
<span class="hljs-attribute" style="color: rgb(238, 220, 112); word-wrap: inherit !important; word-break: inherit !important;" style="font-size: inherit;color: inherit;line-height: inherit;overflow-wrap: inherit !important;word-break: inherit !important;">python -m Bard --session <span class="hljs-string" style="color: rgb(238, 220, 112); word-wrap: inherit !important; word-break: inherit !important;" style="font-size: inherit;color: inherit;line-height: inherit;overflow-wrap: inherit !important;word-break: inherit !important;">"VgiTpJBqhJqxfinFutFiBhZq4CAJcEBFSnApxX_iSmQgxq7CJOr_zA68P4CsWjbZswnP9g."
</span class="hljs-string" style="color: rgb(238, 220, 112); word-wrap: inherit !important; word-break: inherit !important;"></span class="hljs-attribute" style="color: rgb(238, 220, 112); word-wrap: inherit !important; word-break: inherit !important;">
--session
パラメータの値は、上でコピーした秘密鍵です。
プロンプトがYou:
表示されたら質問したい質問を入力し、Alt + Enter
または を押してEsc + Enter
送信し、Bard
回答を待ちます。さらに恥ずかしいのは、Bard
中国語がまだサポートされていないことですが、応答速度はまだ許容範囲です。
コラボノート
慣れている場合はcolab notebook
、このリンクにアクセスしてください
https://drive.google.com/file/d/1YyMWxTJgH4M0RbNRTpeDB8I97AZjKuc1/view?usp=sharing
よくある質問
サービス起動時に以下のエラーが報告された場合
通常、上記のセッション キーが間違っていることが原因ですが、場合によっては最後のセッション キー.
もキーの一部となっている場合。詳しくは記事末尾のリンク 2 を参照してください。
参考文献
https://github.com/acheong08/Bard
https://github.com/acheong08/Bard/issues/11