Skip to content

Qbusiness  >  Operations  >  chat

chat

Operation

chat async

chat(input: ChatInput, plugins: list[Plugin] | None = None) -> DuplexEventStream[ChatInputStream, ChatOutputStream, ChatOutput]

Starts or continues a streaming Amazon Q Business conversation.

Parameters:

Name Type Description Default
input ChatInput

An instance of ChatInput.

required
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None

Returns:

Type Description
DuplexEventStream[ChatInputStream, ChatOutputStream, ChatOutput]

A DuplexEventStream for bidirectional streaming.

Input

ChatInput dataclass

Dataclass for ChatInput structure.

Attributes

application_id class-attribute instance-attribute
application_id: str | None = None

The identifier of the Amazon Q Business application linked to a streaming Amazon Q Business conversation.

client_token class-attribute instance-attribute
client_token: str | None = None

A token that you provide to identify the chat input.

conversation_id class-attribute instance-attribute
conversation_id: str | None = None

The identifier of the Amazon Q Business conversation.

parent_message_id class-attribute instance-attribute
parent_message_id: str | None = None

The identifier used to associate a user message with a AI generated response.

user_groups class-attribute instance-attribute
user_groups: list[str] | None = None

The group names that a user associated with the chat input belongs to.

user_id class-attribute instance-attribute
user_id: str | None = None

The identifier of the user attached to the chat input.

Output

This operation returns a DuplexEventStream for bidirectional streaming.

Event Stream Structure

Input Event Type

ChatInputStream

Output Event Type

ChatOutputStream

Initial Response Structure

ChatOutput dataclass

Dataclass for ChatOutput structure.