openai2 2.0.0

OpenAi client, generated from the OpenAPI spec.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#![allow(unused_imports)]
use openai::OpenAiClient;
use openai::model::*;
#[tokio::main]
async fn main() {
    let client = OpenAiClient::from_env();
    let input = serde_json::json!({});
    let model = "your model";
    let response = client
        .create_embedding(input, model)
        .user("your user")
        .await
        .unwrap();
    println!("{:#?}", response);
}