import boto3


class IntelligentAssistantService:
    def __init__(self, assistant_name):
        self.client = boto3.client('lex-runtime')
        self.assistant_name = assistant_name

    def send_user_text(self, user_id, input_text):
        response = self.client.post_text(
            botName = self.assistant_name,
            botAlias = 'Production',
            userId = user_id,
            inputText = input_text
        )

        return response['message']

{'avg_line_length': 26.11111111111111, 'max_line_length': 50, 'alphanum_fraction': 0.6297872340425532, 'licenses': ['MIT'], 'repository_name': 'PacktPublishing/Hands-On-Artificial-Intelligence-on-Amazon-Web-Services', 'path': 'Chapter06/Capabilities/chalicelib/intelligent_assistant_service.py', 'size': 470, 'lang': 'Python'}