Crates.io | baichat-rs |
lib.rs | baichat-rs |
version | 0.1.0 |
source | src |
created_at | 2023-06-17 15:25:52.385623 |
updated_at | 2023-06-17 15:25:52.385623 |
description | BAI Chat/ThebAI in Rust |
homepage | https://bavarder.codeberg.page/code/baichat_rs/ |
repository | https://codeberg.org/Bavarder/baichat-rs |
max_upload_size | |
id | 892978 |
size | 43,166 |
cargo add baichat-rs
extern crate baichat_rs;
use baichat_rs::ThebAI;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut ai = ThebAI::new(None);
let r = ai.ask("Hello, world!", None).await?;
let response = r[r.len() - 1].text.clone();
println!("{}", response);
Ok(())
}