Google AI 机器人 Bard 逆向工程 API

最新资讯1年前 (2023)发布 AI观察员
254 0 0

谷歌Bard聊天机器人API的逆向工程

安装

 $ pip3 install --upgrade GoogleBard

认证

转到 https://bard.google.com/

  • 用于控制台的 F12
  • 复制值
    • 会话:转到应用程序→ Cookie → 。复制该 Cookie 的值。__Secure-1PSID

用法

$ python3 -m Bard -h
usage: Bard.py [-h] --session SESSION

options:
  -h, --help         show this help message and exit
  --session SESSION  __Secure-1PSID cookie.

快速模式

$ export BARD_QUICK="true"
$ export BARD_SESSION="<__Secure-1PSID>"
$ python3 -m Bard

环境变量可以放在 .zshrc 中。

示例 bash 快捷方式:

# USAGE1: bard QUESTION
# USAGE2: echo "QUESTION" | bard
bard () {
	export BARD_QUICK=true
	export BARD_SESSION=<REDACTED>.
	python3 -m Bard "${@:-$(</dev/stdin)}" | tail -n+7
}

开发人员文档

from os import environ
from Bard import Chatbot

token = environ.get("BARD_TOKEN")

chatbot = Chatbot(token)

chatbot.ask("Hello, how are you?")

谷歌巴德聊天机器人API的逆向工程

安装

 $ pip3 install --upgrade GoogleBard

认证

转到 https://bard.google.com/

  • 用于控制台的 F12
  • 复制值
    • 会话:转到应用程序→ Cookie → 。复制该 Cookie 的值。__Secure-1PSID

用法

$ python3 -m Bard -h
usage: Bard.py [-h] --session SESSION

options:
  -h, --help         show this help message and exit
  --session SESSION  __Secure-1PSID cookie.

快速模式

$ export BARD_QUICK="true"
$ export BARD_SESSION="<__Secure-1PSID>"
$ python3 -m Bard

环境变量可以放在 .zshrc 中。

示例 bash 快捷方式:

# USAGE1: bard QUESTION
# USAGE2: echo "QUESTION" | bard
bard () {
	export BARD_QUICK=true
	export BARD_SESSION=<REDACTED>.
	python3 -m Bard "${@:-$(</dev/stdin)}" | tail -n+7
}

开发人员文档

from os import environ
from Bard import Chatbot

token = environ.get("BARD_TOKEN")

chatbot = Chatbot(token)

chatbot.ask("Hello, how are you?")
© 版权声明

相关文章

天猫U特购  京东优惠购        京东优惠    天猫优惠