train() waits until training finishes before returning.
Parameters
Parameter values aren’t range-checked. An out-of-range value such as
nLists: 0 is accepted and training is skipped as described in Requirements; a negative nLists makes train() resolve with status: 'error'.
Requirements
Training only runs when all three hold:- The index has at least 10,000 vectors.
- It has at least twice as many vectors as
nLists. - The vector dimension is a multiple of 32, such as 384, 768, or 1536.
Returns
Promise<TrainResponse> with status and message. If the index is already training, train() waits for that run to finish, then trains again.
Exceptions
CyborgDBAuthenticationError
CyborgDBAuthenticationError
The client isn’t using the root key, or the
indexKey is invalid (HTTP 401/403). Training requires the root key.CyborgDBNotFoundError
CyborgDBNotFoundError
The index doesn’t exist (HTTP
404).CyborgDBServiceError
CyborgDBServiceError
The service returns
5xx. A failed training run doesn’t throw; see Requirements.