This repository has been archived by the owner on Aug 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 905
EdgeGPT
Antonio edited this page Jun 8, 2023
·
12 revisions
Main.py
class Chatbot()
Combines everything to make it seamless
async def save_conversation(filename: str) -> None
Save the conversation to a file
async def load_conversation(filename: str) -> None
Load the conversation from a file
async def get_conversation() -> dict
Gets the conversation history from conversation_id (requires load_conversation)
async def ask(
prompt: str,
wss_link: str = "wss://sydney.bing.com/sydney/ChatHub",
conversation_style: CONVERSATION_STYLE_TYPE = None,
webpage_context: str | None = None,
search_result: bool = False,
locale: str = guess_locale()) -> dict
Ask a question to the bot Response: { item (dict): messages (list[dict]): adaptiveCards (list[dict]): body (list[dict]): text (str): Response } To get the response, you can do: response["item"]["messages"][1]["adaptiveCards"][0]["body"][0]["text"]
async def ask_stream(
prompt: str,
wss_link: str = "wss://sydney.bing.com/sydney/ChatHub",
conversation_style: CONVERSATION_STYLE_TYPE = None,
raw: bool = False,
webpage_context: str | None = None,
search_result: bool = False,
locale: str = guess_locale()
) -> Generator[bool, dict | str, None]
Ask a question to the bot
async def close() -> None
Close the connection
async def reset() -> None
Reset the conversation
async def get_input_async(session: PromptSession = None,
completer: WordCompleter = None) -> str
Multiline input function.
async def async_main(args: argparse.Namespace) -> None
Main function