use super::provenance::ExperimentProvenance;
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct GgufMetadata {
pub general: GeneralMetadata,
pub provenance: Option<ExperimentProvenance>,
pub custom: HashMap<String, String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct GeneralMetadata {
pub architecture: String,
pub name: String,
pub author: Option<String>,
pub description: Option<String>,
pub license: Option<String>,
pub url: Option<String>,
pub file_type: Option<String>,
}
impl GeneralMetadata {
pub fn new(architecture: impl Into<String>, name: impl Into<String>) -> Self {
Self {
architecture: architecture.into(),
name: name.into(),
author: None,
description: None,
license: None,
url: None,
file_type: None,
}
}
pub fn with_author(mut self, author: impl Into<String>) -> Self {
self.author = Some(author.into());
self
}
pub fn with_description(mut self, desc: impl Into<String>) -> Self {
self.description = Some(desc.into());
self
}
pub fn with_license(mut self, license: impl Into<String>) -> Self {
self.license = Some(license.into());
self
}
}