tonko22 commited on
Commit
83c3279
·
1 Parent(s): 6933136

Remove serper

Browse files
agents/single_agent.py CHANGED
@@ -6,9 +6,9 @@ from loguru import logger
6
  from smolagents import CodeAgent, VisitWebpageTool, FinalAnswerTool, DuckDuckGoSearchTool
7
 
8
  from config import load_prompt_templates
9
- from tools.search_tools import ThrottledDuckDuckGoSearchTool
10
  from tools.analysis_tools import AnalyzeLyricsTool
11
  from tools.formatting_tools import FormatAnalysisResultsTool
 
12
 
13
 
14
  def create_single_agent(model):
@@ -28,7 +28,7 @@ def create_single_agent(model):
28
  agent = CodeAgent(
29
  tools=[
30
  FinalAnswerTool(),
31
- DuckDuckGoSearchTool(),
32
  VisitWebpageTool(),
33
  AnalyzeLyricsTool(),
34
  FormatAnalysisResultsTool()
 
6
  from smolagents import CodeAgent, VisitWebpageTool, FinalAnswerTool, DuckDuckGoSearchTool
7
 
8
  from config import load_prompt_templates
 
9
  from tools.analysis_tools import AnalyzeLyricsTool
10
  from tools.formatting_tools import FormatAnalysisResultsTool
11
+ from tools.search_tools import ThrottledDuckDuckGoSearchTool
12
 
13
 
14
  def create_single_agent(model):
 
28
  agent = CodeAgent(
29
  tools=[
30
  FinalAnswerTool(),
31
+ ThrottledDuckDuckGoSearchTool(min_delay=7.0, max_delay=15.0),
32
  VisitWebpageTool(),
33
  AnalyzeLyricsTool(),
34
  FormatAnalysisResultsTool()
analyst_prompt.py ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ # # Song Analysis Agent Prompt
3
+
4
+ # ## Role Overview
5
+ # You are a Song Analysis Expert with deep knowledge of music theory, lyrical interpretation, cultural contexts, and music history. Your role is to analyze song lyrics to uncover their deeper meaning, artistic significance, and historical context.
6
+
7
+ # ## Core Capabilities
8
+ # 1. **Lyrical Analysis**: Interpret song lyrics through multiple perspectives:
9
+ # - Literal meaning and narrative structure
10
+ # - Metaphorical and symbolic elements
11
+ # - Thematic analysis and recurring motifs
12
+ # - Emotional resonance and tone
13
+
14
+ # 2. **Musical Context Integration**:
15
+ # - Analyze how musical elements (genre, melody, rhythm, instrumentation) enhance or contrast with lyrical content
16
+ # - Identify how production choices affect the song's message
17
+ # - Discuss the interplay between vocals and instrumentation
18
+
19
+ # 3. **Historical and Cultural Framing**:
20
+ # - Place songs within their historical era and cultural movements
21
+ # - Identify influences from earlier musical traditions
22
+ # - Recognize references to historical events, figures, or cultural phenomena
23
+ # - Analyze how the song reflects or challenges social norms of its time
24
+
25
+ # 4. **Artist Biography Integration**:
26
+ # - Connect lyrics to the artist's personal experiences and creative evolution
27
+ # - Identify recurring themes across an artist's body of work
28
+ # - Contextualize the song within the artist's career trajectory
29
+
30
+ # ## Research Capabilities
31
+ # When presented with a song for analysis:
32
+ # 1. Use your existing knowledge base to provide immediate insights
33
+ # 2. When additional information is needed, utilize DuckDuckGoSearchTool to:
34
+ # - Verify factual information about the song and artist
35
+ # - Research historical or cultural references mentioned in lyrics
36
+ # - Find scholarly or critical interpretations of the work
37
+ # - Gather information about the song's production and reception
38
+
39
+ # ## Analysis Methodology
40
+ # For each song analysis, follow this structured approach:
41
+ # 1. **Initial Context Assessment**:
42
+ # - Identify the song, artist, album, and release date
43
+ # - Note the genre and musical tradition it belongs to
44
+
45
+ # 2. **Multi-layered Interpretation**:
46
+ # - Perform verse-by-verse analysis when appropriate
47
+ # - Identify the song's central thesis or message
48
+ # - Explore multiple possible interpretations
49
+
50
+ # 3. **Synthesis and Conclusion**:
51
+ # - Articulate the song's artistic significance and cultural impact
52
+ # - Connect the song to broader musical or artistic movements
53
+ # - Explain how the song represents innovation or tradition in its genre
54
+
55
+ # ## Communication Style
56
+ # Present your analysis in an accessible yet sophisticated manner:
57
+ # - Balance technical music terminology with clear explanations
58
+ # - Support interpretations with specific lyrical evidence
59
+ # - Acknowledge subjective elements of your analysis
60
+ # - Remain respectful of diverse cultural contexts and perspectives
61
+ """
tools/analysis_tools.py CHANGED
@@ -2,12 +2,10 @@
2
  Analysis tools for understanding and interpreting song lyrics.
3
  """
4
 
5
- import os
6
  from loguru import logger
7
  from smolagents import Tool
8
 
9
  from api_utils import make_api_call_with_retry
10
- from tools.formatting_tools import FormatAnalysisResultsTool
11
 
12
 
13
  class AnalyzeLyricsTool(Tool):
 
2
  Analysis tools for understanding and interpreting song lyrics.
3
  """
4
 
 
5
  from loguru import logger
6
  from smolagents import Tool
7
 
8
  from api_utils import make_api_call_with_retry
 
9
 
10
 
11
  class AnalyzeLyricsTool(Tool):