Skip to content

LexRuntimeV2Client.start_conversation

rboto-lex-runtime-v2==0.4.0 · Service index · Types

Model summary (excerpt): Starts an HTTP/2 bidirectional event stream that enables you to send audio, text, or DTMF input in real time. After your application starts a conversation, users send input to Amazon Lex V2 as a stream of events. Amazon Lex V2 processes the incoming events and responds with streaming text or audio events. Audio input must be in the following format: audio/lpcm sample-rate=8000...

Install and imports

python -m pip install "rboto[lex-runtime-v2]==0.4.0"
from rboto import LexRuntimeV2Client
from collections.abc import AsyncIterator
from rboto_lex_runtime_v2.types import (
    ConversationMode,
    StartConversationOutput,
    StartConversationRequestEventStream,
)

Signature

async def start_conversation(
    *,
    bot_id: str,
    bot_alias_id: str,
    locale_id: str,
    session_id: str,
    request_event_stream: AsyncIterator[StartConversationRequestEventStream],
    conversation_mode: ConversationMode | None = None,
) -> StartConversationOutput: ...

Arguments without defaults are required. None omits an optional request argument. Static types do not validate resource existence, permissions, lengths, ranges, or conditional service requirements.

Arguments

Argument Required Model notes (excerpt)
bot_id Yes The identifier of the bot to process the request.
bot_alias_id Yes The alias identifier in use for the bot that processes the request.
locale_id Yes The locale where the session is in use.
session_id Yes The identifier of the user session that is having the conversation.
request_event_stream Yes Represents the stream of events to Amazon Lex V2 from your application. The events are encoded as HTTP/2 data frames.
conversation_mode No The conversation type that you are using the Amazon Lex V2. If the conversation mode is AUDIO you can send both audio and DTMF information. If the mode is TEXT you can only send text.

Output

StartConversationOutput.

Typed response mapping, accessed as response["field"].

Field Type Presence References
response_event_stream AsyncIterator[StartConversationResponseEventStream] Always present StartConversationResponseEventStream

| None means a value can be absent. Output mappings include every declared key; optional input keys may be omitted. Unknown output enum/union variants are not automatically valid inputs.

ConversationMode, StartConversationOutput, StartConversationRequestEventStream

Follow these links for nested inputs and outputs; recursive types link back to the same type page.

Pagination and streaming

No generated paginator for this operation.

Output streams: StartConversationOutput.

Consume with async for. Do not reuse a consumed stream.

Input event streams accept the declared AsyncIterator of typed events.

Errors

Import from rboto_lex_runtime_v2.exceptions:

AccessDeniedError, BadGatewayError, ConflictError, DependencyFailedError, InternalServerError, ResourceNotFoundError, ThrottlingError, ValidationError.

Stream decoding may also raise the linked modeled event errors.

Other service failures use the service base error; credential, transport and timeout failures use shared errors.

Service guide · Pinned model