1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = { "conversations": [{
9 "id": "apify-qa-synthetic-001",
10 "title": "Synthetic Export Normalization Example",
11 "create_time": 1760100000,
12 "update_time": 1760100060,
13 "current_node": "apify-qa-assistant-001",
14 "mapping": {
15 "apify-qa-root-001": {
16 "id": "apify-qa-root-001",
17 "parent": None,
18 "children": ["apify-qa-user-001"],
19 "message": None,
20 },
21 "apify-qa-user-001": {
22 "id": "apify-qa-user-001",
23 "parent": "apify-qa-root-001",
24 "children": ["apify-qa-assistant-001"],
25 "message": {
26 "id": "apify-qa-message-user-001",
27 "author": {
28 "role": "user",
29 "name": None,
30 "metadata": {},
31 },
32 "create_time": 1760100001,
33 "content": {
34 "content_type": "text",
35 "parts": ["Normalize this synthetic conversation export."],
36 },
37 "metadata": {},
38 },
39 },
40 "apify-qa-assistant-001": {
41 "id": "apify-qa-assistant-001",
42 "parent": "apify-qa-user-001",
43 "children": [],
44 "message": {
45 "id": "apify-qa-message-assistant-001",
46 "author": {
47 "role": "assistant",
48 "name": None,
49 "metadata": {},
50 },
51 "create_time": 1760100002,
52 "content": {
53 "content_type": "text",
54 "parts": ["Synthetic export accepted for automated quality assurance."],
55 },
56 "metadata": { "model_slug": "synthetic-qa-example" },
57 },
58 },
59 },
60 }] }
61
62
63run = client.actor("z3n_m4nt1s/ai-chat-export-normalizer").call(run_input=run_input)
64
65
66print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
67for item in client.dataset(run.default_dataset_id).iterate_items():
68 print(item)
69
70