systemprompt_models/artifacts/traits.rs
1use serde::Serialize;
2use serde_json::Value as JsonValue;
3
4use super::types::ArtifactType;
5
6pub trait Artifact: Serialize {
7 fn artifact_type(&self) -> ArtifactType;
8 fn to_schema(&self) -> JsonValue;
9 fn to_json_value(&self) -> JsonValue {
10 serde_json::to_value(self).unwrap_or(JsonValue::Null)
11 }
12}
13
14pub trait ArtifactSchema {
15 fn generate_schema(&self) -> JsonValue;
16}