Skip to content

Use OpenAI API client #20

@zurawiki

Description

@zurawiki

Today, we use a naive HTTP request to get the OpenAI completions using the reqwest library.

Some benefits of a better API client

  • Better handling around rate limits
  • Typed parameters like model name and temperature
  • We can better re-use connections (today we create HTTP client per completion)

We should use a more robust API client library. I saw a few choices on lib.rs: https://lib.rs/search?q=openai but there isn't any library that is officially supported by OpenAI

async-openai https://lib.rs/crates/async-openai looks promising but isn't v1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions