1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/// DrFoo is an OpenAI client library for Rust. It is designed to be a thin shim
/// around the OpenAI HTTP API.
///
/// # Examples
///
/// ```no_run
/// use drfoo::*;
/// use std::env;
///
/// #[tokio::main]
/// async fn main() {
/// drfoo::init_logger();
/// let client = Client::new(env::var("OPENAI_API_KEY").unwrap().into());
///
/// let request = Chat::new()
/// .with_messages([
/// "You're a linux expert and systems administrator.",
/// "You're going to provide a short clever answer to my next question",
/// "What command would you use to find all files in the current directory modified in the last day?"])
/// .with_max_tokens(200);
///
/// let response = client.do_chat(&request).await.unwrap();
/// println!("Response: {:#?}", response);
/// }
/// ```
extern crate log;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
/// This method initializes [`env_logger`] from the environment, defaulting to `info` level logging.