openai_client
provides configuration, models an a http client for working with
the API of OpenAi in Rust. This is
a community maintained library.
[dependencies]
openai_client = "0.1.0"
Or via git:
[dependencies.redis_ts]
git = "https://github.com/tompro/openai_client.git"
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?;
- Models
- Completions
- Edits
- Images
- Create
- Edit
- Variations
- Embeddings
- Files
- Fine Tunes
- Moderations
- Engines
- Parameter details