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

Use the script below to enable Context Studio for your dataset. Only one dataset can have Context Studio enabled at a time.

Prerequisites

Python Script

1import json
2import requests
3
4DATASET_ID = '<your_dataset_id>'
5TOKEN = '<your_access_token>'
6
7response = requests.patch( # use .patch to update an existing config, .put for a new dataset config
8 url=f"https://api.coactive.ai/api/v0/datasets/{DATASET_ID}/config",
9 headers={
10 "accept": "application/json",
11 "Authorization": f"Bearer {TOKEN}",
12 },
13 json={
14 "context_studio_enabled": True
15 },
16 timeout=30.0,
17)
18print(f"{response.status_code=}, {json.dumps(response.json(), indent=2, sort_keys=True)}")

Request Details

ParameterDescription
DATASET_IDThe unique identifier of the dataset you want to enable for Context Studio
TOKENYour API access token
context_studio_enabledSet 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.