✅ 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/
66 lines
2.1 KiB
Python
66 lines
2.1 KiB
Python
#!/usr/bin/env python3
|
|
"""
|
|
Test script for session manager.
|
|
"""
|
|
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
# Add parent directory to path
|
|
sys.path.insert(0, str(Path(__file__).parent.parent))
|
|
|
|
from conversation.session_manager import get_session_manager
|
|
|
|
def test_session_management():
|
|
"""Test basic session management."""
|
|
print("=" * 60)
|
|
print("Session Manager Test")
|
|
print("=" * 60)
|
|
|
|
manager = get_session_manager()
|
|
|
|
# Create session
|
|
print("\n1. Creating session...")
|
|
session_id = manager.create_session(agent_type="family")
|
|
print(f" ✅ Created session: {session_id}")
|
|
|
|
# Add messages
|
|
print("\n2. Adding messages...")
|
|
manager.add_message(session_id, "user", "What time is it?")
|
|
manager.add_message(session_id, "assistant", "It's 3:45 PM EST.")
|
|
manager.add_message(session_id, "user", "Set a timer for 10 minutes")
|
|
manager.add_message(session_id, "assistant", "Timer set for 10 minutes.")
|
|
print(f" ✅ Added 4 messages")
|
|
|
|
# Get context
|
|
print("\n3. Getting context...")
|
|
context = manager.get_context_messages(session_id)
|
|
print(f" ✅ Got {len(context)} messages in context")
|
|
for msg in context:
|
|
print(f" {msg['role']}: {msg['content'][:50]}...")
|
|
|
|
# Get session
|
|
print("\n4. Retrieving session...")
|
|
session = manager.get_session(session_id)
|
|
print(f" ✅ Session retrieved: {session.agent_type}, {len(session.messages)} messages")
|
|
|
|
# Test with tool calls
|
|
print("\n5. Testing with tool calls...")
|
|
manager.add_message(
|
|
session_id,
|
|
"assistant",
|
|
"I'll check the weather for you.",
|
|
tool_calls=[{"name": "weather", "arguments": {"location": "San Francisco"}}],
|
|
tool_results=[{"tool": "weather", "result": "72°F, sunny"}]
|
|
)
|
|
context = manager.get_context_messages(session_id)
|
|
last_msg = context[-1]
|
|
print(f" ✅ Message with tool calls: {len(last_msg.get('tool_calls', []))} calls")
|
|
|
|
print("\n" + "=" * 60)
|
|
print("✅ All tests passed!")
|
|
print("=" * 60)
|
|
|
|
if __name__ == "__main__":
|
|
test_session_management()
|