Cleverbot API的免费版本
cleverbot-free的Python项目详细描述
这是cleverbotapi的免费版本
发出一个请求并获取响应字符串的示例:
fromcleverbot_free.cbaioimportCleverBot#Instantiate the classcb=CleverBot()defmain():"""The first time you call init(), selenium will download the chromium browser, that is necessary to use this library.This is done only one time, i suggest you call this function in a test script,before using it in your programsSubsequent calls to init () will not download anything."""cb.init()"""After initialization you can send text to Cleverbot and recieve the text response in just one line..."""response=cb.getResponse("Hello")print(response)#When you want to reset the chat, you can close the browser session with...cb.close()#If you're using python >= 3.7main()
连续聊天的简单示例
^{pr2}$就这样!我希望这个库能帮助很多人建立聊天机器人。在
如果您发现任何问题,可以在github上发布:https://github.com/St3veR0nin/cleverbot_aio_free
- 项目
标签: