-
Notifications
You must be signed in to change notification settings - Fork 0
Python
HilFing edited this page Sep 2, 2022
·
5 revisions
Do py -m pip install ChatbotAPI and you are done.
There are various commands and utilities in this package. To use it just do
from ChatbotAPI.chatbasics import Chatbot
bot = Chatbot(BrainId, ApiKey, BotName, history, debug)
data = bot.sendmsg("Hi")
print(data)
- To get Brain Id and other info go to BrainShop
- Make an account
- Make a brain and don't change any settings
- Go to the settings tab and copy the BrainID and APIkey and then use it
- Use boolean for history and debug switch.
- To turn on spellchecker use
bot.spellcheck(True) - Voila! It works! Now enjoy your AI chatbot.
Thats All
string[1] is the Brain ID
string[2] is the API Key
string[3] is the Bot Name
boolean[1] is the history switch
boolean[2] is the debug switch
Returns the author name of this library
Returns the Github link of this library
Gets the bots properties in json format.
Turns the spellchecker on or off.
Writes the logs to a file.
Filename must include extension(Recommended .txt or .log)
Default filename is Chatbot.log
Only works when debug is turned on
Returns history in a list format
Length argument must be even and smaller than length of history.
Default length is all.
Only works when history has been turned on
Recommend to use in a for loop like this
his = bot.gethistory()
for i in his:
print(i)