StartBotResourceGeneration - Amazon Lex API Reference

StartBotResourceGeneration

Starts a request for the descriptive bot builder to generate a bot locale configuration based on the prompt you provide it. After you make this call, use the DescribeBotResourceGeneration operation to check on the status of the generation and for the generatedBotLocaleUrl when the generation is complete. Use that value to retrieve the Amazon S3 object containing the bot locale configuration. You can then modify and import this configuration.

Request Syntax

PUT /bots/botId/botversions/botVersion/botlocales/localeId/startgeneration HTTP/1.1 Content-type: application/json { "generationInputPrompt": "string" }

URI Request Parameters

The request uses the following URI parameters.

botId

The unique identifier of the bot for which to generate intents and slot types.

Length Constraints: Fixed length of 10.

Pattern: ^[0-9a-zA-Z]+$

Required: Yes

botVersion

The version of the bot for which to generate intents and slot types.

Length Constraints: Minimum length of 1. Maximum length of 5.

Pattern: ^(DRAFT|[0-9]+)$

Required: Yes

localeId

The locale of the bot for which to generate intents and slot types.

Required: Yes

Request Body

The request accepts the following data in JSON format.

generationInputPrompt

The prompt to generate intents and slot types for the bot locale. Your description should be both detailed and precise to help generate appropriate and sufficient intents for your bot. Include a list of actions to improve the intent creation process.

Type: String

Length Constraints: Minimum length of 100. Maximum length of 2000.

Required: Yes

Response Syntax

HTTP/1.1 202 Content-type: application/json { "botId": "string", "botVersion": "string", "creationDateTime": number, "generationId": "string", "generationInputPrompt": "string", "generationStatus": "string", "localeId": "string" }

Response Elements

If the action is successful, the service sends back an HTTP 202 response.

The following data is returned in JSON format by the service.

botId

The unique identifier of the bot for which the generation request was made.

Type: String

Length Constraints: Fixed length of 10.

Pattern: ^[0-9a-zA-Z]+$

botVersion

The version of the bot for which the generation request was made.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 5.

Pattern: ^(DRAFT|[0-9]+)$

creationDateTime

The date and time at which the generation request was made.

Type: Timestamp

generationId

The unique identifier of the generation request.

Type: String

Length Constraints: Fixed length of 10.

Pattern: ^[0-9a-zA-Z]+$

generationInputPrompt

The prompt that was used generate intents and slot types for the bot locale.

Type: String

Length Constraints: Minimum length of 100. Maximum length of 2000.

generationStatus

The status of the generation request.

Type: String

Valid Values: Failed | Complete | InProgress

localeId

The locale of the bot for which the generation request was made.

Type: String

Errors

For information about the errors that are common to all actions, see Common Errors.

ConflictException

The action that you tried to perform couldn't be completed because the resource is in a conflicting state. For example, deleting a bot that is in the CREATING state. Try your request again.

HTTP Status Code: 409

InternalServerException

The service encountered an unexpected condition. Try your request again.

HTTP Status Code: 500

PreconditionFailedException

Your request couldn't be completed because one or more request fields aren't valid. Check the fields in your request and try again.

HTTP Status Code: 412

ServiceQuotaExceededException

You have reached a quota for your bot.

HTTP Status Code: 402

ThrottlingException

Your request rate is too high. Reduce the frequency of requests.

HTTP Status Code: 429

ValidationException

One of the input parameters in your request isn't valid. Check the parameters and try your request again.

HTTP Status Code: 400

Examples

Example request

This example illustrates one usage of StartBotResourceGeneration.

PUT https://models-v2-lex.us-east-1.amazonaws.com/bots/BOT1234567/botversions/DRAFT/botlocales/en_GB/startgeneration Payload: { "generationInputPrompt": "We want a bot to help customers order food (using item id, quantity, size), check order status, and cancel an order. Use Order ID for indexing order." }

Example response

This example illustrates one usage of StartBotResourceGeneration.

{ "botId": "BOT1234567", "botVersion": "DRAFT", "creationDateTime": 1.699570064977E9, "generationId": "GEN1234567", "generationInputPrompt": null, "generationStatus": "InProgress", "localeId": "en_GB" }

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: