12 fix docs #13

Merged
Berack96 merged 18 commits from 12-fix-docs into main 2025-10-02 01:41:00 +02:00
5 changed files with 7 additions and 7 deletions
Showing only changes of commit 1c884b67dd - Show all commits

View File

@@ -42,6 +42,6 @@ if __name__ == "__main__":
analyze_btn = gr.Button("🔎 Analizza") analyze_btn = gr.Button("🔎 Analizza")
analyze_btn.click(fn=pipeline.interact, inputs=[user_input], outputs=output) analyze_btn.click(fn=pipeline.interact, inputs=[user_input], outputs=output)
server, port = ("0.0.0.0", 8000) server, port = ("127.0.0.1", 8000)
log_info(f"Starting UPO AppAI on http://{server}:{port}") log_info(f"Starting UPO AppAI on http://{server}:{port}")
demo.launch(server_name=server, server_port=port, quiet=True) demo.launch(server_name=server, server_port=port, quiet=True)

View File

@@ -49,10 +49,10 @@ class CoinBaseWrapper(BaseWrapper):
def __init__(self, currency: str = "USD"): def __init__(self, currency: str = "USD"):
api_key = os.getenv("COINBASE_API_KEY") api_key = os.getenv("COINBASE_API_KEY")
assert api_key is not None, "API key is required" assert api_key, "COINBASE_API_KEY environment variable not set"
api_private_key = os.getenv("COINBASE_API_SECRET") api_private_key = os.getenv("COINBASE_API_SECRET")
assert api_private_key is not None, "API private key is required" assert api_private_key, "COINBASE_API_SECRET environment variable not set"
self.currency = currency self.currency = currency
self.client: RESTClient = RESTClient( self.client: RESTClient = RESTClient(

View File

@@ -34,7 +34,7 @@ class CryptoCompareWrapper(BaseWrapper):
""" """
def __init__(self, currency:str='USD'): def __init__(self, currency:str='USD'):
api_key = os.getenv("CRYPTOCOMPARE_API_KEY") api_key = os.getenv("CRYPTOCOMPARE_API_KEY")
assert api_key is not None, "API key is required" assert api_key, "CRYPTOCOMPARE_API_KEY environment variable not set"
copilot-pull-request-reviewer[bot] commented 2025-10-02 01:29:52 +02:00 (Migrated from github.com)
Review

Using assertions for API validation is not recommended in production code. Consider raising a more specific exception like ValueError or APIDataError instead.

    if price.timestamp_ms <= 0:
        raise ValueError("Invalid timestamp data received from CryptoCompare")
Using assertions for API validation is not recommended in production code. Consider raising a more specific exception like `ValueError` or `APIDataError` instead. ```suggestion if price.timestamp_ms <= 0: raise ValueError("Invalid timestamp data received from CryptoCompare") ```
self.api_key = api_key self.api_key = api_key
self.currency = currency self.currency = currency

View File

@@ -19,7 +19,7 @@ class NewsApiWrapper(NewsWrapper):
def __init__(self): def __init__(self):
api_key = os.getenv("NEWS_API_KEY") api_key = os.getenv("NEWS_API_KEY")
assert api_key is not None, "NEWS_API_KEY environment variable not set" assert api_key, "NEWS_API_KEY environment variable not set"
self.client = newsapi.NewsApiClient(api_key=api_key) self.client = newsapi.NewsApiClient(api_key=api_key)
self.category = "business" # Cryptocurrency is under business self.category = "business" # Cryptocurrency is under business

View File

@@ -51,10 +51,10 @@ class RedditWrapper(SocialWrapper):
def __init__(self): def __init__(self):
client_id = os.getenv("REDDIT_API_CLIENT_ID") client_id = os.getenv("REDDIT_API_CLIENT_ID")
assert client_id is not None, "REDDIT_API_CLIENT_ID environment variable is not set" assert client_id, "REDDIT_API_CLIENT_ID environment variable is not set"
client_secret = os.getenv("REDDIT_API_CLIENT_SECRET") client_secret = os.getenv("REDDIT_API_CLIENT_SECRET")
assert client_secret is not None, "REDDIT_API_CLIENT_SECRET environment variable is not set" assert client_secret, "REDDIT_API_CLIENT_SECRET environment variable is not set"
self.tool = Reddit( self.tool = Reddit(
client_id=client_id, client_id=client_id,