Skip to content

Releases: 64bit/async-openai

v0.7.0

17 Feb 23:33
async-openai-v0.7.0
4bec9f9

Choose a tag to compare

New

  • Bug fix in #37
  • crate dependencies are upgraded, only base64 crate had breaking changes
  • updated doc comment links from beta.openai.com to platform.openai.com

New Contributors

v0.6.1

11 Feb 20:35
async-openai-v0.6.1
132e1c5

Choose a tag to compare

Bug Fixes

  • correct implementation of Default trait for Client

Contributors

  • @swnb made their first contribution #35 🎉

v0.6.0

26 Jan 05:53
async-openai-v0.6.0
014ebee

Choose a tag to compare

New

  • Return full paths to the image files from save method in ImageResponse. Previously save method returned ()

v0.5.0 (Ergonomics)

30 Dec 10:57
async-openai-v0.5.0
4dea918

Choose a tag to compare

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)

29 Dec 03:24
async-openai-v0.4.0
6f624ad

Choose a tag to compare

  • v0.4.0 is the first release to support all APIs under https://api.openai.com/v1 .
  • It is also the first release with most correct and most complete Rust types from OpenAPI spec.