openai_http 0.2.0

A strongly-typed client for the OpenAI HTTP API
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use serde::{Deserialize, Serialize};

#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct Message {
    pub role: String,
    pub content: String,
}

impl Message {
    pub fn new(role: &str, content: &str) -> Self {
        Self {
            role: role.to_owned(),
            content: content.to_owned(),
        }
    }
}