29 lines
410 B
Markdown
29 lines
410 B
Markdown
# Theb.ai / BAI Chat
|
|
|
|
## Installation
|
|
|
|
``` shell
|
|
cargo add baichat-rs
|
|
```
|
|
|
|
## Usage
|
|
|
|
``` rust
|
|
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(())
|
|
}
|
|
``` |