5 releases

0.1.4 May 9, 2023
0.1.3 May 7, 2023
0.1.2 Mar 26, 2023
0.1.1 Mar 22, 2023
0.1.0 Jan 29, 2023

#458 in Machine learning

Download history 21/week @ 2024-02-26 16/week @ 2024-03-11 103/week @ 2024-04-01

119 downloads per month
Used in 3 crates

MIT license

24KB
589 lines

gptrust_api

gptrust_api is a library that can used to interact with OpenAI API endpoints. It is unofficial and community maintained library, MIT Licensed.

Often it simplifies the API call by supplying sensible defaults. However if adjusting all parameters are needed, please file an issue or submit a PR with a elaborate version of the call.

Code example:

let completions = gptrust_api::completions::complete(
            "Once upon a time, ".to_string(),
            "text-davinci-001".to_string(),
            100,
            )
            .await
            .expect("Couldn't complete the prompt");
 let names = completions
            .iter()
            .map(|x| x.text.clone())
            .collect::<Vec<String>>();

Dependencies

~5–18MB
~227K SLoC