chat
async
¶
chat(
application_id: ApplicationId,
*,
config_overrides: Optional[AsyncQBusinessClientConfig] = None,
user_id: Optional[UserId] = None,
user_groups: Optional[UserGroups] = None,
conversation_id: Optional[ConversationId] = None,
parent_message_id: Optional[MessageId] = None,
client_token: Optional[ClientToken] = None,
input_stream: Optional[AsyncIterator[_ChatInputStream] | _ChatInputStream] = None,
) -> AsyncGenerator[ChatOutput]
Starts or continues a streaming Amazon Q Business conversation.
Parameters:
-
application_id(ApplicationId) –The identifier of the Amazon Q Business application linked to a streaming Amazon Q Business conversation.
-
user_id(Optional[UserId], default:None) –The identifier of the user attached to the chat input.
-
user_groups(Optional[UserGroups], default:None) –The group names that a user associated with the chat input belongs to.
-
conversation_id(Optional[ConversationId], default:None) –The identifier of the Amazon Q Business conversation.
-
parent_message_id(Optional[MessageId], default:None) –The identifier used to associate a user message with a AI generated response.
-
client_token(Optional[ClientToken], default:None) –A token that you provide to identify the chat input.
-
input_stream(Optional[AsyncIterator[_ChatInputStream] | _ChatInputStream], default:None) –The streaming input for the
ChatAPI.
Raises:
-
AccessDeniedException–You don't have access to perform this action. Make sure you have the required permission policies and user accounts and try again.
-
ConflictException–You are trying to perform an action that conflicts with the current status of your resource. Fix any inconsistencies with your resources and try again.
-
ExternalResourceException–An external resource that you configured with your application is returning errors and preventing this operation from succeeding. Fix those errors and try again.
-
InternalServerException–An issue occurred with the internal server used for your Amazon Q Business service. Wait some minutes and try again, or contact Support for help.
-
LicenseNotFoundException–You don't have permissions to perform the action because your license is inactive. Ask your admin to activate your license and try again after your licence is active.
-
ResourceNotFoundException–The application or plugin resource you want to use doesn’t exist. Make sure you have provided the correct resource and try again.
-
ThrottlingException–The request was denied due to throttling. Reduce the number of requests and try again.
-
ValidationException–The input doesn't meet the constraints set by the Amazon Q Business service. Provide the correct input and try again.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_qbusiness/_services/async_q_business.py
709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 | |