semvec/pypi-packages huggingface dataset:
cleverbot-free 2.0.0
A free version of the Cleverbot API
Requires Python: >=3.6

This is a free version of the CleverBot API

## Requirements

`python3.6` or greater; 

Latest version of `selenium`;

A webdriver, you can choose from the following:

`chromedriver` -> https://chromedriver.chromium.org/

`geckodriver` -> https://github.com/mozilla/geckodriver/releases

## Example of making only one request and getting the response string

```python
from cleverbot_free import cleverbot_api

"""
Create a default Cleverbot object, with no arguments.
"""
cb = cleverbot_api.Cleverbot()
"""
Since only one request is needed, when calling speak() set "one_shot" argument equals True.
The return type will be a string representing Cleverbot's response.
"""
print(cb.speak("Hello!", one_shot=True))
```

## Simple example of a continous chat

```python
from cleverbot_free import cleverbot_api

cb = cleverbot_api.Cleverbot()

"""
Each time start() gets called, the actual Cleverbot session gets closed if it does exists, and a brand new one is initialized.
Call this method everytime you want to reset the chat.
Using the speak() method with one_shot=True implicitly starts the session and closes it when finished.
"""
cb.start()

while True:
    
    try:
        
        text = input("Say something to Cleverbot: ")
        if text.lower().find("end") != -1:
            break
        elif text.lower().find("reset") != -1:
            cb.start()

        print(cb.speak(text))
    
    except Exception as e:
        print(str(e))
        break

"""
Calling close() is strictly necessary when the chat logic ends.
"""

cb.close()
```

## 2.0.0 Update

Significantly improved performance and usability!

Now you can pass arguments to the Cleverbot constructor: 
    
`headless` boolean is for setting the webdriver headless behaviour;

`use_gecko` indicates whether to use chromedriver (Chrome) or geckodriver (Firefox), if no `webriver_path` argument is specified, it is extracted from PATH environment variable; 

You can also update the User Agent strings for both Chrome and Firefox, by setting the arguments `chrome_user_agent` or `firefox_user_agent`;


**That's it!** I hope this library will help lots of people build their chatbots.

If you find any issues, feel free to post them on GitHub: https://github.com/St3veR0nin/cleverbot_free