# config.rs — Agent Configuration via JSON

#### 🧾 Core Struct

```rust
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)

```rust
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

```rust
pub struct GoalConfig {
    pub description: String,
    pub conditions: Option<Vec<String>>,
}
```

This list feeds into the `GoalManager`.

***

#### 🧠 Model Preferences

```rust
pub struct ModelPrefs {
    pub provider: Option<String>,
    pub allow_fallback: bool,
}
```

Specify preferred LLM provider and whether fallback is allowed.

***

#### 🪵 Example (Trimmed)

```json
{
  "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.
