Spaces:
Running
Running
Update crypto__analysis_tasks.py
Browse files- crypto__analysis_tasks.py +12 -35
crypto__analysis_tasks.py
CHANGED
|
@@ -4,55 +4,32 @@ from textwrap import dedent
|
|
| 4 |
class CryptoAnalysisTasks:
|
| 5 |
def market_research(self, agent, crypto):
|
| 6 |
return Task(
|
| 7 |
-
description=f"""
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
2. 24h price change percentage
|
| 11 |
-
3. One recent significant news item
|
| 12 |
-
Keep it concise, under 100 words.
|
| 13 |
-
""",
|
| 14 |
-
expected_output="A brief report with current price, market cap, and one key development for {crypto}.",
|
| 15 |
agent=agent
|
| 16 |
)
|
| 17 |
|
| 18 |
def technical_analysis(self, agent, crypto):
|
| 19 |
return Task(
|
| 20 |
-
description=
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
1. Current RSI
|
| 24 |
-
2. 7-day moving average
|
| 25 |
-
3. One identified support or resistance level
|
| 26 |
-
Keep it concise under 100 words
|
| 27 |
-
"""),
|
| 28 |
-
expected_output="A concise technical analysis report for {crypto} with RSI, 7-day MA, and one support/resistance level.",
|
| 29 |
agent=agent
|
| 30 |
)
|
| 31 |
|
| 32 |
def sentiment_analysis(self, agent, crypto):
|
| 33 |
return Task(
|
| 34 |
-
description=
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
1. Overall sentiment (positive, neutral, or negative)
|
| 38 |
-
2. One key factor influencing the sentiment
|
| 39 |
-
Keep it concise, under 50 words.
|
| 40 |
-
"""),
|
| 41 |
-
expected_output="A brief sentiment analysis report for {crypto} with an overall score and analysis of one recent news article.",
|
| 42 |
agent=agent
|
| 43 |
)
|
| 44 |
|
| 45 |
def recommend(self, agent, crypto):
|
| 46 |
return Task(
|
| 47 |
-
description=
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
1. One-sentence market summary
|
| 51 |
-
2. Key technical indicator (RSI or MA)
|
| 52 |
-
3. Overall sentiment
|
| 53 |
-
4. Clear buy/hold/sell recommendation
|
| 54 |
-
Keep it concise, under 50 words.
|
| 55 |
-
"""),
|
| 56 |
-
expected_output="A concise investment recommendation for {crypto} with market summary, key technical indicator, sentiment, and clear buy/hold/sell advice.",
|
| 57 |
agent=agent
|
| 58 |
)
|
|
|
|
| 4 |
class CryptoAnalysisTasks:
|
| 5 |
def market_research(self, agent, crypto):
|
| 6 |
return Task(
|
| 7 |
+
description=f"""Get current price and market cap for {crypto}. Find one recent news headline.
|
| 8 |
+
Format: Price: $X, Market Cap: $Y, News: [headline]""",
|
| 9 |
+
expected_output=f"Current price, market cap, and one news headline for {crypto}",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
agent=agent
|
| 11 |
)
|
| 12 |
|
| 13 |
def technical_analysis(self, agent, crypto):
|
| 14 |
return Task(
|
| 15 |
+
description=f"""Calculate RSI and 7-day moving average for {crypto}.
|
| 16 |
+
Format: RSI: X, 7-day MA: $Y, Signal: [overbought/oversold/neutral]""",
|
| 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"""Analyze overall market sentiment for {crypto} based on recent price action.
|
| 24 |
+
Format: Sentiment: [Positive/Negative/Neutral], Reason: [brief explanation]""",
|
| 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"""Based on previous analyses, provide investment recommendation for {crypto}.
|
| 32 |
+
Format: Recommendation: [BUY/HOLD/SELL], Confidence: [High/Medium/Low], Reason: [key factor]""",
|
| 33 |
+
expected_output=f"Clear investment recommendation for {crypto}",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
agent=agent
|
| 35 |
)
|