ra83205 / google-bard-api

This project provides a FastAPI wrapper for interacting with Google Bard, a conversational AI by Google. It allows users to send messages to Google Bard and receive responses through a simple API.
254 stars 62 forks source link

Error on hitting post request #9

Open archupsg03 opened 1 year ago

archupsg03 commented 1 year ago

PS C:\Users\ArchanaChinnaiah\Google_Bard\code\google-bard-api> uvicorn main:app --reload --port 8000 ←[32mINFO←[0m: Will watch for changes in these directories: ['C:\Users\ArchanaChinnaiah\Google_Bard\code\google-bard-api'] ←[32mINFO←[0m: Uvicorn running on ←[1mhttp://127.0.0.1:8000←[0m (Press CTRL+C to quit) ←[32mINFO←[0m: Started reloader process [←[36m←[1m17704←[0m] using ←[36m←[1mStatReload←[0m ←[32mINFO←[0m: Started server process [←[36m49560←[0m] ←[32mINFO←[0m: Waiting for application startup. ←[32mINFO←[0m: Application startup complete. ←[32mINFO←[0m: 127.0.0.1:55623 - "←[1mPOST /ask HTTP/1.1←[0m" ←[91m500 Internal Server Error←[0m ←[31mERROR←[0m: Exception in ASGI application Traceback (most recent call last): File "C:\Python310\lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 428, in run_asgi result = await app( # type: ignore[func-returns-value] File "C:\Python310\lib\site-packages\uvicorn\middleware\proxy_headers.py", line 78, in call return await self.app(scope, receive, send) File "C:\Python310\lib\site-packages\fastapi\applications.py", line 276, in call await super().call(scope, receive, send) File "C:\Python310\lib\site-packages\starlette\applications.py", line 122, in call await self.middleware_stack(scope, receive, send) File "C:\Python310\lib\site-packages\starlette\middleware\errors.py", line 184, in call raise exc File "C:\Python310\lib\site-packages\starlette\middleware\errors.py", line 162, in call await self.app(scope, receive, _send) File "C:\Python310\lib\site-packages\starlette\middleware\exceptions.py", line 79, in call raise exc File "C:\Python310\lib\site-packages\starlette\middleware\exceptions.py", line 68, in call await self.app(scope, receive, sender) File "C:\Python310\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 21, in call raise e File "C:\Python310\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 18, in call await self.app(scope, receive, send) File "C:\Python310\lib\site-packages\starlette\routing.py", line 718, in call await route.handle(scope, receive, send) File "C:\Python310\lib\site-packages\starlette\routing.py", line 276, in handle await self.app(scope, receive, send) File "C:\Python310\lib\site-packages\starlette\routing.py", line 66, in app response = await func(request) File "C:\Python310\lib\site-packages\fastapi\routing.py", line 237, in app raw_response = await run_endpoint_function( File "C:\Python310\lib\site-packages\fastapi\routing.py", line 163, in run_endpoint_function return await dependant.call(*values) File "C:\Users\ArchanaChinnaiah\Google_Bard\code\google-bard-api\main.py", line 25, in ask chatbot = Chatbot(message.session_id) File "C:\Users\ArchanaChinnaiah\Google_Bard\code\google-bard-api\Bard.py", line 99, in init self.SNlM0e = self.get_snlm0e() File "C:\Users\ArchanaChinnaiah\Google_Bard\code\google-bard-api\Bard.py", line 106, in get_snlm0e SNlM0e = re.search(r"SNlM0e\":\"(.?)\"", resp.text).group(1) AttributeError: 'NoneType' object has no attribute 'group' ←[32mINFO←[0m: 127.0.0.1:60154 - "←[1mGET / HTTP/1.1←[0m" ←[31m404 Not Found←[0m

Nineswiss commented 1 year ago

I had this problem but fixed it as I was missing a period at the end of my session_id

ksvardhan commented 1 year ago

I still have same problem. I have downloaded yesterday.