chat_sync
¶
chat_sync(
application_id: ApplicationId,
*,
config_overrides: Optional[QBusinessClientConfig] = None,
user_id: Optional[UserId] = None,
user_groups: Optional[UserGroups] = None,
user_message: Optional[UserMessage] = None,
attachments: Optional[AttachmentsInput] = None,
action_execution: Optional[ActionExecution] = None,
auth_challenge_response: Optional[AuthChallengeResponse] = None,
conversation_id: Optional[ConversationId] = None,
parent_message_id: Optional[MessageId] = None,
attribute_filter: Optional[AttributeFilter] = None,
chat_mode: Optional[ChatMode] = None,
chat_mode_configuration: Optional[ChatModeConfiguration] = None,
client_token: Optional[ClientToken] = None,
) -> ChatSyncOutput
Starts or continues a non-streaming Amazon Q Business conversation.
Parameters:
-
application_id(ApplicationId) –The identifier of the Amazon Q Business application linked to the 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.
-
user_message(Optional[UserMessage], default:None) –A end user message in a conversation.
-
attachments(Optional[AttachmentsInput], default:None) –A list of files uploaded directly during chat. You can upload a maximum of 5 files of upto 10 MB each.
-
action_execution(Optional[ActionExecution], default:None) –A request from an end user to perform an Amazon Q Business plugin action.
-
auth_challenge_response(Optional[AuthChallengeResponse], default:None) –An authentication verification event response by a third party authentication server to Amazon Q Business.
-
conversation_id(Optional[ConversationId], default:None) –The identifier of the Amazon Q Business conversation.
-
parent_message_id(Optional[MessageId], default:None) –The identifier of the previous system message in a conversation.
-
attribute_filter(Optional[AttributeFilter], default:None) –Enables filtering of Amazon Q Business web experience responses based on document attributes or metadata fields.
-
chat_mode(Optional[ChatMode], default:None) –The
chatModeparameter 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 has been enabled. In that case, Amazon Q will generate a response from the LLM knowledge -
CREATOR_MODE- By selecting this mode, you can choose to generate responses only from the LLM knowledge. You can also attach files and have Amazon Q generate a response based on the data in those files. If the attached files do not contain an answer for the query, Amazon Q will automatically fall back to generating a response from the LLM knowledge. -
PLUGIN_MODE- By selecting this mode, users can choose to use plugins in chat to get their responses.
If none of the modes are selected, Amazon Q will only respond using the information from the attached files.
For more information, see Admin controls and guardrails, Plugins, and Response sources.
-
-
chat_mode_configuration(Optional[ChatModeConfiguration], default:None) –The chat mode configuration for an Amazon Q Business application.
-
client_token(Optional[ClientToken], default:None) –A token that you provide to identify a chat request.
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/q_business.py
800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 | |