Spaces:
Running
Running
File size: 820 Bytes
a8ed4d6 |
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 |
# 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()) |