Spaces:
Sleeping
Sleeping
| # debug_flow.py | |
| import asyncio | |
| from app.ai.service import aida_chat_sync | |
| async def test_flow(): | |
| user_id = "debug_user" | |
| user_role = "landlord" | |
| messages = [ | |
| "I want to list my 2-bedroom apartment in Lagos for 50k monthly", | |
| "2 bathrooms", | |
| "wifi and parking", | |
| "no requirements", | |
| "publish" | |
| ] | |
| state = None | |
| for msg in messages: | |
| print(f"\n[USER]: {msg}") | |
| state = await aida_chat_sync(user_id, user_role, msg) | |
| print(f"[AIDA]: {state.get('ai_reply')}") | |
| print(f"[STATUS]: {state.get('status')}") | |
| print(f"[MISSING]: {state.get('missing_fields')}") | |
| print(f"[DRAFT]: {state.get('draft_preview') is not None}") | |
| print(f"[MONGO_ID]: {state.get('mongo_id')}") | |
| if __name__ == "__main__": | |
| asyncio.run(test_flow()) |