class Chatbot()
Synchronous wrapper for the AsyncChatbot class.
class AsyncChatbot()
A class to interact with Google Bard. Parameters session: str The __Secure_1PSID cookie. session_ts: str The __Secure_1PSIDTS cookie proxy: str timeout: int Request timeout in seconds.
@classmethod
async def create(cls,
secure_1psid: str,
secure_1psidts: str,
proxy: dict = None,
timeout: int = 20) -> "AsyncChatbot"
Async constructor.
async def save_conversation(file_path: str, conversation_name: str) -> None
Saves conversation to the file
Arguments:
file_path
: file to save (json)conversation_name
: any name of current conversation (unique one)
Returns:
None
async def load_conversation(file_path: str, conversation_name: str) -> bool
Loads a conversation from history file. Returns whether the conversation was found
Arguments:
file_path
: File with conversations (json)conversation_name
: unique conversation name
Returns:
True if the conversation was found
async def ask(message: str) -> dict
Send a message to Google Bard and return the response.
Arguments:
message
: The message to send to Google Bard.
Returns:
A dict containing the response from Google Bard.