public void handlePartialResultProgressNotification()

in plugin/src/software/aws/toolkits/eclipse/amazonq/chat/ChatCommunicationManager.java [308:340]


    public void handlePartialResultProgressNotification(final ProgressParams params) {
        String token = ProgressNotificationUtils.getToken(params);
        String tabId = getPartialChatMessage(token);

        if (tabId == null || tabId.isEmpty()) {
            return;
        }

        // Check to ensure Object is sent in params
        if (params.getValue().isLeft() || Objects.isNull(params.getValue().getRight())) {
            throw new AmazonQPluginException(
                    "Error handling partial result notification: expected value of type Object");
        }

        String encryptedPartialChatResult = ProgressNotificationUtils.getObject(params, String.class);
        String serializedData = lspEncryptionManager.decrypt(encryptedPartialChatResult);
        ChatResult partialChatResult = jsonHandler.deserialize(serializedData, ChatResult.class);

        // Check to ensure the body has content in order to keep displaying the spinner
        // while loading
        if (partialChatResult.body() == null || partialChatResult.body().length() == 0) {
            return;
        }

        String command = (inlineChatTabId.equals(tabId))
            ? ChatUIInboundCommandName.InlineChatPrompt.getValue()
            : ChatUIInboundCommandName.ChatPrompt.getValue();

        ChatUIInboundCommand chatUIInboundCommand = new ChatUIInboundCommand(
                command, tabId, partialChatResult, true);

        sendMessageToChatUI(chatUIInboundCommand);
    }