#!/usr/bin/env python3 """ Debug Real Audio Processing Scenario This script tests with a real audio scenario to reproduce the actual "[}]" and UUID artifacts that occur in GAIA evaluation. """ import os import sys import logging import tempfile import wave import struct from pathlib import Path # Add the deployment-ready directory to Python path sys.path.insert(0, str(Path(__file__).parent)) from agents.fixed_enhanced_unified_agno_agent import FixedGAIAAgent # Configure logging logging.basicConfig( level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s' ) logger = logging.getLogger(__name__) def create_real_wav_file(): """Create a real WAV file with actual audio data.""" # Create a simple sine wave audio file sample_rate = 44100 duration = 1.0 # 1 second frequency = 440 # A4 note with tempfile.NamedTemporaryFile(suffix='.wav', delete=False) as tmp: # Create WAV file with wave.open(tmp.name, 'w') as wav_file: wav_file.setnchannels(1) # Mono wav_file.setsampwidth(2) # 16-bit wav_file.setframerate(sample_rate) # Generate sine wave for i in range(int(sample_rate * duration)): value = int(32767 * 0.3 * (1.0 if i % (sample_rate // frequency) < (sample_rate // frequency // 2) else -1.0)) wav_file.writeframes(struct.pack('