Releases: 64bit/async-openai
Releases · 64bit/async-openai
v0.6.1
v0.6.0
New
- Return full paths to the image files from save method in
ImageResponse
. Previously save method returned()
v0.5.0 (Ergonomics)
New
- 0.5.0 is first most ergonomic version of this library
- All request objects can now be constructed using builder pattern
- Client exposes API "groups" for each one of (images, completions, embeddings, edits, models, fine_tunes, files) for method chaining
Notes on breaking changes
Starting with 0.5.0 I'm hoping to not have major breaking changes, as the functionality and ergonomics are better than any previous versions.
Notes to migrate from 0.4.0 and previous versions to 0.5.0
Previously on 0.4.0 and older versions
// step 1: Create client
let client = Client::new();
// step 2: Create request
let request = CreateCompletionRequest {
model: "text-ada-001".to_owned(),
prompt: Some(Prompt::String(
"Tell me a joke about the universe".to_owned(),
)),
max_tokens: Some(40),
..Default::default()
};
// step 3: Send request
let response = Completions::create(&client, request).await?;
New improved way in 0.5.0
// Use builder pattern
let client = Client::new();
// Request struct has companion builder struct with same name + Args suffix
let request = CreateCompletionRequestArgs::default()
.model("text-davinci-003")
.prompt("Tell me a joke about the universe")
.max_tokens(40_u16)
.build()?;
let response = client
.completions() // chain the API "group" (completions, images,
// embeddings, models, fine_tunes, models, edits)
.create(request).await?; // call the API on selected "group"
v0.4.0 (All APIs supported)
v0.4.0
is the first release to support all APIs underhttps://api.openai.com/v1
.- It is also the first release with most correct and most complete Rust types from OpenAPI spec.