#conversation #cleverbot #free #api #version #down #async

cleverbotfreeapi

Interact with a washed down version of the Cleverbot API for free

2 releases

0.1.1 Oct 4, 2024
0.1.0 Oct 4, 2024

#900 in Web programming

Download history 157/week @ 2024-09-29 65/week @ 2024-10-06 28/week @ 2024-10-13 1/week @ 2024-10-20

251 downloads per month

MIT license

24KB
175 lines

cleverbotfreeapi

cleverbotfreeapi is a Rust client library for interacting with a washed down version of the Cleverbot API for free. This crate provides easy-to-use interfaces for sending messages to Cleverbot and receiving responses. Suitable for async builds like web servers or bots.

Features

  • Get cleverbot responses.
  • Maintain conversation history.
  • Retry failed requests automatically (configurable).

Usage

Here is a basic example of using cleverbotfreeapi to send a message to Cleverbot and receive a response:

use cleverbotfreeapi::{CleverbotBuilder, Error};

#[tokio::main]
async fn main() -> Result<(), Error> {
    let cleverbot = CleverbotBuilder::default().build().await?;
    let response = cleverbot.get_response("are you a bot").await?;
    println!("response: {}", response);  // would respond with something like "no, I'm human"
    Ok(())
}

For more detailed examples, see the examples directory in the repository.

Contributing

Contributions are welcome!

Potential future features

  • Sessions, to automatically manage different conversations happening in different "places". Not sure if this is a good idea, as some people might be happy with im-memory sessions, some might want to use a db, etc.
  • Tests

Dependencies

~5–16MB
~223K SLoC