File size: 1,944 Bytes
033ead0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/env python3
"""
Test script for the lyrics analysis tool.
This script demonstrates the usage of AnalyzeLyricsTool with sample lyrics.
"""

from tools.analysis_tools import AnalyzeLyricsTool

# Sample lyrics for testing
SAMPLE_LYRICS = """
Walking alone through empty streets
The silence echoes what my heart repeats
Shadows dance across the walls
As night descends and darkness calls

But I'll keep moving forward
Even when the path is unclear
There's strength in the journey
And meaning in the tears

The morning light breaks through the clouds
Illuminating what was hidden in shrouds
Each step I take leaves footprints behind
Marking the path for others to find

But I'll keep moving forward
Even when the path is unclear
There's strength in the journey
And meaning in the tears
"""

def test_lyrics_analysis():
    """Test the lyrics analysis tool with sample lyrics."""
    print("\n=== TESTING LYRICS ANALYSIS TOOL ===\n")
    
    # Create an instance of the analysis tool
    analyzer = AnalyzeLyricsTool()
    
    # Analyze the sample lyrics
    song_title = "The Journey"
    artist = "Example Artist"
    
    # Test with formatting enabled (default)
    print("\n--- WITH RICH FORMATTING ---\n")
    formatted_analysis = analyzer.forward(
        song_title=song_title,
        artist=artist,
        lyrics=SAMPLE_LYRICS,
        format_output=True
    )
    print(formatted_analysis)
    
    # Test with formatting disabled (raw JSON)
    print("\n--- WITHOUT FORMATTING (RAW JSON) ---\n")
    raw_analysis = analyzer.forward(
        song_title=song_title,
        artist=artist,
        lyrics=SAMPLE_LYRICS,
        format_output=False
    )
    print(raw_analysis)
    
    return formatted_analysis, raw_analysis

if __name__ == "__main__":
    print("Testing AnalyzeLyricsTool with sample lyrics...")
    formatted_result, raw_result = test_lyrics_analysis()
    print("\nAnalysis test completed successfully!")