Training Endpoints

Manage training data for personas to enhance their knowledge and capabilities.

Note: Also, please check out for Training Slots and Special Data parameters.

Create Training

POST /v2/personas/:id/trainings

Parameters

Name
Type
Description

image

string

Required URL of the training image or reference data

info

string

Optional Information or description about the training data

slot

integer

extras

text

Optional Additional metadata or training information

Curl Example

curl -X POST https://api.luw.ai/v2/personas/123/trainings \
-H "Authorization: Bearer LUW_API_TOKEN" \
-d "image=https://example.com/training.jpg" \
-d "slot=8" \
-d "info=Modern living room design"

Response Example

{
  "status": true,
  "training_id": 456
}

✨ Training slots 1-7 are reserved for system use. Use slots 8+ for custom training data.

List Trainings

GET /v2/personas/:id/trainings

Parameters

Name
Type
Description

id

integer

Required ID of the persona whose trainings to list

Curl Example

curl -X GET https://api.luw.ai/v2/personas/123/trainings \
-H "Authorization: Bearer LUW_API_TOKEN"

Response Example

{
  "status": true,
  "trainings": [
    {
      "id": 456,
      "image": "https://example.com/training.jpg",
      "slot": 8,
      "info": "Modern living room design",
      "created_at": "2024-01-04T12:00:00Z"
    }
  ]
}

Get Training

GET /v2/personas/:id/trainings/:training_id

Parameters

Name
Type
Description

id

integer

Required ID of the persona

training_id

integer

Required ID of the training to retrieve

Curl Example

curl -X GET https://api.luw.ai/v2/personas/123/trainings/456 \
-H "Authorization: Bearer LUW_API_TOKEN"

Response Example

{
  "status": true,
  "training": {
    "id": 456,
    "image": "https://example.com/training.jpg",
    "slot": 8,
    "info": "Modern living room design",
    "created_at": "2024-01-04T12:00:00Z"
  }
}

Update Training

PUT /v2/personas/:id/trainings/:training_id

Parameters

Name
Type
Description

id

integer

Required ID of the persona

training_id

integer

Required ID of the training to update

image

string

Optional New URL of the training image

info

string

Optional New information about the training

slot

integer

Optional New training slot number

extras

text

Optional New additional metadata

Curl Example

curl -X PUT https://api.luw.ai/v2/personas/123/trainings/456 \
-H "Authorization: Bearer LUW_API_TOKEN" \
-d "info=Updated modern living room design" \
-d "slot=9"

Response Example

{
  "status": true
}

Delete Training

DELETE /v2/personas/:id/trainings/:training_id

Parameters

Name
Type
Description

id

integer

Required ID of the persona

training_id

integer

Required ID of the training to delete

Curl Example

curl -X DELETE https://api.luw.ai/v2/personas/123/trainings/456 \
-H "Authorization: Bearer LUW_API_TOKEN"

Response Example

{
  "status": true
}

Delete Training by Slot

DELETE /v2/personas/:id/trainings/slot/:slot

Parameters

Name
Type
Description

id

integer

Required ID of the persona

slot

integer

Curl Example

curl -X DELETE https://api.luw.ai/v2/personas/123/trainings/slot/7 \
-H "Authorization: Bearer LUW_API_TOKEN"

Response Example

{
  "status": true
}

Last updated