chat
async
¶
chat(
message: ChatInputContent,
environment_arn: EnvironmentArn,
*,
config_overrides: Optional[AsyncAssuranceClientConfig] = None,
session_id: Optional[ChatSessionId] = None,
expected_sequence_number: Optional[ChatSequenceNumber] = None,
) -> ChatOutput
Starts a streaming chat turn with the AWS Assurance agent. Returns an event stream of chat events, including chunks, tool calls, and errors.
Parameters:
-
message(ChatInputContent) –The chat message to send to the AWS Assurance agent.
-
session_id(Optional[ChatSessionId], default:None) –The session to continue. Pass the
sessionIdreturned by a previousChatcall to continue that session. If you omit it, AWS Assurance starts a new session. If the session doesn't exist or has expired, the operation returnsResourceNotFoundException. If the format isn't valid, the operation returnsValidationException. -
environment_arn(EnvironmentArn) –The ARN of this governance environment.
-
expected_sequence_number(Optional[ChatSequenceNumber], default:None) –The sequence number of the last message you received. If the service detects a more recent sequence number, the request fails with
ConflictException, indicating a concurrent update.
Raises:
-
AccessDeniedException–You do not have sufficient access to perform this action. This error occurs when the request is unauthenticated, or is authenticated but lacks permission to invoke the operation.
-
ConflictException–A conflict occurred (for example, resource already exists).
-
InternalServerException–An internal server error occurred.
-
ResourceNotFoundException–The requested resource was not found.
-
ServiceQuotaExceededException–The request would exceed a service quota.
-
ThrottlingException–The request was throttled.
-
ValidationException–The request failed validation.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
Continue a chat session Sends a follow-up question to the AWS Assurance agent to review the open controls in a PCI-DSS assessment.
>>> await client.chat(message='Summarize the open controls in my PCI-DSS assessment.', session_id='a1b2c3d4-5678-90ab-cdef-EXAMPLE88888', environment_arn='arn:aws:assurance:us-east-1:111122223333:environment/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111', expected_sequence_number=2)
Source code in docs_src/capo_assurance/_services/async_assurance.py
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 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 | |