diff --git a/README.md b/README.md index ea63bcd..32ca26b 100644 --- a/README.md +++ b/README.md @@ -108,7 +108,7 @@ src ├── config.py <-- Configurazioni app ├── agents <-- Agenti, Team, prompts e simili ├── api <-- Tutte le API esterne - │ ├── base <-- Classi base per le API + │ ├── core <-- Classi core per le API │ ├── markets <-- Market data provider (Es. Binance) │ ├── news <-- News data provider (Es. NewsAPI) │ └── social <-- Social data provider (Es. Reddit) diff --git a/src/app/agents/pipeline.py b/src/app/agents/pipeline.py index 40bdaf2..3522432 100644 --- a/src/app/agents/pipeline.py +++ b/src/app/agents/pipeline.py @@ -2,7 +2,7 @@ from agno.run.agent import RunOutput from app.agents.team import create_team_with from app.agents.predictor import PredictorInput, PredictorOutput from app.agents.prompts import * -from app.api.base.markets import ProductInfo +from app.api.core.markets import ProductInfo from app.configs import AppConfig diff --git a/src/app/agents/predictor.py b/src/app/agents/predictor.py index da79e7e..2073947 100644 --- a/src/app/agents/predictor.py +++ b/src/app/agents/predictor.py @@ -1,5 +1,5 @@ from pydantic import BaseModel, Field -from app.api.base.markets import ProductInfo +from app.api.core.markets import ProductInfo class PredictorInput(BaseModel): data: list[ProductInfo] = Field(..., description="Market data as a list of ProductInfo") diff --git a/src/app/api/base/__init__.py b/src/app/api/core/__init__.py similarity index 100% rename from src/app/api/base/__init__.py rename to src/app/api/core/__init__.py diff --git a/src/app/api/base/markets.py b/src/app/api/core/markets.py similarity index 100% rename from src/app/api/base/markets.py rename to src/app/api/core/markets.py diff --git a/src/app/api/base/news.py b/src/app/api/core/news.py similarity index 100% rename from src/app/api/base/news.py rename to src/app/api/core/news.py diff --git a/src/app/api/base/social.py b/src/app/api/core/social.py similarity index 100% rename from src/app/api/base/social.py rename to src/app/api/core/social.py diff --git a/src/app/api/markets/__init__.py b/src/app/api/markets/__init__.py index 9a48853..015e548 100644 --- a/src/app/api/markets/__init__.py +++ b/src/app/api/markets/__init__.py @@ -1,6 +1,6 @@ from agno.tools import Toolkit from app.api.wrapper_handler import WrapperHandler -from app.api.base.markets import MarketWrapper, Price, ProductInfo +from app.api.core.markets import MarketWrapper, Price, ProductInfo from app.api.markets.binance import BinanceWrapper from app.api.markets.coinbase import CoinBaseWrapper from app.api.markets.cryptocompare import CryptoCompareWrapper diff --git a/src/app/api/markets/binance.py b/src/app/api/markets/binance.py index 18b5f35..2206157 100644 --- a/src/app/api/markets/binance.py +++ b/src/app/api/markets/binance.py @@ -1,7 +1,7 @@ import os from typing import Any from binance.client import Client # type: ignore -from app.api.base.markets import ProductInfo, MarketWrapper, Price +from app.api.core.markets import ProductInfo, MarketWrapper, Price def extract_product(currency: str, ticker_data: dict[str, Any]) -> ProductInfo: diff --git a/src/app/api/markets/coinbase.py b/src/app/api/markets/coinbase.py index 13016f6..194bf22 100644 --- a/src/app/api/markets/coinbase.py +++ b/src/app/api/markets/coinbase.py @@ -3,7 +3,7 @@ from enum import Enum from datetime import datetime, timedelta from coinbase.rest import RESTClient # type: ignore from coinbase.rest.types.product_types import Candle, GetProductResponse, Product # type: ignore -from app.api.base.markets import ProductInfo, MarketWrapper, Price +from app.api.core.markets import ProductInfo, MarketWrapper, Price def extract_product(product_data: GetProductResponse | Product) -> ProductInfo: diff --git a/src/app/api/markets/cryptocompare.py b/src/app/api/markets/cryptocompare.py index a6c5d70..64706a0 100644 --- a/src/app/api/markets/cryptocompare.py +++ b/src/app/api/markets/cryptocompare.py @@ -1,7 +1,7 @@ import os from typing import Any import requests -from app.api.base.markets import ProductInfo, MarketWrapper, Price +from app.api.core.markets import ProductInfo, MarketWrapper, Price def extract_product(asset_data: dict[str, Any]) -> ProductInfo: diff --git a/src/app/api/markets/yfinance.py b/src/app/api/markets/yfinance.py index f63192e..579b591 100644 --- a/src/app/api/markets/yfinance.py +++ b/src/app/api/markets/yfinance.py @@ -1,6 +1,6 @@ import json from agno.tools.yfinance import YFinanceTools -from app.api.base.markets import MarketWrapper, ProductInfo, Price +from app.api.core.markets import MarketWrapper, ProductInfo, Price def extract_product(stock_data: dict[str, str]) -> ProductInfo: diff --git a/src/app/api/news/__init__.py b/src/app/api/news/__init__.py index ed6afb6..eb36d8a 100644 --- a/src/app/api/news/__init__.py +++ b/src/app/api/news/__init__.py @@ -1,6 +1,6 @@ from agno.tools import Toolkit from app.api.wrapper_handler import WrapperHandler -from app.api.base.news import NewsWrapper, Article +from app.api.core.news import NewsWrapper, Article from app.api.news.newsapi import NewsApiWrapper from app.api.news.googlenews import GoogleNewsWrapper from app.api.news.cryptopanic_api import CryptoPanicWrapper diff --git a/src/app/api/news/cryptopanic_api.py b/src/app/api/news/cryptopanic_api.py index b1810b7..4e6f6db 100644 --- a/src/app/api/news/cryptopanic_api.py +++ b/src/app/api/news/cryptopanic_api.py @@ -2,7 +2,7 @@ import os from typing import Any import requests from enum import Enum -from app.api.base.news import NewsWrapper, Article +from app.api.core.news import NewsWrapper, Article class CryptoPanicFilter(Enum): diff --git a/src/app/api/news/duckduckgo.py b/src/app/api/news/duckduckgo.py index d854a2d..7fe232d 100644 --- a/src/app/api/news/duckduckgo.py +++ b/src/app/api/news/duckduckgo.py @@ -1,7 +1,7 @@ import json from typing import Any from agno.tools.duckduckgo import DuckDuckGoTools -from app.api.base.news import Article, NewsWrapper +from app.api.core.news import Article, NewsWrapper def extract_article(result: dict[str, Any]) -> Article: diff --git a/src/app/api/news/googlenews.py b/src/app/api/news/googlenews.py index 613484f..6b3a3ff 100644 --- a/src/app/api/news/googlenews.py +++ b/src/app/api/news/googlenews.py @@ -1,6 +1,6 @@ from typing import Any from gnews import GNews # type: ignore -from app.api.base.news import Article, NewsWrapper +from app.api.core.news import Article, NewsWrapper def extract_article(result: dict[str, Any]) -> Article: diff --git a/src/app/api/news/newsapi.py b/src/app/api/news/newsapi.py index 3c229f3..142b6f7 100644 --- a/src/app/api/news/newsapi.py +++ b/src/app/api/news/newsapi.py @@ -1,7 +1,7 @@ import os from typing import Any import newsapi # type: ignore -from app.api.base.news import Article, NewsWrapper +from app.api.core.news import Article, NewsWrapper def extract_article(result: dict[str, Any]) -> Article: diff --git a/src/app/api/social/__init__.py b/src/app/api/social/__init__.py index 69d4331..37b1e30 100644 --- a/src/app/api/social/__init__.py +++ b/src/app/api/social/__init__.py @@ -1,6 +1,6 @@ from agno.tools import Toolkit from app.api.wrapper_handler import WrapperHandler -from app.api.base.social import SocialPost, SocialWrapper +from app.api.core.social import SocialPost, SocialWrapper from app.api.social.reddit import RedditWrapper __all__ = ["SocialAPIsTool", "RedditWrapper", "SocialPost"] diff --git a/src/app/api/social/reddit.py b/src/app/api/social/reddit.py index e098ee3..ca06211 100644 --- a/src/app/api/social/reddit.py +++ b/src/app/api/social/reddit.py @@ -1,7 +1,7 @@ import os from praw import Reddit # type: ignore from praw.models import Submission # type: ignore -from app.api.base.social import SocialWrapper, SocialPost, SocialComment +from app.api.core.social import SocialWrapper, SocialPost, SocialComment MAX_COMMENTS = 5 diff --git a/tests/agents/test_predictor.py b/tests/agents/test_predictor.py index 518e659..1e9145f 100644 --- a/tests/agents/test_predictor.py +++ b/tests/agents/test_predictor.py @@ -2,7 +2,7 @@ import pytest from app.agents import AppModels from app.agents.predictor import PredictorInput, PredictorOutput, PredictorStyle from app.agents.prompts import PREDICTOR_INSTRUCTIONS -from app.api.base.markets import ProductInfo +from app.api.core.markets import ProductInfo def unified_checks(model: AppModels, input: PredictorInput) -> None: llm = model.get_agent(PREDICTOR_INSTRUCTIONS, output_schema=PredictorOutput) # type: ignore[arg-type] diff --git a/tests/utils/test_market_aggregator.py b/tests/utils/test_market_aggregator.py index 8c6ea18..0d62985 100644 --- a/tests/utils/test_market_aggregator.py +++ b/tests/utils/test_market_aggregator.py @@ -1,6 +1,6 @@ import pytest from datetime import datetime -from app.api.base.markets import ProductInfo, Price +from app.api.core.markets import ProductInfo, Price @pytest.mark.aggregator