Skip to content

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

License

Notifications You must be signed in to change notification settings

motorlatitude/oai_rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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);
};

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages