LyricsAnalyzerAgent / test_analysis.py
tonko22's picture
Recent updates (WIP)
033ead0
#!/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!")