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

Latest commit

 

History

History
102 lines (65 loc) · 1.75 KB

DOCUMENTATION.md

File metadata and controls

102 lines (65 loc) · 1.75 KB

Bard

Chatbot Objects

class Chatbot()

Synchronous wrapper for the AsyncChatbot class.

AsyncChatbot Objects

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.

create

@classmethod
async def create(cls,
                 secure_1psid: str,
                 secure_1psidts: str,
                 proxy: dict = None,
                 timeout: int = 20) -> "AsyncChatbot"

Async constructor.

save_conversation

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

load_conversation

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

ask

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.