put_session
async
¶
put_session(
bot_id: BotIdentifier,
bot_alias_id: BotAliasIdentifier,
locale_id: LocaleId,
session_id: SessionId,
session_state: SessionState,
*,
config_overrides: Optional[AsyncLexRuntimeV2ClientConfig] = None,
messages: Optional[Messages] = None,
request_attributes: Optional[StringMap] = None,
response_content_type: Optional[NonEmptyString] = None,
) -> AsyncGenerator[PutSessionResponse]
Creates a new session or modifies an existing session with an Amazon Lex V2 bot. Use this operation to enable your application to set the state of the bot.
Parameters:
-
bot_id(BotIdentifier) –The identifier of the bot that receives the session data.
-
bot_alias_id(BotAliasIdentifier) –The alias identifier of the bot that receives the session data.
-
locale_id(LocaleId) –The locale where the session is in use.
-
session_id(SessionId) –The identifier of the session that receives the session data.
-
messages(Optional[Messages], default:None) –A list of messages to send to the user. Messages are sent in the order that they are defined in the list.
-
session_state(SessionState) –Sets the state of the session with the user. You can use this to set the current intent, attributes, context, and dialog action. Use the dialog action to determine the next step that Amazon Lex V2 should use in the conversation with the user.
-
request_attributes(Optional[StringMap], default:None) –Request-specific information passed between Amazon Lex V2 and the client application.
The namespace
x-amz-lex:is reserved for special attributes. Don't create any request attributes with the prefixx-amz-lex:. -
response_content_type(Optional[NonEmptyString], default:None) –The message that Amazon Lex V2 returns in the response can be either text or speech depending on the value of this parameter.
-
If the value is
text/plain; charset=utf-8, Amazon Lex V2 returns text in the response.
-
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/async_lex_runtime_v2.py
301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 | |