From fbe26e09f4e10f262496d1c8e07b060c7a3a7c7c Mon Sep 17 00:00:00 2001 From: Berack96 Date: Mon, 6 Oct 2025 10:46:53 +0200 Subject: [PATCH] fix docs --- src/app/agents/models.py | 3 ++- src/app/base/markets.py | 7 +++++-- src/app/markets/binance.py | 11 ++++++----- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/app/agents/models.py b/src/app/agents/models.py index 1bb4142..b2d23ca 100644 --- a/src/app/agents/models.py +++ b/src/app/agents/models.py @@ -90,13 +90,14 @@ class AppModels(Enum): raise ValueError(f"Modello non supportato: {self}") - def get_agent(self, instructions: str, name: str = "", output_schema: type[BaseModel] | None = None, tools: list[Toolkit] = []) -> Agent: + def get_agent(self, instructions: str, name: str = "", output_schema: type[BaseModel] | None = None, tools: list[Toolkit] | None = None) -> Agent: """ Costruisce un agente con il modello e le istruzioni specificate. Args: instructions: istruzioni da passare al modello (system prompt) name: nome dell'agente (opzionale) output: schema di output opzionale (Pydantic BaseModel) + tools: lista opzionale di strumenti (tools) da fornire all'agente Returns: Un'istanza di Agent. """ diff --git a/src/app/base/markets.py b/src/app/base/markets.py index 052d033..cd00879 100644 --- a/src/app/base/markets.py +++ b/src/app/base/markets.py @@ -28,9 +28,12 @@ class Price(BaseModel): def set_timestamp(self, timestamp_ms: int | None = None, timestamp_s: int | None = None) -> None: """ - Imposta il timestamp in millisecondi. + Imposta il timestamp a partire da millisecondi o secondi. + IL timestamp viene salvato come stringa formattata 'YYYY-MM-DD HH:MM'. Args: - timestamp (int | datetime): Il timestamp in millisecondi o come oggetto datetime. + timestamp_ms: Timestamp in millisecondi. + timestamp_s: Timestamp in secondi. + Raises: """ if timestamp_ms is not None: timestamp = timestamp_ms // 1000 diff --git a/src/app/markets/binance.py b/src/app/markets/binance.py index c277e46..ffd31bb 100644 --- a/src/app/markets/binance.py +++ b/src/app/markets/binance.py @@ -35,11 +35,12 @@ class BinanceWrapper(MarketWrapper): def __init__(self, currency: str = "USD"): """ - Inizializza il wrapper di Binance con le credenziali API e la valuta di riferimento (default "USD"). - La valuta poi viene cambiata in una stablecoin Tether, come USDT, dato che Binance non - supporta le valute fiat direttamente per le criptovalute. - Args: - currency (str): Valuta in cui restituire i prezzi. Default è "USD". + Inizializza il wrapper di Binance con le credenziali API e la valuta di riferimento. + Se viene fornita una valuta fiat come "USD", questa viene automaticamente convertita in una stablecoin Tether ("USDT") per compatibilità con Binance, + poiché Binance non supporta direttamente le valute fiat per il trading di criptovalute. + Tutti i prezzi e volumi restituiti saranno quindi denominati nella stablecoin (ad esempio, "USDT") e non nella valuta fiat originale. + Args: + currency (str): Valuta in cui restituire i prezzi. Se "USD" viene fornito, verrà utilizzato "USDT". Default è "USD". """ api_key = os.getenv("BINANCE_API_KEY") api_secret = os.getenv("BINANCE_API_SECRET")