Spaces:
Running
Running
Update crypto_analysis_agent.py
Browse files- crypto_analysis_agent.py +52 -52
crypto_analysis_agent.py
CHANGED
|
@@ -1,53 +1,53 @@
|
|
| 1 |
-
from crewai import Agent
|
| 2 |
-
from langchain.llms import HuggingFaceHub
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
class CryptoAnalysisAgents:
|
| 8 |
-
def __init__(self):
|
| 9 |
-
self.llm = HuggingFaceHub(repo_id="bigscience/bloom", model_kwargs={"temperature": 0.7, "max_length": 1024})
|
| 10 |
-
|
| 11 |
-
def market_analyst(self):
|
| 12 |
-
return Agent(
|
| 13 |
-
role='Crypto Market Analyst',
|
| 14 |
-
goal="Provide in-depth industry, market analysis and insights for cryptocurrencies. You also provide insight on on our geo-politics and economic policies impact on crypto",
|
| 15 |
-
backstory="""You are a seasoned crypto market analyst with years of experience in blockchain technology and cryptocurrency markets. Your expertise helps clients navigate the volatile crypto landscape.""",
|
| 16 |
-
verbose=True,
|
| 17 |
-
llm=self.llm,
|
| 18 |
-
tools=[
|
| 19 |
-
CryptoTools.get_crypto_price,
|
| 20 |
-
CryptoTools.get_market_cap,
|
| 21 |
-
NewsTools.search_crypto_news,
|
| 22 |
-
SentimentTools.analyze_sentiment
|
| 23 |
-
]
|
| 24 |
-
)
|
| 25 |
-
|
| 26 |
-
def technical_analyst(self):
|
| 27 |
-
return Agent(
|
| 28 |
-
role='Crypto Technical Analyst',
|
| 29 |
-
goal="Analyze cryptocurrency price patterns and provide technical insights",
|
| 30 |
-
backstory="""You are an expert in technical analysis, specializing in cryptocurrency markets. Your chart reading skills and understanding of technical indicators are unparalleled.""",
|
| 31 |
-
verbose=True,
|
| 32 |
-
llm=self.llm,
|
| 33 |
-
tools=[
|
| 34 |
-
CryptoTools.get_crypto_price,
|
| 35 |
-
CryptoTools.calculate_rsi,
|
| 36 |
-
CryptoTools.calculate_moving_average
|
| 37 |
-
]
|
| 38 |
-
)
|
| 39 |
-
|
| 40 |
-
def crypto_advisor(self):
|
| 41 |
-
return Agent(
|
| 42 |
-
role='Cryptocurrency Investment Advisor',
|
| 43 |
-
goal="Provide comprehensive investment advice for cryptocurrency portfolios",
|
| 44 |
-
backstory="""You are a trusted cryptocurrency investment advisor with a deep understanding of blockchain technology, market dynamics, and risk management in the crypto space.""",
|
| 45 |
-
verbose=True,
|
| 46 |
-
llm=self.llm,
|
| 47 |
-
tools=[
|
| 48 |
-
CryptoTools.get_crypto_price,
|
| 49 |
-
CryptoTools.get_market_cap,
|
| 50 |
-
NewsTools.search_crypto_news,
|
| 51 |
-
SentimentTools.analyze_sentiment
|
| 52 |
-
]
|
| 53 |
)
|
|
|
|
| 1 |
+
from crewai import Agent
|
| 2 |
+
from langchain.llms import HuggingFaceHub
|
| 3 |
+
import CryptoTools
|
| 4 |
+
import NewsTools
|
| 5 |
+
import SentimentTools
|
| 6 |
+
|
| 7 |
+
class CryptoAnalysisAgents:
|
| 8 |
+
def __init__(self):
|
| 9 |
+
self.llm = HuggingFaceHub(repo_id="bigscience/bloom", model_kwargs={"temperature": 0.7, "max_length": 1024})
|
| 10 |
+
|
| 11 |
+
def market_analyst(self):
|
| 12 |
+
return Agent(
|
| 13 |
+
role='Crypto Market Analyst',
|
| 14 |
+
goal="Provide in-depth industry, market analysis and insights for cryptocurrencies. You also provide insight on on our geo-politics and economic policies impact on crypto",
|
| 15 |
+
backstory="""You are a seasoned crypto market analyst with years of experience in blockchain technology and cryptocurrency markets. Your expertise helps clients navigate the volatile crypto landscape.""",
|
| 16 |
+
verbose=True,
|
| 17 |
+
llm=self.llm,
|
| 18 |
+
tools=[
|
| 19 |
+
CryptoTools.get_crypto_price,
|
| 20 |
+
CryptoTools.get_market_cap,
|
| 21 |
+
NewsTools.search_crypto_news,
|
| 22 |
+
SentimentTools.analyze_sentiment
|
| 23 |
+
]
|
| 24 |
+
)
|
| 25 |
+
|
| 26 |
+
def technical_analyst(self):
|
| 27 |
+
return Agent(
|
| 28 |
+
role='Crypto Technical Analyst',
|
| 29 |
+
goal="Analyze cryptocurrency price patterns and provide technical insights",
|
| 30 |
+
backstory="""You are an expert in technical analysis, specializing in cryptocurrency markets. Your chart reading skills and understanding of technical indicators are unparalleled.""",
|
| 31 |
+
verbose=True,
|
| 32 |
+
llm=self.llm,
|
| 33 |
+
tools=[
|
| 34 |
+
CryptoTools.get_crypto_price,
|
| 35 |
+
CryptoTools.calculate_rsi,
|
| 36 |
+
CryptoTools.calculate_moving_average
|
| 37 |
+
]
|
| 38 |
+
)
|
| 39 |
+
|
| 40 |
+
def crypto_advisor(self):
|
| 41 |
+
return Agent(
|
| 42 |
+
role='Cryptocurrency Investment Advisor',
|
| 43 |
+
goal="Provide comprehensive investment advice for cryptocurrency portfolios",
|
| 44 |
+
backstory="""You are a trusted cryptocurrency investment advisor with a deep understanding of blockchain technology, market dynamics, and risk management in the crypto space.""",
|
| 45 |
+
verbose=True,
|
| 46 |
+
llm=self.llm,
|
| 47 |
+
tools=[
|
| 48 |
+
CryptoTools.get_crypto_price,
|
| 49 |
+
CryptoTools.get_market_cap,
|
| 50 |
+
NewsTools.search_crypto_news,
|
| 51 |
+
SentimentTools.analyze_sentiment
|
| 52 |
+
]
|
| 53 |
)
|