QBusinessClient.chat_sync
rboto-qbusiness==0.4.0 · Service index · Types
Model summary (excerpt): Starts or continues a non-streaming Amazon Q Business conversation.
Install and imports
from rboto import QBusinessClient
from collections.abc import Sequence
from rboto_qbusiness.types import (
ActionExecution,
AttachmentInput,
AttributeFilter,
AuthChallengeResponse,
ChatMode,
ChatModeConfiguration,
ChatSyncOutput,
)
Signature
async def chat_sync(
*,
application_id: str,
user_id: str | None = None,
user_groups: Sequence[str] | None = None,
user_message: str | None = None,
attachments: Sequence[AttachmentInput] | None = None,
action_execution: ActionExecution | None = None,
auth_challenge_response: AuthChallengeResponse | None = None,
conversation_id: str | None = None,
parent_message_id: str | None = None,
attribute_filter: AttributeFilter | None = None,
chat_mode: ChatMode | None = None,
chat_mode_configuration: ChatModeConfiguration | None = None,
client_token: str | None = None,
) -> ChatSyncOutput: ...
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) |
|---|---|---|
application_id |
Yes | The identifier of the Amazon Q Business application linked to the Amazon Q Business conversation. |
user_id |
No | The identifier of the user attached to the chat input. |
user_groups |
No | The group names that a user associated with the chat input belongs to. |
user_message |
No | A end user message in a conversation. |
attachments |
No | A list of files uploaded directly during chat. You can upload a maximum of 5 files of upto 10 MB each. |
action_execution |
No | A request from an end user to perform an Amazon Q Business plugin action. |
auth_challenge_response |
No | An authentication verification event response by a third party authentication server to Amazon Q Business. |
conversation_id |
No | The identifier of the Amazon Q Business conversation. |
parent_message_id |
No | The identifier of the previous system message in a conversation. |
attribute_filter |
No | Enables filtering of Amazon Q Business web experience responses based on document attributes or metadata fields. |
chat_mode |
No | The chatMode parameter determines the chat modes available to Amazon Q Business users: RETRIEVAL_MODE - If you choose this mode, Amazon Q generates responses solely from the data sources connected and indexed by the application. If an answer is not found in the data sources or there are no data sources available, Amazon Q will respond with a " No Answer Found " message, unless LLM knowledge... |
chat_mode_configuration |
No | The chat mode configuration for an Amazon Q Business application. |
client_token |
No | A token that you provide to identify a chat request. |
Output
ChatSyncOutput.
Read-only native attributes, accessed as response.field. Collection getters materialize Python values; to_dict() recursively materializes a mapping. Streams are consumed once.
| Field | Type | Presence | References |
|---|---|---|---|
conversation_id |
str | None |
Always present | — |
system_message |
str | None |
Always present | — |
system_message_id |
str | None |
Always present | — |
user_message_id |
str | None |
Always present | — |
action_review |
ActionReviewOutput | None |
Always present | ActionReviewOutput |
auth_challenge_request |
AuthChallengeRequestOutput | None |
Always present | AuthChallengeRequestOutput |
source_attributions |
list[SourceAttributionOutput | None] | None |
Always present | SourceAttributionOutput |
failed_attachments |
list[AttachmentValueValueOutput] | None |
Always present | AttachmentValueValueOutput |
| 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.
Related types
ActionExecution, AttachmentInput, AttributeFilter, AuthChallengeResponse, ChatMode, ChatModeConfiguration, ChatSyncOutput
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.
No output stream.
Errors
Import from rboto_qbusiness.exceptions:
AccessDeniedError, ConflictError, ExternalResourceError, InternalServerError, LicenseNotFoundError, ResourceNotFoundError, ThrottlingError, ValidationError.
Other service failures use the service base error; credential, transport and timeout failures use shared errors.
Example
Complete, type-checked service example. Replace its placeholders and configure credentials before running it.
import asyncio
from rboto import QBusinessClient
async def main() -> None:
client = QBusinessClient(region="us-east-1")
response = await client.chat_sync(
application_id="YOUR_APPLICATION_ID",
user_id="YOUR_USER_ID",
user_message="Where is our onboarding guide?",
)
print(response.system_message)
if __name__ == "__main__":
asyncio.run(main())