Configuration
Context Studio requires a single dataset to be enabled for the feature. You enable it by setting the context_studio_enabled flag on the dataset configuration.
Enable Context Studio for a Dataset
Section titled “Enable Context Studio for a Dataset”Use the script below to enable Context Studio for your dataset. Only one dataset can have Context Studio enabled at a time.
Prerequisites
Section titled “Prerequisites”- Your dataset ID
- An API access token (see API Authentication)
Python Script
Section titled “Python Script”import jsonimport requests
DATASET_ID = '<your_dataset_id>'TOKEN = '<your_access_token>'
response = requests.patch( # use .patch to update an existing config, .put for a new dataset config url=f"https://api.coactive.ai/api/v0/datasets/{DATASET_ID}/config", headers={ "accept": "application/json", "Authorization": f"Bearer {TOKEN}", }, json={ "context_studio_enabled": True }, timeout=30.0,)print(f"{response.status_code=}, {json.dumps(response.json(), indent=2, sort_keys=True)}")Request Details
Section titled “Request Details”| Parameter | Description |
|---|---|
DATASET_ID |
The unique identifier of the dataset you want to enable for Context Studio |
TOKEN |
Your API access token |
context_studio_enabled |
Set to True to enable Context Studio for the dataset |
Use requests.patch() to update an existing dataset configuration, or requests.put() if configuring a new dataset.
