Skip to content
This repository has been archived by the owner on Aug 10, 2023. It is now read-only.

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonio Cheong committed Mar 22, 2023
1 parent 40a0494 commit 43bcef2
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 11 deletions.
31 changes: 31 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
repos:
- repo: https://github.com/asottile/reorder_python_imports
rev: v3.9.0
hooks:
- id: reorder-python-imports
args: [--py37-plus]
- repo: https://github.com/asottile/add-trailing-comma
rev: v2.3.0
hooks:
- id: add-trailing-comma
args: [--py36-plus]
- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
hooks:
- id: pyupgrade
args: [--py37-plus]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: debug-statements
- id: double-quote-string-fixer
- id: name-tests-test
- id: requirements-txt-fixer
- repo: https://github.com/psf/black
rev: 22.10.0
hooks:
- id: black
1 change: 0 additions & 1 deletion DOCUMENTATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,3 @@ Send a message to Google Bard and return the response.
**Returns**:

A dict containing the response from Google Bard.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ Go to https://bard.google.com/

- F12 for console
- Copy the values
- Session: `cookieStore.get("_U").then(result => console.log(result.value))`
- At: `window.WIZ_global_data.SNlM0e`
- Session: `cookieStore.get("_U").then(result => console.log(result.value))`
- At: `window.WIZ_global_data.SNlM0e`

## Usage

Expand Down
21 changes: 13 additions & 8 deletions src/Bard.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
"""
Reverse engineering of Google Bard
"""
import argparse
import json
import random
import string
import requests
import re
import argparse
import string

import requests
from prompt_toolkit import prompt
from prompt_toolkit import PromptSession
from prompt_toolkit.auto_suggest import AutoSuggestFromHistory
from prompt_toolkit.completion import WordCompleter
from prompt_toolkit.history import InMemoryHistory
from prompt_toolkit.key_binding import KeyBindings

from rich.markdown import Markdown
from rich.console import Console
from rich.markdown import Markdown


def create_session() -> PromptSession:
Expand Down Expand Up @@ -133,14 +132,20 @@ def ask(self, message: str) -> dict:
Repo: github.com/acheong08/Bard
Enter `alt+enter` or `esc+enter` to send a message.
"""
""",
)
parser = argparse.ArgumentParser()
parser.add_argument(
"--session", help="__Secure-1PSID cookie.", type=str, required=True
"--session",
help="__Secure-1PSID cookie.",
type=str,
required=True,
)
parser.add_argument(
"--at", help="window.WIZ_global_data.SNlM0e", type=str, required=True
"--at",
help="window.WIZ_global_data.SNlM0e",
type=str,
required=True,
)
args = parser.parse_args()

Expand Down

0 comments on commit 43bcef2

Please sign in to comment.