-
Notifications
You must be signed in to change notification settings - Fork 273
feat(amazonq): Export chat conversations #5663
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
Changes from 9 commits
d90e230
3a46078
e2c667a
f5c8d38
aed9e92
7398398
8b14510
2e2ff62
fe10a85
fc3dab7
a5e6927
570ad7d
6b9f26e
ea56082
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,19 @@ | ||
| // Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| @file:Suppress("BannedImports") | ||
| package software.aws.toolkits.jetbrains.services.amazonq.lsp.flareChat | ||
|
|
||
| import com.google.gson.Gson | ||
| import com.intellij.openapi.components.Service | ||
| import com.intellij.openapi.components.service | ||
| import com.intellij.openapi.project.Project | ||
| import org.eclipse.lsp4j.ProgressParams | ||
| import software.aws.toolkits.jetbrains.services.amazonq.lsp.AmazonQLspService | ||
| import software.aws.toolkits.jetbrains.services.amazonq.lsp.flareChat.ProgressNotificationUtils.getObject | ||
| import software.aws.toolkits.jetbrains.services.amazonq.lsp.model.aws.chat.GetSerializedChatResult | ||
| import software.aws.toolkits.jetbrains.services.amazonq.lsp.model.aws.chat.SEND_CHAT_COMMAND_PROMPT | ||
| import java.util.UUID | ||
| import java.util.concurrent.CompletableFuture | ||
| import java.util.concurrent.ConcurrentHashMap | ||
|
|
||
| @Service(Service.Level.PROJECT) | ||
|
|
@@ -56,6 +59,11 @@ class ChatCommunicationManager { | |
| companion object { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this need to be in companion object? I moved my openTab map into ChatCommunicationManager but just made it part of the class. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. -- might be going away anyways. I'll move mine to companion so we are aligned |
||
| fun getInstance(project: Project) = project.service<ChatCommunicationManager>() | ||
|
|
||
| val pendingSerializedChatRequests = ConcurrentHashMap<String, CompletableFuture<GetSerializedChatResult>>() | ||
| fun completeSerializedChatResponse(requestId: String, content: String) { | ||
| pendingSerializedChatRequests.remove(requestId)?.complete(GetSerializedChatResult((content))) | ||
| } | ||
|
|
||
| fun convertToJsonToSendToChat(command: String, tabId: String, params: String, isPartialResult: Boolean): String = | ||
| """ | ||
| { | ||
|
|
@@ -65,5 +73,13 @@ class ChatCommunicationManager { | |
| "isPartialResult": $isPartialResult | ||
| } | ||
| """.trimIndent() | ||
|
|
||
| inline fun <reified T> convertNotificationToJsonForChat(command: String, params: T? = null) = | ||
| """ | ||
| { | ||
| "command":"$command", | ||
| "params": ${if (params != null) Gson().toJson(params) else "{}"} | ||
| } | ||
| """.trimIndent() | ||
| } | ||
| } | ||
Check warning
Code scanning / QDJVMC
Unused import directive Warning