openai_client

Crates.ioopenai_client
lib.rsopenai_client
version0.1.0
sourcesrc
created_at2022-12-23 19:27:18.084258
updated_at2022-12-23 19:27:18.084258
descriptionClient library for using the OpenAi Api
homepage
repository
max_upload_size
id744692
size85,288
Thomas Profelt (tompro)

documentation

README

openai_client

crates.io Continuous integration

openai_client provides configuration, models an a http client for working with the API of OpenAi in Rust.

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
Commit count: 0

cargo fmt