@@ -38,6 +38,7 @@ import {
38
38
import type { AuthenticatedUser } from '@kbn/security-plugin/common' ;
39
39
import { findLastIndex } from 'lodash' ;
40
40
import React , { useCallback , useEffect , useRef , useState } from 'react' ;
41
+ import { ChatFeedback } from '@kbn/observability-ai-assistant-plugin/public/analytics/schemas/chat_feedback' ;
41
42
import type { UseKnowledgeBaseResult } from '../hooks/use_knowledge_base' ;
42
43
import { ASSISTANT_SETUP_TITLE , EMPTY_CONVERSATION_TITLE , UPGRADE_LICENSE_TITLE } from '../i18n' ;
43
44
import { useAIAssistantChatService } from '../hooks/use_ai_assistant_chat_service' ;
@@ -220,13 +221,24 @@ export function ChatBody({
220
221
if ( conversation . value ?. conversation && 'user' in conversation . value ) {
221
222
const {
222
223
messages : _removedMessages , // Exclude messages
223
- conversation : { title : _removedTitle , ...conversationRest } , // Exclude title
224
- ...rest
224
+ systemMessage : _removedSystemMessage , // Exclude systemMessage
225
+ conversation : { title : _removedTitle , id, last_updated : lastUpdated } , // Exclude title
226
+ user,
227
+ labels,
228
+ numeric_labels : numericLabels ,
229
+ namespace,
230
+ public : isPublic ,
231
+ '@timestamp' : timestamp ,
225
232
} = conversation . value ;
226
233
227
- const conversationWithoutMessagesAndTitle = {
228
- ...rest ,
229
- conversation : conversationRest ,
234
+ const conversationWithoutMessagesAndTitle : ChatFeedback [ 'conversation' ] = {
235
+ '@timestamp' : timestamp ,
236
+ user,
237
+ labels,
238
+ numeric_labels : numericLabels ,
239
+ namespace,
240
+ public : isPublic ,
241
+ conversation : { id, last_updated : lastUpdated } ,
230
242
} ;
231
243
232
244
chatService . sendAnalyticsEvent ( {
0 commit comments