Save classifier content
const url = 'https://example.com/v1/adapters/ids/classifier/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"model_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","description":"example","intent":{"intents":[{"id":"example","description":"example","phrase":{"phrases":["example"]}}]}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://example.com/v1/adapters/ids/classifier/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "model_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "description": "example", "intent": { "intents": [ { "id": "example", "description": "example", "phrase": { "phrases": [ "example" ] } } ] } }'Records the supplied training-relevant content as the next version of the classifier and queues training for it (201). Content identical to a version the classifier already holds resolves to that version instead and trains nothing (200), which is what keeps a publish from triggering a mass retrain.
Recorded versions are immutable, so this never alters an existing one. Queueing is never refused, however much an account already has waiting: training capacity is shared out when a run starts, not here.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Classifier id (UUID).
Header Parameters
Section titled “Header Parameters”Target account for principals broader than one account (tenant / account API key); account-scoped principals use their own.
Request Bodyrequired
Section titled “Request Bodyrequired”Training-relevant content of a classifier.
object
object
object
object
Examplegenerated
{ "model_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "description": "example", "intent": { "intents": [ { "id": "example", "description": "example", "phrase": { "phrases": [ "example" ] } } ] }}Responses
Section titled “Responses”Content resolved to a version the classifier already holds
One immutable version of a classifier, addressed by the account, the classifier id and the version number.
object
Version number. 0 is an ordinary version like any other — the first one a classifier gets, and the one existing scenario bricks name.
object
object
object
Identity of this version’s training-relevant content. Two versions of one classifier can never carry the same value; it is what lets identical content resolve to an existing version instead of training again.
Why the last training run of this version ended as it did. Present on a single-version read; absent from list entries.
object
Why the last training run failed. Absent unless it failed.
When the training run was queued. Absent if none was ever queued.
When the training run last changed state. Absent if none was ever queued.
Example
{ "state": "new"}Version recorded and queued for training
One immutable version of a classifier, addressed by the account, the classifier id and the version number.
object
Version number. 0 is an ordinary version like any other — the first one a classifier gets, and the one existing scenario bricks name.
object
object
object
Identity of this version’s training-relevant content. Two versions of one classifier can never carry the same value; it is what lets identical content resolve to an existing version instead of training again.
Why the last training run of this version ended as it did. Present on a single-version read; absent from list entries.
object
Why the last training run failed. Absent unless it failed.
When the training run was queued. Absent if none was ever queued.
When the training run last changed state. Absent if none was ever queued.
Example
{ "state": "new"}Bad request
object
Examplegenerated
{ "name": "example", "message": "example", "code": 1, "status": 1}Unauthorized
Forbidden
Not found
object
Examplegenerated
{ "name": "example", "message": "example", "code": 1, "status": 1}Concurrent writers kept taking the version this save was going to record. The save is safe to repeat.
object
Examplegenerated
{ "name": "example", "message": "example", "code": 1, "status": 1}Internal server error
object
Examplegenerated
{ "name": "example", "message": "example", "code": 1, "status": 1}Bad gateway (upstream adapter error)