Skip to main content

async_openai/types/
metadata.rs

1/// Set of 16 key-value pairs that can be attached to an object.
2/// This can be useful for storing additional information about the
3/// object in a structured format, and querying for objects via API
4/// or the dashboard. Keys are strings with a maximum length of 64
5/// characters. Values are strings with a maximum length of 512
6/// characters.
7#[derive(Debug, serde::Serialize, serde::Deserialize, Clone, PartialEq, Default)]
8#[serde(transparent)]
9#[cfg_attr(feature = "openapi", derive(utoipa::ToSchema))]
10#[cfg_attr(feature = "openapi", schema(as = async_openai::Metadata))]
11pub struct Metadata(serde_json::Value);
12
13impl From<serde_json::Value> for Metadata {
14    fn from(value: serde_json::Value) -> Self {
15        Self(value)
16    }
17}