Skip to main content

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
10    fn to_json_value(&self) -> Result<JsonValue, serde_json::Error> {
11        serde_json::to_value(self)
12    }
13}
14
15pub trait ArtifactSchema {
16    fn generate_schema(&self) -> JsonValue;
17}