Refactor market system and improve app configuration
- Refactor market system from singleton function to class-based architecture with MarketAPIs - Add automatic API key detection for Coinbase and CryptoCompare wrappers - Improve error handling and logging with agno.utils.log throughout the application - Split Models class into separate methods for online and local model availability - Add proper JSON response extraction with thinking pattern support - Enhance ToolAgent with better state management for provider and style selection - Update Gradio app with proper server configuration and logging
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import os
|
||||
import requests
|
||||
from app.markets.base import ProductInfo, BaseWrapper, Price
|
||||
|
||||
@@ -9,7 +10,9 @@ class CryptoCompareWrapper(BaseWrapper):
|
||||
La documentazione delle API è disponibile qui: https://developers.coindesk.com/documentation/legacy/Price/SingleSymbolPriceEndpoint
|
||||
!!ATTENZIONE!! sembra essere una API legacy e potrebbe essere deprecata in futuro.
|
||||
"""
|
||||
def __init__(self, api_key:str, currency:str='USD'):
|
||||
def __init__(self, api_key:str = None, currency:str='USD'):
|
||||
if api_key is None:
|
||||
api_key = os.getenv("CRYPTOCOMPARE_API_KEY")
|
||||
assert api_key is not None, "API key is required"
|
||||
|
||||
self.api_key = api_key
|
||||
|
||||
Reference in New Issue
Block a user