| Crates.io | unified-entity-card |
| lib.rs | unified-entity-card |
| version | 0.1.1 |
| created_at | 2026-01-09 21:35:28.740684+00 |
| updated_at | 2026-01-09 22:05:44.061523+00 |
| description | Unified Entity Card helpers for validating UEC JSON payloads. |
| homepage | |
| repository | https://github.com/LettuceAI/Unified-Entity-Cards |
| max_upload_size | |
| id | 2032920 |
| size | 25,849 |
Lightweight helpers for validating Unified Entity Cards with serde_json::Value.
crates.io: https://crates.io/crates/unified-entity-card
use serde_json::json;
use unified_entity_card::{assert_uec, validate_uec};
let card = json!({
"schema": { "name": "UEC", "version": "1.0" },
"kind": "character",
"payload": {
"id": "4c5d8e2a-7a7f-4cda-9f68-6a2b6f4f4f2f",
"name": "Aster Vale"
},
"app_specific_settings": {},
"meta": {},
"extensions": {}
});
let result = validate_uec(&card, true);
if !result.ok {
eprintln!("{:?}", result.errors);
}
assert_uec(&card, false).expect("card is invalid");
app_specific_settings is treated as an opaque object. Validation focuses on schema, kind, and payload structure.
If systemPrompt is a template ID, use create_character_uec with system_prompt_is_id = true to store it as _ID:<id>.