1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "documents": ["{\"name\": \"Alice\", \"age\": 30, \"email\": \"alice@example.com\"}"],
10 "schema": {
11 "type": "object",
12 "properties": {
13 "name": { "type": "string" },
14 "age": {
15 "type": "integer",
16 "minimum": 0,
17 },
18 "email": {
19 "type": "string",
20 "format": "email",
21 },
22 },
23 "required": [
24 "name",
25 "age",
26 "email",
27 ],
28 "additionalProperties": False,
29 },
30}
31
32
33run = client.actor("codeclouds/llm-output-validator").call(run_input=run_input)
34
35
36print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
37for item in client.dataset(run.default_dataset_id).iterate_items():
38 print(item)
39
40