File size: 1,035 Bytes
e1fc9bc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import json
import os

import requests

BASE_URL = os.getenv(
    "COMPOSITION_API_URL",
    "http://localhost:7860",
).rstrip("/")

payload = {
    "progression": {
        "knowledge_state": "PARTIAL",
        "demonstrated_state": [
            "Created the initial animation and added the first set of assets"
        ],
        "next_gap": "Finish and polish the remaining animation work",
        "activity_plan": {
            "action": "complete the remaining animation work",
            "target": "the animation",
            "avoid_repeating": [
                "recreating the initial animation",
                "re-adding assets already included",
            ],
        },
    }
}

print("HEALTH")
health = requests.get(
    f"{BASE_URL}/health",
    timeout=30,
)
print(health.status_code)
print(json.dumps(health.json(), indent=2))

print("\nGENERATE")
response = requests.post(
    f"{BASE_URL}/generate",
    json=payload,
    timeout=180,
)

print(response.status_code)
print(json.dumps(response.json(), indent=2))