Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ class TelemetryHelper(private val context: AmazonQAppInitContext, private val se
AmazonqTelemetry.interactWithMessage(
cwsprChatConversationId = getConversationId(message.tabId).orEmpty(),
cwsprChatMessageId = message.messageId,
cwsprChatUserIntent = message.userIntent?.let { getTelemetryUserIntent(it) },
cwsprChatInteractionType = CwsprChatInteractionType.CopySnippet,
cwsprChatAcceptedCharactersLength = message.code.length.toLong(),
cwsprChatInteractionTarget = message.insertionTargetType,
Expand All @@ -233,6 +234,7 @@ class TelemetryHelper(private val context: AmazonQAppInitContext, private val se
AmazonqTelemetry.interactWithMessage(
cwsprChatConversationId = getConversationId(message.tabId).orEmpty(),
cwsprChatMessageId = message.messageId,
cwsprChatUserIntent = message.userIntent?.let { getTelemetryUserIntent(it) },
cwsprChatInteractionType = CwsprChatInteractionType.InsertAtCursor,
cwsprChatAcceptedCharactersLength = message.code.length.toLong(),
cwsprChatAcceptedNumberOfLines = message.code.lines().size.toLong(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import com.fasterxml.jackson.databind.JsonSerializer
import com.fasterxml.jackson.databind.SerializerProvider
import com.fasterxml.jackson.databind.annotation.JsonDeserialize
import com.fasterxml.jackson.databind.annotation.JsonSerialize
import software.amazon.awssdk.services.codewhispererstreaming.model.UserIntent
import software.aws.toolkits.jetbrains.services.amazonq.auth.AuthFollowUpType
import software.aws.toolkits.jetbrains.services.amazonq.messages.AmazonQMessage
import software.aws.toolkits.jetbrains.services.amazonq.onboarding.OnboardingPageInteractionType
Expand Down Expand Up @@ -65,6 +66,7 @@ sealed interface IncomingCwcMessage : CwcMessage {
val command: String?,
@JsonProperty("tabID") val tabId: String,
val messageId: String,
val userIntent: UserIntent?,
val code: String,
val insertionTargetType: String?,
val eventId: String?,
Expand All @@ -75,6 +77,7 @@ sealed interface IncomingCwcMessage : CwcMessage {
data class InsertCodeAtCursorPosition(
@JsonProperty("tabID") val tabId: String,
val messageId: String,
val userIntent: UserIntent?,
val code: String,
val insertionTargetType: String?,
val codeReference: List<CodeReference>?,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ class TelemetryHelperTest {
private const val mockRegion = "us-east-1"
private const val tabId = "tabId"
private const val messageId = "messageId"
private val userIntent = UserIntent.SHOW_EXAMPLES
private const val conversationId = "conversationId"
private const val triggerId = "triggerId"
private const val customizationArn = "customizationArn"
Expand Down Expand Up @@ -414,6 +415,7 @@ class TelemetryHelperTest {
"command",
tabId,
messageId,
userIntent,
"println()",
"insertionTargetType",
"eventId",
Expand Down Expand Up @@ -476,6 +478,7 @@ class TelemetryHelperTest {
IncomingCwcMessage.InsertCodeAtCursorPosition(
tabId,
messageId,
userIntent,
code,
inserTionTargetType,
emptyList(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,10 @@
{
"type": "cwsprChatMessageId"
},
{
"type": "cwsprChatUserIntent",
"required": false
},
Comment on lines +656 to +659
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be pushing this into the common definitions

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, this was mentioned in my VSCode plugin change as well. Going to get out that change

{
"type": "cwsprChatInteractionType"
},
Expand Down
Loading