This package contains the Botpress Standalone NLU server.
Available Routes /** * Gets the current version of the NLU engine being used. Usefull to test if your installation is working. * @returns info: version, health and supported languages. */ GET http://HOST:PORT/v1/info /** * Starts a training. * @header x-app-id Application ID to make sure there's no collision between models of different applications. * @body_parameter language Language to use for training. * @body_parameter intents Intents definitions. * @body_parameter contexts All available contexts. * @body_parameter entities Entities definitions. * @body_parameter seed Number to seed random number generators used during training (beta feature). ** Optionnal ** * @returns modelId A model id for futur API calls */ POST http://HOST:PORT/v1/train /** * Gets a training progress status. * @header x-app-id Application ID to make sure there's no collision between models of different applications. * @path_parameter modelId The model id for which you seek the training progress. * @returns session A training state data structure with information on desired model. */ GET http://HOST:PORT/v1/train/:modelId /** * List all models for a given app Id and secret. * @header x-app-id Application ID to make sure there's no collision between models of different applications. * @path_parameter modelId The model id for which you seek the training progress. * @returns models Array of strings model ids available for prediction. */ GET http://HOST:PORT/v1/models/:modelId /** * Cancels a training. * @header x-app-id Application ID to make sure there's no collision between models of different applications. * @path_parameter modelId The model id for which you want to cancel the training. * @returns models Array of strings model ids that where pruned. */ POST http://HOST:PORT/v1/models/prune /** * Cancels a training. * @header x-app-id Application ID to make sure there's no collision between models of different applications. * @path_parameter modelId The model id for which you want to cancel the training. */ POST http://HOST:PORT/v1/train/:modelId/cancel /** * Perform prediction for a text input. * @header x-app-id Application ID to make sure there's no collision between models of different applications. * @path_parameter modelId The model id you want to use for prediction. * @body_parameter utterances Array of text for which you want a prediction. * @returns predictions Array of predictions; Each prediction is a data structure reprensenting the understanding of the text. */ POST http://HOST:PORT/v1/predict/:modelId /** * Perform prediction for a text input. * @header x-app-id Application ID to make sure there's no collision between models of different applications. * @path_parameter modelId The model id you want to use for prediction. * @body_parameter utterances Array of text for which you want a prediction. * @body_parameter models Array of strings model ids you want to use to detect language. ** Optionnal ** * @returns detectedLanguages Array of string language codes. */ POST http://HOST:PORT/v1/detect-lang For more detailed information on typings, see https://github.com/botpress/nlu/blob/master/packages/nlu-client/src/typings/sdk.d.ts. For a complete example on training input, see https://github.com/botpress/nlu/blob/master/packages/nlu-server/examples/train-example.json. If you plan on querying from a nodejs environment, see https://www.npmjs.com/package/@botpress/nlu-client.
To display this documentation, launch the nlu server with argument --doc.
The NLU Server does not enforce authentication in any way. This means it is completely exposed to many attacks. If you plan on using the nlu-server in your local Botpress setup, makes sure it is not publicly exposed. If you plan on exposing the NLU server, make sure it his hidden behind a reverse proxy which ensures a proper authentication. This reverse proxy should:
- Ensure each appId (
X-App-Idheader) is unique. - Ensure a user with appId
user1can't call the nlu server with headerX-App-Idset to anything other thanuser1. - Ensure only calls with a registered appId can call the nlu server except maybe for the
GET /inforoute.
The NLU Server's only purpose is to do NLU.
This software is protected by the same license as the main Botpress repository. You can find the license file here.