File size: 1,315 Bytes
24f95f0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import asyncio
import os
from app.services.self_reflection import self_reflection
from app.services.case_store import list_cases

async def main():
    print("Listing cases...")
    cases = list_cases(limit=10, full=True)
    if not cases:
        print("No cases found! Adding a mock case.")
        cases = [{
            "user_input": "Analyze the impact of rising interest rates on tech stocks.",
            "final": {
                "response": "Rising interest rates generally compress the valuation multiples of growth oriented tech stocks due to a higher discount rate..."
            }
        }, {
            "user_input": "What is the sentiment around AI?",
            "final": {
                "response": "AI sentiment remains extremely bullish globally..."
            }
        }]
    print(f"Running night review on {len(cases)} cases...")
    review = self_reflection.run_night_review(cases)
    print("REVIEW RESULTS:")
    print(review)
    print("\n--- OPINIONS ---\n")
    for op in self_reflection.opinions[-3:]:
        print(f"[{op.get('topic')}] (Conf {op.get('confidence')}): {op.get('statement')}")
    print("\n--- GAPS ---\n")
    for gap in self_reflection.gaps[-3:]:
        print(f"[{gap.get('topic')}]: {gap.get('reason')}")

if __name__ == "__main__":
    asyncio.run(main())