An async rust library that's a wrapper for the OpenAI API.
Handles some of the following endpoints of the API:
Simply add oai_rs=0.1.1
to your cargo.toml file. The API key should be provided as an enivormental variable using OPENAI_API_KEY
.
Simple example to complete a prompt string.
```rust use oai_rs::{completions, models};
async { let completions = completions::build(models::CompletionModels::TEXTDAVINCI003) .prompt("Ice cream or cookies?") .max_tokens(32) .complete() .await;
println!("{:?}", completions);
}; ```