Skip to content

Commit a5a93f3

Browse files
[Security Solution][AI Assistant] Revert conversation mappings changes (#233428)
## Summary Epic: elastic/security-team#12768 Meta: elastic/security-team#13657 RFC: [internal link](https://docs.google.com/document/d/13jAJ5Q3_At_zAuwKjvpYehnM5uzKJSwZIZ1aJJNAf5k) This PR reverts conversation mappings changes introduced in #232288. Since we decided to put on hold the Using Past Conversation as Context feature, we decided to remove added summary field backed by the `semantic_text` field to avoid potential issues that users mights have when updating a conversation while the inference endpoint is not available. **Changes**: * Removed mapping fields: `semantic_content` and `summarized_message_ids` * As part of these changes, the `summary` field was hidden on the API level and conversations response object won't have it anymore --------- Co-authored-by: kibanamachine <[email protected]>
1 parent 6706d66 commit a5a93f3

File tree

16 files changed

+11
-314
lines changed

16 files changed

+11
-314
lines changed

oas_docs/output/kibana.serverless.yaml

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -61670,8 +61670,6 @@ components:
6167061670
type: string
6167161671
replacements:
6167261672
$ref: '#/components/schemas/Security_AI_Assistant_API_Replacements'
61673-
summary:
61674-
$ref: '#/components/schemas/Security_AI_Assistant_API_ConversationSummary'
6167561673
timestamp:
6167661674
$ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyTimestamp'
6167761675
title:
@@ -61694,29 +61692,6 @@ components:
6169461692
- users
6169561693
- namespace
6169661694
- category
61697-
Security_AI_Assistant_API_ConversationSummary:
61698-
allOf:
61699-
- $ref: '#/components/schemas/Security_AI_Assistant_API_ConversationSummaryBase'
61700-
- type: object
61701-
properties:
61702-
timestamp:
61703-
$ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyTimestamp'
61704-
description: The timestamp summary was updated.
61705-
example: '2025-04-30T16:00:00Z'
61706-
required:
61707-
- timestamp
61708-
Security_AI_Assistant_API_ConversationSummaryBase:
61709-
type: object
61710-
properties:
61711-
semanticContent:
61712-
description: Summary text of the conversation over time.
61713-
example: This conversation covered how to configure the Security AI Assistant.
61714-
type: string
61715-
summarizedMessageIds:
61716-
description: The list of summarized messages.
61717-
items:
61718-
$ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString'
61719-
type: array
6172061695
Security_AI_Assistant_API_ConversationUpdateProps:
6172161696
type: object
6172261697
properties:
@@ -61739,8 +61714,6 @@ components:
6173961714
type: array
6174061715
replacements:
6174161716
$ref: '#/components/schemas/Security_AI_Assistant_API_Replacements'
61742-
summary:
61743-
$ref: '#/components/schemas/Security_AI_Assistant_API_ConversationSummaryBase'
6174461717
title:
6174561718
description: The conversation title.
6174661719
example: Updated Security AI Assistant Setup

oas_docs/output/kibana.yaml

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -74225,8 +74225,6 @@ components:
7422574225
type: string
7422674226
replacements:
7422774227
$ref: '#/components/schemas/Security_AI_Assistant_API_Replacements'
74228-
summary:
74229-
$ref: '#/components/schemas/Security_AI_Assistant_API_ConversationSummary'
7423074228
timestamp:
7423174229
$ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyTimestamp'
7423274230
title:
@@ -74249,29 +74247,6 @@ components:
7424974247
- users
7425074248
- namespace
7425174249
- category
74252-
Security_AI_Assistant_API_ConversationSummary:
74253-
allOf:
74254-
- $ref: '#/components/schemas/Security_AI_Assistant_API_ConversationSummaryBase'
74255-
- type: object
74256-
properties:
74257-
timestamp:
74258-
$ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyTimestamp'
74259-
description: The timestamp summary was updated.
74260-
example: '2025-04-30T16:00:00Z'
74261-
required:
74262-
- timestamp
74263-
Security_AI_Assistant_API_ConversationSummaryBase:
74264-
type: object
74265-
properties:
74266-
semanticContent:
74267-
description: Summary text of the conversation over time.
74268-
example: This conversation covered how to configure the Security AI Assistant.
74269-
type: string
74270-
summarizedMessageIds:
74271-
description: The list of summarized messages.
74272-
items:
74273-
$ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString'
74274-
type: array
7427574250
Security_AI_Assistant_API_ConversationUpdateProps:
7427674251
type: object
7427774252
properties:
@@ -74294,8 +74269,6 @@ components:
7429474269
type: array
7429574270
replacements:
7429674271
$ref: '#/components/schemas/Security_AI_Assistant_API_Replacements'
74297-
summary:
74298-
$ref: '#/components/schemas/Security_AI_Assistant_API_ConversationSummaryBase'
7429974272
title:
7430074273
description: The conversation title.
7430174274
example: Updated Security AI Assistant Setup

x-pack/platform/packages/shared/kbn-elastic-assistant-common/docs/openapi/ess/elastic_assistant_api_2023_10_31.bundled.schema.yaml

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2032,8 +2032,6 @@ components:
20322032
type: string
20332033
replacements:
20342034
$ref: '#/components/schemas/Replacements'
2035-
summary:
2036-
$ref: '#/components/schemas/ConversationSummary'
20372035
timestamp:
20382036
$ref: '#/components/schemas/NonEmptyTimestamp'
20392037
title:
@@ -2056,31 +2054,6 @@ components:
20562054
- users
20572055
- namespace
20582056
- category
2059-
ConversationSummary:
2060-
allOf:
2061-
- $ref: '#/components/schemas/ConversationSummaryBase'
2062-
- type: object
2063-
properties:
2064-
timestamp:
2065-
$ref: '#/components/schemas/NonEmptyTimestamp'
2066-
description: The timestamp summary was updated.
2067-
example: '2025-04-30T16:00:00Z'
2068-
required:
2069-
- timestamp
2070-
ConversationSummaryBase:
2071-
type: object
2072-
properties:
2073-
semanticContent:
2074-
description: Summary text of the conversation over time.
2075-
example: >-
2076-
This conversation covered how to configure the Security AI
2077-
Assistant.
2078-
type: string
2079-
summarizedMessageIds:
2080-
description: The list of summarized messages.
2081-
items:
2082-
$ref: '#/components/schemas/NonEmptyString'
2083-
type: array
20842057
ConversationUpdateProps:
20852058
type: object
20862059
properties:
@@ -2103,8 +2076,6 @@ components:
21032076
type: array
21042077
replacements:
21052078
$ref: '#/components/schemas/Replacements'
2106-
summary:
2107-
$ref: '#/components/schemas/ConversationSummaryBase'
21082079
title:
21092080
description: The conversation title.
21102081
example: Updated Security AI Assistant Setup

x-pack/platform/packages/shared/kbn-elastic-assistant-common/docs/openapi/serverless/elastic_assistant_api_2023_10_31.bundled.schema.yaml

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2032,8 +2032,6 @@ components:
20322032
type: string
20332033
replacements:
20342034
$ref: '#/components/schemas/Replacements'
2035-
summary:
2036-
$ref: '#/components/schemas/ConversationSummary'
20372035
timestamp:
20382036
$ref: '#/components/schemas/NonEmptyTimestamp'
20392037
title:
@@ -2056,31 +2054,6 @@ components:
20562054
- users
20572055
- namespace
20582056
- category
2059-
ConversationSummary:
2060-
allOf:
2061-
- $ref: '#/components/schemas/ConversationSummaryBase'
2062-
- type: object
2063-
properties:
2064-
timestamp:
2065-
$ref: '#/components/schemas/NonEmptyTimestamp'
2066-
description: The timestamp summary was updated.
2067-
example: '2025-04-30T16:00:00Z'
2068-
required:
2069-
- timestamp
2070-
ConversationSummaryBase:
2071-
type: object
2072-
properties:
2073-
semanticContent:
2074-
description: Summary text of the conversation over time.
2075-
example: >-
2076-
This conversation covered how to configure the Security AI
2077-
Assistant.
2078-
type: string
2079-
summarizedMessageIds:
2080-
description: The list of summarized messages.
2081-
items:
2082-
$ref: '#/components/schemas/NonEmptyString'
2083-
type: array
20842057
ConversationUpdateProps:
20852058
type: object
20862059
properties:
@@ -2103,8 +2076,6 @@ components:
21032076
type: array
21042077
replacements:
21052078
$ref: '#/components/schemas/Replacements'
2106-
summary:
2107-
$ref: '#/components/schemas/ConversationSummaryBase'
21082079
title:
21092080
description: The conversation title.
21102081
example: Updated Security AI Assistant Setup

x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/conversations/common_attributes.gen.ts

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -231,14 +231,6 @@ export const ConversationCategory = z.enum(['assistant', 'insights']);
231231
export type ConversationCategoryEnum = typeof ConversationCategory.enum;
232232
export const ConversationCategoryEnum = ConversationCategory.enum;
233233

234-
/**
235-
* The conversation confidence.
236-
*/
237-
export type ConversationConfidence = z.infer<typeof ConversationConfidence>;
238-
export const ConversationConfidence = z.enum(['low', 'medium', 'high']);
239-
export type ConversationConfidenceEnum = typeof ConversationConfidence.enum;
240-
export const ConversationConfidenceEnum = ConversationConfidence.enum;
241-
242234
/**
243235
* AI assistant conversation message.
244236
*/
@@ -306,28 +298,6 @@ export const ApiConfig = z.object({
306298
model: z.string().optional(),
307299
});
308300

309-
export type ConversationSummaryBase = z.infer<typeof ConversationSummaryBase>;
310-
export const ConversationSummaryBase = z.object({
311-
/**
312-
* Summary text of the conversation over time.
313-
*/
314-
semanticContent: z.string().optional(),
315-
/**
316-
* The list of summarized messages.
317-
*/
318-
summarizedMessageIds: z.array(NonEmptyString).optional(),
319-
});
320-
321-
export type ConversationSummary = z.infer<typeof ConversationSummary>;
322-
export const ConversationSummary = ConversationSummaryBase.merge(
323-
z.object({
324-
/**
325-
* The timestamp summary was updated.
326-
*/
327-
timestamp: NonEmptyTimestamp,
328-
})
329-
);
330-
331301
export type ErrorSchema = z.infer<typeof ErrorSchema>;
332302
export const ErrorSchema = z
333303
.object({
@@ -350,7 +320,6 @@ export const ConversationResponse = z.object({
350320
* The conversation category.
351321
*/
352322
category: ConversationCategory,
353-
summary: ConversationSummary.optional(),
354323
timestamp: NonEmptyTimestamp.optional(),
355324
/**
356325
* The last time conversation was updated.
@@ -403,7 +372,6 @@ export const ConversationUpdateProps = z.object({
403372
* LLM API configuration.
404373
*/
405374
apiConfig: ApiConfig.optional(),
406-
summary: ConversationSummaryBase.optional(),
407375
/**
408376
* Exclude from last conversation storage.
409377
*/

x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/conversations/common_attributes.schema.yaml

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -236,15 +236,6 @@ components:
236236
- insights
237237
example: 'assistant'
238238

239-
ConversationConfidence:
240-
type: string
241-
description: The conversation confidence.
242-
enum:
243-
- low
244-
- medium
245-
- high
246-
example: 'high'
247-
248239
Message:
249240
type: object
250241
description: AI assistant conversation message.
@@ -312,31 +303,6 @@ components:
312303
description: Model
313304
example: 'gpt-4'
314305

315-
ConversationSummaryBase:
316-
type: object
317-
properties:
318-
semanticContent:
319-
type: string
320-
description: Summary text of the conversation over time.
321-
example: 'This conversation covered how to configure the Security AI Assistant.'
322-
summarizedMessageIds:
323-
type: array
324-
description: The list of summarized messages.
325-
items:
326-
$ref: '../common_attributes.schema.yaml#/components/schemas/NonEmptyString'
327-
328-
ConversationSummary:
329-
allOf:
330-
- $ref: '#/components/schemas/ConversationSummaryBase'
331-
- type: object
332-
required:
333-
- timestamp
334-
properties:
335-
timestamp:
336-
$ref: '../common_attributes.schema.yaml#/components/schemas/NonEmptyTimestamp'
337-
description: The timestamp summary was updated.
338-
example: '2025-04-30T16:00:00Z'
339-
340306
ErrorSchema:
341307
type: object
342308
required:
@@ -380,8 +346,6 @@ components:
380346
$ref: '#/components/schemas/ConversationCategory'
381347
description: The conversation category.
382348
example: 'assistant'
383-
summary:
384-
$ref: '#/components/schemas/ConversationSummary'
385349
timestamp:
386350
$ref: '../common_attributes.schema.yaml#/components/schemas/NonEmptyTimestamp'
387351
updatedAt:
@@ -440,8 +404,6 @@ components:
440404
apiConfig:
441405
$ref: '#/components/schemas/ApiConfig'
442406
description: LLM API configuration.
443-
summary:
444-
$ref: '#/components/schemas/ConversationSummaryBase'
445407
excludeFromLastConversationStorage:
446408
description: Exclude from last conversation storage.
447409
type: boolean

x-pack/solutions/security/plugins/elastic_assistant/server/__mocks__/conversations_schema.mock.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import type {
1414
ConversationResponse,
1515
DeleteAllConversationsRequestBody,
1616
ConversationUpdateProps,
17-
ConversationSummary,
1817
} from '@kbn/elastic-assistant-common';
1918
import type {
2019
CreateMessageSchema,
@@ -100,7 +99,7 @@ export const getDeleteAllConversationsSchemaMock = (): DeleteAllConversationsReq
10099

101100
export const getUpdateConversationSchemaMock = (
102101
conversationId = 'conversation-1'
103-
): ConversationUpdateProps & { summary?: ConversationSummary } => ({
102+
): ConversationUpdateProps => ({
104103
title: 'Welcome 2',
105104
apiConfig: {
106105
actionTypeId: '.gen-ai',
@@ -138,9 +137,7 @@ export const getAppendConversationMessagesSchemaMock =
138137
],
139138
});
140139

141-
export type ConversationMockParams = (ConversationCreateProps | ConversationUpdateProps) & {
142-
summary?: ConversationSummary;
143-
};
140+
export type ConversationMockParams = ConversationCreateProps | ConversationUpdateProps;
144141

145142
export const getConversationMock = (params: ConversationMockParams): ConversationResponse => ({
146143
id: '04128c15-0d1b-4716-a4c5-46997ac7f3bd',

0 commit comments

Comments
 (0)