diff --git a/src/app/markets/__init__.py b/src/app/markets/__init__.py index 57f04b7..bec8149 100644 --- a/src/app/markets/__init__.py +++ b/src/app/markets/__init__.py @@ -18,7 +18,7 @@ class MarketAPIs(BaseWrapper): def __init__(self, currency: str = "USD"): self.currency = currency - wrappers = [ CoinBaseWrapper, CryptoCompareWrapper ] + wrappers = [ BinanceWrapper, CoinBaseWrapper, CryptoCompareWrapper ] self.wrappers: WrapperHandler[BaseWrapper] = WrapperHandler.build_wrappers(wrappers) def get_product(self, asset_id): diff --git a/src/app/models.py b/src/app/models.py index 77b79b3..4cc591d 100644 --- a/src/app/models.py +++ b/src/app/models.py @@ -21,7 +21,8 @@ class AppModels(Enum): GEMINI_PRO = "gemini-2.0-pro" # API online, più costoso ma migliore OLLAMA_GPT = "gpt-oss:latest" # + good - slow (13b) OLLAMA_QWEN = "qwen3:latest" # + good + fast (8b) - OLLAMA_QWEN_4B = "qwen3:4b" # + fast - decent (4b) + OLLAMA_QWEN_4B = "qwen3:4b" # + fast + decent (4b) + OLLAMA_QWEN_1B = "qwen3:1.7b" # + very fast + decent (1.7b) @staticmethod def availables_local() -> list['AppModels']: diff --git a/src/app/social/reddit.py b/src/app/social/reddit.py index 8f3867f..6028010 100644 --- a/src/app/social/reddit.py +++ b/src/app/social/reddit.py @@ -4,6 +4,21 @@ from praw.models import Submission, MoreComments from .base import SocialWrapper, SocialPost, SocialComment MAX_COMMENTS = 5 +# TODO mettere piu' subreddit? +# scelti da https://lkiconsulting.io/marketing/best-crypto-subreddits/ +SUBREDDITS = [ + "CryptoCurrency", + "Bitcoin", + "Ethereum", + "CryptoMarkets", + "Dogecoin", + "Altcoin", + "DeFi", + "NFT", + "BitcoinBeginners", + "CryptoTechnology", + "btc" # alt subs of Bitcoin +] def create_social_post(post: Submission) -> SocialPost: @@ -46,9 +61,8 @@ class RedditWrapper(SocialWrapper): client_secret=client_secret, user_agent="upo-appAI", ) + self.subreddits = self.tool.subreddit("+".join(SUBREDDITS)) def get_top_crypto_posts(self, limit: int = 5) -> list[SocialPost]: - subreddit = self.tool.subreddit("CryptoCurrency") - top_posts = subreddit.top(limit=limit, time_filter="week") + top_posts = self.subreddits.top(limit=limit, time_filter="week") return [create_social_post(post) for post in top_posts] - diff --git a/tests/api/test_reddit.py b/tests/api/test_reddit.py index 84c66da..81ab8ca 100644 --- a/tests/api/test_reddit.py +++ b/tests/api/test_reddit.py @@ -7,8 +7,7 @@ from app.social.reddit import MAX_COMMENTS, RedditWrapper class TestRedditWrapper: def test_initialization(self): wrapper = RedditWrapper() - assert wrapper.client_id is not None - assert wrapper.client_secret is not None + assert wrapper is not None assert isinstance(wrapper.tool, Reddit) def test_get_top_crypto_posts(self):