systemprompt-models 0.1.22

Shared data models and types for systemprompt.io OS
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use serde::Serialize;
use serde_json::Value as JsonValue;

use super::types::ArtifactType;

pub trait Artifact: Serialize {
    fn artifact_type(&self) -> ArtifactType;
    fn to_schema(&self) -> JsonValue;

    fn to_json_value(&self) -> Result<JsonValue, serde_json::Error> {
        serde_json::to_value(self)
    }
}

pub trait ArtifactSchema {
    fn generate_schema(&self) -> JsonValue;
}