✅ TICKET-006: Wake-word Detection Service - Implemented wake-word detection using openWakeWord - HTTP/WebSocket server on port 8002 - Real-time detection with configurable threshold - Event emission for ASR integration - Location: home-voice-agent/wake-word/ ✅ TICKET-010: ASR Service - Implemented ASR using faster-whisper - HTTP endpoint for file transcription - WebSocket endpoint for streaming transcription - Support for multiple audio formats - Auto language detection - GPU acceleration support - Location: home-voice-agent/asr/ ✅ TICKET-014: TTS Service - Implemented TTS using Piper - HTTP endpoint for text-to-speech synthesis - Low-latency processing (< 500ms) - Multiple voice support - WAV audio output - Location: home-voice-agent/tts/ ✅ TICKET-047: Updated Hardware Purchases - Marked Pi5 kit, SSD, microphone, and speakers as purchased - Updated progress log with purchase status 📚 Documentation: - Added VOICE_SERVICES_README.md with complete testing guide - Each service includes README.md with usage instructions - All services ready for Pi5 deployment 🧪 Testing: - Created test files for each service - All imports validated - FastAPI apps created successfully - Code passes syntax validation 🚀 Ready for: - Pi5 deployment - End-to-end voice flow testing - Integration with MCP server Files Added: - wake-word/detector.py - wake-word/server.py - wake-word/requirements.txt - wake-word/README.md - wake-word/test_detector.py - asr/service.py - asr/server.py - asr/requirements.txt - asr/README.md - asr/test_service.py - tts/service.py - tts/server.py - tts/requirements.txt - tts/README.md - tts/test_service.py - VOICE_SERVICES_README.md Files Modified: - tickets/done/TICKET-047_hardware-purchases.md Files Moved: - tickets/backlog/TICKET-006_prototype-wake-word-node.md → tickets/done/ - tickets/backlog/TICKET-010_streaming-asr-service.md → tickets/done/ - tickets/backlog/TICKET-014_tts-service.md → tickets/done/
81 lines
2.4 KiB
Python
81 lines
2.4 KiB
Python
"""
|
|
Memory schema and data models.
|
|
"""
|
|
|
|
from dataclasses import dataclass
|
|
from datetime import datetime
|
|
from typing import Optional, List
|
|
from enum import Enum
|
|
|
|
|
|
class MemoryCategory(Enum):
|
|
"""Memory categories."""
|
|
PERSONAL = "personal"
|
|
FAMILY = "family"
|
|
PREFERENCES = "preferences"
|
|
ROUTINES = "routines"
|
|
FACTS = "facts"
|
|
|
|
|
|
class MemorySource(Enum):
|
|
"""Source of memory entry."""
|
|
EXPLICIT = "explicit" # User explicitly stated
|
|
INFERRED = "inferred" # Inferred from conversation
|
|
CONFIRMED = "confirmed" # User confirmed inferred fact
|
|
|
|
|
|
@dataclass
|
|
class MemoryEntry:
|
|
"""A single memory entry."""
|
|
id: str
|
|
category: MemoryCategory
|
|
key: str
|
|
value: str
|
|
confidence: float # 0.0 to 1.0
|
|
source: MemorySource
|
|
timestamp: datetime
|
|
last_accessed: Optional[datetime] = None
|
|
access_count: int = 0
|
|
tags: List[str] = None
|
|
context: Optional[str] = None
|
|
|
|
def __post_init__(self):
|
|
"""Initialize default values."""
|
|
if self.tags is None:
|
|
self.tags = []
|
|
if self.last_accessed is None:
|
|
self.last_accessed = self.timestamp
|
|
|
|
def to_dict(self) -> dict:
|
|
"""Convert to dictionary."""
|
|
return {
|
|
"id": self.id,
|
|
"category": self.category.value,
|
|
"key": self.key,
|
|
"value": self.value,
|
|
"confidence": self.confidence,
|
|
"source": self.source.value,
|
|
"timestamp": self.timestamp.isoformat(),
|
|
"last_accessed": self.last_accessed.isoformat() if self.last_accessed else None,
|
|
"access_count": self.access_count,
|
|
"tags": self.tags,
|
|
"context": self.context
|
|
}
|
|
|
|
@classmethod
|
|
def from_dict(cls, data: dict) -> "MemoryEntry":
|
|
"""Create from dictionary."""
|
|
return cls(
|
|
id=data["id"],
|
|
category=MemoryCategory(data["category"]),
|
|
key=data["key"],
|
|
value=data["value"],
|
|
confidence=data["confidence"],
|
|
source=MemorySource(data["source"]),
|
|
timestamp=datetime.fromisoformat(data["timestamp"]),
|
|
last_accessed=datetime.fromisoformat(data["last_accessed"]) if data.get("last_accessed") else None,
|
|
access_count=data.get("access_count", 0),
|
|
tags=data.get("tags", []),
|
|
context=data.get("context")
|
|
)
|