async_openai/types/
common.rs

1use std::path::PathBuf;
2
3use bytes::Bytes;
4use serde::{Deserialize, Serialize};
5
6#[derive(Debug, Clone, PartialEq)]
7pub enum InputSource {
8    Path { path: PathBuf },
9    Bytes { filename: String, bytes: Bytes },
10    VecU8 { filename: String, vec: Vec<u8> },
11}
12
13#[derive(Debug, Serialize, Deserialize, Clone, Copy, PartialEq)]
14#[serde(rename_all = "lowercase")]
15pub enum OrganizationRole {
16    Owner,
17    Reader,
18}
19
20/// Set of 16 key-value pairs that can be attached to an object.
21/// This can be useful for storing additional information about the
22/// object in a structured format, and querying for objects via API
23/// or the dashboard. Keys are strings with a maximum length of 64
24/// characters. Values are strings with a maximum length of 512
25/// characters.
26#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Default)]
27#[serde(transparent)]
28pub struct Metadata(serde_json::Value);
29
30impl From<serde_json::Value> for Metadata {
31    fn from(value: serde_json::Value) -> Self {
32        Self(value)
33    }
34}