Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chat Partial Result #36

Merged
merged 10 commits into from
Oct 1, 2024
Merged

Chat Partial Result #36

merged 10 commits into from
Oct 1, 2024

Conversation

angjordn
Copy link
Contributor

@angjordn angjordn commented Sep 25, 2024

Description:

  • Add support for chat message partial results. Provides the ability to process and display incremental results when a chat message is sent by the user.

Detailed Flow

  1. sendChatPrompt message is received from Webview and handled by AmazonQChatViewActionHandler
  2. AmazonQChatViewActionHandler initiates a send via the chatCommunicationManager.sendMessageToChatServer
  3. chatCommunicationManager forwards the request to a ChatMessageProvider
  4. ChatMessageProvider defines a ChatMessage and initiates the sendChatMessageWithProgress method
    • The method creates an entry in the partialResultToken to ChatMessage mapping maintained by the ChatCommunicationManager
    • A request is sent to the LSP server containing the partialResultToken (which is the indicator for the LSP server to intermittently send progress notifications to the client)
  5. The handler for the progress notifications is defined by the AmazonQLspClientImpl.notifyProgress. Once a progress notification is retrieved by the client, the ChatMessage is retrieved utilizing the partialResultToken contained in the ProgressParams of the notification. A message is sent to the Webview to display the partial chat result.
  6. Once the final chat result is retrieved, the partialResultToken to ChatMessage mapping entry is removed and a message is sent to the Webview indicating that it is the final result.

Demo

Shorted.Partial.Result.Demo.mov

@angjordn angjordn force-pushed the partial-result branch 3 times, most recently from cc60b9e to 8e55f15 Compare October 1, 2024 16:44
@angjordn angjordn merged commit 690f6ed into main Oct 1, 2024
1 check passed
@breedloj breedloj deleted the partial-result branch November 22, 2024 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants