acheong08 / Bard

Python SDK/API for reverse engineered Google Bard
MIT License
1.42k stars 179 forks source link

Feature Request - quick-response from stdin or a parameter #15

Closed tekemperor closed 1 year ago

tekemperor commented 1 year ago

First, I just want to thank you for making this. Being able to talk to Bard in the terminal is a great productivity booster for me.

I have aliased the launch command python3 -m Bard --session SESSION to bard. I would like to be able to type one of the following to get the response on stdout instead of starting a chat session.

Is there a way to do this?

tekemperor commented 1 year ago

Well that was fast. Since you added the "BARD_QUICK" variable check, I was able to make this bash function that does exactly what I want.

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