File size: 729 Bytes
97f8d30 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# Create a session and capture the session ID
SESSION_ID=$(curl -s -X POST https://adyen-executor.hf.space/create_session | yq -r '.session_id')
echo "Created session: $SESSION_ID"
# Execute some basic code
curl -X POST https://adyen-executor.hf.space/execute/$SESSION_ID \
-H "Content-Type: application/json" \
-d '{"code": "x = 42\nprint(f\"The value is {x}\")"}'
# Execute code that uses the previous variable
curl -X POST https://adyen-executor.hf.space/execute/$SESSION_ID \
-H "Content-Type: application/json" \
-d '{"code": "print(f\"x is still {x}\")"}'
# List sessions
curl https://adyen-executor.hf.space/list_sessions
# Shutdown the session
curl -X POST https://adyen-executor.hf.space/shutdown/$SESSION_ID |