Get started with HITL.sh in minutes. Learn how to add human supervision to your AI workflows.
{ "name": "Content Review", "fields": [ { "name": "content", "type": "text", "label": "Content to review", "required": true }, { "name": "approval", "type": "boolean", "label": "Approve content", "required": true }, { "name": "feedback", "type": "text", "label": "Feedback or comments", "required": false } ] }
from hitl import HITLClient # Initialize client client = HITLClient(api_key="your_api_key") # Create review request review = client.create_review( template_id="template_123", content={ "content": "AI-generated article content...", "metadata": {"source": "gpt-4", "topic": "technology"} }, assignees=["reviewer@company.com"] ) print(f"Review created: {review.id}")
import { HITLClient } from '@hitl/typescript'; // Initialize client const client = new HITLClient({ apiKey: 'your_api_key' }); // Create review request const review = await client.createReview({ templateId: 'template_123', content: { content: 'AI-generated article content...', metadata: { source: 'gpt-4', topic: 'technology' } }, assignees: ['reviewer@company.com'] }); console.log(`Review created: ${review.id}`);
curl -X POST https://api.hitl.sh/v1/reviews \ -H "Authorization: Bearer your_api_key" \ -H "Content-Type: application/json" \ -d '{ "template_id": "template_123", "content": { "content": "AI-generated article content...", "metadata": {"source": "gpt-4", "topic": "technology"} }, "assignees": ["reviewer@company.com"] }'
from flask import Flask, request import json app = Flask(__name__) @app.route('/webhook', methods=['POST']) def handle_webhook(): data = request.json if data['event'] == 'review.completed': review_id = data['review']['id'] result = data['review']['result'] # Process the review result if result['approval']: # Continue with approved content process_approved_content(result['content']) else: # Handle rejected content handle_rejected_content(result['feedback']) return {'status': 'ok'}, 200
{ "event": "review.completed", "review": { "id": "rev_123", "template_id": "template_123", "result": { "approval": true, "content": "AI-generated article content...", "feedback": "Great content, approved with minor edits" }, "completed_at": "2024-01-15T10:30:00Z" } }