ChatGPT-rs-blocking
Fork of Async chatgpt_rs
I needed a blocking variation of this without reqwest
Usage
Here is a simple usage of the API, getting completion for a single message.
You can see more practical examples in the examples directory.
use chatgpt::prelude::*;
async fn main() -> Result<()> {
let key = args().nth(1).unwrap();
let client = ChatGPT::new(key)?;
let response: CompletionResponse = client
.send_message("Describe in five words the Rust programming language.")
.unwrap();
println!("Response: {}", response.message().content);
Ok(())
}