Files
sapl/docs/scripts/show_thinking.py
T

16 lines
581 B
Python

import sys, json
sys.path.insert(0, 'backend')
from database import SessionLocal
from models.trend import TrendSearch
search_id = sys.argv[1] if len(sys.argv) > 1 else "e50505db-c503-4990-bbbe-e8e55688ea25"
db = SessionLocal()
s = db.query(TrendSearch).filter(TrendSearch.id == search_id).first()
print(f"Status: {s.status} items: {s.items_count}")
thinking = json.loads(s.agent_thinking or "[]")
for step in thinking:
print(f"\nstep {step['step']} [{step['action']}]")
print(f" detail: {step['detail'][:100]}")
print(f" result: {step['result'][:200]}")
db.close()