oai_rs

Crates.iooai_rs
lib.rsoai_rs
version0.1.3
sourcesrc
created_at2022-12-09 17:03:04.810068
updated_at2023-10-22 18:48:29.489157
descriptionAn async rust library that's a wrapper for the OpenAI API
homepagehttps://github.com/motorlatitude/oai_rs
repositoryhttps://github.com/motorlatitude/oai_rs
max_upload_size
id733376
size415,176
Lennart Hase (motorlatitude)

documentation

https://docs.rs/oai_rs/

README

OAI_RS

Cargo oai_rs GitHub issues docs.rs oai_rs

An async rust library that's a wrapper for the OpenAI API.

💫 Features

Handles some of the following endpoints of the API:

  • Models

  • Edits

  • Images

  • Embeddings

  • Files

  • Fine-tunes

  • Moderations

🚀 Getting Started

Simply add oai_rs = "0.1.2" to your cargo.toml file. The API key should be provided as an enivormental variable using OPENAI_API_KEY.

📚 Examples

Simple example to complete a prompt string.

use oai_rs::{completions, models};

async {
     let completions = completions::build(models::CompletionModels::TEXT_DAVINCI_003)
         .prompt("Ice cream or cookies?")
         .max_tokens(32)
         .complete()
         .await;

        println!("{:?}", completions);
};
Commit count: 14

cargo fmt