-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_ai.py
More file actions
29 lines (27 loc) · 942 Bytes
/
Copy pathtest_ai.py
File metadata and controls
29 lines (27 loc) · 942 Bytes
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
import sys
sys.path.insert(0, 'app')
import asyncio
from app.services.ai_service import AIService
async def test_ai():
service = AIService()
try:
result = await service.analyze_operational_risk(
unanswered_count=5,
unanswered_threshold=3,
no_show_rate=0.2,
no_show_threshold=0.15,
pending_forms=2,
pending_forms_threshold=3,
low_stock_items=[],
booking_trends={}
)
print('AI Service Result:')
print(f' OK: {result.get("ok", False)}')
print(f' Risk Level: {result.get("overall_risk_level", "unknown")}')
print(f' Summary: {result.get("summary", "no summary")}')
if not result.get('ok', False):
print(f' Error: {result.get("error", "unknown error")}')
except Exception as e:
print(f'Exception: {e}')
if __name__ == '__main__':
asyncio.run(test_ai())