1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "requests_jsonl": """{\"custom_id\": \"A\", \"method\": \"POST\", \"url\": \"/v1/responses\", \"body\": {\"model\": \"example-not-a-live-model\", \"input\": \"Synthetic A\"}}\r
10{\"custom_id\": \"B\", \"method\": \"POST\", \"url\": \"/v1/responses\", \"body\": {\"model\": \"example-not-a-live-model\", \"input\": \"Synthetic B\"}}\r
11""",
12 "outputs_jsonl": """{\"custom_id\": \"A\", \"response\": {\"status_code\": 200, \"body\": {\"output\": []}, \"request_id\": \"req_1\"}, \"error\": null, \"id\": \"batch_req_outputs_1\"}\r
13""",
14 "errors_jsonl": """{\"id\": \"batch_req_synthetic_error_B\", \"custom_id\": \"B\", \"response\": null, \"error\": {\"code\": \"batch_expired\", \"message\": \"Synthetic example only\"}}\r
15""",
16 "policy_json": """{}\r
17""",
18}
19
20
21run = client.actor("biztoolsus/openai-batch-result-reconciliation").call(run_input=run_input)
22
23
24print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
25for item in client.dataset(run.default_dataset_id).iterate_items():
26 print(item)
27
28