Giter Club home page Giter Club logo

bard's Introduction

Bard

Reverse engineering of Google's Bard chatbot API

Installation

 $ pip3 install --upgrade GoogleBard

Authentication

Go to https://bard.google.com/

  • F12 for console
  • Copy the values
    • Session: Go to Application → Cookies → __Secure-1PSID and __Secure-1PSIDTS. Copy the value of those cookie.

Usage

$ python3 -m Bard -h
usage: Bard.py [-h] --session <__Secure-1PSID> --session_ts <__Secure-1PSIDTS>

options:
  -h, --help         show this help message and exit
  --session --session_ts       pass two cookies

Quick mode

$ export BARD_QUICK="true"
$ export BARD__Secure_1PSID="<__Secure-1PSID>"
$ export BARD__Secure_1PSIDTS="<__Secure-1PSIDTS>"
$ python3 -m Bard

Environment variables can be placed in .zshrc.

Example bash shortcut:

# USAGE1: bard QUESTION
# USAGE2: echo "QUESTION" | bard
bard () {
	export BARD_QUICK=true
	export BARD__Secure_1PSID=<__Secure-1PSID>
	export BARD__Secure_1PSIDTS=<__Secure-1PSIDTS>
	python3 -m Bard "${@:-$(</dev/stdin)}" | tail -n+7
}

Implementation:

from os import environ
from Bard import Chatbot

Secure_1PSID = environ.get("BARD__Secure_1PSID")
Secure_1PSIDTS = environ.get("BARD__Secure_1PSIDTS")
chatbot = Chatbot(Secure_1PSID, Secure_1PSIDTS)

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

print(answer['content']

Async Implementation:

import asyncio
from os import environ
from Bard import AsyncChatbot

Secure_1PSID = environ.get("BARD__Secure_1PSID")
Secure_1PSIDTS = environ.get("BARD__Secure_1PSIDTS")

async def main():
    chatbot = await AsyncChatbot.create(Secure_1PSID, Secure_1PSIDTS)
    response = await chatbot.ask("Hello, how are you?")
    print(response['content'])

asyncio.run(main())

Credits:

  • discordtehe - Derivative of his original reverse engineering

bard's People

Contributors

agmmnn avatar canxin121 avatar daxitdon avatar dsdanielpark avatar f33rni avatar imptype avatar jans-code avatar kitsunedfox avatar xiaoxinyo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bard's Issues

Getting error when running

Google Bard encountered an error: b')]}'\n\n38\n[["wrb.fr",null,null,null,null,[7]]]\n55\n[["di",64],["af.httprm",63,"-6337835833054683153",8]]\n25\n[["e",4,null,null,130]]\n'.

Python error

16863508214586319983982132447080

Please go through this
This error raised when i run Example.py

Add Proxy support

It would be nice to add socks or http proxy support to use it in countries that are not supported.

VPN already works though

IndexError: list index out of range

It worked perfectly fine a few days ago. It just happened today. I tried updating my 1PSID already, but it didn't help.

chatbot.ask("hi")
---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
Cell In [22], line 1
----> 1 chatbot.ask("hi")

File ~\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\Bard.py:127, in Chatbot.ask(self, message)
    119 # do the request!
    120 resp = self.session.post(
    121     "https://bard.google.com/_/BardChatUi/data/assistant.lamda.BardFrontendService/StreamGenerate",
    122     params=params,
    123     data=data,
    124     timeout=120,
    125 )
--> 127 chat_data = json.loads(resp.content.splitlines()[3])[0][2]
    128 if not chat_data:
    129     return {"content": f"Google Bard encountered an error: {resp.content}."}

IndexError: list index out of range

Error when running in a project.

I'm using Pynecone to build a build a web app and using Bard in it. It is giving me an error when I run it in the Pynecone project, but works perfectly in another file with just a command line application of Bard. I have thoroughly checked my code and there's no problem in the Pynecone section as other AI models are working fine in it. I think there's some problem in bard.
Error:

Process SpawnProcess-19:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/process.py", line 314, in _bootstrap
self.run()
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/uvicorn/_subprocess.py", line 76, in subprocess_started
target(sockets=sockets)
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/uvicorn/server.py", line 60, in run
return asyncio.run(self.serve(sockets=sockets))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/runners.py", line 190, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/uvicorn/server.py", line 67, in serve
config.load()
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/uvicorn/config.py", line 477, in load
self.loaded_app = import_from_string(self.app)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/uvicorn/importer.py", line 21, in import_from_string
module = importlib.import_module(module_str)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1206, in _gcd_import
File "", line 1178, in _find_and_load
File "", line 1149, in _find_and_load_unlocked
File "", line 690, in _load_unlocked
File "", line 940, in exec_module
File "", line 241, in _call_with_frames_removed
File "/Users/vanshshah/Documents/s.t.e.v.e. forge/neurum/neurum/neurum.py", line 7, in
chatbot = Chatbot(token)
^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/Bard.py", line 63, in init
self.async_chatbot = self.loop.run_until_complete(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/base_events.py", line 629, in run_until_complete
self._check_running()
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/base_events.py", line 588, in _check_running
raise RuntimeError('This event loop is already running')
RuntimeError: This event loop is already running
sys:1: RuntimeWarning:

coroutine 'AsyncChatbot.create' was never awaited

seems not working anymore (Response code not 200. Response Status is 302)

use the example code from README

result

>>> chatbot = Chatbot(token)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ubuntu/test/venv/lib/python3.11/site-packages/Bard.py", line 63, in __init__
    self.async_chatbot = self.loop.run_until_complete(
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/home/ubuntu/test/venv/lib/python3.11/site-packages/Bard.py", line 143, in create
    instance.SNlM0e = await instance.__get_snlm0e()
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ubuntu/test/venv/lib/python3.11/site-packages/Bard.py", line 196, in __get_snlm0e
    raise Exception(
Exception: Response code not 200. Response Status is 302

I can't install Bard library.

As the title says, I can't install this library, I have installed it but its code doesn't appear in python's site-packages.

sometimes json_chat_data[2] could be None

Hi,
in line 118,

"textQuery": json_chat_data[2][0],

sometimes json_chat_data[2] could be None, (no textQuery)
if that happened, line 118 will fail with error TypeError: 'NoneType' object is not subscriptable

print(json_chat_data[2], type(json_chat_data[2]))
print(json_chat_data[2][0])

output:

None <class 'NoneType'>
TypeError: 'NoneType' object is not subscriptable

example response:

[
	["text"],
	["c_8", "r_3"], null, [],
	[
		["rc_3", ["text"],
			[]
		],
		["rc_3", ["text"],
			[]
		],
		["rc_3", ["text"],
			[]
		]
	]
]

can be fixed with:

"textQuery": json_chat_data[2][0] if json_chat_data[2] is not None else '',

'AsyncChatbot' object has no attribute 'SNlM0e'

from Bard import AsyncChatbot

token = "..." #__Secure-1PSID

chatbot = AsyncChatbot(token)

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

'AsyncChatbot' object has no attribute 'SNlM0e'

Updates to Bard not accessible from canadian account

Hi there,

First off, thank you for creating these reverse-engineered repos. I've been using them a lot.

I just want to express this so people can confirm whether or not my intuition is right.

I'm canadian, and I've been using a VPN to interact with the website since it came out. Though, I'm pretty sure now i'm not interacting with the updated version as my account is canadian.

If you navigate to the Network tab in Console mode, you will see an object called StreamGenerate.

It refers to a URL : https://bard.google.com/_/BardChatUi/data/assistant.lamda.BardFrontendService/StreamGenerate?bl=boq_assistant-bard-web-server_20230510.09_p1&_reqid=557387&rt=c

This is making me doubt that i'm not interacting with the latest LLM, but still with LLaMDA because of regulations. It may be that Google is filtering out requests from accounts in EU and Canada. Here is the list of accepted countries. Thus, accounts from the EU and Canada would not be able to interact with either PaLM2 or Gemini

I'm currently in the US and not using a VPN and it still spits out the same URL and authuser error under the Network tab whenever i'm sending a message (https://play.google.com/log?format=json&hasfast=true&authuser=0).

(and yes, I have access to dark mode and export to Docs and Gmail, so part of the update is on).

Can a user with US gmail account verify that ?

Also, I believe this could affect your code @acheong08 in self.session.post

"https://bard.google.com/_/BardChatUi/data/assistant.lamda.BardFrontendService/StreamGenerate",

How to get 'Search related topics'

Do the Bard APIs have any functionality to get these types of related/suggested search terms? If not, are there any plans to add such a feature in the future?

Any information on this would be greatly appreciated. Thank you!

Inkedimage_2023-04-10_19-39-28

RuntimeError: This event loop is already running

Cell In[14], line 7
3 from Bard import Chatbot
5 token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
----> 7 chatbot = Chatbot(token)
9 chatbot.ask("Hello, how are you?")

File d:\async\env\lib\site-packages\Bard.py:63, in Chatbot.init(self, session_id, proxy, timeout)
56 def init(
57 self,
58 session_id: str,
59 proxy: dict = None,
60 timeout: int = 20,
61 ):
62 self.loop = asyncio.get_event_loop()
---> 63 self.async_chatbot = self.loop.run_until_complete(
64 AsyncChatbot.create(session_id, proxy, timeout),
65 )

File C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\asyncio\base_events.py:625, in BaseEventLoop.run_until_complete(self, future)
614 """Run until the Future is done.
615
616 If the argument is a coroutine, it is wrapped in a Task.
(...)
...
585 if events._get_running_loop() is not None:
586 raise RuntimeError(
587 'Cannot run the event loop while another loop is running')

RuntimeError: This event loop is already running

How to Fix it?

Issue with the chat_data = json.loads(resp.content.splitlines()[3])[0][2]

from os import environ
from Bard import Chatbot

token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
chatbot = Chatbot(token)

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

when i ran it it always gives this error
Traceback (most recent call last):
File "P:\New Model Traning\Bard Jarvis\bard_jarvis.py", line 7, in
chatbot.ask("Hello, how are you?")
File "C:\Users\vandu\AppData\Local\Programs\Python\Python311\Lib\site-packages\Bard.py", line 83, in ask
return self.loop.run_until_complete(self.async_chatbot.ask(message))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\vandu\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 653, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "C:\Users\vandu\AppData\Local\Programs\Python\Python311\Lib\site-packages\Bard.py", line 236, in ask
chat_data = json.loads(resp.content.splitlines()[3])[0][2]
~~~~~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range

coroutine 'AsyncChatbot.create' was never awaited

This happens immediately after chatbot.ask returns its answer. The answer is proper, the "ask" worked, but then the entire thing crashes.

I have updated Python and all associated libs this morning.
I have made sure there are no other active logins on the machine.

Traceback (most recent call last):
File "C:\Users\phoen\AppData\Local\Programs\Python\Python38\lib\asyncio\proactor_events.py", line 116, in del
File "C:\Users\phoen\AppData\Local\Programs\Python\Python38\lib\asyncio\proactor_events.py", line 108, in close
File "C:\Users\phoen\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 719, in call_soon
File "C:\Users\phoen\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 508, in _check_closed
RuntimeError: Event loop is closed
sys:1: RuntimeWarning: coroutine 'AsyncChatbot.create' was never awaited

Thanks!

Add support for image responses

Bard now provides image responses.

Screenshot 2023-05-31 at 16 59 51

Right now if you ask Bard for an image here is what the reply looks like

You:
give me an image of what a desert looks like

Google Bard:
Sure, here is an image of a desert. [Image of Desert landscape]

Could the behavior be such that it shows a link to the image?

IndexError upon usage

Traceback:
Traceback (most recent call last):
File "/home/container/.local/lib/python3.10/site-packages/discord/commands/core.py", line 124, in wrapped
ret = await coro(arg)
File "/home/container/.local/lib/python3.10/site-packages/discord/commands/core.py", line 980, in _invoke
await self.callback(ctx, **kwargs)
File "/home/container/bot.py", line 422, in bard
response = await loop.run_in_executor(ThreadPoolExecutor(), bardchatbot.ask, message)
File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/container/.local/lib/python3.10/site-packages/Bard.py", line 135, in ask
chat_data = json.loads(resp.content.splitlines()[3])[0][2]
IndexError: list index out of range

1.0.2 was working fine, but all of a sudden the error started appearing, then I did an update to 1.0.3, it didn't help though, so uh, I am really not sure what is going on there

Add proxy option

Could you add a "proxy" property in the Chatbot constructor like in ChatGPT and EdgeGPT?

[Feature request]: Save/Load conversations

{
    "conversations": {
        "rows": [
            {
                "id": "574087840426754073",
                "c": "c_2e77eb0d18b42c8e",
                "r": "r_2ac0ecccbff96235",
                "rc": "rc_2ac0ecccbff96cb7",
                "lastActive": 1685098292915
            },
        ],
        "name": "conversations"
    }
}

Showing error after every 2 or 3 chats

After every send 2 or 3 chats it's throwing an error

Google Bard encountered an error:
b')]}'\n\n38\n[["wrb.fr",null,null,null,null,[8]]]\n55\n[["di",50],["a
f.httprm",50,"3088337182611657993",40]]\n25\n[["e",4,null,null,130]]\n
'.

And again starts working after restarting the bot and aborts after 2-3 messages

Multithread

I change the code with rest service. I send a many request. but my application is not work real api as I expected. Every request wait other request. How can ı deal with this problem ?

Chatbot cannot be imported after update

Hi, I updated from Pypi this morning, and now I am getting this error as soon as I call

from Bard import Chatbot

the error that I get is

line 119, in Chatbot def load_conversations(self, file_path: str) -> list[dict]: TypeError: 'type' object is not subscriptable

Any help greatly appreciated...

Google Bard Encountered Error

Hi I've seen this issue on this project before but they seemed to be all closed
Google Bard encountered an error: b')]}'\n\n38\n[["wrb.fr",null,null,null,null,[8]]]\n54\n[["di",82],["af.httprm",83,"6657274337850409787",1]]\n25\n[["e",4,null,null,129]]\n'

Thank you very much this project is amazing.

Feature Request - quick-response from stdin or a parameter

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.

  • bard "What is the orbital period of Neptune?"
  • echo "What is the orbital period of Neptune?" | bard -
  • bard -f ./long-question.txt | ./long-answer.txt
  • cat ./long-question.txt | bard - | ./long-answer.txt

Is there a way to do this?

SNlM0e error, tried everything mentioned in other error reports.

got this error:
SNlM0e = re.search(r"SNlM0e":"(.*?)"", resp.text).group(1)
AttributeError: 'NoneType' object has no attribute 'group'

I checked my token multiple times, including using the trailing period. When i printed resp.text, it printed a lot of text. however, snml0e clearly has a value of none. Does anyone know how to fix this? i read the other error reports, and nothing worked. I am in the U.S, not using a proxy/vpn.

SNlM0e value not found in response

I have tried to interpret core python code to C# with the help of Chatgpt as I'm just a newbie in this field , It generated the full code to be applicable for integration with Unity. but I have got the error "SNlM0e value not found in response".
I don't know what is the issue, it might be related to my location ?

The chatbot doesn't retain information

Whenever the program is shut the chatbot forgets whatever i told it. I tried setting the conversation_id manually and saving the chatbot object in a file for later retrieval, but nothing worked

API failing to get response

So, lately i was trying to setup an AI that behave like a human being, and to avoid training the AI on tons and tons of data i was trying to use the google bard API to make him respond to all of the questions that i could ask

the code im trying to use is this:

from os import environ
from Bard import Chatbot


chatbot = Chatbot("*MyKey*")

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

but im getting this error back, since im in Italy and google bard is not avaible in Italy i tried with both with and without the vpn, moving myself to virginia, with no success, the key is generated from a new account created while on the virginia server.

this is the error im getting
{'content': 'Google Bard encountered an error: b\')]}\\\'\\n\\n38\\n[["wrb.fr",null,null,null,null,[9]]]\\n55\\n[["di",95],["af.httprm",94,"-2844884599098641368",5]]\\n25\\n[["e",4,null,null,130]]\\n\'.'}

any idea on how to fix?

Google Bard encountered an error:

Google Bard encountered an error:
b')]}'\n\n102\n[["er",null,null,null,null,400,null,null,null,3],["di",88],["af.httprm",88,"9026063738222580818",1]]\n25\n[["e",4,nu
ll,null,138]]\n'.

SNlm0e related error

Getting an error that the resp.text does not contain SNlm0e

SNlM0e = re.search(r"SNlM0e\":\"(.*?)\"", resp.text).group(1)
AttributeError: 'NoneType' object has no attribute 'group'

Thoughts?

API call is failing. Google may have changed the API response structure

API call is failing. Google may have changed the API response structure

Traceback (most recent call last):
File "bard-hack.py", line 8, in
response = chatbot.ask("Tell me a joke?")
File "/lib/python3.9/site-packages/Bard.py", line 83, in ask
return self.loop.run_until_complete(self.async_chatbot.ask(message))
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
return future.result()
File "/lib/python3.9/site-packages/Bard.py", line 247, in ask
"content": json_chat_data[0][0],
TypeError: 'NoneType' object is not subscriptable

Google Bard encountered an error: b.....

image

wrong text:

Google Bard:
Google Bard encountered an error: b')]}'\n\n38\n[["wrb.fr",null,null,null,null,[9]]]\n56\n[["di",134],["af.httprm",134,"5395322503221162922",1]]\n25\n[["e",4,null,null,131]]\n'.                         

Error Instantiating

I updated this morning and now I am getting this error as soon as it tries to import the class...

File "C:\Users\phoen\AppData\Local\Programs\Python\Python38\lib\site-packages\Bard.py", line 119, in Chatbot def load_conversations(self, file_path: str) -> list[dict]: TypeError: 'type' object is not subscriptable

My code that is causing this is literally just...

from Bard import Chatbot

Anyone?

The Chatbot() class has no attributes

So i used the example, with this code:

import os
import discord
from discord.ext import commands, bridge
from Bard import Chatbot
bard_token = "token"
chatbot = Chatbot(session_id=bard_token)

class BardCog(commands.Cog):
    def __init__(self, bot):
        self.bot = bot
    
    @bridge.bridge_command()
    @commands.cooldown(1, 30, commands.BucketType.user)
    async def bard(self, ctx, prompt: discord.Option(str, description="Your query to bard")):
        """Use Bard in discord."""
        answer = chatbot.ask(prompt)
        if answer > 1900:
            await ctx.respond("The answer is too long to be posted on discord")
        else:
            await ctx.respond(answer)
    
def setup(bot):
    bot.add_cog(BardCog(bot)) 

Which throws this error:

File "/home/container/.local/lib/python3.8/site-packages/discord/cog.py", line 777, in _load_from_module_spec
    spec.loader.exec_module(lib)  # type: ignore
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/container/cogs/bard.py", line 6, in <module>
    chatbot = Chatbot(session_id=bard_token)
  File "/home/container/.local/lib/python3.8/site-packages/Bard.py", line 93, in __init__
    self.SNlM0e = self.__get_snlm0e()
  File "/home/container/.local/lib/python3.8/site-packages/Bard.py", line 100, in __get_snlm0e
    SNlM0e = re.search(r"SNlM0e\":\"(.*?)\"", resp.text).group(1)
AttributeError: 'NoneType' object has no attribute 'group'

How do i fix this?

Nothing outputs except some google introduction

(venv) oliver@hecs-275203:~/chatbot/tests$ python3 -m Bard

    Bard - A command-line interface to Google's Bard (https://bard.google.com/)
    Repo: github.com/acheong08/Bard

    Enter `alt+enter` or `esc+enter` to send a message.

HI^[
^[
^[
Here are the steps on how to get a refund from the IRS:

1 Check the status of your refund. You can check the status of your refund online at the IRS website or by calling the IRS Refund Hotline at 1-800-829-1954.
2 If you haven't received your refund, initiate a refund trace. You can initiate a refund trace online at the IRS website or by calling the IRS Refund Hotline at 1-800-829-1954.
3 If you still haven't received your refund after initiating a refund trace, you can file Form 3911, Taxpayer Statement Regarding Refund. You can download Form 3911 from the IRS website or by
calling the IRS at 1-800-829-1040.

Here are some additional tips for getting a refund from the IRS:

• File your tax return on time. The IRS will start processing your refund after you file your tax return. If you file your tax return late, it could delay your refund.
• Make sure your tax return is accurate. If there are any errors on your tax return, it could delay your refund.
• Use direct deposit. If you have direct deposit set up, your refund will be deposited directly into your bank account. This is usually the fastest way to get your refund.
• Be patient. It can take several weeks for the IRS to process your refund. If you haven't received your refund after four weeks, you can initiate a refund trace.

I hope this helps!
(venv) oliver@hecs-275203:/chatbot/tests$ vim test_bard.py
(venv) oliver@hecs-275203:
/chatbot/tests$ python3 -m Bard

    Bard - A command-line interface to Google's Bard (https://bard.google.com/)
    Repo: github.com/acheong08/Bard

    Enter `alt+enter` or `esc+enter` to send a message.

fdHere are the steps on how to clean a dog's ear:

1 Gather your supplies. You will need:
• A veterinarian-approved ear cleaner
• A cotton ball or gauze pad
• A towel
• A treat (optional)
2 Get your dog comfortable. Have your dog sit or stand still, and reward them with a treat.
3 Lift your dog's ear flap. Gently pull up on your dog's ear flap to expose the ear canal.
4 Apply the ear cleaner. Pour a small amount of ear cleaner into the ear canal.
5 Massage the base of the ear. Massage the base of the ear for about 30 seconds. This will help to loosen any debris and wax.
6 Wipe away the debris. Use a cotton ball or gauze pad to wipe away any debris that you see in the ear canal.
7 Repeat on the other ear. Repeat steps 3-6 on the other ear.
8 Praise your dog. Give your dog a treat and praise them for being good.

Here are some additional tips for cleaning your dog's ears:

• Do not use a cotton swab to clean your dog's ears. This can push the debris further into the ear canal and damage the eardrum.
• Do not use hydrogen peroxide or alcohol to clean your dog's ears. These products can irritate the skin and cause damage.
• If your dog has a lot of earwax, you may need to clean their ears more often. Talk to your veterinarian about how often you should clean your dog's ears.
• If your dog has any signs of ear infection, such as redness, swelling, or discharge, take them to the veterinarian immediately.

By following these steps, you can help to keep your dog's ears clean and healthy.

use await with AsyncChatbot.ask

2023-06-24T06:50:25.405478171Z /home/user_854774556984082491/bot.py:70: RuntimeWarning: coroutine 'AsyncChatbot.ask' was never awaited
2023-06-24T06:50:25.405522254Z except Exception as e: print(e)
2023-06-24T06:50:25.405528796Z RuntimeWarning: Enable tracemalloc to get the object allocation traceback

I'm getting this error while hosting bot on discloud earlier it used to work work but now it isn't.
In terminal its working tho

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.