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.
255 stars 60 forks source link

Cookies and Auth_Key #3

Open elbiozard opened 1 year ago

elbiozard commented 1 year ago

Hello, is it still working? I can't find the AUTH_KEY in Cookies

izdrail commented 1 year ago

@elbiozard I've just removed that check and rebuild the image just comment from 16 -> 21 line and you should have it working in main.py I guess he is using that to check if from a third party service or something

hussainwali74 commented 1 year ago

not working am using these: __Secure-1PSID SID

izdrail commented 1 year ago

I've told you you need to comment or remove the lines and the post to /ask { 'session_id': "THE __SECURE-1PSID", "message": "Your bard question" }

ra83205 commented 1 year ago

Hello, is it still working? I can't find the AUTH_KEY in Cookies

Hello! I noticed that the attribute AUTH_KEY, which has been renamed to USER_AUTH_KEY, is causing some confusion for people, and I would like to clarify its purpose. The value of USER_AUTH_KEY is essential for ensuring that your API endpoint has at least some minimal protection and is not directly linked to Bard. Initially, we required this parameter for all API requests, but now USER_AUTH_KEY is an optional parameter.

To send a POST request to the API, you will need to include the session ID in the request body along with the message prompt. The session ID is the value of the __SECURE-1PSID cookie, which you can retrieve from the user's browser.

Therefore, you can update this repository to reflect the new changes.

raymerjacque commented 1 year ago

you should have the session_ID server side, not client side. its dangerous to have it client side.