1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "items": [
10 "Hi, I've been trying to connect my Stripe account for 3 days and the integration keeps failing. I'm losing sales. Please help ASAP.",
11 {
12 "subject": "Invoice question",
13 "body": "Can you send me the invoice for August? No rush.",
14 },
15 "How much does the enterprise plan cost for 50 seats?",
16 ],
17 "questions": {
18 "department": {
19 "type": "choice",
20 "instructions": "Which team should handle this message?",
21 "criteria": {
22 "billing": "Payments, invoicing, refunds, subscription charges",
23 "technical": "Bugs, outages, integrations, errors",
24 "sales": "Pricing, upgrades, new accounts, plan questions",
25 },
26 },
27 "frustration": {
28 "type": "score",
29 "instructions": "How frustrated does the customer appear?",
30 "criteria": [
31 "Calm, just stating facts",
32 "Frustrated but civil",
33 "Very angry, strong language",
34 ],
35 },
36 "is_urgent": {
37 "type": "noul",
38 "instructions": "Does the message convey urgency or time-sensitivity?",
39 "criteria": {
40 "true": "Explicitly time-sensitive or blocking",
41 "false": "No urgency expressed",
42 },
43 },
44 },
45}
46
47
48run = client.actor("sameh.jarour/jev-classifier").call(run_input=run_input)
49
50
51print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
52for item in client.dataset(run.default_dataset_id).iterate_items():
53 print(item)
54
55