Spaces:
Running
Running
Update crypto__analysis_tasks.py
Browse files- crypto__analysis_tasks.py +47 -10
crypto__analysis_tasks.py
CHANGED
|
@@ -4,32 +4,69 @@ from textwrap import dedent
|
|
| 4 |
class CryptoAnalysisTasks:
|
| 5 |
def market_research(self, agent, crypto):
|
| 6 |
return Task(
|
| 7 |
-
description=f"""
|
| 8 |
-
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
agent=agent
|
| 11 |
)
|
| 12 |
|
| 13 |
def technical_analysis(self, agent, crypto):
|
| 14 |
return Task(
|
| 15 |
-
description=f"""
|
| 16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
expected_output=f"RSI, moving average, and technical signal for {crypto}",
|
| 18 |
agent=agent
|
| 19 |
)
|
| 20 |
|
| 21 |
def sentiment_analysis(self, agent, crypto):
|
| 22 |
return Task(
|
| 23 |
-
description=f"""
|
| 24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
expected_output=f"Market sentiment assessment for {crypto}",
|
| 26 |
agent=agent
|
| 27 |
)
|
| 28 |
|
| 29 |
def recommend(self, agent, crypto):
|
| 30 |
return Task(
|
| 31 |
-
description=f"""
|
| 32 |
-
|
| 33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
agent=agent
|
| 35 |
)
|
|
|
|
| 4 |
class CryptoAnalysisTasks:
|
| 5 |
def market_research(self, agent, crypto):
|
| 6 |
return Task(
|
| 7 |
+
description=dedent(f"""
|
| 8 |
+
Get current price and market cap for {crypto}. Find recent news headlines.
|
| 9 |
+
|
| 10 |
+
Instructions:
|
| 11 |
+
1. Get current price for {crypto}
|
| 12 |
+
2. Get market cap for {crypto}
|
| 13 |
+
3. Search for recent news about {crypto}
|
| 14 |
+
|
| 15 |
+
Format your response as:
|
| 16 |
+
Price: $X, Market Cap: $Y, News: [headline summary]
|
| 17 |
+
"""),
|
| 18 |
+
expected_output=f"Current price, market cap, and recent news headlines for {crypto}",
|
| 19 |
agent=agent
|
| 20 |
)
|
| 21 |
|
| 22 |
def technical_analysis(self, agent, crypto):
|
| 23 |
return Task(
|
| 24 |
+
description=dedent(f"""
|
| 25 |
+
Calculate RSI and 7-day moving average for {crypto}.
|
| 26 |
+
|
| 27 |
+
Instructions:
|
| 28 |
+
1. Calculate RSI for {crypto}
|
| 29 |
+
2. Calculate 7-day moving average for {crypto}
|
| 30 |
+
3. Determine if the asset is overbought, oversold, or neutral
|
| 31 |
+
|
| 32 |
+
Format your response as:
|
| 33 |
+
RSI: X, 7-day MA: $Y, Signal: [overbought/oversold/neutral]
|
| 34 |
+
"""),
|
| 35 |
expected_output=f"RSI, moving average, and technical signal for {crypto}",
|
| 36 |
agent=agent
|
| 37 |
)
|
| 38 |
|
| 39 |
def sentiment_analysis(self, agent, crypto):
|
| 40 |
return Task(
|
| 41 |
+
description=dedent(f"""
|
| 42 |
+
Analyze overall market sentiment for {crypto} based on available information.
|
| 43 |
+
|
| 44 |
+
Instructions:
|
| 45 |
+
1. Get current price information for {crypto}
|
| 46 |
+
2. Analyze sentiment of the price action and market data
|
| 47 |
+
3. Provide sentiment assessment
|
| 48 |
+
|
| 49 |
+
Format your response as:
|
| 50 |
+
Sentiment: [Positive/Negative/Neutral], Reason: [brief explanation]
|
| 51 |
+
"""),
|
| 52 |
expected_output=f"Market sentiment assessment for {crypto}",
|
| 53 |
agent=agent
|
| 54 |
)
|
| 55 |
|
| 56 |
def recommend(self, agent, crypto):
|
| 57 |
return Task(
|
| 58 |
+
description=dedent(f"""
|
| 59 |
+
Based on all previous analyses, provide a clear investment recommendation for {crypto}.
|
| 60 |
+
|
| 61 |
+
Consider:
|
| 62 |
+
1. Current price and market cap
|
| 63 |
+
2. Technical indicators (RSI, moving averages)
|
| 64 |
+
3. Market sentiment
|
| 65 |
+
4. Recent news impact
|
| 66 |
+
|
| 67 |
+
Format your response as:
|
| 68 |
+
Recommendation: [BUY/HOLD/SELL], Confidence: [High/Medium/Low], Reason: [key supporting factor]
|
| 69 |
+
"""),
|
| 70 |
+
expected_output=f"Clear investment recommendation with reasoning for {crypto}",
|
| 71 |
agent=agent
|
| 72 |
)
|