recognize_text
¶
recognize_text(
bot_id: BotIdentifier,
bot_alias_id: BotAliasIdentifier,
locale_id: LocaleId,
session_id: SessionId,
text: Text,
*,
config_overrides: Optional[LexRuntimeV2ClientConfig] = None,
session_state: Optional[SessionState] = None,
request_attributes: Optional[StringMap] = None,
) -> RecognizeTextResponse
Sends user input to Amazon Lex V2. Client applications use this API to send requests to Amazon Lex V2 at runtime. Amazon Lex V2 then interprets the user input using the machine learning model that it build for the bot.
In response, Amazon Lex V2 returns the next message to convey to the user and an optional response card to display.
If the optional post-fulfillment response is specified, the messages are returned as follows. For more information, see PostFulfillmentStatusSpecification.
-
Success message - Returned if the Lambda function completes successfully and the intent state is fulfilled or ready fulfillment if the message is present.
-
Failed message - The failed message is returned if the Lambda function throws an exception or if the Lambda function returns a failed intent state without a message.
-
Timeout message - If you don't configure a timeout message and a timeout, and the Lambda function doesn't return within 30 seconds, the timeout message is returned. If you configure a timeout, the timeout message is returned when the period times out.
For more information, see Completion message.
Parameters:
-
bot_id(BotIdentifier) –The identifier of the bot that processes the request.
-
bot_alias_id(BotAliasIdentifier) –The alias identifier in use for the bot that processes the request.
-
locale_id(LocaleId) –The locale where the session is in use.
-
session_id(SessionId) –The identifier of the user session that is having the conversation.
-
text(Text) –The text that the user entered. Amazon Lex V2 interprets this text.
-
session_state(Optional[SessionState], default:None) –The current state of the dialog between the user and the bot.
-
request_attributes(Optional[StringMap], default:None) –Request-specific information passed between the client application and Amazon Lex V2
The namespace
x-amz-lex:is reserved for special attributes. Don't create any request attributes with the prefixx-amz-lex:.
Raises:
-
AccessDeniedException– -
BadGatewayException– -
ConflictException– -
DependencyFailedException– -
InternalServerException– -
ResourceNotFoundException– -
ThrottlingException– -
ValidationException– -
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_lex_runtime_v2/_services/lex_runtime_v2.py
403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 | |