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

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonio Cheong committed Feb 10, 2023
1 parent d9fec1d commit 73912cd
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 30 deletions.
44 changes: 36 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,48 +35,76 @@ Use Async for the best experience
import asyncio
from EdgeGPT import Chatbot

def get_input(prompt):
"""
Multi-line input function
"""
# Display the prompt
print(prompt, end="")

# Initialize an empty list to store the input lines
lines = []

# Read lines of input until the user enters an empty line
while True:
line = input()
if line == "":
break
lines.append(line)

# Join the lines, separated by newlines, and store the result
user_input = "\n".join(lines)

# Return the input
return user_input


async def main():
"""
Main function
"""
print("Initializing...")
bot = Chatbot()
await bot.start()
while True:
prompt = input("\nYou:\n")
prompt = get_input("\nYou:\n")
if prompt == "!exit":
break
elif prompt == "!help":
print("""
print(
"""
!help - Show this help message
!exit - Exit the program
!reset - Reset the conversation
""")
""",
)
continue
elif prompt == "!reset":
await bot.reset()
continue
print("Bot:")
print((await bot.ask(prompt=prompt))["item"]["messages"][1]["text"])
print(
(await bot.ask(prompt=prompt))["item"]["messages"][1]["adaptiveCards"][0][
"body"
][0]["text"],
)
await bot.close()


if __name__ == "__main__":
print(
"""
EdgeGPT - A demo of reverse engineering the Edge GPT chatbot
EdgeGPT - A demo of reverse engineering the Bing GPT chatbot
Repo: github.com/acheong08/EdgeGPT
By: Antonio Cheong
!help for help
Type !exit to exit
Enter twice to send message
"""
""",
)
asyncio.run(main())


```

## Work in progress
Expand Down
22 changes: 0 additions & 22 deletions example.py

This file was deleted.

0 comments on commit 73912cd

Please sign in to comment.