config.rs — Agent Configuration via JSON
The config.rs module defines the struct mappings for config.json, allowing agents to be configured without code changes. This supports rapid iteration and modularity.
🧾 Core Struct
r#[derive(Deserialize)]
pub struct AgentConfig {
pub name: String,
pub persona: String,
pub voice_profile: Option<VoiceProfile>,
pub memory_file: Option<String>,
pub goals: Vec<GoalConfig>,
pub model_preferences: Option<ModelPrefs>,
}Each field maps directly from a JSON key used to initialize an agent at runtime.
🗣️ Voice Profile (Optional)
pub struct VoiceProfile {
pub tts: String,
pub stt: String,
}Used to configure text-to-speech and speech-to-text services (e.g., Whisper, ElevenLabs).
🎯 Goals
pub struct GoalConfig {
pub description: String,
pub conditions: Option<Vec<String>>,
}This list feeds into the GoalManager.
🧠 Model Preferences
pub struct ModelPrefs {
pub provider: Option<String>,
pub allow_fallback: bool,
}Specify preferred LLM provider and whether fallback is allowed.
🪵 Example (Trimmed)
{
"name": "Velma",
"persona": "Clever archaeologist NPC...",
"voice_profile": {
"tts": "elevenlabs",
"stt": "whisper"
},
"memory_file": "velma_memories.json",
"goals": [
{ "description": "Explore ruins" },
{ "description": "Avoid danger" }
]
}🧩 Extensibility
New fields can be added to this config to:
Enable new features
Tune emotional weights
Control LLM temperature or system prompts
Rust-side deserialization ensures type safety.
