Configurazioni dell'app #27

Merged
Berack96 merged 16 commits from configs into main 2025-10-12 18:05:43 +02:00
2 changed files with 10 additions and 0 deletions
Showing only changes of commit f2d099f547 - Show all commits

View File

@@ -33,6 +33,10 @@ api:
retry_attempts: 3 retry_attempts: 3
retry_delay_seconds: 2 retry_delay_seconds: 2
currency: EUR currency: EUR
# TODO Magari implementare un sistema per settare i providers
market_providers: [BinanceWrapper, YFinanceWrapper]
news_providers: [GoogleNewsWrapper, DuckDuckGoWrapper]
social_providers: [RedditWrapper]
agents: agents:
strategy: Conservative strategy: Conservative

View File

@@ -1,4 +1,5 @@
import os import os
copilot-pull-request-reviewer[bot] commented 2025-10-12 17:56:25 +02:00 (Migrated from github.com)
Review

This singleton implementation is not thread-safe and can cause issues in concurrent environments. Consider using a proper singleton pattern with locks or removing the singleton behavior if it's not strictly necessary.

This singleton implementation is not thread-safe and can cause issues in concurrent environments. Consider using a proper singleton pattern with locks or removing the singleton behavior if it's not strictly necessary.
copilot-pull-request-reviewer[bot] commented 2025-10-12 17:56:25 +02:00 (Migrated from github.com)
Review

Import statements should be placed at the top of the file, not within method bodies. Move this import to the top-level imports section.

Import statements should be placed at the top of the file, not within method bodies. Move this import to the top-level imports section.
copilot-pull-request-reviewer[bot] commented 2025-10-12 17:56:25 +02:00 (Migrated from github.com)
Review

Comment should be in English to maintain consistency with code comments throughout the project.

            'disable_existing_loggers': False, # Keeps existing loggers (e.g., third-party loggers)
Comment should be in English to maintain consistency with code comments throughout the project. ```suggestion 'disable_existing_loggers': False, # Keeps existing loggers (e.g., third-party loggers) ```
copilot-pull-request-reviewer[bot] commented 2025-10-12 17:56:25 +02:00 (Migrated from github.com)
Review

Comment should be in English to maintain consistency with code comments throughout the project.

                'httpx': {'level': 'WARNING'}, # Too much spam for INFO
Comment should be in English to maintain consistency with code comments throughout the project. ```suggestion 'httpx': {'level': 'WARNING'}, # Too much spam for INFO ```
from typing import Any
import ollama import ollama
import yaml import yaml
import logging.config import logging.config
@@ -104,6 +105,11 @@ class AppConfig(BaseModel):
log.info(f"Loaded configuration from {file_path}") log.info(f"Loaded configuration from {file_path}")
return configs return configs
def __new__(cls, *args: Any, **kwargs: Any) -> 'AppConfig':
if not hasattr(cls, 'instance'):
cls.instance = super(AppConfig, cls).__new__(cls)
return cls.instance
def get_model_by_name(self, name: str) -> AppModel: def get_model_by_name(self, name: str) -> AppModel:
""" """
Retrieve a model configuration by its name. Retrieve a model configuration by its name.