openai_http_client

Crates.ioopenai_http_client
lib.rsopenai_http_client
version0.4.0
sourcesrc
created_at2023-03-19 18:59:18.238542
updated_at2023-03-19 21:17:38.011989
descriptionA strongly-typed client for the OpenAI HTTP API
homepage
repositoryhttps://github.com/gmosx/openai_sdk_rust/tree/main/openai_http
max_upload_size
id814623
size53,428
George Moschovitis (gmosx)

documentation

README

OpenAI HTTP API Client

A strongly-typed client for the OpenAI HTTP API.

This crate is an unofficial, community-driven effort.

Example

let openai = Client::new(&api_token);

let prompt = "Some popular programming languages are ";

let req = CreateCompletionRequest::new(prompt).model("text-davinci-003");
let resp = openai.send(req).await?;

let text = resp.choices[0].text.clone();

println!("{prompt}{text}");

Or run some of the examples:

. env.sh
cargo r --example chat
cargo r --example completion

Status

The software is under active development and the API is expected to change.

Contributing

Pull requests, issues and comments are welcome! Make sure to add tests for new features and bug fixes.

Contact

For questions, suggestions, etc, you can reach the maintainer on Twitter.

License

The software is distributed under the terms of both the MIT license and the Apache License (Version 2.0). See LICENSE-APACHE and LICENSE-MIT for details.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Disclaimer

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Copyright

Copyright © 2023 George Moschovitis.

Commit count: 0

cargo fmt