Spaces:
Sleeping
Sleeping
Update crypto_analysis_agents.py
Browse files- crypto_analysis_agents.py +43 -1
crypto_analysis_agents.py
CHANGED
@@ -31,7 +31,49 @@ class CryptoAnalysisAgents:
|
|
31 |
# Wrap the pipeline in a HuggingFacePipeline
|
32 |
self.llm = HuggingFacePipeline(pipeline=pipe)
|
33 |
|
34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
|
36 |
def _truncate_input(self, text, max_length=512):
|
37 |
"""Truncate input text to a maximum length."""
|
|
|
31 |
# Wrap the pipeline in a HuggingFacePipeline
|
32 |
self.llm = HuggingFacePipeline(pipeline=pipe)
|
33 |
|
34 |
+
def market_analyst(self):
|
35 |
+
return Agent(
|
36 |
+
role='Crypto Market Analyst',
|
37 |
+
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",
|
38 |
+
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.""",
|
39 |
+
verbose=True,
|
40 |
+
llm=self.llm,
|
41 |
+
tools=[
|
42 |
+
CryptoTools.get_crypto_price,
|
43 |
+
CryptoTools.get_market_cap,
|
44 |
+
NewsTools.search_crypto_news,
|
45 |
+
SentimentTools.analyze_sentiment
|
46 |
+
]
|
47 |
+
)
|
48 |
+
|
49 |
+
def technical_analyst(self):
|
50 |
+
return Agent(
|
51 |
+
role='Crypto Technical Analyst',
|
52 |
+
goal="Analyze cryptocurrency price patterns and provide technical insights",
|
53 |
+
backstory="""You are an expert in technical analysis, specializing in cryptocurrency markets. Your chart reading skills and understanding of technical indicators are unparalleled.""",
|
54 |
+
verbose=True,
|
55 |
+
llm=self.llm,
|
56 |
+
tools=[
|
57 |
+
CryptoTools.get_crypto_price,
|
58 |
+
CryptoTools.calculate_rsi,
|
59 |
+
CryptoTools.calculate_moving_average
|
60 |
+
]
|
61 |
+
)
|
62 |
+
|
63 |
+
def crypto_advisor(self):
|
64 |
+
return Agent(
|
65 |
+
role='Cryptocurrency Investment Advisor',
|
66 |
+
goal="Provide comprehensive investment advice for cryptocurrency portfolios",
|
67 |
+
backstory="""You are a trusted cryptocurrency investment advisor with a deep understanding of blockchain technology, market dynamics, and risk management in the crypto space.""",
|
68 |
+
verbose=True,
|
69 |
+
llm=self.llm,
|
70 |
+
tools=[
|
71 |
+
CryptoTools.get_crypto_price,
|
72 |
+
CryptoTools.get_market_cap,
|
73 |
+
NewsTools.search_crypto_news,
|
74 |
+
SentimentTools.analyze_sentiment
|
75 |
+
]
|
76 |
+
)
|
77 |
|
78 |
def _truncate_input(self, text, max_length=512):
|
79 |
"""Truncate input text to a maximum length."""
|