From b969ea79e7faa6915387dda017c21cf1f8f8e91c Mon Sep 17 00:00:00 2001 From: Maxim Palenov Date: Mon, 22 Jul 2024 12:13:37 +0200 Subject: [PATCH 1/6] update the bundling script --- ...c_assistant_2023_10_31.bundled.schema.yaml | 511 ++++++++++++++++++ ...c_assistant_2023_10_31.bundled.schema.yaml | 511 ++++++++++++++++++ 2 files changed, 1022 insertions(+) create mode 100644 x-pack/packages/kbn-elastic-assistant-common/docs/openapi/ess/elastic_assistant_2023_10_31.bundled.schema.yaml create mode 100644 x-pack/packages/kbn-elastic-assistant-common/docs/openapi/serverless/elastic_assistant_2023_10_31.bundled.schema.yaml diff --git a/x-pack/packages/kbn-elastic-assistant-common/docs/openapi/ess/elastic_assistant_2023_10_31.bundled.schema.yaml b/x-pack/packages/kbn-elastic-assistant-common/docs/openapi/ess/elastic_assistant_2023_10_31.bundled.schema.yaml new file mode 100644 index 0000000000000..243d040df1550 --- /dev/null +++ b/x-pack/packages/kbn-elastic-assistant-common/docs/openapi/ess/elastic_assistant_2023_10_31.bundled.schema.yaml @@ -0,0 +1,511 @@ +openapi: 3.0.3 +info: + description: >- + The AI Assistant aids users in navigating complex workflows, providing smart + insights, and enhancing interactive experiences across our solutions. + title: Security Solution AI Assistant API (Elastic Cloud and self-hosted) + version: '2023-10-31' +servers: + - url: 'http://{kibana_host}:{port}' + variables: + kibana_host: + default: localhost + port: + default: '5601' +paths: + /api/elastic_assistant/chat/complete: + post: + description: Creates a model response for the given chat conversation. + operationId: ChatComplete + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ChatCompleteProps' + required: true + responses: + '200': + content: + application/octet-stream: + schema: + format: binary + type: string + description: Indicates a successful call. + '400': + content: + application/json: + schema: + type: object + properties: + error: + type: string + message: + type: string + statusCode: + type: number + description: Generic Error + summary: Creates a model response for the given chat conversation. + tags: + - Chat Complete API + /api/elastic_assistant/knowledge_base/entries: + post: + description: Create a Knowledge Base Entry + operationId: CreateKnowledgeBaseEntry + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/KnowledgeBaseEntryCreateProps' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/KnowledgeBaseEntryResponse' + description: Successful request returning Knowledge Base Entries + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/KnowledgeBaseEntryErrorSchema' + description: Generic Error + summary: Create a Knowledge Base Entry + tags: + - Knowledge Base Entries API + /api/elastic_assistant/knowledge_base/entries/_bulk_action: + post: + description: >- + The bulk action is applied to all Knowledge Base Entries that match the + filter or to the list of Knowledge Base Entries by their IDs + operationId: PerformKnowledgeBaseEntryBulkAction + requestBody: + content: + application/json: + schema: + type: object + properties: + create: + items: + $ref: '#/components/schemas/KnowledgeBaseEntryCreateProps' + type: array + delete: + type: object + properties: + ids: + description: Array of Knowledge base Entry IDs + items: + type: string + minItems: 1 + type: array + query: + description: Query to filter Knowledge Base Entries + type: string + update: + items: + $ref: '#/components/schemas/KnowledgeBaseEntryUpdateProps' + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/KnowledgeBaseEntryBulkCrudActionResponse' + description: Successful bulk operation request + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/KnowledgeBaseEntryErrorSchema' + description: Generic Error + summary: Applies a bulk action to multiple Knowledge Base Entries + tags: + - Knowledge Base Entries Bulk API + '/api/elastic_assistant/knowledge_base/entries/{id}': + delete: + description: Deletes a single Knowledge Base Entry using the `id` field + operationId: DeleteKnowledgeBaseEntry + parameters: + - description: The Knowledge Base Entry's `id` value + in: path + name: id + required: true + schema: + $ref: '#/components/schemas/NonEmptyString' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/KnowledgeBaseEntryResponse' + description: Successful request returning the deleted Knowledge Base Entry + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/KnowledgeBaseEntryErrorSchema' + description: Generic Error + summary: Deletes a single Knowledge Base Entry using the `id` field + tags: + - Knowledge Base Entries API + get: + description: Read a Knowledge Base Entry + operationId: ReadKnowledgeBaseEntry + parameters: + - description: The Knowledge Base Entry's `id` value. + in: path + name: id + required: true + schema: + $ref: '#/components/schemas/NonEmptyString' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/KnowledgeBaseEntryResponse' + description: Successful request returning a Knowledge Base Entry + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/KnowledgeBaseEntryErrorSchema' + description: Generic Error + summary: Read a Knowledge Base Entry + tags: + - Knowledge Base Entries API + put: + description: Update a Knowledge Base Entry + operationId: UpdateKnowledgeBaseEntry + parameters: + - description: The Knowledge Base Entry's `id` value + in: path + name: id + required: true + schema: + $ref: '#/components/schemas/NonEmptyString' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/KnowledgeBaseEntryUpdateProps' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/KnowledgeBaseEntryResponse' + description: Successful request returning the updated Knowledge Base Entry + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/KnowledgeBaseEntryErrorSchema' + description: Generic Error + summary: Update a Knowledge Base Entry + tags: + - Knowledge Base Entries API +components: + schemas: + ChatCompleteProps: + type: object + properties: + connectorId: + type: string + conversationId: + type: string + isStream: + type: boolean + langSmithApiKey: + type: string + langSmithProject: + type: string + messages: + items: + $ref: '#/components/schemas/ChatMessage' + type: array + model: + type: string + persist: + type: boolean + promptId: + type: string + responseLanguage: + type: string + required: + - messages + - persist + - connectorId + ChatMessage: + description: AI assistant message. + type: object + properties: + content: + description: Message content. + type: string + data: + $ref: '#/components/schemas/MessageData' + description: ECS object to attach to the context of the message. + fields_to_anonymize: + items: + type: string + type: array + role: + $ref: '#/components/schemas/ChatMessageRole' + description: Message role. + required: + - role + ChatMessageRole: + description: Message role. + enum: + - system + - user + - assistant + type: string + KnowledgeBaseEntryBulkActionSkipReason: + enum: + - KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED + type: string + KnowledgeBaseEntryBulkActionSkipResult: + type: object + properties: + id: + type: string + name: + type: string + skip_reason: + $ref: '#/components/schemas/KnowledgeBaseEntryBulkActionSkipReason' + required: + - id + - skip_reason + KnowledgeBaseEntryBulkCrudActionResponse: + type: object + properties: + attributes: + type: object + properties: + errors: + items: + $ref: '#/components/schemas/NormalizedKnowledgeBaseEntryError' + type: array + results: + $ref: '#/components/schemas/KnowledgeBaseEntryBulkCrudActionResults' + summary: + $ref: '#/components/schemas/KnowledgeBaseEntryBulkCrudActionSummary' + required: + - results + - summary + knowledgeBaseEntriesCount: + type: integer + message: + type: string + statusCode: + type: integer + success: + type: boolean + required: + - attributes + KnowledgeBaseEntryBulkCrudActionResults: + type: object + properties: + created: + items: + $ref: '#/components/schemas/KnowledgeBaseEntryResponse' + type: array + deleted: + items: + type: string + type: array + skipped: + items: + $ref: '#/components/schemas/KnowledgeBaseEntryBulkActionSkipResult' + type: array + updated: + items: + $ref: '#/components/schemas/KnowledgeBaseEntryResponse' + type: array + required: + - updated + - created + - deleted + - skipped + KnowledgeBaseEntryBulkCrudActionSummary: + type: object + properties: + failed: + type: integer + skipped: + type: integer + succeeded: + type: integer + total: + type: integer + required: + - failed + - skipped + - succeeded + - total + KnowledgeBaseEntryCreateProps: + type: object + properties: + metadata: + $ref: '#/components/schemas/Metadata' + description: Metadata about the Knowledge Base Entry + text: + description: Knowledge Base Entry content + type: string + required: + - metadata + - text + KnowledgeBaseEntryDetailsInError: + type: object + properties: + id: + type: string + name: + type: string + required: + - id + KnowledgeBaseEntryErrorSchema: + additionalProperties: false + type: object + properties: + error: + type: string + message: + type: string + statusCode: + type: number + required: + - statusCode + - error + - message + KnowledgeBaseEntryResponse: + type: object + properties: + createdAt: + description: Time the Knowledge Base Entry was created + type: string + createdBy: + description: User who created the Knowledge Base Entry + type: string + id: + $ref: '#/components/schemas/NonEmptyString' + metadata: + $ref: '#/components/schemas/Metadata' + description: Metadata about the Knowledge Base Entry + namespace: + description: Kibana space + type: string + text: + description: Knowledge Base Entry content + type: string + timestamp: + $ref: '#/components/schemas/NonEmptyString' + updatedAt: + description: Time the Knowledge Base Entry was last updated + type: string + updatedBy: + description: User who last updated the Knowledge Base Entry + type: string + users: + items: + $ref: '#/components/schemas/User' + type: array + vector: + $ref: '#/components/schemas/Vector' + required: + - id + - createdAt + - users + - namespace + - text + KnowledgeBaseEntryUpdateProps: + type: object + properties: + id: + $ref: '#/components/schemas/NonEmptyString' + metadata: + $ref: '#/components/schemas/Metadata' + description: Metadata about the Knowledge Base Entry + required: + - id + MessageData: + additionalProperties: true + type: object + Metadata: + description: Metadata about an Knowledge Base Entry + type: object + properties: + kbResource: + description: >- + Knowledge Base resource name for grouping entries, e.g. 'esql', + 'lens-docs', etc + type: string + required: + description: Whether or not this resource should always be included + type: boolean + source: + description: Source document name or filepath + type: string + required: + - kbResource + - source + - required + NonEmptyString: + description: A string that is not empty and does not contain only whitespace + minLength: 1 + pattern: ^(?! *$).+$ + type: string + NormalizedKnowledgeBaseEntryError: + type: object + properties: + err_code: + type: string + knowledgeBaseEntries: + items: + $ref: '#/components/schemas/KnowledgeBaseEntryDetailsInError' + type: array + message: + type: string + statusCode: + type: integer + required: + - message + - statusCode + - knowledgeBaseEntries + User: + description: 'Could be any string, not necessarily a UUID' + type: object + properties: + id: + description: User id + type: string + name: + description: User name + type: string + Vector: + description: >- + Object containing Knowledge Base Entry text embeddings and modelId used + to create the embeddings + type: object + properties: + modelId: + description: ID of the model used to create the embeddings + type: string + tokens: + additionalProperties: + type: number + description: Tokens with their corresponding values + type: object + required: + - modelId + - tokens + securitySchemes: + BasicAuth: + scheme: basic + type: http +security: + - BasicAuth: [] +tags: ! '' diff --git a/x-pack/packages/kbn-elastic-assistant-common/docs/openapi/serverless/elastic_assistant_2023_10_31.bundled.schema.yaml b/x-pack/packages/kbn-elastic-assistant-common/docs/openapi/serverless/elastic_assistant_2023_10_31.bundled.schema.yaml new file mode 100644 index 0000000000000..b1d547a037485 --- /dev/null +++ b/x-pack/packages/kbn-elastic-assistant-common/docs/openapi/serverless/elastic_assistant_2023_10_31.bundled.schema.yaml @@ -0,0 +1,511 @@ +openapi: 3.0.3 +info: + description: >- + The AI Assistant aids users in navigating complex workflows, providing smart + insights, and enhancing interactive experiences across our solutions. + title: Security Solution AI Assistant API (Elastic Cloud Serverless) + version: '2023-10-31' +servers: + - url: 'http://{kibana_host}:{port}' + variables: + kibana_host: + default: localhost + port: + default: '5601' +paths: + /api/elastic_assistant/chat/complete: + post: + description: Creates a model response for the given chat conversation. + operationId: ChatComplete + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ChatCompleteProps' + required: true + responses: + '200': + content: + application/octet-stream: + schema: + format: binary + type: string + description: Indicates a successful call. + '400': + content: + application/json: + schema: + type: object + properties: + error: + type: string + message: + type: string + statusCode: + type: number + description: Generic Error + summary: Creates a model response for the given chat conversation. + tags: + - Chat Complete API + /api/elastic_assistant/knowledge_base/entries: + post: + description: Create a Knowledge Base Entry + operationId: CreateKnowledgeBaseEntry + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/KnowledgeBaseEntryCreateProps' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/KnowledgeBaseEntryResponse' + description: Successful request returning Knowledge Base Entries + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/KnowledgeBaseEntryErrorSchema' + description: Generic Error + summary: Create a Knowledge Base Entry + tags: + - Knowledge Base Entries API + /api/elastic_assistant/knowledge_base/entries/_bulk_action: + post: + description: >- + The bulk action is applied to all Knowledge Base Entries that match the + filter or to the list of Knowledge Base Entries by their IDs + operationId: PerformKnowledgeBaseEntryBulkAction + requestBody: + content: + application/json: + schema: + type: object + properties: + create: + items: + $ref: '#/components/schemas/KnowledgeBaseEntryCreateProps' + type: array + delete: + type: object + properties: + ids: + description: Array of Knowledge base Entry IDs + items: + type: string + minItems: 1 + type: array + query: + description: Query to filter Knowledge Base Entries + type: string + update: + items: + $ref: '#/components/schemas/KnowledgeBaseEntryUpdateProps' + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/KnowledgeBaseEntryBulkCrudActionResponse' + description: Successful bulk operation request + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/KnowledgeBaseEntryErrorSchema' + description: Generic Error + summary: Applies a bulk action to multiple Knowledge Base Entries + tags: + - Knowledge Base Entries Bulk API + '/api/elastic_assistant/knowledge_base/entries/{id}': + delete: + description: Deletes a single Knowledge Base Entry using the `id` field + operationId: DeleteKnowledgeBaseEntry + parameters: + - description: The Knowledge Base Entry's `id` value + in: path + name: id + required: true + schema: + $ref: '#/components/schemas/NonEmptyString' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/KnowledgeBaseEntryResponse' + description: Successful request returning the deleted Knowledge Base Entry + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/KnowledgeBaseEntryErrorSchema' + description: Generic Error + summary: Deletes a single Knowledge Base Entry using the `id` field + tags: + - Knowledge Base Entries API + get: + description: Read a Knowledge Base Entry + operationId: ReadKnowledgeBaseEntry + parameters: + - description: The Knowledge Base Entry's `id` value. + in: path + name: id + required: true + schema: + $ref: '#/components/schemas/NonEmptyString' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/KnowledgeBaseEntryResponse' + description: Successful request returning a Knowledge Base Entry + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/KnowledgeBaseEntryErrorSchema' + description: Generic Error + summary: Read a Knowledge Base Entry + tags: + - Knowledge Base Entries API + put: + description: Update a Knowledge Base Entry + operationId: UpdateKnowledgeBaseEntry + parameters: + - description: The Knowledge Base Entry's `id` value + in: path + name: id + required: true + schema: + $ref: '#/components/schemas/NonEmptyString' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/KnowledgeBaseEntryUpdateProps' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/KnowledgeBaseEntryResponse' + description: Successful request returning the updated Knowledge Base Entry + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/KnowledgeBaseEntryErrorSchema' + description: Generic Error + summary: Update a Knowledge Base Entry + tags: + - Knowledge Base Entries API +components: + schemas: + ChatCompleteProps: + type: object + properties: + connectorId: + type: string + conversationId: + type: string + isStream: + type: boolean + langSmithApiKey: + type: string + langSmithProject: + type: string + messages: + items: + $ref: '#/components/schemas/ChatMessage' + type: array + model: + type: string + persist: + type: boolean + promptId: + type: string + responseLanguage: + type: string + required: + - messages + - persist + - connectorId + ChatMessage: + description: AI assistant message. + type: object + properties: + content: + description: Message content. + type: string + data: + $ref: '#/components/schemas/MessageData' + description: ECS object to attach to the context of the message. + fields_to_anonymize: + items: + type: string + type: array + role: + $ref: '#/components/schemas/ChatMessageRole' + description: Message role. + required: + - role + ChatMessageRole: + description: Message role. + enum: + - system + - user + - assistant + type: string + KnowledgeBaseEntryBulkActionSkipReason: + enum: + - KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED + type: string + KnowledgeBaseEntryBulkActionSkipResult: + type: object + properties: + id: + type: string + name: + type: string + skip_reason: + $ref: '#/components/schemas/KnowledgeBaseEntryBulkActionSkipReason' + required: + - id + - skip_reason + KnowledgeBaseEntryBulkCrudActionResponse: + type: object + properties: + attributes: + type: object + properties: + errors: + items: + $ref: '#/components/schemas/NormalizedKnowledgeBaseEntryError' + type: array + results: + $ref: '#/components/schemas/KnowledgeBaseEntryBulkCrudActionResults' + summary: + $ref: '#/components/schemas/KnowledgeBaseEntryBulkCrudActionSummary' + required: + - results + - summary + knowledgeBaseEntriesCount: + type: integer + message: + type: string + statusCode: + type: integer + success: + type: boolean + required: + - attributes + KnowledgeBaseEntryBulkCrudActionResults: + type: object + properties: + created: + items: + $ref: '#/components/schemas/KnowledgeBaseEntryResponse' + type: array + deleted: + items: + type: string + type: array + skipped: + items: + $ref: '#/components/schemas/KnowledgeBaseEntryBulkActionSkipResult' + type: array + updated: + items: + $ref: '#/components/schemas/KnowledgeBaseEntryResponse' + type: array + required: + - updated + - created + - deleted + - skipped + KnowledgeBaseEntryBulkCrudActionSummary: + type: object + properties: + failed: + type: integer + skipped: + type: integer + succeeded: + type: integer + total: + type: integer + required: + - failed + - skipped + - succeeded + - total + KnowledgeBaseEntryCreateProps: + type: object + properties: + metadata: + $ref: '#/components/schemas/Metadata' + description: Metadata about the Knowledge Base Entry + text: + description: Knowledge Base Entry content + type: string + required: + - metadata + - text + KnowledgeBaseEntryDetailsInError: + type: object + properties: + id: + type: string + name: + type: string + required: + - id + KnowledgeBaseEntryErrorSchema: + additionalProperties: false + type: object + properties: + error: + type: string + message: + type: string + statusCode: + type: number + required: + - statusCode + - error + - message + KnowledgeBaseEntryResponse: + type: object + properties: + createdAt: + description: Time the Knowledge Base Entry was created + type: string + createdBy: + description: User who created the Knowledge Base Entry + type: string + id: + $ref: '#/components/schemas/NonEmptyString' + metadata: + $ref: '#/components/schemas/Metadata' + description: Metadata about the Knowledge Base Entry + namespace: + description: Kibana space + type: string + text: + description: Knowledge Base Entry content + type: string + timestamp: + $ref: '#/components/schemas/NonEmptyString' + updatedAt: + description: Time the Knowledge Base Entry was last updated + type: string + updatedBy: + description: User who last updated the Knowledge Base Entry + type: string + users: + items: + $ref: '#/components/schemas/User' + type: array + vector: + $ref: '#/components/schemas/Vector' + required: + - id + - createdAt + - users + - namespace + - text + KnowledgeBaseEntryUpdateProps: + type: object + properties: + id: + $ref: '#/components/schemas/NonEmptyString' + metadata: + $ref: '#/components/schemas/Metadata' + description: Metadata about the Knowledge Base Entry + required: + - id + MessageData: + additionalProperties: true + type: object + Metadata: + description: Metadata about an Knowledge Base Entry + type: object + properties: + kbResource: + description: >- + Knowledge Base resource name for grouping entries, e.g. 'esql', + 'lens-docs', etc + type: string + required: + description: Whether or not this resource should always be included + type: boolean + source: + description: Source document name or filepath + type: string + required: + - kbResource + - source + - required + NonEmptyString: + description: A string that is not empty and does not contain only whitespace + minLength: 1 + pattern: ^(?! *$).+$ + type: string + NormalizedKnowledgeBaseEntryError: + type: object + properties: + err_code: + type: string + knowledgeBaseEntries: + items: + $ref: '#/components/schemas/KnowledgeBaseEntryDetailsInError' + type: array + message: + type: string + statusCode: + type: integer + required: + - message + - statusCode + - knowledgeBaseEntries + User: + description: 'Could be any string, not necessarily a UUID' + type: object + properties: + id: + description: User id + type: string + name: + description: User name + type: string + Vector: + description: >- + Object containing Knowledge Base Entry text embeddings and modelId used + to create the embeddings + type: object + properties: + modelId: + description: ID of the model used to create the embeddings + type: string + tokens: + additionalProperties: + type: number + description: Tokens with their corresponding values + type: object + required: + - modelId + - tokens + securitySchemes: + BasicAuth: + scheme: basic + type: http +security: + - BasicAuth: [] +tags: ! '' From a4a2d73dd1d738dfdb0c4d7a530a8a449c21f4fe Mon Sep 17 00:00:00 2001 From: Maxim Palenov Date: Mon, 22 Jul 2024 12:14:45 +0200 Subject: [PATCH 2/6] add AI Assistant bundling into the pipeline script --- .../openapi_bundling/security_solution_openapi_bundling.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.buildkite/scripts/steps/openapi_bundling/security_solution_openapi_bundling.sh b/.buildkite/scripts/steps/openapi_bundling/security_solution_openapi_bundling.sh index 615353e20ef68..e6a43ab24eacb 100755 --- a/.buildkite/scripts/steps/openapi_bundling/security_solution_openapi_bundling.sh +++ b/.buildkite/scripts/steps/openapi_bundling/security_solution_openapi_bundling.sh @@ -18,4 +18,7 @@ check_for_changed_files "yarn openapi:bundle:entity-analytics" true check_for_changed_files "yarn openapi:bundle" true (cd packages/kbn-securitysolution-exceptions-common && yarn openapi:bundle) +check_for_changed_files "yarn openapi:bundle" true + +(cd x-pack/packages/kbn-elastic-assistant-common && yarn openapi:bundle) check_for_changed_files "yarn openapi:bundle" true \ No newline at end of file From 95522eddcb5b9a9cc557cc0b7c47e8e3e3b740f2 Mon Sep 17 00:00:00 2001 From: Maxim Palenov Date: Wed, 24 Jul 2024 17:33:40 +0200 Subject: [PATCH 3/6] cleanup outdated artifacts --- ...c_assistant_2023_10_31.bundled.schema.yaml | 511 ------------------ ...c_assistant_2023_10_31.bundled.schema.yaml | 511 ------------------ 2 files changed, 1022 deletions(-) delete mode 100644 x-pack/packages/kbn-elastic-assistant-common/docs/openapi/ess/elastic_assistant_2023_10_31.bundled.schema.yaml delete mode 100644 x-pack/packages/kbn-elastic-assistant-common/docs/openapi/serverless/elastic_assistant_2023_10_31.bundled.schema.yaml diff --git a/x-pack/packages/kbn-elastic-assistant-common/docs/openapi/ess/elastic_assistant_2023_10_31.bundled.schema.yaml b/x-pack/packages/kbn-elastic-assistant-common/docs/openapi/ess/elastic_assistant_2023_10_31.bundled.schema.yaml deleted file mode 100644 index 243d040df1550..0000000000000 --- a/x-pack/packages/kbn-elastic-assistant-common/docs/openapi/ess/elastic_assistant_2023_10_31.bundled.schema.yaml +++ /dev/null @@ -1,511 +0,0 @@ -openapi: 3.0.3 -info: - description: >- - The AI Assistant aids users in navigating complex workflows, providing smart - insights, and enhancing interactive experiences across our solutions. - title: Security Solution AI Assistant API (Elastic Cloud and self-hosted) - version: '2023-10-31' -servers: - - url: 'http://{kibana_host}:{port}' - variables: - kibana_host: - default: localhost - port: - default: '5601' -paths: - /api/elastic_assistant/chat/complete: - post: - description: Creates a model response for the given chat conversation. - operationId: ChatComplete - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ChatCompleteProps' - required: true - responses: - '200': - content: - application/octet-stream: - schema: - format: binary - type: string - description: Indicates a successful call. - '400': - content: - application/json: - schema: - type: object - properties: - error: - type: string - message: - type: string - statusCode: - type: number - description: Generic Error - summary: Creates a model response for the given chat conversation. - tags: - - Chat Complete API - /api/elastic_assistant/knowledge_base/entries: - post: - description: Create a Knowledge Base Entry - operationId: CreateKnowledgeBaseEntry - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/KnowledgeBaseEntryCreateProps' - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/KnowledgeBaseEntryResponse' - description: Successful request returning Knowledge Base Entries - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/KnowledgeBaseEntryErrorSchema' - description: Generic Error - summary: Create a Knowledge Base Entry - tags: - - Knowledge Base Entries API - /api/elastic_assistant/knowledge_base/entries/_bulk_action: - post: - description: >- - The bulk action is applied to all Knowledge Base Entries that match the - filter or to the list of Knowledge Base Entries by their IDs - operationId: PerformKnowledgeBaseEntryBulkAction - requestBody: - content: - application/json: - schema: - type: object - properties: - create: - items: - $ref: '#/components/schemas/KnowledgeBaseEntryCreateProps' - type: array - delete: - type: object - properties: - ids: - description: Array of Knowledge base Entry IDs - items: - type: string - minItems: 1 - type: array - query: - description: Query to filter Knowledge Base Entries - type: string - update: - items: - $ref: '#/components/schemas/KnowledgeBaseEntryUpdateProps' - type: array - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/KnowledgeBaseEntryBulkCrudActionResponse' - description: Successful bulk operation request - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/KnowledgeBaseEntryErrorSchema' - description: Generic Error - summary: Applies a bulk action to multiple Knowledge Base Entries - tags: - - Knowledge Base Entries Bulk API - '/api/elastic_assistant/knowledge_base/entries/{id}': - delete: - description: Deletes a single Knowledge Base Entry using the `id` field - operationId: DeleteKnowledgeBaseEntry - parameters: - - description: The Knowledge Base Entry's `id` value - in: path - name: id - required: true - schema: - $ref: '#/components/schemas/NonEmptyString' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/KnowledgeBaseEntryResponse' - description: Successful request returning the deleted Knowledge Base Entry - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/KnowledgeBaseEntryErrorSchema' - description: Generic Error - summary: Deletes a single Knowledge Base Entry using the `id` field - tags: - - Knowledge Base Entries API - get: - description: Read a Knowledge Base Entry - operationId: ReadKnowledgeBaseEntry - parameters: - - description: The Knowledge Base Entry's `id` value. - in: path - name: id - required: true - schema: - $ref: '#/components/schemas/NonEmptyString' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/KnowledgeBaseEntryResponse' - description: Successful request returning a Knowledge Base Entry - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/KnowledgeBaseEntryErrorSchema' - description: Generic Error - summary: Read a Knowledge Base Entry - tags: - - Knowledge Base Entries API - put: - description: Update a Knowledge Base Entry - operationId: UpdateKnowledgeBaseEntry - parameters: - - description: The Knowledge Base Entry's `id` value - in: path - name: id - required: true - schema: - $ref: '#/components/schemas/NonEmptyString' - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/KnowledgeBaseEntryUpdateProps' - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/KnowledgeBaseEntryResponse' - description: Successful request returning the updated Knowledge Base Entry - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/KnowledgeBaseEntryErrorSchema' - description: Generic Error - summary: Update a Knowledge Base Entry - tags: - - Knowledge Base Entries API -components: - schemas: - ChatCompleteProps: - type: object - properties: - connectorId: - type: string - conversationId: - type: string - isStream: - type: boolean - langSmithApiKey: - type: string - langSmithProject: - type: string - messages: - items: - $ref: '#/components/schemas/ChatMessage' - type: array - model: - type: string - persist: - type: boolean - promptId: - type: string - responseLanguage: - type: string - required: - - messages - - persist - - connectorId - ChatMessage: - description: AI assistant message. - type: object - properties: - content: - description: Message content. - type: string - data: - $ref: '#/components/schemas/MessageData' - description: ECS object to attach to the context of the message. - fields_to_anonymize: - items: - type: string - type: array - role: - $ref: '#/components/schemas/ChatMessageRole' - description: Message role. - required: - - role - ChatMessageRole: - description: Message role. - enum: - - system - - user - - assistant - type: string - KnowledgeBaseEntryBulkActionSkipReason: - enum: - - KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED - type: string - KnowledgeBaseEntryBulkActionSkipResult: - type: object - properties: - id: - type: string - name: - type: string - skip_reason: - $ref: '#/components/schemas/KnowledgeBaseEntryBulkActionSkipReason' - required: - - id - - skip_reason - KnowledgeBaseEntryBulkCrudActionResponse: - type: object - properties: - attributes: - type: object - properties: - errors: - items: - $ref: '#/components/schemas/NormalizedKnowledgeBaseEntryError' - type: array - results: - $ref: '#/components/schemas/KnowledgeBaseEntryBulkCrudActionResults' - summary: - $ref: '#/components/schemas/KnowledgeBaseEntryBulkCrudActionSummary' - required: - - results - - summary - knowledgeBaseEntriesCount: - type: integer - message: - type: string - statusCode: - type: integer - success: - type: boolean - required: - - attributes - KnowledgeBaseEntryBulkCrudActionResults: - type: object - properties: - created: - items: - $ref: '#/components/schemas/KnowledgeBaseEntryResponse' - type: array - deleted: - items: - type: string - type: array - skipped: - items: - $ref: '#/components/schemas/KnowledgeBaseEntryBulkActionSkipResult' - type: array - updated: - items: - $ref: '#/components/schemas/KnowledgeBaseEntryResponse' - type: array - required: - - updated - - created - - deleted - - skipped - KnowledgeBaseEntryBulkCrudActionSummary: - type: object - properties: - failed: - type: integer - skipped: - type: integer - succeeded: - type: integer - total: - type: integer - required: - - failed - - skipped - - succeeded - - total - KnowledgeBaseEntryCreateProps: - type: object - properties: - metadata: - $ref: '#/components/schemas/Metadata' - description: Metadata about the Knowledge Base Entry - text: - description: Knowledge Base Entry content - type: string - required: - - metadata - - text - KnowledgeBaseEntryDetailsInError: - type: object - properties: - id: - type: string - name: - type: string - required: - - id - KnowledgeBaseEntryErrorSchema: - additionalProperties: false - type: object - properties: - error: - type: string - message: - type: string - statusCode: - type: number - required: - - statusCode - - error - - message - KnowledgeBaseEntryResponse: - type: object - properties: - createdAt: - description: Time the Knowledge Base Entry was created - type: string - createdBy: - description: User who created the Knowledge Base Entry - type: string - id: - $ref: '#/components/schemas/NonEmptyString' - metadata: - $ref: '#/components/schemas/Metadata' - description: Metadata about the Knowledge Base Entry - namespace: - description: Kibana space - type: string - text: - description: Knowledge Base Entry content - type: string - timestamp: - $ref: '#/components/schemas/NonEmptyString' - updatedAt: - description: Time the Knowledge Base Entry was last updated - type: string - updatedBy: - description: User who last updated the Knowledge Base Entry - type: string - users: - items: - $ref: '#/components/schemas/User' - type: array - vector: - $ref: '#/components/schemas/Vector' - required: - - id - - createdAt - - users - - namespace - - text - KnowledgeBaseEntryUpdateProps: - type: object - properties: - id: - $ref: '#/components/schemas/NonEmptyString' - metadata: - $ref: '#/components/schemas/Metadata' - description: Metadata about the Knowledge Base Entry - required: - - id - MessageData: - additionalProperties: true - type: object - Metadata: - description: Metadata about an Knowledge Base Entry - type: object - properties: - kbResource: - description: >- - Knowledge Base resource name for grouping entries, e.g. 'esql', - 'lens-docs', etc - type: string - required: - description: Whether or not this resource should always be included - type: boolean - source: - description: Source document name or filepath - type: string - required: - - kbResource - - source - - required - NonEmptyString: - description: A string that is not empty and does not contain only whitespace - minLength: 1 - pattern: ^(?! *$).+$ - type: string - NormalizedKnowledgeBaseEntryError: - type: object - properties: - err_code: - type: string - knowledgeBaseEntries: - items: - $ref: '#/components/schemas/KnowledgeBaseEntryDetailsInError' - type: array - message: - type: string - statusCode: - type: integer - required: - - message - - statusCode - - knowledgeBaseEntries - User: - description: 'Could be any string, not necessarily a UUID' - type: object - properties: - id: - description: User id - type: string - name: - description: User name - type: string - Vector: - description: >- - Object containing Knowledge Base Entry text embeddings and modelId used - to create the embeddings - type: object - properties: - modelId: - description: ID of the model used to create the embeddings - type: string - tokens: - additionalProperties: - type: number - description: Tokens with their corresponding values - type: object - required: - - modelId - - tokens - securitySchemes: - BasicAuth: - scheme: basic - type: http -security: - - BasicAuth: [] -tags: ! '' diff --git a/x-pack/packages/kbn-elastic-assistant-common/docs/openapi/serverless/elastic_assistant_2023_10_31.bundled.schema.yaml b/x-pack/packages/kbn-elastic-assistant-common/docs/openapi/serverless/elastic_assistant_2023_10_31.bundled.schema.yaml deleted file mode 100644 index b1d547a037485..0000000000000 --- a/x-pack/packages/kbn-elastic-assistant-common/docs/openapi/serverless/elastic_assistant_2023_10_31.bundled.schema.yaml +++ /dev/null @@ -1,511 +0,0 @@ -openapi: 3.0.3 -info: - description: >- - The AI Assistant aids users in navigating complex workflows, providing smart - insights, and enhancing interactive experiences across our solutions. - title: Security Solution AI Assistant API (Elastic Cloud Serverless) - version: '2023-10-31' -servers: - - url: 'http://{kibana_host}:{port}' - variables: - kibana_host: - default: localhost - port: - default: '5601' -paths: - /api/elastic_assistant/chat/complete: - post: - description: Creates a model response for the given chat conversation. - operationId: ChatComplete - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ChatCompleteProps' - required: true - responses: - '200': - content: - application/octet-stream: - schema: - format: binary - type: string - description: Indicates a successful call. - '400': - content: - application/json: - schema: - type: object - properties: - error: - type: string - message: - type: string - statusCode: - type: number - description: Generic Error - summary: Creates a model response for the given chat conversation. - tags: - - Chat Complete API - /api/elastic_assistant/knowledge_base/entries: - post: - description: Create a Knowledge Base Entry - operationId: CreateKnowledgeBaseEntry - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/KnowledgeBaseEntryCreateProps' - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/KnowledgeBaseEntryResponse' - description: Successful request returning Knowledge Base Entries - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/KnowledgeBaseEntryErrorSchema' - description: Generic Error - summary: Create a Knowledge Base Entry - tags: - - Knowledge Base Entries API - /api/elastic_assistant/knowledge_base/entries/_bulk_action: - post: - description: >- - The bulk action is applied to all Knowledge Base Entries that match the - filter or to the list of Knowledge Base Entries by their IDs - operationId: PerformKnowledgeBaseEntryBulkAction - requestBody: - content: - application/json: - schema: - type: object - properties: - create: - items: - $ref: '#/components/schemas/KnowledgeBaseEntryCreateProps' - type: array - delete: - type: object - properties: - ids: - description: Array of Knowledge base Entry IDs - items: - type: string - minItems: 1 - type: array - query: - description: Query to filter Knowledge Base Entries - type: string - update: - items: - $ref: '#/components/schemas/KnowledgeBaseEntryUpdateProps' - type: array - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/KnowledgeBaseEntryBulkCrudActionResponse' - description: Successful bulk operation request - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/KnowledgeBaseEntryErrorSchema' - description: Generic Error - summary: Applies a bulk action to multiple Knowledge Base Entries - tags: - - Knowledge Base Entries Bulk API - '/api/elastic_assistant/knowledge_base/entries/{id}': - delete: - description: Deletes a single Knowledge Base Entry using the `id` field - operationId: DeleteKnowledgeBaseEntry - parameters: - - description: The Knowledge Base Entry's `id` value - in: path - name: id - required: true - schema: - $ref: '#/components/schemas/NonEmptyString' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/KnowledgeBaseEntryResponse' - description: Successful request returning the deleted Knowledge Base Entry - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/KnowledgeBaseEntryErrorSchema' - description: Generic Error - summary: Deletes a single Knowledge Base Entry using the `id` field - tags: - - Knowledge Base Entries API - get: - description: Read a Knowledge Base Entry - operationId: ReadKnowledgeBaseEntry - parameters: - - description: The Knowledge Base Entry's `id` value. - in: path - name: id - required: true - schema: - $ref: '#/components/schemas/NonEmptyString' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/KnowledgeBaseEntryResponse' - description: Successful request returning a Knowledge Base Entry - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/KnowledgeBaseEntryErrorSchema' - description: Generic Error - summary: Read a Knowledge Base Entry - tags: - - Knowledge Base Entries API - put: - description: Update a Knowledge Base Entry - operationId: UpdateKnowledgeBaseEntry - parameters: - - description: The Knowledge Base Entry's `id` value - in: path - name: id - required: true - schema: - $ref: '#/components/schemas/NonEmptyString' - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/KnowledgeBaseEntryUpdateProps' - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/KnowledgeBaseEntryResponse' - description: Successful request returning the updated Knowledge Base Entry - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/KnowledgeBaseEntryErrorSchema' - description: Generic Error - summary: Update a Knowledge Base Entry - tags: - - Knowledge Base Entries API -components: - schemas: - ChatCompleteProps: - type: object - properties: - connectorId: - type: string - conversationId: - type: string - isStream: - type: boolean - langSmithApiKey: - type: string - langSmithProject: - type: string - messages: - items: - $ref: '#/components/schemas/ChatMessage' - type: array - model: - type: string - persist: - type: boolean - promptId: - type: string - responseLanguage: - type: string - required: - - messages - - persist - - connectorId - ChatMessage: - description: AI assistant message. - type: object - properties: - content: - description: Message content. - type: string - data: - $ref: '#/components/schemas/MessageData' - description: ECS object to attach to the context of the message. - fields_to_anonymize: - items: - type: string - type: array - role: - $ref: '#/components/schemas/ChatMessageRole' - description: Message role. - required: - - role - ChatMessageRole: - description: Message role. - enum: - - system - - user - - assistant - type: string - KnowledgeBaseEntryBulkActionSkipReason: - enum: - - KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED - type: string - KnowledgeBaseEntryBulkActionSkipResult: - type: object - properties: - id: - type: string - name: - type: string - skip_reason: - $ref: '#/components/schemas/KnowledgeBaseEntryBulkActionSkipReason' - required: - - id - - skip_reason - KnowledgeBaseEntryBulkCrudActionResponse: - type: object - properties: - attributes: - type: object - properties: - errors: - items: - $ref: '#/components/schemas/NormalizedKnowledgeBaseEntryError' - type: array - results: - $ref: '#/components/schemas/KnowledgeBaseEntryBulkCrudActionResults' - summary: - $ref: '#/components/schemas/KnowledgeBaseEntryBulkCrudActionSummary' - required: - - results - - summary - knowledgeBaseEntriesCount: - type: integer - message: - type: string - statusCode: - type: integer - success: - type: boolean - required: - - attributes - KnowledgeBaseEntryBulkCrudActionResults: - type: object - properties: - created: - items: - $ref: '#/components/schemas/KnowledgeBaseEntryResponse' - type: array - deleted: - items: - type: string - type: array - skipped: - items: - $ref: '#/components/schemas/KnowledgeBaseEntryBulkActionSkipResult' - type: array - updated: - items: - $ref: '#/components/schemas/KnowledgeBaseEntryResponse' - type: array - required: - - updated - - created - - deleted - - skipped - KnowledgeBaseEntryBulkCrudActionSummary: - type: object - properties: - failed: - type: integer - skipped: - type: integer - succeeded: - type: integer - total: - type: integer - required: - - failed - - skipped - - succeeded - - total - KnowledgeBaseEntryCreateProps: - type: object - properties: - metadata: - $ref: '#/components/schemas/Metadata' - description: Metadata about the Knowledge Base Entry - text: - description: Knowledge Base Entry content - type: string - required: - - metadata - - text - KnowledgeBaseEntryDetailsInError: - type: object - properties: - id: - type: string - name: - type: string - required: - - id - KnowledgeBaseEntryErrorSchema: - additionalProperties: false - type: object - properties: - error: - type: string - message: - type: string - statusCode: - type: number - required: - - statusCode - - error - - message - KnowledgeBaseEntryResponse: - type: object - properties: - createdAt: - description: Time the Knowledge Base Entry was created - type: string - createdBy: - description: User who created the Knowledge Base Entry - type: string - id: - $ref: '#/components/schemas/NonEmptyString' - metadata: - $ref: '#/components/schemas/Metadata' - description: Metadata about the Knowledge Base Entry - namespace: - description: Kibana space - type: string - text: - description: Knowledge Base Entry content - type: string - timestamp: - $ref: '#/components/schemas/NonEmptyString' - updatedAt: - description: Time the Knowledge Base Entry was last updated - type: string - updatedBy: - description: User who last updated the Knowledge Base Entry - type: string - users: - items: - $ref: '#/components/schemas/User' - type: array - vector: - $ref: '#/components/schemas/Vector' - required: - - id - - createdAt - - users - - namespace - - text - KnowledgeBaseEntryUpdateProps: - type: object - properties: - id: - $ref: '#/components/schemas/NonEmptyString' - metadata: - $ref: '#/components/schemas/Metadata' - description: Metadata about the Knowledge Base Entry - required: - - id - MessageData: - additionalProperties: true - type: object - Metadata: - description: Metadata about an Knowledge Base Entry - type: object - properties: - kbResource: - description: >- - Knowledge Base resource name for grouping entries, e.g. 'esql', - 'lens-docs', etc - type: string - required: - description: Whether or not this resource should always be included - type: boolean - source: - description: Source document name or filepath - type: string - required: - - kbResource - - source - - required - NonEmptyString: - description: A string that is not empty and does not contain only whitespace - minLength: 1 - pattern: ^(?! *$).+$ - type: string - NormalizedKnowledgeBaseEntryError: - type: object - properties: - err_code: - type: string - knowledgeBaseEntries: - items: - $ref: '#/components/schemas/KnowledgeBaseEntryDetailsInError' - type: array - message: - type: string - statusCode: - type: integer - required: - - message - - statusCode - - knowledgeBaseEntries - User: - description: 'Could be any string, not necessarily a UUID' - type: object - properties: - id: - description: User id - type: string - name: - description: User name - type: string - Vector: - description: >- - Object containing Knowledge Base Entry text embeddings and modelId used - to create the embeddings - type: object - properties: - modelId: - description: ID of the model used to create the embeddings - type: string - tokens: - additionalProperties: - type: number - description: Tokens with their corresponding values - type: object - required: - - modelId - - tokens - securitySchemes: - BasicAuth: - scheme: basic - type: http -security: - - BasicAuth: [] -tags: ! '' From 7edacb24cda43e7c22851d84e1830c5fc0d9d7cb Mon Sep 17 00:00:00 2001 From: Maxim Palenov Date: Wed, 24 Jul 2024 18:36:58 +0200 Subject: [PATCH 4/6] fix improper API versions --- .../kbn-elastic-assistant-common/constants.ts | 60 +- ...lastic_assistant_api_1.bundled.schema.yaml | 1133 ----------------- ...sistant_api_2023_10_31.bundled.schema.yaml | 1111 ++++++++++++++++ ...lastic_assistant_api_1.bundled.schema.yaml | 1133 ----------------- ...sistant_api_2023_10_31.bundled.schema.yaml | 1111 ++++++++++++++++ ...ulk_crud_anonymization_fields_route.gen.ts | 2 +- ...rud_anonymization_fields_route.schema.yaml | 3 +- .../find_anonymization_fields_route.gen.ts | 2 +- ...ind_anonymization_fields_route.schema.yaml | 2 +- .../conversations/append_message.gen.ts | 44 + .../conversations/append_message.schema.yaml | 47 + .../crud_conversation_route.gen.ts | 27 +- .../crud_conversation_route.schema.yaml | 45 +- .../find_conversations_route.gen.ts | 2 +- .../find_conversations_route.schema.yaml | 2 +- .../impl/schemas/index.ts | 3 +- .../prompts/bulk_crud_prompts_route.gen.ts | 2 +- .../bulk_crud_prompts_route.schema.yaml | 3 +- .../schemas/prompts/find_prompts_route.gen.ts | 2 +- .../prompts/find_prompts_route.schema.yaml | 2 +- 20 files changed, 2365 insertions(+), 2371 deletions(-) delete mode 100644 x-pack/packages/kbn-elastic-assistant-common/docs/openapi/ess/elastic_assistant_api_1.bundled.schema.yaml delete mode 100644 x-pack/packages/kbn-elastic-assistant-common/docs/openapi/serverless/elastic_assistant_api_1.bundled.schema.yaml create mode 100644 x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/append_message.gen.ts create mode 100644 x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/append_message.schema.yaml diff --git a/x-pack/packages/kbn-elastic-assistant-common/constants.ts b/x-pack/packages/kbn-elastic-assistant-common/constants.ts index 144bbcaeb0226..a25c935139b24 100755 --- a/x-pack/packages/kbn-elastic-assistant-common/constants.ts +++ b/x-pack/packages/kbn-elastic-assistant-common/constants.ts @@ -10,27 +10,43 @@ export const ELASTIC_AI_ASSISTANT_INTERNAL_API_VERSION = '1'; export const ELASTIC_AI_ASSISTANT_URL = '/api/security_ai_assistant'; export const ELASTIC_AI_ASSISTANT_INTERNAL_URL = '/internal/elastic_assistant'; -export const ELASTIC_AI_ASSISTANT_CONVERSATIONS_URL = `${ELASTIC_AI_ASSISTANT_URL}/current_user/conversations`; -export const ELASTIC_AI_ASSISTANT_CONVERSATIONS_URL_BY_ID = `${ELASTIC_AI_ASSISTANT_CONVERSATIONS_URL}/{id}`; - -export const ELASTIC_AI_ASSISTANT_INTERNAL_CONVERSATIONS_URL = `${ELASTIC_AI_ASSISTANT_INTERNAL_URL}/current_user/conversations`; -export const ELASTIC_AI_ASSISTANT_CONVERSATIONS_URL_BY_ID_MESSAGES = `${ELASTIC_AI_ASSISTANT_INTERNAL_CONVERSATIONS_URL}/{id}/messages`; - -export const ELASTIC_AI_ASSISTANT_CHAT_COMPLETE_URL = `${ELASTIC_AI_ASSISTANT_URL}/chat/complete`; - -export const ELASTIC_AI_ASSISTANT_CONVERSATIONS_URL_BULK_ACTION = `${ELASTIC_AI_ASSISTANT_INTERNAL_CONVERSATIONS_URL}/_bulk_action`; -export const ELASTIC_AI_ASSISTANT_CONVERSATIONS_URL_FIND = `${ELASTIC_AI_ASSISTANT_CONVERSATIONS_URL}/_find`; - -export const ELASTIC_AI_ASSISTANT_PROMPTS_URL = `${ELASTIC_AI_ASSISTANT_URL}/prompts`; -export const ELASTIC_AI_ASSISTANT_PROMPTS_URL_BULK_ACTION = `${ELASTIC_AI_ASSISTANT_PROMPTS_URL}/_bulk_action`; -export const ELASTIC_AI_ASSISTANT_PROMPTS_URL_FIND = `${ELASTIC_AI_ASSISTANT_PROMPTS_URL}/_find`; - -export const ELASTIC_AI_ASSISTANT_ANONYMIZATION_FIELDS_URL = `${ELASTIC_AI_ASSISTANT_URL}/anonymization_fields`; -export const ELASTIC_AI_ASSISTANT_ANONYMIZATION_FIELDS_URL_BULK_ACTION = `${ELASTIC_AI_ASSISTANT_ANONYMIZATION_FIELDS_URL}/_bulk_action`; -export const ELASTIC_AI_ASSISTANT_ANONYMIZATION_FIELDS_URL_FIND = `${ELASTIC_AI_ASSISTANT_ANONYMIZATION_FIELDS_URL}/_find`; +export const ELASTIC_AI_ASSISTANT_CONVERSATIONS_URL = + `${ELASTIC_AI_ASSISTANT_URL}/current_user/conversations` as const; +export const ELASTIC_AI_ASSISTANT_CONVERSATIONS_URL_BY_ID = + `${ELASTIC_AI_ASSISTANT_CONVERSATIONS_URL}/{id}` as const; + +export const ELASTIC_AI_ASSISTANT_INTERNAL_CONVERSATIONS_URL = + `${ELASTIC_AI_ASSISTANT_INTERNAL_URL}/current_user/conversations` as const; +export const ELASTIC_AI_ASSISTANT_CONVERSATIONS_URL_BY_ID_MESSAGES = + `${ELASTIC_AI_ASSISTANT_INTERNAL_CONVERSATIONS_URL}/{id}/messages` as const; + +export const ELASTIC_AI_ASSISTANT_CHAT_COMPLETE_URL = + `${ELASTIC_AI_ASSISTANT_URL}/chat/complete` as const; + +export const ELASTIC_AI_ASSISTANT_CONVERSATIONS_URL_BULK_ACTION = + `${ELASTIC_AI_ASSISTANT_INTERNAL_CONVERSATIONS_URL}/_bulk_action` as const; +export const ELASTIC_AI_ASSISTANT_CONVERSATIONS_URL_FIND = + `${ELASTIC_AI_ASSISTANT_CONVERSATIONS_URL}/_find` as const; + +export const ELASTIC_AI_ASSISTANT_PROMPTS_URL = `${ELASTIC_AI_ASSISTANT_URL}/prompts` as const; +export const ELASTIC_AI_ASSISTANT_PROMPTS_URL_BULK_ACTION = + `${ELASTIC_AI_ASSISTANT_PROMPTS_URL}/_bulk_action` as const; +export const ELASTIC_AI_ASSISTANT_PROMPTS_URL_FIND = + `${ELASTIC_AI_ASSISTANT_PROMPTS_URL}/_find` as const; + +export const ELASTIC_AI_ASSISTANT_ANONYMIZATION_FIELDS_URL = + `${ELASTIC_AI_ASSISTANT_URL}/anonymization_fields` as const; +export const ELASTIC_AI_ASSISTANT_ANONYMIZATION_FIELDS_URL_BULK_ACTION = + `${ELASTIC_AI_ASSISTANT_ANONYMIZATION_FIELDS_URL}/_bulk_action` as const; +export const ELASTIC_AI_ASSISTANT_ANONYMIZATION_FIELDS_URL_FIND = + `${ELASTIC_AI_ASSISTANT_ANONYMIZATION_FIELDS_URL}/_find` as const; // TODO: Update existing 'status' endpoint to take resource as query param as to not conflict with 'entries' -export const ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_URL = `${ELASTIC_AI_ASSISTANT_INTERNAL_URL}/knowledge_base/{resource?}`; -export const ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_ENTRIES_URL = `${ELASTIC_AI_ASSISTANT_INTERNAL_URL}/knowledge_base/entries`; -export const ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_ENTRIES_URL_FIND = `${ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_ENTRIES_URL}/_find`; -export const ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_ENTRIES_URL_BULK_ACTION = `${ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_ENTRIES_URL}/_bulk_action`; +export const ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_URL = + `${ELASTIC_AI_ASSISTANT_INTERNAL_URL}/knowledge_base/{resource?}` as const; +export const ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_ENTRIES_URL = + `${ELASTIC_AI_ASSISTANT_INTERNAL_URL}/knowledge_base/entries` as const; +export const ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_ENTRIES_URL_FIND = + `${ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_ENTRIES_URL}/_find` as const; +export const ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_ENTRIES_URL_BULK_ACTION = + `${ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_ENTRIES_URL}/_bulk_action` as const; diff --git a/x-pack/packages/kbn-elastic-assistant-common/docs/openapi/ess/elastic_assistant_api_1.bundled.schema.yaml b/x-pack/packages/kbn-elastic-assistant-common/docs/openapi/ess/elastic_assistant_api_1.bundled.schema.yaml deleted file mode 100644 index be9cb47ef033d..0000000000000 --- a/x-pack/packages/kbn-elastic-assistant-common/docs/openapi/ess/elastic_assistant_api_1.bundled.schema.yaml +++ /dev/null @@ -1,1133 +0,0 @@ -openapi: 3.0.3 -info: - description: Manage and interact with Security Assistant resources. - title: Security AI Assistant API (Elastic Cloud & self-hosted) - version: '1' -servers: - - url: 'http://{kibana_host}:{port}' - variables: - kibana_host: - default: localhost - port: - default: '5601' -paths: - /api/security_ai_assistant/anonymization_fields/_bulk_action: - post: - description: >- - The bulk action is applied to all anonymization fields that match the - filter or to the list of anonymization fields by their IDs. - operationId: PerformBulkAction - requestBody: - content: - application/json: - schema: - type: object - properties: - create: - items: - $ref: '#/components/schemas/AnonymizationFieldCreateProps' - type: array - delete: - type: object - properties: - ids: - description: Array of anonymization fields IDs - items: - type: string - minItems: 1 - type: array - query: - description: Query to filter anonymization fields - type: string - update: - items: - $ref: '#/components/schemas/AnonymizationFieldUpdateProps' - type: array - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/AnonymizationFieldsBulkCrudActionResponse' - description: Indicates a successful call. - '400': - content: - application/json: - schema: - type: object - properties: - error: - type: string - message: - type: string - statusCode: - type: number - description: Generic Error - summary: Applies a bulk action to multiple anonymization fields - tags: - - Bulk API - /api/security_ai_assistant/anonymization_fields/_find: - get: - description: Finds anonymization fields that match the given query. - operationId: FindAnonymizationFields - parameters: - - in: query - name: fields - required: false - schema: - items: - type: string - type: array - - description: Search query - in: query - name: filter - required: false - schema: - type: string - - description: Field to sort by - in: query - name: sort_field - required: false - schema: - $ref: '#/components/schemas/FindAnonymizationFieldsSortField' - - description: Sort order - in: query - name: sort_order - required: false - schema: - $ref: '#/components/schemas/SortOrder' - - description: Page number - in: query - name: page - required: false - schema: - default: 1 - minimum: 1 - type: integer - - description: AnonymizationFields per page - in: query - name: per_page - required: false - schema: - default: 20 - minimum: 0 - type: integer - responses: - '200': - content: - application/json: - schema: - type: object - properties: - data: - items: - $ref: '#/components/schemas/AnonymizationFieldResponse' - type: array - page: - type: integer - perPage: - type: integer - total: - type: integer - required: - - page - - perPage - - total - - data - description: Successful response - '400': - content: - application/json: - schema: - type: object - properties: - error: - type: string - message: - type: string - statusCode: - type: number - description: Generic Error - summary: Finds anonymization fields that match the given query. - tags: - - AnonymizationFields API - /api/security_ai_assistant/current_user/conversations: - post: - description: Create a conversation - operationId: CreateConversation - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ConversationCreateProps' - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ConversationResponse' - description: Indicates a successful call. - '400': - content: - application/json: - schema: - type: object - properties: - error: - type: string - message: - type: string - statusCode: - type: number - description: Generic Error - summary: Create a conversation - tags: - - Conversation API - /api/security_ai_assistant/current_user/conversations/_find: - get: - description: Finds conversations that match the given query. - operationId: FindConversations - parameters: - - in: query - name: fields - required: false - schema: - items: - type: string - type: array - - description: Search query - in: query - name: filter - required: false - schema: - type: string - - description: Field to sort by - in: query - name: sort_field - required: false - schema: - $ref: '#/components/schemas/FindConversationsSortField' - - description: Sort order - in: query - name: sort_order - required: false - schema: - $ref: '#/components/schemas/SortOrder' - - description: Page number - in: query - name: page - required: false - schema: - default: 1 - minimum: 1 - type: integer - - description: Conversations per page - in: query - name: per_page - required: false - schema: - default: 20 - minimum: 0 - type: integer - responses: - '200': - content: - application/json: - schema: - type: object - properties: - data: - items: - $ref: '#/components/schemas/ConversationResponse' - type: array - page: - type: integer - perPage: - type: integer - total: - type: integer - required: - - page - - perPage - - total - - data - description: Successful response - '400': - content: - application/json: - schema: - type: object - properties: - error: - type: string - message: - type: string - statusCode: - type: number - description: Generic Error - summary: Finds conversations that match the given query. - tags: - - Conversations API - '/api/security_ai_assistant/current_user/conversations/{id}': - delete: - description: Deletes a single conversation using the `id` field. - operationId: DeleteConversation - parameters: - - description: The conversation's `id` value. - in: path - name: id - required: true - schema: - $ref: '#/components/schemas/NonEmptyString' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ConversationResponse' - description: Indicates a successful call. - '400': - content: - application/json: - schema: - type: object - properties: - error: - type: string - message: - type: string - statusCode: - type: number - description: Generic Error - summary: Deletes a single conversation using the `id` field. - tags: - - Conversation API - get: - description: Read a single conversation - operationId: ReadConversation - parameters: - - description: The conversation's `id` value. - in: path - name: id - required: true - schema: - $ref: '#/components/schemas/NonEmptyString' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ConversationResponse' - description: Indicates a successful call. - '400': - content: - application/json: - schema: - type: object - properties: - error: - type: string - message: - type: string - statusCode: - type: number - description: Generic Error - summary: Read a single conversation - tags: - - Conversations API - put: - description: Update a single conversation - operationId: UpdateConversation - parameters: - - description: The conversation's `id` value. - in: path - name: id - required: true - schema: - $ref: '#/components/schemas/NonEmptyString' - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ConversationUpdateProps' - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ConversationResponse' - description: Indicates a successful call. - '400': - content: - application/json: - schema: - type: object - properties: - error: - type: string - message: - type: string - statusCode: - type: number - description: Generic Error - summary: Update a conversation - tags: - - Conversation API - /api/security_ai_assistant/prompts/_bulk_action: - post: - description: >- - The bulk action is applied to all prompts that match the filter or to - the list of prompts by their IDs. - operationId: PerformBulkAction - requestBody: - content: - application/json: - schema: - type: object - properties: - create: - items: - $ref: '#/components/schemas/PromptCreateProps' - type: array - delete: - type: object - properties: - ids: - description: Array of prompts IDs - items: - type: string - minItems: 1 - type: array - query: - description: Query to filter promps - type: string - update: - items: - $ref: '#/components/schemas/PromptUpdateProps' - type: array - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PromptsBulkCrudActionResponse' - description: Indicates a successful call. - '400': - content: - application/json: - schema: - type: object - properties: - error: - type: string - message: - type: string - statusCode: - type: number - description: Generic Error - summary: Applies a bulk action to multiple prompts - tags: - - Bulk API - /api/security_ai_assistant/prompts/_find: - get: - description: Finds prompts that match the given query. - operationId: FindPrompts - parameters: - - in: query - name: fields - required: false - schema: - items: - type: string - type: array - - description: Search query - in: query - name: filter - required: false - schema: - type: string - - description: Field to sort by - in: query - name: sort_field - required: false - schema: - $ref: '#/components/schemas/FindPromptsSortField' - - description: Sort order - in: query - name: sort_order - required: false - schema: - $ref: '#/components/schemas/SortOrder' - - description: Page number - in: query - name: page - required: false - schema: - default: 1 - minimum: 1 - type: integer - - description: Prompts per page - in: query - name: per_page - required: false - schema: - default: 20 - minimum: 0 - type: integer - responses: - '200': - content: - application/json: - schema: - type: object - properties: - data: - items: - $ref: '#/components/schemas/PromptResponse' - type: array - page: - type: integer - perPage: - type: integer - total: - type: integer - required: - - page - - perPage - - total - - data - description: Successful response - '400': - content: - application/json: - schema: - type: object - properties: - error: - type: string - message: - type: string - statusCode: - type: number - description: Generic Error - summary: Finds prompts that match the given query. - tags: - - Prompts API -components: - schemas: - AnonymizationFieldCreateProps: - type: object - properties: - allowed: - type: boolean - anonymized: - type: boolean - field: - type: string - required: - - field - AnonymizationFieldDetailsInError: - type: object - properties: - id: - type: string - name: - type: string - required: - - id - AnonymizationFieldResponse: - type: object - properties: - allowed: - type: boolean - anonymized: - type: boolean - createdAt: - type: string - createdBy: - type: string - field: - type: string - id: - $ref: '#/components/schemas/NonEmptyString' - namespace: - description: Kibana space - type: string - timestamp: - $ref: '#/components/schemas/NonEmptyString' - updatedAt: - type: string - updatedBy: - type: string - required: - - id - - field - AnonymizationFieldsBulkActionSkipReason: - enum: - - ANONYMIZATION_FIELD_NOT_MODIFIED - type: string - AnonymizationFieldsBulkActionSkipResult: - type: object - properties: - id: - type: string - name: - type: string - skip_reason: - $ref: '#/components/schemas/AnonymizationFieldsBulkActionSkipReason' - required: - - id - - skip_reason - AnonymizationFieldsBulkCrudActionResponse: - type: object - properties: - anonymization_fields_count: - type: integer - attributes: - type: object - properties: - errors: - items: - $ref: '#/components/schemas/NormalizedAnonymizationFieldError' - type: array - results: - $ref: '#/components/schemas/AnonymizationFieldsBulkCrudActionResults' - summary: - $ref: '#/components/schemas/BulkCrudActionSummary' - required: - - results - - summary - message: - type: string - status_code: - type: integer - success: - type: boolean - required: - - attributes - AnonymizationFieldsBulkCrudActionResults: - type: object - properties: - created: - items: - $ref: '#/components/schemas/AnonymizationFieldResponse' - type: array - deleted: - items: - type: string - type: array - skipped: - items: - $ref: '#/components/schemas/AnonymizationFieldsBulkActionSkipResult' - type: array - updated: - items: - $ref: '#/components/schemas/AnonymizationFieldResponse' - type: array - required: - - updated - - created - - deleted - - skipped - AnonymizationFieldUpdateProps: - type: object - properties: - allowed: - type: boolean - anonymized: - type: boolean - id: - type: string - required: - - id - ApiConfig: - type: object - properties: - actionTypeId: - description: action type id - type: string - connectorId: - description: connector id - type: string - defaultSystemPromptId: - description: defaultSystemPromptId - type: string - model: - description: model - type: string - provider: - $ref: '#/components/schemas/Provider' - description: Provider - required: - - connectorId - - actionTypeId - BulkCrudActionSummary: - type: object - properties: - failed: - type: integer - skipped: - type: integer - succeeded: - type: integer - total: - type: integer - required: - - failed - - skipped - - succeeded - - total - ConversationCategory: - description: The conversation category. - enum: - - assistant - - insights - type: string - ConversationConfidence: - description: The conversation confidence. - enum: - - low - - medium - - high - type: string - ConversationCreateProps: - type: object - properties: - apiConfig: - $ref: '#/components/schemas/ApiConfig' - description: LLM API configuration. - category: - $ref: '#/components/schemas/ConversationCategory' - description: The conversation category. - excludeFromLastConversationStorage: - description: excludeFromLastConversationStorage. - type: boolean - id: - description: The conversation id. - type: string - isDefault: - description: Is default conversation. - type: boolean - messages: - description: The conversation messages. - items: - $ref: '#/components/schemas/Message' - type: array - replacements: - $ref: '#/components/schemas/Replacements' - title: - description: The conversation title. - type: string - required: - - title - ConversationResponse: - type: object - properties: - apiConfig: - $ref: '#/components/schemas/ApiConfig' - description: LLM API configuration. - category: - $ref: '#/components/schemas/ConversationCategory' - description: The conversation category. - createdAt: - description: The last time conversation was updated. - type: string - excludeFromLastConversationStorage: - description: excludeFromLastConversationStorage. - type: boolean - id: - $ref: '#/components/schemas/NonEmptyString' - isDefault: - description: Is default conversation. - type: boolean - messages: - description: The conversation messages. - items: - $ref: '#/components/schemas/Message' - type: array - namespace: - description: Kibana space - type: string - replacements: - $ref: '#/components/schemas/Replacements' - summary: - $ref: '#/components/schemas/ConversationSummary' - timestamp: - $ref: '#/components/schemas/NonEmptyString' - title: - description: The conversation title. - type: string - updatedAt: - description: The last time conversation was updated. - type: string - users: - items: - $ref: '#/components/schemas/User' - type: array - required: - - id - - title - - createdAt - - users - - namespace - - category - ConversationSummary: - type: object - properties: - confidence: - $ref: '#/components/schemas/ConversationConfidence' - description: >- - How confident you are about this being a correct and useful - learning. - content: - description: Summary text of the conversation over time. - type: string - public: - description: Define if summary is marked as publicly available. - type: boolean - timestamp: - $ref: '#/components/schemas/NonEmptyString' - description: The timestamp summary was updated. - ConversationUpdateProps: - type: object - properties: - apiConfig: - $ref: '#/components/schemas/ApiConfig' - description: LLM API configuration. - category: - $ref: '#/components/schemas/ConversationCategory' - description: The conversation category. - excludeFromLastConversationStorage: - description: excludeFromLastConversationStorage. - type: boolean - id: - $ref: '#/components/schemas/NonEmptyString' - messages: - description: The conversation messages. - items: - $ref: '#/components/schemas/Message' - type: array - replacements: - $ref: '#/components/schemas/Replacements' - summary: - $ref: '#/components/schemas/ConversationSummary' - title: - description: The conversation title. - type: string - required: - - id - FindAnonymizationFieldsSortField: - enum: - - created_at - - anonymized - - allowed - - field - - updated_at - type: string - FindConversationsSortField: - enum: - - created_at - - is_default - - title - - updated_at - type: string - FindPromptsSortField: - enum: - - created_at - - is_default - - name - - updated_at - type: string - Message: - description: AI assistant conversation message. - type: object - properties: - content: - description: Message content. - type: string - isError: - description: Is error message. - type: boolean - reader: - $ref: '#/components/schemas/Reader' - description: Message content. - role: - $ref: '#/components/schemas/MessageRole' - description: Message role. - timestamp: - $ref: '#/components/schemas/NonEmptyString' - description: The timestamp message was sent or received. - traceData: - $ref: '#/components/schemas/TraceData' - description: trace Data - required: - - timestamp - - content - - role - MessageRole: - description: Message role. - enum: - - system - - user - - assistant - type: string - NonEmptyString: - description: A string that is not empty and does not contain only whitespace - minLength: 1 - pattern: ^(?! *$).+$ - type: string - NormalizedAnonymizationFieldError: - type: object - properties: - anonymization_fields: - items: - $ref: '#/components/schemas/AnonymizationFieldDetailsInError' - type: array - err_code: - type: string - message: - type: string - status_code: - type: integer - required: - - message - - status_code - - anonymization_fields - NormalizedPromptError: - type: object - properties: - err_code: - type: string - message: - type: string - prompts: - items: - $ref: '#/components/schemas/PromptDetailsInError' - type: array - status_code: - type: integer - required: - - message - - status_code - - prompts - PromptCreateProps: - type: object - properties: - categories: - items: - type: string - type: array - color: - type: string - consumer: - type: string - content: - type: string - isDefault: - type: boolean - isNewConversationDefault: - type: boolean - name: - type: string - promptType: - $ref: '#/components/schemas/PromptType' - required: - - name - - content - - promptType - PromptDetailsInError: - type: object - properties: - id: - type: string - name: - type: string - required: - - id - PromptResponse: - type: object - properties: - categories: - items: - type: string - type: array - color: - type: string - consumer: - type: string - content: - type: string - createdAt: - type: string - createdBy: - type: string - id: - $ref: '#/components/schemas/NonEmptyString' - isDefault: - type: boolean - isNewConversationDefault: - type: boolean - name: - type: string - namespace: - description: Kibana space - type: string - promptType: - $ref: '#/components/schemas/PromptType' - timestamp: - $ref: '#/components/schemas/NonEmptyString' - updatedAt: - type: string - updatedBy: - type: string - users: - items: - $ref: '#/components/schemas/User' - type: array - required: - - id - - name - - promptType - - content - PromptsBulkActionSkipReason: - enum: - - PROMPT_FIELD_NOT_MODIFIED - type: string - PromptsBulkActionSkipResult: - type: object - properties: - id: - type: string - name: - type: string - skip_reason: - $ref: '#/components/schemas/PromptsBulkActionSkipReason' - required: - - id - - skip_reason - PromptsBulkCrudActionResponse: - type: object - properties: - attributes: - type: object - properties: - errors: - items: - $ref: '#/components/schemas/NormalizedPromptError' - type: array - results: - $ref: '#/components/schemas/PromptsBulkCrudActionResults' - summary: - $ref: '#/components/schemas/BulkCrudActionSummary' - required: - - results - - summary - message: - type: string - prompts_count: - type: integer - status_code: - type: integer - success: - type: boolean - required: - - attributes - PromptsBulkCrudActionResults: - type: object - properties: - created: - items: - $ref: '#/components/schemas/PromptResponse' - type: array - deleted: - items: - type: string - type: array - skipped: - items: - $ref: '#/components/schemas/PromptsBulkActionSkipResult' - type: array - updated: - items: - $ref: '#/components/schemas/PromptResponse' - type: array - required: - - updated - - created - - deleted - - skipped - PromptType: - description: Prompt type - enum: - - system - - quick - type: string - PromptUpdateProps: - type: object - properties: - categories: - items: - type: string - type: array - color: - type: string - consumer: - type: string - content: - type: string - id: - type: string - isDefault: - type: boolean - isNewConversationDefault: - type: boolean - required: - - id - Provider: - description: Provider - enum: - - OpenAI - - Azure OpenAI - type: string - Reader: - additionalProperties: true - type: object - Replacements: - additionalProperties: - type: string - description: Replacements object used to anonymize/deanomymize messsages - type: object - SortOrder: - enum: - - asc - - desc - type: string - TraceData: - description: trace Data - type: object - properties: - traceId: - description: 'Could be any string, not necessarily a UUID' - type: string - transactionId: - description: 'Could be any string, not necessarily a UUID' - type: string - User: - description: 'Could be any string, not necessarily a UUID' - type: object - properties: - id: - description: User id - type: string - name: - description: User name - type: string - securitySchemes: - BasicAuth: - scheme: basic - type: http -security: - - BasicAuth: [] -tags: ! '' diff --git a/x-pack/packages/kbn-elastic-assistant-common/docs/openapi/ess/elastic_assistant_api_2023_10_31.bundled.schema.yaml b/x-pack/packages/kbn-elastic-assistant-common/docs/openapi/ess/elastic_assistant_api_2023_10_31.bundled.schema.yaml index 701df70006d88..be3b7da9e910a 100644 --- a/x-pack/packages/kbn-elastic-assistant-common/docs/openapi/ess/elastic_assistant_api_2023_10_31.bundled.schema.yaml +++ b/x-pack/packages/kbn-elastic-assistant-common/docs/openapi/ess/elastic_assistant_api_2023_10_31.bundled.schema.yaml @@ -11,6 +11,146 @@ servers: port: default: '5601' paths: + /api/security_ai_assistant/anonymization_fields/_bulk_action: + post: + description: >- + The bulk action is applied to all anonymization fields that match the + filter or to the list of anonymization fields by their IDs. + operationId: PerformBulkAction + requestBody: + content: + application/json: + schema: + type: object + properties: + create: + items: + $ref: '#/components/schemas/AnonymizationFieldCreateProps' + type: array + delete: + type: object + properties: + ids: + description: Array of anonymization fields IDs + items: + type: string + minItems: 1 + type: array + query: + description: Query to filter anonymization fields + type: string + update: + items: + $ref: '#/components/schemas/AnonymizationFieldUpdateProps' + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/AnonymizationFieldsBulkCrudActionResponse' + description: Indicates a successful call. + '400': + content: + application/json: + schema: + type: object + properties: + error: + type: string + message: + type: string + statusCode: + type: number + description: Generic Error + summary: Applies a bulk action to multiple anonymization fields + tags: + - Bulk API + /api/security_ai_assistant/anonymization_fields/_find: + get: + description: Finds anonymization fields that match the given query. + operationId: FindAnonymizationFields + parameters: + - in: query + name: fields + required: false + schema: + items: + type: string + type: array + - description: Search query + in: query + name: filter + required: false + schema: + type: string + - description: Field to sort by + in: query + name: sort_field + required: false + schema: + $ref: '#/components/schemas/FindAnonymizationFieldsSortField' + - description: Sort order + in: query + name: sort_order + required: false + schema: + $ref: '#/components/schemas/SortOrder' + - description: Page number + in: query + name: page + required: false + schema: + default: 1 + minimum: 1 + type: integer + - description: AnonymizationFields per page + in: query + name: per_page + required: false + schema: + default: 20 + minimum: 0 + type: integer + responses: + '200': + content: + application/json: + schema: + type: object + properties: + data: + items: + $ref: '#/components/schemas/AnonymizationFieldResponse' + type: array + page: + type: integer + perPage: + type: integer + total: + type: integer + required: + - page + - perPage + - total + - data + description: Successful response + '400': + content: + application/json: + schema: + type: object + properties: + error: + type: string + message: + type: string + statusCode: + type: number + description: Generic Error + summary: Finds anonymization fields that match the given query. + tags: + - AnonymizationFields API /api/security_ai_assistant/chat/complete: post: description: Creates a model response for the given chat conversation. @@ -45,8 +185,534 @@ paths: summary: Creates a model response for the given chat conversation. tags: - Chat Complete API + /api/security_ai_assistant/current_user/conversations: + post: + description: Create a conversation + operationId: CreateConversation + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ConversationCreateProps' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ConversationResponse' + description: Indicates a successful call. + '400': + content: + application/json: + schema: + type: object + properties: + error: + type: string + message: + type: string + statusCode: + type: number + description: Generic Error + summary: Create a conversation + tags: + - Conversation API + /api/security_ai_assistant/current_user/conversations/_find: + get: + description: Finds conversations that match the given query. + operationId: FindConversations + parameters: + - in: query + name: fields + required: false + schema: + items: + type: string + type: array + - description: Search query + in: query + name: filter + required: false + schema: + type: string + - description: Field to sort by + in: query + name: sort_field + required: false + schema: + $ref: '#/components/schemas/FindConversationsSortField' + - description: Sort order + in: query + name: sort_order + required: false + schema: + $ref: '#/components/schemas/SortOrder' + - description: Page number + in: query + name: page + required: false + schema: + default: 1 + minimum: 1 + type: integer + - description: Conversations per page + in: query + name: per_page + required: false + schema: + default: 20 + minimum: 0 + type: integer + responses: + '200': + content: + application/json: + schema: + type: object + properties: + data: + items: + $ref: '#/components/schemas/ConversationResponse' + type: array + page: + type: integer + perPage: + type: integer + total: + type: integer + required: + - page + - perPage + - total + - data + description: Successful response + '400': + content: + application/json: + schema: + type: object + properties: + error: + type: string + message: + type: string + statusCode: + type: number + description: Generic Error + summary: Finds conversations that match the given query. + tags: + - Conversations API + '/api/security_ai_assistant/current_user/conversations/{id}': + delete: + description: Deletes a single conversation using the `id` field. + operationId: DeleteConversation + parameters: + - description: The conversation's `id` value. + in: path + name: id + required: true + schema: + $ref: '#/components/schemas/NonEmptyString' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ConversationResponse' + description: Indicates a successful call. + '400': + content: + application/json: + schema: + type: object + properties: + error: + type: string + message: + type: string + statusCode: + type: number + description: Generic Error + summary: Deletes a single conversation using the `id` field. + tags: + - Conversation API + get: + description: Read a single conversation + operationId: ReadConversation + parameters: + - description: The conversation's `id` value. + in: path + name: id + required: true + schema: + $ref: '#/components/schemas/NonEmptyString' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ConversationResponse' + description: Indicates a successful call. + '400': + content: + application/json: + schema: + type: object + properties: + error: + type: string + message: + type: string + statusCode: + type: number + description: Generic Error + summary: Read a single conversation + tags: + - Conversations API + put: + description: Update a single conversation + operationId: UpdateConversation + parameters: + - description: The conversation's `id` value. + in: path + name: id + required: true + schema: + $ref: '#/components/schemas/NonEmptyString' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ConversationUpdateProps' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ConversationResponse' + description: Indicates a successful call. + '400': + content: + application/json: + schema: + type: object + properties: + error: + type: string + message: + type: string + statusCode: + type: number + description: Generic Error + summary: Update a conversation + tags: + - Conversation API + /api/security_ai_assistant/prompts/_bulk_action: + post: + description: >- + The bulk action is applied to all prompts that match the filter or to + the list of prompts by their IDs. + operationId: PerformBulkAction + requestBody: + content: + application/json: + schema: + type: object + properties: + create: + items: + $ref: '#/components/schemas/PromptCreateProps' + type: array + delete: + type: object + properties: + ids: + description: Array of prompts IDs + items: + type: string + minItems: 1 + type: array + query: + description: Query to filter promps + type: string + update: + items: + $ref: '#/components/schemas/PromptUpdateProps' + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PromptsBulkCrudActionResponse' + description: Indicates a successful call. + '400': + content: + application/json: + schema: + type: object + properties: + error: + type: string + message: + type: string + statusCode: + type: number + description: Generic Error + summary: Applies a bulk action to multiple prompts + tags: + - Bulk API + /api/security_ai_assistant/prompts/_find: + get: + description: Finds prompts that match the given query. + operationId: FindPrompts + parameters: + - in: query + name: fields + required: false + schema: + items: + type: string + type: array + - description: Search query + in: query + name: filter + required: false + schema: + type: string + - description: Field to sort by + in: query + name: sort_field + required: false + schema: + $ref: '#/components/schemas/FindPromptsSortField' + - description: Sort order + in: query + name: sort_order + required: false + schema: + $ref: '#/components/schemas/SortOrder' + - description: Page number + in: query + name: page + required: false + schema: + default: 1 + minimum: 1 + type: integer + - description: Prompts per page + in: query + name: per_page + required: false + schema: + default: 20 + minimum: 0 + type: integer + responses: + '200': + content: + application/json: + schema: + type: object + properties: + data: + items: + $ref: '#/components/schemas/PromptResponse' + type: array + page: + type: integer + perPage: + type: integer + total: + type: integer + required: + - page + - perPage + - total + - data + description: Successful response + '400': + content: + application/json: + schema: + type: object + properties: + error: + type: string + message: + type: string + statusCode: + type: number + description: Generic Error + summary: Finds prompts that match the given query. + tags: + - Prompts API components: schemas: + AnonymizationFieldCreateProps: + type: object + properties: + allowed: + type: boolean + anonymized: + type: boolean + field: + type: string + required: + - field + AnonymizationFieldDetailsInError: + type: object + properties: + id: + type: string + name: + type: string + required: + - id + AnonymizationFieldResponse: + type: object + properties: + allowed: + type: boolean + anonymized: + type: boolean + createdAt: + type: string + createdBy: + type: string + field: + type: string + id: + $ref: '#/components/schemas/NonEmptyString' + namespace: + description: Kibana space + type: string + timestamp: + $ref: '#/components/schemas/NonEmptyString' + updatedAt: + type: string + updatedBy: + type: string + required: + - id + - field + AnonymizationFieldsBulkActionSkipReason: + enum: + - ANONYMIZATION_FIELD_NOT_MODIFIED + type: string + AnonymizationFieldsBulkActionSkipResult: + type: object + properties: + id: + type: string + name: + type: string + skip_reason: + $ref: '#/components/schemas/AnonymizationFieldsBulkActionSkipReason' + required: + - id + - skip_reason + AnonymizationFieldsBulkCrudActionResponse: + type: object + properties: + anonymization_fields_count: + type: integer + attributes: + type: object + properties: + errors: + items: + $ref: '#/components/schemas/NormalizedAnonymizationFieldError' + type: array + results: + $ref: '#/components/schemas/AnonymizationFieldsBulkCrudActionResults' + summary: + $ref: '#/components/schemas/BulkCrudActionSummary' + required: + - results + - summary + message: + type: string + status_code: + type: integer + success: + type: boolean + required: + - attributes + AnonymizationFieldsBulkCrudActionResults: + type: object + properties: + created: + items: + $ref: '#/components/schemas/AnonymizationFieldResponse' + type: array + deleted: + items: + type: string + type: array + skipped: + items: + $ref: '#/components/schemas/AnonymizationFieldsBulkActionSkipResult' + type: array + updated: + items: + $ref: '#/components/schemas/AnonymizationFieldResponse' + type: array + required: + - updated + - created + - deleted + - skipped + AnonymizationFieldUpdateProps: + type: object + properties: + allowed: + type: boolean + anonymized: + type: boolean + id: + type: string + required: + - id + ApiConfig: + type: object + properties: + actionTypeId: + description: action type id + type: string + connectorId: + description: connector id + type: string + defaultSystemPromptId: + description: defaultSystemPromptId + type: string + model: + description: model + type: string + provider: + $ref: '#/components/schemas/Provider' + description: Provider + required: + - connectorId + - actionTypeId + BulkCrudActionSummary: + type: object + properties: + failed: + type: integer + skipped: + type: integer + succeeded: + type: integer + total: + type: integer + required: + - failed + - skipped + - succeeded + - total ChatCompleteProps: type: object properties: @@ -102,9 +768,454 @@ components: - user - assistant type: string + ConversationCategory: + description: The conversation category. + enum: + - assistant + - insights + type: string + ConversationConfidence: + description: The conversation confidence. + enum: + - low + - medium + - high + type: string + ConversationCreateProps: + type: object + properties: + apiConfig: + $ref: '#/components/schemas/ApiConfig' + description: LLM API configuration. + category: + $ref: '#/components/schemas/ConversationCategory' + description: The conversation category. + excludeFromLastConversationStorage: + description: excludeFromLastConversationStorage. + type: boolean + id: + description: The conversation id. + type: string + isDefault: + description: Is default conversation. + type: boolean + messages: + description: The conversation messages. + items: + $ref: '#/components/schemas/Message' + type: array + replacements: + $ref: '#/components/schemas/Replacements' + title: + description: The conversation title. + type: string + required: + - title + ConversationResponse: + type: object + properties: + apiConfig: + $ref: '#/components/schemas/ApiConfig' + description: LLM API configuration. + category: + $ref: '#/components/schemas/ConversationCategory' + description: The conversation category. + createdAt: + description: The last time conversation was updated. + type: string + excludeFromLastConversationStorage: + description: excludeFromLastConversationStorage. + type: boolean + id: + $ref: '#/components/schemas/NonEmptyString' + isDefault: + description: Is default conversation. + type: boolean + messages: + description: The conversation messages. + items: + $ref: '#/components/schemas/Message' + type: array + namespace: + description: Kibana space + type: string + replacements: + $ref: '#/components/schemas/Replacements' + summary: + $ref: '#/components/schemas/ConversationSummary' + timestamp: + $ref: '#/components/schemas/NonEmptyString' + title: + description: The conversation title. + type: string + updatedAt: + description: The last time conversation was updated. + type: string + users: + items: + $ref: '#/components/schemas/User' + type: array + required: + - id + - title + - createdAt + - users + - namespace + - category + ConversationSummary: + type: object + properties: + confidence: + $ref: '#/components/schemas/ConversationConfidence' + description: >- + How confident you are about this being a correct and useful + learning. + content: + description: Summary text of the conversation over time. + type: string + public: + description: Define if summary is marked as publicly available. + type: boolean + timestamp: + $ref: '#/components/schemas/NonEmptyString' + description: The timestamp summary was updated. + ConversationUpdateProps: + type: object + properties: + apiConfig: + $ref: '#/components/schemas/ApiConfig' + description: LLM API configuration. + category: + $ref: '#/components/schemas/ConversationCategory' + description: The conversation category. + excludeFromLastConversationStorage: + description: excludeFromLastConversationStorage. + type: boolean + id: + $ref: '#/components/schemas/NonEmptyString' + messages: + description: The conversation messages. + items: + $ref: '#/components/schemas/Message' + type: array + replacements: + $ref: '#/components/schemas/Replacements' + summary: + $ref: '#/components/schemas/ConversationSummary' + title: + description: The conversation title. + type: string + required: + - id + FindAnonymizationFieldsSortField: + enum: + - created_at + - anonymized + - allowed + - field + - updated_at + type: string + FindConversationsSortField: + enum: + - created_at + - is_default + - title + - updated_at + type: string + FindPromptsSortField: + enum: + - created_at + - is_default + - name + - updated_at + type: string + Message: + description: AI assistant conversation message. + type: object + properties: + content: + description: Message content. + type: string + isError: + description: Is error message. + type: boolean + reader: + $ref: '#/components/schemas/Reader' + description: Message content. + role: + $ref: '#/components/schemas/MessageRole' + description: Message role. + timestamp: + $ref: '#/components/schemas/NonEmptyString' + description: The timestamp message was sent or received. + traceData: + $ref: '#/components/schemas/TraceData' + description: trace Data + required: + - timestamp + - content + - role MessageData: additionalProperties: true type: object + MessageRole: + description: Message role. + enum: + - system + - user + - assistant + type: string + NonEmptyString: + description: A string that is not empty and does not contain only whitespace + minLength: 1 + pattern: ^(?! *$).+$ + type: string + NormalizedAnonymizationFieldError: + type: object + properties: + anonymization_fields: + items: + $ref: '#/components/schemas/AnonymizationFieldDetailsInError' + type: array + err_code: + type: string + message: + type: string + status_code: + type: integer + required: + - message + - status_code + - anonymization_fields + NormalizedPromptError: + type: object + properties: + err_code: + type: string + message: + type: string + prompts: + items: + $ref: '#/components/schemas/PromptDetailsInError' + type: array + status_code: + type: integer + required: + - message + - status_code + - prompts + PromptCreateProps: + type: object + properties: + categories: + items: + type: string + type: array + color: + type: string + consumer: + type: string + content: + type: string + isDefault: + type: boolean + isNewConversationDefault: + type: boolean + name: + type: string + promptType: + $ref: '#/components/schemas/PromptType' + required: + - name + - content + - promptType + PromptDetailsInError: + type: object + properties: + id: + type: string + name: + type: string + required: + - id + PromptResponse: + type: object + properties: + categories: + items: + type: string + type: array + color: + type: string + consumer: + type: string + content: + type: string + createdAt: + type: string + createdBy: + type: string + id: + $ref: '#/components/schemas/NonEmptyString' + isDefault: + type: boolean + isNewConversationDefault: + type: boolean + name: + type: string + namespace: + description: Kibana space + type: string + promptType: + $ref: '#/components/schemas/PromptType' + timestamp: + $ref: '#/components/schemas/NonEmptyString' + updatedAt: + type: string + updatedBy: + type: string + users: + items: + $ref: '#/components/schemas/User' + type: array + required: + - id + - name + - promptType + - content + PromptsBulkActionSkipReason: + enum: + - PROMPT_FIELD_NOT_MODIFIED + type: string + PromptsBulkActionSkipResult: + type: object + properties: + id: + type: string + name: + type: string + skip_reason: + $ref: '#/components/schemas/PromptsBulkActionSkipReason' + required: + - id + - skip_reason + PromptsBulkCrudActionResponse: + type: object + properties: + attributes: + type: object + properties: + errors: + items: + $ref: '#/components/schemas/NormalizedPromptError' + type: array + results: + $ref: '#/components/schemas/PromptsBulkCrudActionResults' + summary: + $ref: '#/components/schemas/BulkCrudActionSummary' + required: + - results + - summary + message: + type: string + prompts_count: + type: integer + status_code: + type: integer + success: + type: boolean + required: + - attributes + PromptsBulkCrudActionResults: + type: object + properties: + created: + items: + $ref: '#/components/schemas/PromptResponse' + type: array + deleted: + items: + type: string + type: array + skipped: + items: + $ref: '#/components/schemas/PromptsBulkActionSkipResult' + type: array + updated: + items: + $ref: '#/components/schemas/PromptResponse' + type: array + required: + - updated + - created + - deleted + - skipped + PromptType: + description: Prompt type + enum: + - system + - quick + type: string + PromptUpdateProps: + type: object + properties: + categories: + items: + type: string + type: array + color: + type: string + consumer: + type: string + content: + type: string + id: + type: string + isDefault: + type: boolean + isNewConversationDefault: + type: boolean + required: + - id + Provider: + description: Provider + enum: + - OpenAI + - Azure OpenAI + type: string + Reader: + additionalProperties: true + type: object + Replacements: + additionalProperties: + type: string + description: Replacements object used to anonymize/deanomymize messsages + type: object + SortOrder: + enum: + - asc + - desc + type: string + TraceData: + description: trace Data + type: object + properties: + traceId: + description: 'Could be any string, not necessarily a UUID' + type: string + transactionId: + description: 'Could be any string, not necessarily a UUID' + type: string + User: + description: 'Could be any string, not necessarily a UUID' + type: object + properties: + id: + description: User id + type: string + name: + description: User name + type: string securitySchemes: BasicAuth: scheme: basic diff --git a/x-pack/packages/kbn-elastic-assistant-common/docs/openapi/serverless/elastic_assistant_api_1.bundled.schema.yaml b/x-pack/packages/kbn-elastic-assistant-common/docs/openapi/serverless/elastic_assistant_api_1.bundled.schema.yaml deleted file mode 100644 index e0579f55dfbb9..0000000000000 --- a/x-pack/packages/kbn-elastic-assistant-common/docs/openapi/serverless/elastic_assistant_api_1.bundled.schema.yaml +++ /dev/null @@ -1,1133 +0,0 @@ -openapi: 3.0.3 -info: - description: Manage and interact with Security Assistant resources. - title: Security AI Assistant API (Elastic Cloud Serverless) - version: '1' -servers: - - url: 'http://{kibana_host}:{port}' - variables: - kibana_host: - default: localhost - port: - default: '5601' -paths: - /api/security_ai_assistant/anonymization_fields/_bulk_action: - post: - description: >- - The bulk action is applied to all anonymization fields that match the - filter or to the list of anonymization fields by their IDs. - operationId: PerformBulkAction - requestBody: - content: - application/json: - schema: - type: object - properties: - create: - items: - $ref: '#/components/schemas/AnonymizationFieldCreateProps' - type: array - delete: - type: object - properties: - ids: - description: Array of anonymization fields IDs - items: - type: string - minItems: 1 - type: array - query: - description: Query to filter anonymization fields - type: string - update: - items: - $ref: '#/components/schemas/AnonymizationFieldUpdateProps' - type: array - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/AnonymizationFieldsBulkCrudActionResponse' - description: Indicates a successful call. - '400': - content: - application/json: - schema: - type: object - properties: - error: - type: string - message: - type: string - statusCode: - type: number - description: Generic Error - summary: Applies a bulk action to multiple anonymization fields - tags: - - Bulk API - /api/security_ai_assistant/anonymization_fields/_find: - get: - description: Finds anonymization fields that match the given query. - operationId: FindAnonymizationFields - parameters: - - in: query - name: fields - required: false - schema: - items: - type: string - type: array - - description: Search query - in: query - name: filter - required: false - schema: - type: string - - description: Field to sort by - in: query - name: sort_field - required: false - schema: - $ref: '#/components/schemas/FindAnonymizationFieldsSortField' - - description: Sort order - in: query - name: sort_order - required: false - schema: - $ref: '#/components/schemas/SortOrder' - - description: Page number - in: query - name: page - required: false - schema: - default: 1 - minimum: 1 - type: integer - - description: AnonymizationFields per page - in: query - name: per_page - required: false - schema: - default: 20 - minimum: 0 - type: integer - responses: - '200': - content: - application/json: - schema: - type: object - properties: - data: - items: - $ref: '#/components/schemas/AnonymizationFieldResponse' - type: array - page: - type: integer - perPage: - type: integer - total: - type: integer - required: - - page - - perPage - - total - - data - description: Successful response - '400': - content: - application/json: - schema: - type: object - properties: - error: - type: string - message: - type: string - statusCode: - type: number - description: Generic Error - summary: Finds anonymization fields that match the given query. - tags: - - AnonymizationFields API - /api/security_ai_assistant/current_user/conversations: - post: - description: Create a conversation - operationId: CreateConversation - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ConversationCreateProps' - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ConversationResponse' - description: Indicates a successful call. - '400': - content: - application/json: - schema: - type: object - properties: - error: - type: string - message: - type: string - statusCode: - type: number - description: Generic Error - summary: Create a conversation - tags: - - Conversation API - /api/security_ai_assistant/current_user/conversations/_find: - get: - description: Finds conversations that match the given query. - operationId: FindConversations - parameters: - - in: query - name: fields - required: false - schema: - items: - type: string - type: array - - description: Search query - in: query - name: filter - required: false - schema: - type: string - - description: Field to sort by - in: query - name: sort_field - required: false - schema: - $ref: '#/components/schemas/FindConversationsSortField' - - description: Sort order - in: query - name: sort_order - required: false - schema: - $ref: '#/components/schemas/SortOrder' - - description: Page number - in: query - name: page - required: false - schema: - default: 1 - minimum: 1 - type: integer - - description: Conversations per page - in: query - name: per_page - required: false - schema: - default: 20 - minimum: 0 - type: integer - responses: - '200': - content: - application/json: - schema: - type: object - properties: - data: - items: - $ref: '#/components/schemas/ConversationResponse' - type: array - page: - type: integer - perPage: - type: integer - total: - type: integer - required: - - page - - perPage - - total - - data - description: Successful response - '400': - content: - application/json: - schema: - type: object - properties: - error: - type: string - message: - type: string - statusCode: - type: number - description: Generic Error - summary: Finds conversations that match the given query. - tags: - - Conversations API - '/api/security_ai_assistant/current_user/conversations/{id}': - delete: - description: Deletes a single conversation using the `id` field. - operationId: DeleteConversation - parameters: - - description: The conversation's `id` value. - in: path - name: id - required: true - schema: - $ref: '#/components/schemas/NonEmptyString' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ConversationResponse' - description: Indicates a successful call. - '400': - content: - application/json: - schema: - type: object - properties: - error: - type: string - message: - type: string - statusCode: - type: number - description: Generic Error - summary: Deletes a single conversation using the `id` field. - tags: - - Conversation API - get: - description: Read a single conversation - operationId: ReadConversation - parameters: - - description: The conversation's `id` value. - in: path - name: id - required: true - schema: - $ref: '#/components/schemas/NonEmptyString' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ConversationResponse' - description: Indicates a successful call. - '400': - content: - application/json: - schema: - type: object - properties: - error: - type: string - message: - type: string - statusCode: - type: number - description: Generic Error - summary: Read a single conversation - tags: - - Conversations API - put: - description: Update a single conversation - operationId: UpdateConversation - parameters: - - description: The conversation's `id` value. - in: path - name: id - required: true - schema: - $ref: '#/components/schemas/NonEmptyString' - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ConversationUpdateProps' - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ConversationResponse' - description: Indicates a successful call. - '400': - content: - application/json: - schema: - type: object - properties: - error: - type: string - message: - type: string - statusCode: - type: number - description: Generic Error - summary: Update a conversation - tags: - - Conversation API - /api/security_ai_assistant/prompts/_bulk_action: - post: - description: >- - The bulk action is applied to all prompts that match the filter or to - the list of prompts by their IDs. - operationId: PerformBulkAction - requestBody: - content: - application/json: - schema: - type: object - properties: - create: - items: - $ref: '#/components/schemas/PromptCreateProps' - type: array - delete: - type: object - properties: - ids: - description: Array of prompts IDs - items: - type: string - minItems: 1 - type: array - query: - description: Query to filter promps - type: string - update: - items: - $ref: '#/components/schemas/PromptUpdateProps' - type: array - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PromptsBulkCrudActionResponse' - description: Indicates a successful call. - '400': - content: - application/json: - schema: - type: object - properties: - error: - type: string - message: - type: string - statusCode: - type: number - description: Generic Error - summary: Applies a bulk action to multiple prompts - tags: - - Bulk API - /api/security_ai_assistant/prompts/_find: - get: - description: Finds prompts that match the given query. - operationId: FindPrompts - parameters: - - in: query - name: fields - required: false - schema: - items: - type: string - type: array - - description: Search query - in: query - name: filter - required: false - schema: - type: string - - description: Field to sort by - in: query - name: sort_field - required: false - schema: - $ref: '#/components/schemas/FindPromptsSortField' - - description: Sort order - in: query - name: sort_order - required: false - schema: - $ref: '#/components/schemas/SortOrder' - - description: Page number - in: query - name: page - required: false - schema: - default: 1 - minimum: 1 - type: integer - - description: Prompts per page - in: query - name: per_page - required: false - schema: - default: 20 - minimum: 0 - type: integer - responses: - '200': - content: - application/json: - schema: - type: object - properties: - data: - items: - $ref: '#/components/schemas/PromptResponse' - type: array - page: - type: integer - perPage: - type: integer - total: - type: integer - required: - - page - - perPage - - total - - data - description: Successful response - '400': - content: - application/json: - schema: - type: object - properties: - error: - type: string - message: - type: string - statusCode: - type: number - description: Generic Error - summary: Finds prompts that match the given query. - tags: - - Prompts API -components: - schemas: - AnonymizationFieldCreateProps: - type: object - properties: - allowed: - type: boolean - anonymized: - type: boolean - field: - type: string - required: - - field - AnonymizationFieldDetailsInError: - type: object - properties: - id: - type: string - name: - type: string - required: - - id - AnonymizationFieldResponse: - type: object - properties: - allowed: - type: boolean - anonymized: - type: boolean - createdAt: - type: string - createdBy: - type: string - field: - type: string - id: - $ref: '#/components/schemas/NonEmptyString' - namespace: - description: Kibana space - type: string - timestamp: - $ref: '#/components/schemas/NonEmptyString' - updatedAt: - type: string - updatedBy: - type: string - required: - - id - - field - AnonymizationFieldsBulkActionSkipReason: - enum: - - ANONYMIZATION_FIELD_NOT_MODIFIED - type: string - AnonymizationFieldsBulkActionSkipResult: - type: object - properties: - id: - type: string - name: - type: string - skip_reason: - $ref: '#/components/schemas/AnonymizationFieldsBulkActionSkipReason' - required: - - id - - skip_reason - AnonymizationFieldsBulkCrudActionResponse: - type: object - properties: - anonymization_fields_count: - type: integer - attributes: - type: object - properties: - errors: - items: - $ref: '#/components/schemas/NormalizedAnonymizationFieldError' - type: array - results: - $ref: '#/components/schemas/AnonymizationFieldsBulkCrudActionResults' - summary: - $ref: '#/components/schemas/BulkCrudActionSummary' - required: - - results - - summary - message: - type: string - status_code: - type: integer - success: - type: boolean - required: - - attributes - AnonymizationFieldsBulkCrudActionResults: - type: object - properties: - created: - items: - $ref: '#/components/schemas/AnonymizationFieldResponse' - type: array - deleted: - items: - type: string - type: array - skipped: - items: - $ref: '#/components/schemas/AnonymizationFieldsBulkActionSkipResult' - type: array - updated: - items: - $ref: '#/components/schemas/AnonymizationFieldResponse' - type: array - required: - - updated - - created - - deleted - - skipped - AnonymizationFieldUpdateProps: - type: object - properties: - allowed: - type: boolean - anonymized: - type: boolean - id: - type: string - required: - - id - ApiConfig: - type: object - properties: - actionTypeId: - description: action type id - type: string - connectorId: - description: connector id - type: string - defaultSystemPromptId: - description: defaultSystemPromptId - type: string - model: - description: model - type: string - provider: - $ref: '#/components/schemas/Provider' - description: Provider - required: - - connectorId - - actionTypeId - BulkCrudActionSummary: - type: object - properties: - failed: - type: integer - skipped: - type: integer - succeeded: - type: integer - total: - type: integer - required: - - failed - - skipped - - succeeded - - total - ConversationCategory: - description: The conversation category. - enum: - - assistant - - insights - type: string - ConversationConfidence: - description: The conversation confidence. - enum: - - low - - medium - - high - type: string - ConversationCreateProps: - type: object - properties: - apiConfig: - $ref: '#/components/schemas/ApiConfig' - description: LLM API configuration. - category: - $ref: '#/components/schemas/ConversationCategory' - description: The conversation category. - excludeFromLastConversationStorage: - description: excludeFromLastConversationStorage. - type: boolean - id: - description: The conversation id. - type: string - isDefault: - description: Is default conversation. - type: boolean - messages: - description: The conversation messages. - items: - $ref: '#/components/schemas/Message' - type: array - replacements: - $ref: '#/components/schemas/Replacements' - title: - description: The conversation title. - type: string - required: - - title - ConversationResponse: - type: object - properties: - apiConfig: - $ref: '#/components/schemas/ApiConfig' - description: LLM API configuration. - category: - $ref: '#/components/schemas/ConversationCategory' - description: The conversation category. - createdAt: - description: The last time conversation was updated. - type: string - excludeFromLastConversationStorage: - description: excludeFromLastConversationStorage. - type: boolean - id: - $ref: '#/components/schemas/NonEmptyString' - isDefault: - description: Is default conversation. - type: boolean - messages: - description: The conversation messages. - items: - $ref: '#/components/schemas/Message' - type: array - namespace: - description: Kibana space - type: string - replacements: - $ref: '#/components/schemas/Replacements' - summary: - $ref: '#/components/schemas/ConversationSummary' - timestamp: - $ref: '#/components/schemas/NonEmptyString' - title: - description: The conversation title. - type: string - updatedAt: - description: The last time conversation was updated. - type: string - users: - items: - $ref: '#/components/schemas/User' - type: array - required: - - id - - title - - createdAt - - users - - namespace - - category - ConversationSummary: - type: object - properties: - confidence: - $ref: '#/components/schemas/ConversationConfidence' - description: >- - How confident you are about this being a correct and useful - learning. - content: - description: Summary text of the conversation over time. - type: string - public: - description: Define if summary is marked as publicly available. - type: boolean - timestamp: - $ref: '#/components/schemas/NonEmptyString' - description: The timestamp summary was updated. - ConversationUpdateProps: - type: object - properties: - apiConfig: - $ref: '#/components/schemas/ApiConfig' - description: LLM API configuration. - category: - $ref: '#/components/schemas/ConversationCategory' - description: The conversation category. - excludeFromLastConversationStorage: - description: excludeFromLastConversationStorage. - type: boolean - id: - $ref: '#/components/schemas/NonEmptyString' - messages: - description: The conversation messages. - items: - $ref: '#/components/schemas/Message' - type: array - replacements: - $ref: '#/components/schemas/Replacements' - summary: - $ref: '#/components/schemas/ConversationSummary' - title: - description: The conversation title. - type: string - required: - - id - FindAnonymizationFieldsSortField: - enum: - - created_at - - anonymized - - allowed - - field - - updated_at - type: string - FindConversationsSortField: - enum: - - created_at - - is_default - - title - - updated_at - type: string - FindPromptsSortField: - enum: - - created_at - - is_default - - name - - updated_at - type: string - Message: - description: AI assistant conversation message. - type: object - properties: - content: - description: Message content. - type: string - isError: - description: Is error message. - type: boolean - reader: - $ref: '#/components/schemas/Reader' - description: Message content. - role: - $ref: '#/components/schemas/MessageRole' - description: Message role. - timestamp: - $ref: '#/components/schemas/NonEmptyString' - description: The timestamp message was sent or received. - traceData: - $ref: '#/components/schemas/TraceData' - description: trace Data - required: - - timestamp - - content - - role - MessageRole: - description: Message role. - enum: - - system - - user - - assistant - type: string - NonEmptyString: - description: A string that is not empty and does not contain only whitespace - minLength: 1 - pattern: ^(?! *$).+$ - type: string - NormalizedAnonymizationFieldError: - type: object - properties: - anonymization_fields: - items: - $ref: '#/components/schemas/AnonymizationFieldDetailsInError' - type: array - err_code: - type: string - message: - type: string - status_code: - type: integer - required: - - message - - status_code - - anonymization_fields - NormalizedPromptError: - type: object - properties: - err_code: - type: string - message: - type: string - prompts: - items: - $ref: '#/components/schemas/PromptDetailsInError' - type: array - status_code: - type: integer - required: - - message - - status_code - - prompts - PromptCreateProps: - type: object - properties: - categories: - items: - type: string - type: array - color: - type: string - consumer: - type: string - content: - type: string - isDefault: - type: boolean - isNewConversationDefault: - type: boolean - name: - type: string - promptType: - $ref: '#/components/schemas/PromptType' - required: - - name - - content - - promptType - PromptDetailsInError: - type: object - properties: - id: - type: string - name: - type: string - required: - - id - PromptResponse: - type: object - properties: - categories: - items: - type: string - type: array - color: - type: string - consumer: - type: string - content: - type: string - createdAt: - type: string - createdBy: - type: string - id: - $ref: '#/components/schemas/NonEmptyString' - isDefault: - type: boolean - isNewConversationDefault: - type: boolean - name: - type: string - namespace: - description: Kibana space - type: string - promptType: - $ref: '#/components/schemas/PromptType' - timestamp: - $ref: '#/components/schemas/NonEmptyString' - updatedAt: - type: string - updatedBy: - type: string - users: - items: - $ref: '#/components/schemas/User' - type: array - required: - - id - - name - - promptType - - content - PromptsBulkActionSkipReason: - enum: - - PROMPT_FIELD_NOT_MODIFIED - type: string - PromptsBulkActionSkipResult: - type: object - properties: - id: - type: string - name: - type: string - skip_reason: - $ref: '#/components/schemas/PromptsBulkActionSkipReason' - required: - - id - - skip_reason - PromptsBulkCrudActionResponse: - type: object - properties: - attributes: - type: object - properties: - errors: - items: - $ref: '#/components/schemas/NormalizedPromptError' - type: array - results: - $ref: '#/components/schemas/PromptsBulkCrudActionResults' - summary: - $ref: '#/components/schemas/BulkCrudActionSummary' - required: - - results - - summary - message: - type: string - prompts_count: - type: integer - status_code: - type: integer - success: - type: boolean - required: - - attributes - PromptsBulkCrudActionResults: - type: object - properties: - created: - items: - $ref: '#/components/schemas/PromptResponse' - type: array - deleted: - items: - type: string - type: array - skipped: - items: - $ref: '#/components/schemas/PromptsBulkActionSkipResult' - type: array - updated: - items: - $ref: '#/components/schemas/PromptResponse' - type: array - required: - - updated - - created - - deleted - - skipped - PromptType: - description: Prompt type - enum: - - system - - quick - type: string - PromptUpdateProps: - type: object - properties: - categories: - items: - type: string - type: array - color: - type: string - consumer: - type: string - content: - type: string - id: - type: string - isDefault: - type: boolean - isNewConversationDefault: - type: boolean - required: - - id - Provider: - description: Provider - enum: - - OpenAI - - Azure OpenAI - type: string - Reader: - additionalProperties: true - type: object - Replacements: - additionalProperties: - type: string - description: Replacements object used to anonymize/deanomymize messsages - type: object - SortOrder: - enum: - - asc - - desc - type: string - TraceData: - description: trace Data - type: object - properties: - traceId: - description: 'Could be any string, not necessarily a UUID' - type: string - transactionId: - description: 'Could be any string, not necessarily a UUID' - type: string - User: - description: 'Could be any string, not necessarily a UUID' - type: object - properties: - id: - description: User id - type: string - name: - description: User name - type: string - securitySchemes: - BasicAuth: - scheme: basic - type: http -security: - - BasicAuth: [] -tags: ! '' diff --git a/x-pack/packages/kbn-elastic-assistant-common/docs/openapi/serverless/elastic_assistant_api_2023_10_31.bundled.schema.yaml b/x-pack/packages/kbn-elastic-assistant-common/docs/openapi/serverless/elastic_assistant_api_2023_10_31.bundled.schema.yaml index f04e55d6c5a55..c51b30974b05c 100644 --- a/x-pack/packages/kbn-elastic-assistant-common/docs/openapi/serverless/elastic_assistant_api_2023_10_31.bundled.schema.yaml +++ b/x-pack/packages/kbn-elastic-assistant-common/docs/openapi/serverless/elastic_assistant_api_2023_10_31.bundled.schema.yaml @@ -11,6 +11,146 @@ servers: port: default: '5601' paths: + /api/security_ai_assistant/anonymization_fields/_bulk_action: + post: + description: >- + The bulk action is applied to all anonymization fields that match the + filter or to the list of anonymization fields by their IDs. + operationId: PerformBulkAction + requestBody: + content: + application/json: + schema: + type: object + properties: + create: + items: + $ref: '#/components/schemas/AnonymizationFieldCreateProps' + type: array + delete: + type: object + properties: + ids: + description: Array of anonymization fields IDs + items: + type: string + minItems: 1 + type: array + query: + description: Query to filter anonymization fields + type: string + update: + items: + $ref: '#/components/schemas/AnonymizationFieldUpdateProps' + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/AnonymizationFieldsBulkCrudActionResponse' + description: Indicates a successful call. + '400': + content: + application/json: + schema: + type: object + properties: + error: + type: string + message: + type: string + statusCode: + type: number + description: Generic Error + summary: Applies a bulk action to multiple anonymization fields + tags: + - Bulk API + /api/security_ai_assistant/anonymization_fields/_find: + get: + description: Finds anonymization fields that match the given query. + operationId: FindAnonymizationFields + parameters: + - in: query + name: fields + required: false + schema: + items: + type: string + type: array + - description: Search query + in: query + name: filter + required: false + schema: + type: string + - description: Field to sort by + in: query + name: sort_field + required: false + schema: + $ref: '#/components/schemas/FindAnonymizationFieldsSortField' + - description: Sort order + in: query + name: sort_order + required: false + schema: + $ref: '#/components/schemas/SortOrder' + - description: Page number + in: query + name: page + required: false + schema: + default: 1 + minimum: 1 + type: integer + - description: AnonymizationFields per page + in: query + name: per_page + required: false + schema: + default: 20 + minimum: 0 + type: integer + responses: + '200': + content: + application/json: + schema: + type: object + properties: + data: + items: + $ref: '#/components/schemas/AnonymizationFieldResponse' + type: array + page: + type: integer + perPage: + type: integer + total: + type: integer + required: + - page + - perPage + - total + - data + description: Successful response + '400': + content: + application/json: + schema: + type: object + properties: + error: + type: string + message: + type: string + statusCode: + type: number + description: Generic Error + summary: Finds anonymization fields that match the given query. + tags: + - AnonymizationFields API /api/security_ai_assistant/chat/complete: post: description: Creates a model response for the given chat conversation. @@ -45,8 +185,534 @@ paths: summary: Creates a model response for the given chat conversation. tags: - Chat Complete API + /api/security_ai_assistant/current_user/conversations: + post: + description: Create a conversation + operationId: CreateConversation + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ConversationCreateProps' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ConversationResponse' + description: Indicates a successful call. + '400': + content: + application/json: + schema: + type: object + properties: + error: + type: string + message: + type: string + statusCode: + type: number + description: Generic Error + summary: Create a conversation + tags: + - Conversation API + /api/security_ai_assistant/current_user/conversations/_find: + get: + description: Finds conversations that match the given query. + operationId: FindConversations + parameters: + - in: query + name: fields + required: false + schema: + items: + type: string + type: array + - description: Search query + in: query + name: filter + required: false + schema: + type: string + - description: Field to sort by + in: query + name: sort_field + required: false + schema: + $ref: '#/components/schemas/FindConversationsSortField' + - description: Sort order + in: query + name: sort_order + required: false + schema: + $ref: '#/components/schemas/SortOrder' + - description: Page number + in: query + name: page + required: false + schema: + default: 1 + minimum: 1 + type: integer + - description: Conversations per page + in: query + name: per_page + required: false + schema: + default: 20 + minimum: 0 + type: integer + responses: + '200': + content: + application/json: + schema: + type: object + properties: + data: + items: + $ref: '#/components/schemas/ConversationResponse' + type: array + page: + type: integer + perPage: + type: integer + total: + type: integer + required: + - page + - perPage + - total + - data + description: Successful response + '400': + content: + application/json: + schema: + type: object + properties: + error: + type: string + message: + type: string + statusCode: + type: number + description: Generic Error + summary: Finds conversations that match the given query. + tags: + - Conversations API + '/api/security_ai_assistant/current_user/conversations/{id}': + delete: + description: Deletes a single conversation using the `id` field. + operationId: DeleteConversation + parameters: + - description: The conversation's `id` value. + in: path + name: id + required: true + schema: + $ref: '#/components/schemas/NonEmptyString' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ConversationResponse' + description: Indicates a successful call. + '400': + content: + application/json: + schema: + type: object + properties: + error: + type: string + message: + type: string + statusCode: + type: number + description: Generic Error + summary: Deletes a single conversation using the `id` field. + tags: + - Conversation API + get: + description: Read a single conversation + operationId: ReadConversation + parameters: + - description: The conversation's `id` value. + in: path + name: id + required: true + schema: + $ref: '#/components/schemas/NonEmptyString' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ConversationResponse' + description: Indicates a successful call. + '400': + content: + application/json: + schema: + type: object + properties: + error: + type: string + message: + type: string + statusCode: + type: number + description: Generic Error + summary: Read a single conversation + tags: + - Conversations API + put: + description: Update a single conversation + operationId: UpdateConversation + parameters: + - description: The conversation's `id` value. + in: path + name: id + required: true + schema: + $ref: '#/components/schemas/NonEmptyString' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ConversationUpdateProps' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ConversationResponse' + description: Indicates a successful call. + '400': + content: + application/json: + schema: + type: object + properties: + error: + type: string + message: + type: string + statusCode: + type: number + description: Generic Error + summary: Update a conversation + tags: + - Conversation API + /api/security_ai_assistant/prompts/_bulk_action: + post: + description: >- + The bulk action is applied to all prompts that match the filter or to + the list of prompts by their IDs. + operationId: PerformBulkAction + requestBody: + content: + application/json: + schema: + type: object + properties: + create: + items: + $ref: '#/components/schemas/PromptCreateProps' + type: array + delete: + type: object + properties: + ids: + description: Array of prompts IDs + items: + type: string + minItems: 1 + type: array + query: + description: Query to filter promps + type: string + update: + items: + $ref: '#/components/schemas/PromptUpdateProps' + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PromptsBulkCrudActionResponse' + description: Indicates a successful call. + '400': + content: + application/json: + schema: + type: object + properties: + error: + type: string + message: + type: string + statusCode: + type: number + description: Generic Error + summary: Applies a bulk action to multiple prompts + tags: + - Bulk API + /api/security_ai_assistant/prompts/_find: + get: + description: Finds prompts that match the given query. + operationId: FindPrompts + parameters: + - in: query + name: fields + required: false + schema: + items: + type: string + type: array + - description: Search query + in: query + name: filter + required: false + schema: + type: string + - description: Field to sort by + in: query + name: sort_field + required: false + schema: + $ref: '#/components/schemas/FindPromptsSortField' + - description: Sort order + in: query + name: sort_order + required: false + schema: + $ref: '#/components/schemas/SortOrder' + - description: Page number + in: query + name: page + required: false + schema: + default: 1 + minimum: 1 + type: integer + - description: Prompts per page + in: query + name: per_page + required: false + schema: + default: 20 + minimum: 0 + type: integer + responses: + '200': + content: + application/json: + schema: + type: object + properties: + data: + items: + $ref: '#/components/schemas/PromptResponse' + type: array + page: + type: integer + perPage: + type: integer + total: + type: integer + required: + - page + - perPage + - total + - data + description: Successful response + '400': + content: + application/json: + schema: + type: object + properties: + error: + type: string + message: + type: string + statusCode: + type: number + description: Generic Error + summary: Finds prompts that match the given query. + tags: + - Prompts API components: schemas: + AnonymizationFieldCreateProps: + type: object + properties: + allowed: + type: boolean + anonymized: + type: boolean + field: + type: string + required: + - field + AnonymizationFieldDetailsInError: + type: object + properties: + id: + type: string + name: + type: string + required: + - id + AnonymizationFieldResponse: + type: object + properties: + allowed: + type: boolean + anonymized: + type: boolean + createdAt: + type: string + createdBy: + type: string + field: + type: string + id: + $ref: '#/components/schemas/NonEmptyString' + namespace: + description: Kibana space + type: string + timestamp: + $ref: '#/components/schemas/NonEmptyString' + updatedAt: + type: string + updatedBy: + type: string + required: + - id + - field + AnonymizationFieldsBulkActionSkipReason: + enum: + - ANONYMIZATION_FIELD_NOT_MODIFIED + type: string + AnonymizationFieldsBulkActionSkipResult: + type: object + properties: + id: + type: string + name: + type: string + skip_reason: + $ref: '#/components/schemas/AnonymizationFieldsBulkActionSkipReason' + required: + - id + - skip_reason + AnonymizationFieldsBulkCrudActionResponse: + type: object + properties: + anonymization_fields_count: + type: integer + attributes: + type: object + properties: + errors: + items: + $ref: '#/components/schemas/NormalizedAnonymizationFieldError' + type: array + results: + $ref: '#/components/schemas/AnonymizationFieldsBulkCrudActionResults' + summary: + $ref: '#/components/schemas/BulkCrudActionSummary' + required: + - results + - summary + message: + type: string + status_code: + type: integer + success: + type: boolean + required: + - attributes + AnonymizationFieldsBulkCrudActionResults: + type: object + properties: + created: + items: + $ref: '#/components/schemas/AnonymizationFieldResponse' + type: array + deleted: + items: + type: string + type: array + skipped: + items: + $ref: '#/components/schemas/AnonymizationFieldsBulkActionSkipResult' + type: array + updated: + items: + $ref: '#/components/schemas/AnonymizationFieldResponse' + type: array + required: + - updated + - created + - deleted + - skipped + AnonymizationFieldUpdateProps: + type: object + properties: + allowed: + type: boolean + anonymized: + type: boolean + id: + type: string + required: + - id + ApiConfig: + type: object + properties: + actionTypeId: + description: action type id + type: string + connectorId: + description: connector id + type: string + defaultSystemPromptId: + description: defaultSystemPromptId + type: string + model: + description: model + type: string + provider: + $ref: '#/components/schemas/Provider' + description: Provider + required: + - connectorId + - actionTypeId + BulkCrudActionSummary: + type: object + properties: + failed: + type: integer + skipped: + type: integer + succeeded: + type: integer + total: + type: integer + required: + - failed + - skipped + - succeeded + - total ChatCompleteProps: type: object properties: @@ -102,9 +768,454 @@ components: - user - assistant type: string + ConversationCategory: + description: The conversation category. + enum: + - assistant + - insights + type: string + ConversationConfidence: + description: The conversation confidence. + enum: + - low + - medium + - high + type: string + ConversationCreateProps: + type: object + properties: + apiConfig: + $ref: '#/components/schemas/ApiConfig' + description: LLM API configuration. + category: + $ref: '#/components/schemas/ConversationCategory' + description: The conversation category. + excludeFromLastConversationStorage: + description: excludeFromLastConversationStorage. + type: boolean + id: + description: The conversation id. + type: string + isDefault: + description: Is default conversation. + type: boolean + messages: + description: The conversation messages. + items: + $ref: '#/components/schemas/Message' + type: array + replacements: + $ref: '#/components/schemas/Replacements' + title: + description: The conversation title. + type: string + required: + - title + ConversationResponse: + type: object + properties: + apiConfig: + $ref: '#/components/schemas/ApiConfig' + description: LLM API configuration. + category: + $ref: '#/components/schemas/ConversationCategory' + description: The conversation category. + createdAt: + description: The last time conversation was updated. + type: string + excludeFromLastConversationStorage: + description: excludeFromLastConversationStorage. + type: boolean + id: + $ref: '#/components/schemas/NonEmptyString' + isDefault: + description: Is default conversation. + type: boolean + messages: + description: The conversation messages. + items: + $ref: '#/components/schemas/Message' + type: array + namespace: + description: Kibana space + type: string + replacements: + $ref: '#/components/schemas/Replacements' + summary: + $ref: '#/components/schemas/ConversationSummary' + timestamp: + $ref: '#/components/schemas/NonEmptyString' + title: + description: The conversation title. + type: string + updatedAt: + description: The last time conversation was updated. + type: string + users: + items: + $ref: '#/components/schemas/User' + type: array + required: + - id + - title + - createdAt + - users + - namespace + - category + ConversationSummary: + type: object + properties: + confidence: + $ref: '#/components/schemas/ConversationConfidence' + description: >- + How confident you are about this being a correct and useful + learning. + content: + description: Summary text of the conversation over time. + type: string + public: + description: Define if summary is marked as publicly available. + type: boolean + timestamp: + $ref: '#/components/schemas/NonEmptyString' + description: The timestamp summary was updated. + ConversationUpdateProps: + type: object + properties: + apiConfig: + $ref: '#/components/schemas/ApiConfig' + description: LLM API configuration. + category: + $ref: '#/components/schemas/ConversationCategory' + description: The conversation category. + excludeFromLastConversationStorage: + description: excludeFromLastConversationStorage. + type: boolean + id: + $ref: '#/components/schemas/NonEmptyString' + messages: + description: The conversation messages. + items: + $ref: '#/components/schemas/Message' + type: array + replacements: + $ref: '#/components/schemas/Replacements' + summary: + $ref: '#/components/schemas/ConversationSummary' + title: + description: The conversation title. + type: string + required: + - id + FindAnonymizationFieldsSortField: + enum: + - created_at + - anonymized + - allowed + - field + - updated_at + type: string + FindConversationsSortField: + enum: + - created_at + - is_default + - title + - updated_at + type: string + FindPromptsSortField: + enum: + - created_at + - is_default + - name + - updated_at + type: string + Message: + description: AI assistant conversation message. + type: object + properties: + content: + description: Message content. + type: string + isError: + description: Is error message. + type: boolean + reader: + $ref: '#/components/schemas/Reader' + description: Message content. + role: + $ref: '#/components/schemas/MessageRole' + description: Message role. + timestamp: + $ref: '#/components/schemas/NonEmptyString' + description: The timestamp message was sent or received. + traceData: + $ref: '#/components/schemas/TraceData' + description: trace Data + required: + - timestamp + - content + - role MessageData: additionalProperties: true type: object + MessageRole: + description: Message role. + enum: + - system + - user + - assistant + type: string + NonEmptyString: + description: A string that is not empty and does not contain only whitespace + minLength: 1 + pattern: ^(?! *$).+$ + type: string + NormalizedAnonymizationFieldError: + type: object + properties: + anonymization_fields: + items: + $ref: '#/components/schemas/AnonymizationFieldDetailsInError' + type: array + err_code: + type: string + message: + type: string + status_code: + type: integer + required: + - message + - status_code + - anonymization_fields + NormalizedPromptError: + type: object + properties: + err_code: + type: string + message: + type: string + prompts: + items: + $ref: '#/components/schemas/PromptDetailsInError' + type: array + status_code: + type: integer + required: + - message + - status_code + - prompts + PromptCreateProps: + type: object + properties: + categories: + items: + type: string + type: array + color: + type: string + consumer: + type: string + content: + type: string + isDefault: + type: boolean + isNewConversationDefault: + type: boolean + name: + type: string + promptType: + $ref: '#/components/schemas/PromptType' + required: + - name + - content + - promptType + PromptDetailsInError: + type: object + properties: + id: + type: string + name: + type: string + required: + - id + PromptResponse: + type: object + properties: + categories: + items: + type: string + type: array + color: + type: string + consumer: + type: string + content: + type: string + createdAt: + type: string + createdBy: + type: string + id: + $ref: '#/components/schemas/NonEmptyString' + isDefault: + type: boolean + isNewConversationDefault: + type: boolean + name: + type: string + namespace: + description: Kibana space + type: string + promptType: + $ref: '#/components/schemas/PromptType' + timestamp: + $ref: '#/components/schemas/NonEmptyString' + updatedAt: + type: string + updatedBy: + type: string + users: + items: + $ref: '#/components/schemas/User' + type: array + required: + - id + - name + - promptType + - content + PromptsBulkActionSkipReason: + enum: + - PROMPT_FIELD_NOT_MODIFIED + type: string + PromptsBulkActionSkipResult: + type: object + properties: + id: + type: string + name: + type: string + skip_reason: + $ref: '#/components/schemas/PromptsBulkActionSkipReason' + required: + - id + - skip_reason + PromptsBulkCrudActionResponse: + type: object + properties: + attributes: + type: object + properties: + errors: + items: + $ref: '#/components/schemas/NormalizedPromptError' + type: array + results: + $ref: '#/components/schemas/PromptsBulkCrudActionResults' + summary: + $ref: '#/components/schemas/BulkCrudActionSummary' + required: + - results + - summary + message: + type: string + prompts_count: + type: integer + status_code: + type: integer + success: + type: boolean + required: + - attributes + PromptsBulkCrudActionResults: + type: object + properties: + created: + items: + $ref: '#/components/schemas/PromptResponse' + type: array + deleted: + items: + type: string + type: array + skipped: + items: + $ref: '#/components/schemas/PromptsBulkActionSkipResult' + type: array + updated: + items: + $ref: '#/components/schemas/PromptResponse' + type: array + required: + - updated + - created + - deleted + - skipped + PromptType: + description: Prompt type + enum: + - system + - quick + type: string + PromptUpdateProps: + type: object + properties: + categories: + items: + type: string + type: array + color: + type: string + consumer: + type: string + content: + type: string + id: + type: string + isDefault: + type: boolean + isNewConversationDefault: + type: boolean + required: + - id + Provider: + description: Provider + enum: + - OpenAI + - Azure OpenAI + type: string + Reader: + additionalProperties: true + type: object + Replacements: + additionalProperties: + type: string + description: Replacements object used to anonymize/deanomymize messsages + type: object + SortOrder: + enum: + - asc + - desc + type: string + TraceData: + description: trace Data + type: object + properties: + traceId: + description: 'Could be any string, not necessarily a UUID' + type: string + transactionId: + description: 'Could be any string, not necessarily a UUID' + type: string + User: + description: 'Could be any string, not necessarily a UUID' + type: object + properties: + id: + description: User id + type: string + name: + description: User name + type: string securitySchemes: BasicAuth: scheme: basic diff --git a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/anonymization_fields/bulk_crud_anonymization_fields_route.gen.ts b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/anonymization_fields/bulk_crud_anonymization_fields_route.gen.ts index 7c94bf1748499..f72fb2f5423e9 100644 --- a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/anonymization_fields/bulk_crud_anonymization_fields_route.gen.ts +++ b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/anonymization_fields/bulk_crud_anonymization_fields_route.gen.ts @@ -11,7 +11,7 @@ * * info: * title: Bulk Anonymization Fields Actions API endpoint - * version: 1 + * version: 2023-10-31 */ import { z } from 'zod'; diff --git a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/anonymization_fields/bulk_crud_anonymization_fields_route.schema.yaml b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/anonymization_fields/bulk_crud_anonymization_fields_route.schema.yaml index f077f70396df5..8e9d5700f577e 100644 --- a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/anonymization_fields/bulk_crud_anonymization_fields_route.schema.yaml +++ b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/anonymization_fields/bulk_crud_anonymization_fields_route.schema.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: title: Bulk Anonymization Fields Actions API endpoint - version: '1' + version: '2023-10-31' paths: /api/security_ai_assistant/anonymization_fields/_bulk_action: post: @@ -195,7 +195,6 @@ components: required: - attributes - BulkActionBase: x-inline: true type: object diff --git a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/anonymization_fields/find_anonymization_fields_route.gen.ts b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/anonymization_fields/find_anonymization_fields_route.gen.ts index 486df4547b429..d74f96b9be6ce 100644 --- a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/anonymization_fields/find_anonymization_fields_route.gen.ts +++ b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/anonymization_fields/find_anonymization_fields_route.gen.ts @@ -11,7 +11,7 @@ * * info: * title: Find AnonymizationFields API endpoint - * version: 1 + * version: 2023-10-31 */ import { z } from 'zod'; diff --git a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/anonymization_fields/find_anonymization_fields_route.schema.yaml b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/anonymization_fields/find_anonymization_fields_route.schema.yaml index 3ec1f398df65c..5ec0632add6dc 100644 --- a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/anonymization_fields/find_anonymization_fields_route.schema.yaml +++ b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/anonymization_fields/find_anonymization_fields_route.schema.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: title: Find AnonymizationFields API endpoint - version: '1' + version: '2023-10-31' paths: /api/security_ai_assistant/anonymization_fields/_find: get: diff --git a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/append_message.gen.ts b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/append_message.gen.ts new file mode 100644 index 0000000000000..ac32946f946e3 --- /dev/null +++ b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/append_message.gen.ts @@ -0,0 +1,44 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +/* + * NOTICE: Do not edit this file manually. + * This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. + * + * info: + * title: Create Conversation API endpoint + * version: 1 + */ + +import { z } from 'zod'; + +import { NonEmptyString } from '../common_attributes.gen'; +import { ConversationMessageCreateProps, ConversationResponse } from './common_attributes.gen'; + +export type AppendConversationMessageRequestParams = z.infer< + typeof AppendConversationMessageRequestParams +>; +export const AppendConversationMessageRequestParams = z.object({ + /** + * The conversation's `id` value. + */ + id: NonEmptyString, +}); +export type AppendConversationMessageRequestParamsInput = z.input< + typeof AppendConversationMessageRequestParams +>; + +export type AppendConversationMessageRequestBody = z.infer< + typeof AppendConversationMessageRequestBody +>; +export const AppendConversationMessageRequestBody = ConversationMessageCreateProps; +export type AppendConversationMessageRequestBodyInput = z.input< + typeof AppendConversationMessageRequestBody +>; + +export type AppendConversationMessageResponse = z.infer; +export const AppendConversationMessageResponse = ConversationResponse; diff --git a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/append_message.schema.yaml b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/append_message.schema.yaml new file mode 100644 index 0000000000000..0d9dccfa0550c --- /dev/null +++ b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/append_message.schema.yaml @@ -0,0 +1,47 @@ +openapi: 3.0.0 +info: + title: Append Conversation API endpoint + version: '1' +paths: + /internal/elastic_assistant/current_user/conversations/{id}/messages: + post: + x-codegen-enabled: true + x-labels: [ess, serverless] + operationId: AppendConversationMessage + description: Append a message to the conversation + summary: Append a message to the conversation + tags: + - Conversation API + parameters: + - name: id + in: path + required: true + description: The conversation's `id` value. + schema: + $ref: '../common_attributes.schema.yaml#/components/schemas/NonEmptyString' + requestBody: + required: true + content: + application/json: + schema: + $ref: './common_attributes.schema.yaml#/components/schemas/ConversationMessageCreateProps' + responses: + 200: + description: Indicates a successful call. + content: + application/json: + schema: + $ref: './common_attributes.schema.yaml#/components/schemas/ConversationResponse' + 400: + description: Generic Error + content: + application/json: + schema: + type: object + properties: + statusCode: + type: number + error: + type: string + message: + type: string diff --git a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.gen.ts b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.gen.ts index d4c9d262c25db..4145cb66b2852 100644 --- a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.gen.ts +++ b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.gen.ts @@ -11,7 +11,7 @@ * * info: * title: Create Conversation API endpoint - * version: 1 + * version: 2023-10-31 */ import { z } from 'zod'; @@ -20,34 +20,9 @@ import { ConversationCreateProps, ConversationResponse, ConversationUpdateProps, - ConversationMessageCreateProps, } from './common_attributes.gen'; import { NonEmptyString } from '../common_attributes.gen'; -export type AppendConversationMessageRequestParams = z.infer< - typeof AppendConversationMessageRequestParams ->; -export const AppendConversationMessageRequestParams = z.object({ - /** - * The conversation's `id` value. - */ - id: NonEmptyString, -}); -export type AppendConversationMessageRequestParamsInput = z.input< - typeof AppendConversationMessageRequestParams ->; - -export type AppendConversationMessageRequestBody = z.infer< - typeof AppendConversationMessageRequestBody ->; -export const AppendConversationMessageRequestBody = ConversationMessageCreateProps; -export type AppendConversationMessageRequestBodyInput = z.input< - typeof AppendConversationMessageRequestBody ->; - -export type AppendConversationMessageResponse = z.infer; -export const AppendConversationMessageResponse = ConversationResponse; - export type CreateConversationRequestBody = z.infer; export const CreateConversationRequestBody = ConversationCreateProps; export type CreateConversationRequestBodyInput = z.input; diff --git a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.schema.yaml b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.schema.yaml index ae5ca7d325a6a..9d9929f7f4e77 100644 --- a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.schema.yaml +++ b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.schema.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: title: Create Conversation API endpoint - version: '1' + version: '2023-10-31' paths: /api/security_ai_assistant/current_user/conversations: post: @@ -151,46 +151,3 @@ paths: type: string message: type: string - - /internal/elastic_assistant/current_user/conversations/{id}/messages: - post: - x-codegen-enabled: true - x-labels: [ess, serverless] - operationId: AppendConversationMessage - description: Append a message to the conversation - summary: Append a message to the conversation - tags: - - Conversation API - parameters: - - name: id - in: path - required: true - description: The conversation's `id` value. - schema: - $ref: '../common_attributes.schema.yaml#/components/schemas/NonEmptyString' - requestBody: - required: true - content: - application/json: - schema: - $ref: './common_attributes.schema.yaml#/components/schemas/ConversationMessageCreateProps' - responses: - 200: - description: Indicates a successful call. - content: - application/json: - schema: - $ref: './common_attributes.schema.yaml#/components/schemas/ConversationResponse' - 400: - description: Generic Error - content: - application/json: - schema: - type: object - properties: - statusCode: - type: number - error: - type: string - message: - type: string diff --git a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/find_conversations_route.gen.ts b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/find_conversations_route.gen.ts index f5d0962d13a77..95c9f7f53c8a2 100644 --- a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/find_conversations_route.gen.ts +++ b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/find_conversations_route.gen.ts @@ -11,7 +11,7 @@ * * info: * title: Find Conversations API endpoint - * version: 1 + * version: 2023-10-31 */ import { z } from 'zod'; diff --git a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/find_conversations_route.schema.yaml b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/find_conversations_route.schema.yaml index ea1f9b637186d..a7bf67c059f91 100644 --- a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/find_conversations_route.schema.yaml +++ b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/find_conversations_route.schema.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: title: Find Conversations API endpoint - version: '1' + version: '2023-10-31' paths: /api/security_ai_assistant/current_user/conversations/_find: get: diff --git a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/index.ts b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/index.ts index 1cbe8bbf8e792..c6c6c758a8cf6 100644 --- a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/index.ts +++ b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/index.ts @@ -13,7 +13,7 @@ export const API_VERSIONS = { internal: { v1: '1', }, -}; +} as const; export const PUBLIC_API_ACCESS = 'public'; export const INTERNAL_API_ACCESS = 'internal'; @@ -38,6 +38,7 @@ export * from './evaluation/get_evaluate_route.gen'; export * from './capabilities/get_capabilities_route.gen'; // Conversations Schemas +export * from './conversations/append_message.gen'; export * from './conversations/bulk_crud_conversations_route.gen'; export * from './conversations/common_attributes.gen'; export * from './conversations/crud_conversation_route.gen'; diff --git a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/prompts/bulk_crud_prompts_route.gen.ts b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/prompts/bulk_crud_prompts_route.gen.ts index 09e7fc85f9363..8247a88c66297 100644 --- a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/prompts/bulk_crud_prompts_route.gen.ts +++ b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/prompts/bulk_crud_prompts_route.gen.ts @@ -11,7 +11,7 @@ * * info: * title: Bulk Prompts Actions API endpoint - * version: 1 + * version: 2023-10-31 */ import { z } from 'zod'; diff --git a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/prompts/bulk_crud_prompts_route.schema.yaml b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/prompts/bulk_crud_prompts_route.schema.yaml index f5b6ee918429c..ad0550e6d3d6f 100644 --- a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/prompts/bulk_crud_prompts_route.schema.yaml +++ b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/prompts/bulk_crud_prompts_route.schema.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: title: Bulk Prompts Actions API endpoint - version: '1' + version: '2023-10-31' paths: /api/security_ai_assistant/prompts/_bulk_action: post: @@ -220,7 +220,6 @@ components: required: - attributes - BulkActionBase: x-inline: true type: object diff --git a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/prompts/find_prompts_route.gen.ts b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/prompts/find_prompts_route.gen.ts index 49f4c75029581..ab40398cddbdb 100644 --- a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/prompts/find_prompts_route.gen.ts +++ b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/prompts/find_prompts_route.gen.ts @@ -11,7 +11,7 @@ * * info: * title: Find Prompts API endpoint - * version: 1 + * version: 2023-10-31 */ import { z } from 'zod'; diff --git a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/prompts/find_prompts_route.schema.yaml b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/prompts/find_prompts_route.schema.yaml index dbd5590b29ee1..6ddfce4666823 100644 --- a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/prompts/find_prompts_route.schema.yaml +++ b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/prompts/find_prompts_route.schema.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: title: Find Prompts API endpoint - version: '1' + version: '2023-10-31' paths: /api/security_ai_assistant/prompts/_find: get: From 24cb25f30a65270258c62fdbd2af90839e560e33 Mon Sep 17 00:00:00 2001 From: Maxim Palenov Date: Wed, 24 Jul 2024 20:19:38 +0200 Subject: [PATCH 5/6] update CI bundling script --- .../security_solution_openapi_bundling.sh | 12 ++++++++++-- x-pack/plugins/security_solution/package.json | 2 +- .../openapi/{bundle.js => bundle_detections.js} | 0 3 files changed, 11 insertions(+), 3 deletions(-) rename x-pack/plugins/security_solution/scripts/openapi/{bundle.js => bundle_detections.js} (100%) diff --git a/.buildkite/scripts/steps/openapi_bundling/security_solution_openapi_bundling.sh b/.buildkite/scripts/steps/openapi_bundling/security_solution_openapi_bundling.sh index e6a43ab24eacb..8a158d2d13e79 100755 --- a/.buildkite/scripts/steps/openapi_bundling/security_solution_openapi_bundling.sh +++ b/.buildkite/scripts/steps/openapi_bundling/security_solution_openapi_bundling.sh @@ -6,19 +6,27 @@ source .buildkite/scripts/common/util.sh echo --- Security Solution OpenAPI Bundling -(cd x-pack/plugins/security_solution && yarn openapi:bundle) -check_for_changed_files "yarn openapi:bundle" true +echo -e "\n[Security Solution OpenAPI Bundling] Detections API\n" + +(cd x-pack/plugins/security_solution && yarn openapi:bundle:detections) +check_for_changed_files "yarn openapi:bundle:detections" true echo -e "\n[Security Solution OpenAPI Bundling] Entity Analytics API\n" (cd x-pack/plugins/security_solution && yarn openapi:bundle:entity-analytics) check_for_changed_files "yarn openapi:bundle:entity-analytics" true +echo -e "\n[Security Solution OpenAPI Bundling] Lists API\n" + (cd packages/kbn-securitysolution-lists-common && yarn openapi:bundle) check_for_changed_files "yarn openapi:bundle" true +echo -e "\n[Security Solution OpenAPI Bundling] Exceptions API\n" + (cd packages/kbn-securitysolution-exceptions-common && yarn openapi:bundle) check_for_changed_files "yarn openapi:bundle" true +echo -e "\n[Security Solution OpenAPI Bundling] Elastic Assistant API\n" + (cd x-pack/packages/kbn-elastic-assistant-common && yarn openapi:bundle) check_for_changed_files "yarn openapi:bundle" true \ No newline at end of file diff --git a/x-pack/plugins/security_solution/package.json b/x-pack/plugins/security_solution/package.json index 0647c73dcf6c9..7fa9e460ebf89 100644 --- a/x-pack/plugins/security_solution/package.json +++ b/x-pack/plugins/security_solution/package.json @@ -30,7 +30,7 @@ "junit:transform": "node scripts/junit_transformer --pathPattern '../../../target/kibana-security-solution/cypress/results/*.xml' --rootDirectory ../../../ --reportName 'Security Solution Cypress' --writeInPlace", "openapi:generate": "node scripts/openapi/generate", "openapi:generate:debug": "node --inspect-brk scripts/openapi/generate", - "openapi:bundle": "node scripts/openapi/bundle", + "openapi:bundle:detections": "node scripts/openapi/bundle_detections", "openapi:bundle:entity-analytics": "node scripts/openapi/bundle_entity_analytics" } } diff --git a/x-pack/plugins/security_solution/scripts/openapi/bundle.js b/x-pack/plugins/security_solution/scripts/openapi/bundle_detections.js similarity index 100% rename from x-pack/plugins/security_solution/scripts/openapi/bundle.js rename to x-pack/plugins/security_solution/scripts/openapi/bundle_detections.js From e9a43cdcca5c65ffd92866a0bef5eb716f0028a1 Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Wed, 24 Jul 2024 19:06:19 +0000 Subject: [PATCH 6/6] [CI] Auto-commit changed files from 'yarn openapi:generate' --- .../impl/schemas/conversations/append_message.gen.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/append_message.gen.ts b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/append_message.gen.ts index ac32946f946e3..7789a4fbb2983 100644 --- a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/append_message.gen.ts +++ b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/append_message.gen.ts @@ -10,7 +10,7 @@ * This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. * * info: - * title: Create Conversation API endpoint + * title: Append Conversation API endpoint * version: 1 */