cleverbotfreeapi

Crates.iocleverbotfreeapi
lib.rscleverbotfreeapi
version0.1.1
sourcesrc
created_at2024-10-04 17:55:10.815227
updated_at2024-10-04 18:22:30.672278
descriptionInteract with a washed down version of the Cleverbot API for free
homepagehttps://github.com/rootofminus1atu/cleverbotfreeapi
repository
max_upload_size
id1396894
size83,962
RootOfMinus1ATU (rootofminus1atu)

documentation

https://docs.rs/cleverbotfreeapi

README

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

Links

Commit count: 0

cargo fmt