diff --git a/src/memory.rs b/src/memory.rs index 0a871c3..532c3fc 100644 --- a/src/memory.rs +++ b/src/memory.rs @@ -10,13 +10,24 @@ use crate::ai_interpreter::AIInterpreter; pub struct Memory { pub id: String, pub content: String, + #[serde(default = "default_interpreted_content")] pub interpreted_content: String, // AI解釈後のコンテンツ + #[serde(default = "default_priority_score")] pub priority_score: f32, // 心理判定スコア (0.0-1.0) + #[serde(default)] pub user_context: Option, // ユーザー固有性 pub created_at: DateTime, pub updated_at: DateTime, } +fn default_interpreted_content() -> String { + String::new() +} + +fn default_priority_score() -> f32 { + 0.5 +} + #[derive(Debug, Clone, Serialize, Deserialize)] pub struct Conversation { pub id: String,