github-actions[bot]
Automated deployment from GitHub Actions: a9d5a91de63ad7224bafe6039fb2b7479388fbf4
0a8c81b Download tests/test_bot.py from VLTA-AI/dropshop: direct link, hf CLI and curl.
- Browser
- Download file 1.15 kB
-
https://huggingface.co/spaces/VLTA-AI/dropshop/resolve/main/tests/test_bot.py
- Command line
-
hf download hf://spaces/VLTA-AI/dropshop/tests/test_bot.py
-
curl -L -o test_bot.py https://huggingface.co/spaces/VLTA-AI/dropshop/resolve/main/tests/test_bot.py
1.15 kB
| import os | |
| import sys | |
| # Add src to python path so we can import agents | |
| sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), 'apps/engine'))) | |
| from src.agents.customer_bot_agent import CustomerBotAgent | |
| def run_tests(): | |
| print("🤖 Starting Customer Bot Agent Tests (With Email Auth)...") | |
| bot = CustomerBotAgent() | |
| test_cases = [ | |
| {"msg": "Where is my order 1002?", "email": ""}, # Missing email | |
| {"msg": "Where is my order 1002?", "email": "wrong@email.com"}, # Wrong email (Privacy Test) | |
| {"msg": "Where is my order 1002?", "email": "john@test.com"}, # Correct email | |
| {"msg": "My tracking says it was delivered but I am very angry, I want a refund now for 1001!", "email": "buyer@example.com"}, # Escalation | |
| ] | |
| for case in test_cases: | |
| print(f"\n🗣️ USER ({case['email'] or 'NO_EMAIL'}): {case['msg']}") | |
| response = bot.process_message(case['msg'], case['email']) | |
| print(f"🤖 BOT : {response['reply_text']}") | |
| if response['escalated_to_human']: | |
| print(f"⚠️ [ESCALATION TRIGGERED]") | |
| if __name__ == "__main__": | |
| run_tests() | |