Skip to content

Latest commit

 

History

History
99 lines (62 loc) · 1.66 KB

DOCUMENTATION.md

File metadata and controls

99 lines (62 loc) · 1.66 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_id: str The __Secure-1PSID cookie. proxy: str timeout: int Request timeout in seconds.

create

@classmethod
async def create(cls,
                 session_id: 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.