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/// Set of 16 key-value pairs that can be attached to an object.
14/// This can be useful for storing additional information about the
15/// object in a structured format, and querying for objects via API
16/// or the dashboard. Keys are strings with a maximum length of 64
17/// characters. Values are strings with a maximum length of 512
18/// characters.
19#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Default)]
20#[serde(transparent)]
21pub struct Metadata(serde_json::Value);
22
23impl From<serde_json::Value> for Metadata {
24    fn from(value: serde_json::Value) -> Self {
25        Self(value)
26    }
27}