PrimoGreedy-Agent / test_run.py
CiscsoPonce's picture
feat: major architecture refactor with yFinance screener, scoring, and insider feeds
8ed954c
import asyncio
from src.agent import app
async def main():
print("πŸš€ Triggering the Advanced Agent Pipeline (USA)...")
# We pass the state to the compiled StateGraph
result = await app.ainvoke({"region": "USA", "retry_count": 0, "ticker": "NONE"})
print("\n" + "="*50)
print("πŸ“ˆ PIPELINE RESULTS")
print("="*50)
ticker = result.get('ticker', 'NONE')
status = result.get('status', 'FAIL')
verdict = result.get('final_verdict', 'No Verdict')
print(f"🎯 Target Acquired: {ticker}")
print(f"βš–οΈ Gatekeeper Status: {status}")
if status == 'PASS':
info = result.get('financial_data', {})
print(f"πŸ’° Price: ${info.get('currentPrice')}")
print(f"πŸ“Š Market Cap: ${info.get('marketCap', 0):,.0f}")
print(f"🌊 Float Shares: {info.get('floatShares', 0):,.0f}")
print(f"πŸ‘” Insider Ownership: {info.get('heldPercentInsiders', 0) * 100:.1f}%")
print("\n🧠 SENIOR BROKER ANALYSIS:")
print(verdict)
else:
print(f"πŸ›‘ Reason for failure: {result.get('financial_data', {}).get('reason', 'N/A')}")
print("="*50 + "\n")
if __name__ == "__main__":
asyncio.run(main())