File size: 1,971 Bytes
d9b1770
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
607aee8
b252213
d9b1770
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
be6f674
 
d9b1770
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
from crewai import Agent
# from langchain_community.tools import DuckDuckGoSearchRun
from crewai_tools import tool, SerperDevTool
from langchain_community.llms import HuggingFaceEndpoint

from tools.crypt_news_tool import GetCryptoNews 
from tools.search_duckduckgo_tool import SearchDuckDuckGo 
# from tools.crypt_news_tool import GetCryptoNews 


search_tool = SerperDevTool()

repo_id = "mistralai/Mistral-7B-Instruct-v0.2"
llm = HuggingFaceEndpoint(
    repo_id = repo_id, 
    # huggingfacehub_api_token=HUGGINGFACEHUB_API_TOKEN,
)

class CryptoAnalysisAgents():
    def crypto_analyst(self):
        return Agent(
            role='Crypto Analyst',
            goal='Scrape the latest cryptocurrency news, indicators, tweets and current price of the target coin.',
            backstory=(
                'Keen on staying ahead with the most current information, '
                'the Crypto Analyst scours through various media to gather the latest news and social sentiments.'
            ),
            tools=[
                search_tool, 
                GetCryptoNews(), 
                # SearchDuckDuckGo()
            ],
            allow_delegation=False,
            llm=llm,
            verbose=True,
            cache=True, 
            max_iter=20, 
        )

    def content_writer(self):
        return Agent(
            role='Content Writer',
            goal='Synthesize data and write engaging articles on latest trend of the target coin',
            backstory=(
                'Armed with a flair for storytelling, the Content Writer transforms intricate crypto data into captivating narratives,'
                'illuminating the latest trends for a wide audience.'
            ),
            tools=[
                # search_tool, 
                   # AskWolframAlpha(),
                  ],
            allow_delegation=False,
            llm=llm,
            verbose=True,
            cache=True, 
            max_iter=20,  
        )