ci/woodpecker/push/woodpecker Pipeline failed
Build and Push / lint-and-test (push) Has been cancelled
Build and Push / build-services (map[cmd:python -m services.adapters.broker_adapter name:broker-adapter]) (push) Has been cancelled
Build and Push / build-services (map[cmd:python -m services.aggregation.worker name:aggregation]) (push) Has been cancelled
Build and Push / build-services (map[cmd:python -m services.extractor.worker name:extractor]) (push) Has been cancelled
Build and Push / build-services (map[cmd:python -m services.ingestion.worker name:ingestion]) (push) Has been cancelled
Build and Push / build-services (map[cmd:python -m services.lake_publisher.worker name:lake-publisher]) (push) Has been cancelled
Build and Push / build-services (map[cmd:python -m services.parser.worker name:parser]) (push) Has been cancelled
Build and Push / build-services (map[cmd:python -m services.recommendation.worker name:recommendation]) (push) Has been cancelled
Build and Push / build-services (map[cmd:python -m services.scheduler.app name:scheduler]) (push) Has been cancelled
Build and Push / build-services (map[cmd:uvicorn services.api.app:app --host 0.0.0.0 --port 8000 name:query-api]) (push) Has been cancelled
Build and Push / build-services (map[cmd:uvicorn services.risk.app:app --host 0.0.0.0 --port 8000 name:risk]) (push) Has been cancelled
Build and Push / build-services (map[cmd:uvicorn services.symbol_registry.app:app --host 0.0.0.0 --port 8000 name:symbol-registry]) (push) Has been cancelled
Build and Push / build-services (map[cmd:uvicorn services.trading.app:app --host 0.0.0.0 --port 8000 name:trading-engine]) (push) Has been cancelled
Build and Push / build-dashboard (push) Has been cancelled
Build and Push / build-superset (push) Has been cancelled
Build and Push / integration-test (push) Has been cancelled
47 lines
1.4 KiB
Python
47 lines
1.4 KiB
Python
import json
|
|
import os
|
|
|
|
from minio import Minio
|
|
|
|
mc = Minio(os.environ["MINIO_ENDPOINT"], access_key=os.environ["MINIO_ACCESS_KEY"], secret_key=os.environ["MINIO_SECRET_KEY"], secure=False)
|
|
raw_objs = list(mc.list_objects("stonks-llm-results", recursive=True))
|
|
|
|
# Count companies found vs not found
|
|
total = 0
|
|
with_companies = 0
|
|
empty_companies = 0
|
|
wrong_tickers = 0
|
|
our_tickers = {"AAPL","MSFT","NVDA","AMZN","GOOGL","JPM","JNJ","XOM","TSLA","META"}
|
|
ticker_hits = {}
|
|
|
|
for o in raw_objs:
|
|
data = json.loads(mc.get_object("stonks-llm-results", o.object_name).read())
|
|
if not data.get("success"):
|
|
continue
|
|
attempts = data.get("attempts", [])
|
|
if not attempts:
|
|
continue
|
|
raw_out = attempts[-1].get("raw_output", "")
|
|
try:
|
|
parsed = json.loads(raw_out)
|
|
companies = parsed.get("companies", [])
|
|
total += 1
|
|
if companies:
|
|
with_companies += 1
|
|
for c in companies:
|
|
t = c.get("ticker", "")
|
|
if t in our_tickers:
|
|
ticker_hits[t] = ticker_hits.get(t, 0) + 1
|
|
else:
|
|
wrong_tickers += 1
|
|
else:
|
|
empty_companies += 1
|
|
except:
|
|
pass
|
|
|
|
print(f"Total successful extractions: {total}")
|
|
print(f" With companies: {with_companies}")
|
|
print(f" Empty companies: {empty_companies}")
|
|
print(f" Wrong/unknown tickers: {wrong_tickers}")
|
|
print(f" Our ticker hits: {ticker_hits}")
|