3

体验 Google Bard

 1 year ago
source link: https://xugaoxiang.com/2023/04/24/google-bard/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
  • windows 10 64bit
  • Google Bard
  • python 3.8

本篇介绍一个开源的 Google 聊天机器人BardAPI 逆向工程,使用它,可以免费的使用 Bard 服务,项目地址:https://github.com/acheong08/Bard

安装及使用

通过 pip 来安装

pip install --upgrade GoogleBard

接下来,我们需要去获取一下会话秘钥,浏览器中打开网址 https://bard.google.com/,按下键盘上的 F12,进入控制台,来到 Application –> Cookies,找到 url,过滤字符串 Secure-1PSID,将其中的值拷贝下来

google bard

然后,来到终端,启动服务

python -m Bard --session "VgiTpJBqhJqxfinFutFiBhZq4CAJcEBFSnApxX_iSmQgxq7CJOr_zA68P4CsWjbZswnP9g."

--session 参数的值就是上面复制的秘钥

google bard

在提示符 You: 后面可填入你想要问的问题,然后按下 Alt + Enter 或者 Esc + Enter 发送,然后就是等待 Bard 的回答。比较尴尬的是,Bard 目前还不支持中文,不过响应的速度还是可以的。

colab notebook

如果你习惯使用 colab notebook,可访问这个链接

https://drive.google.com/file/d/1YyMWxTJgH4M0RbNRTpeDB8I97AZjKuc1/view?usp=sharing

如果启动服务时,报如下错误

google bard

一般是由于上面的会话秘钥不对,有些情况下最后面的 . 也是秘钥的一部分,详情可参考文末链接2


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK