import os
from docent import Docent
client = Docent(
api_key=os.getenv("DOCENT_API_KEY"),
)
# Define your label schema using JSON Schema
label_schema = {
"type": "object",
"properties": {
"label": {
"enum": [
"match",
"no match"
],
"type": "string"
},
"explanation": {
"type": "string",
# Custom field for citations in the UI
"citations": true
}
}
}
# Create the label set
label_set_id = client.create_label_set(
collection_id="your-collection-id",
name="Auditor Labels",
label_schema=label_schema,
description="Labels from human auditors."
)
print(f"Created label set: {label_set_id}")