1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "texts": [
10 """```json
11{
12 name: 'Alice',
13 \"role\": 'Engineer',
14 \"skills\": ['Python', 'AI',],
15 \"active\": True,
16}
17```
18Hope this helps!""",
19 "Here is the product info: {\"id\": 101, \"title\": \"Smart Lamp\", \"price\": 29.99, \"inStock\": true}",
20 ],
21 "schema": {
22 "type": "object",
23 "properties": {
24 "name": { "type": "string" },
25 "role": { "type": "string" },
26 "skills": {
27 "type": "array",
28 "items": { "type": "string" },
29 },
30 "active": { "type": "boolean" },
31 },
32 "required": [
33 "name",
34 "role",
35 ],
36 },
37}
38
39
40run = client.actor("kadev-code/llm-json-repair").call(run_input=run_input)
41
42
43print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
44for item in client.dataset(run.default_dataset_id).iterate_items():
45 print(item)
46
47