feat: add readme
This commit is contained in:
parent
5890073c07
commit
b13c878027
29
README.md
Normal file
29
README.md
Normal file
@ -0,0 +1,29 @@
|
||||
# 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(())
|
||||
}
|
||||
```
|
Loading…
Reference in New Issue
Block a user