Skip to content
This repository has been archived by the owner on Feb 20, 2024. It is now read-only.

tompro/openai_client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

openai_client

crates.io Continuous integration

openai_client provides configuration, models an a http client for working with the API of OpenAi in Rust. This is a community maintained library.

Cargo

[dependencies]
openai_client = "0.1.0"

Or via git:

[dependencies.redis_ts]
git = "https://github.com/tompro/openai_client.git"

Usage

use openai_client::*;

// Create client
let client = OpenAiClient::new(OpenAiConfig::new("<ACCESS_TOKEN>"));

// Create request
let request = EditRequestBuilder::default()
   .model("text-davinci-edit-001")
   .input("What day of the wek is it?")
   .instruction("Fix the spelling mistakes")
   .build()
   .unwrap();

// Send request
let result = client.create_edit(request).await?;

Features

  • Models
  • Completions
  • Edits
  • Images
    • Create
    • Edit
    • Variations
  • Embeddings
  • Files
  • Fine Tunes
  • Moderations
  • Engines
  • Parameter details