From 81e251e63bbf9e87219f2b32a3946a1b4c012873 Mon Sep 17 00:00:00 2001 From: Steph Milovic Date: Thu, 28 Sep 2023 08:14:08 -0600 Subject: [PATCH 01/11] apply patch --- .github/CODEOWNERS | 6 +- api_docs/actions.devdocs.json | 16 +- .../connector-apis-passthru.asciidoc | 14 +- docs/management/action-types.asciidoc | 2 +- .../{gen-ai.asciidoc => openai.asciidoc} | 24 +- docs/management/connectors/index.asciidoc | 2 +- .../pre-configured-connectors.asciidoc | 8 +- docs/settings/alert-action-settings.asciidoc | 8 +- ...evert_a_few_changes_rename_gen_ai_to.patch | 2423 +++++++++++++++++ .../README.md | 4 +- .../public/components/list_connector.tsx | 2 +- .../public/components/setup_connector.tsx | 6 +- .../gen_ai_streaming_response_example.tsx | 2 +- .../public/plugin.tsx | 7 +- .../server/plugin.ts | 2 +- .../impl/assistant/assistant_header/index.tsx | 2 +- .../conversation_selector/index.tsx | 2 +- .../conversation_selector_settings/index.tsx | 2 +- .../impl/assistant/index.tsx | 2 +- .../assistant/settings/assistant_settings.tsx | 2 +- .../settings/assistant_settings_button.tsx | 2 +- .../impl/assistant_context/types.tsx | 2 +- .../connectorland/connector_button/index.tsx | 4 +- .../impl/connectorland/helpers.tsx | 4 +- .../use_load_action_types/index.tsx | 7 +- .../content/prompts/welcome/translations.ts | 2 +- .../impl/mock/conversation.ts | 2 +- .../common/connector_feature_config.ts | 18 +- x-pack/plugins/actions/common/types.ts | 2 +- .../plugins/actions/docs/openapi/bundled.json | 10 +- .../plugins/actions/docs/openapi/bundled.yaml | 12 +- .../schemas/config_properties_genai.yaml | 4 +- .../connector_response_properties_genai.yaml | 2 +- .../create_connector_request_genai.yaml | 6 +- .../schemas/secrets_properties_genai.yaml | 4 +- .../update_connector_request_genai.yaml | 4 +- .../server/lib/action_executor.test.ts | 2 +- .../actions/server/lib/action_executor.ts | 6 +- .../data_drift/data_drift_utils.test.ts | 88 + ...ion_template_url_from_agent_policy.test.ts | 68 + ...ormation_template_url_from_agent_policy.ts | 38 + ...ion_template_url_from_package_info.test.ts | 66 + ...ormation_template_url_from_package_info.ts | 32 + .../detail_panel/detail_panel.container.d.ts | 8 + .../detail_panel/detail_panel.container.js | 64 + .../index_list/detail_panel/detail_panel.js | 176 ++ .../edit_settings_json.container.js | 34 + .../edit_settings_json/edit_settings_json.js | 170 ++ .../detail_panel/edit_settings_json/index.js | 8 + .../home/index_list/detail_panel}/index.ts | 2 +- .../detail_panel/show_json/index.js | 8 + .../show_json/show_json.container.js | 36 + .../detail_panel/show_json/show_json.js | 31 + .../index_list/detail_panel/summary/index.js | 8 + .../detail_panel/summary/summary.container.js | 21 + .../detail_panel/summary/summary.js | 147 + .../application/store/actions/detail_panel.js | 11 + .../store/actions/edit_index_settings.js | 38 + .../store/actions/load_index_data.js | 24 + .../store/actions/update_index_settings.js | 39 + .../store/reducers/detail_panel.js | 91 + .../common/locators/discover_logs_locator.ts | 27 + .../locators/discover_node_logs_locator.ts | 32 + .../infra/public/apps/discover_app.tsx | 30 + .../observability_ai_assistant/README.md | 2 +- .../components/chat/initial_setup_panel.tsx | 6 +- .../common/{gen_ai => open_ai}/constants.ts | 2 +- .../common/{gen_ai => open_ai}/schema.ts | 0 .../common/{gen_ai => open_ai}/types.ts | 0 .../stack_connectors/public/common/index.ts | 6 +- .../connector_types/d3security/d3security.tsx | 2 +- .../public/connector_types/index.ts | 4 +- .../{gen_ai => open_ai}/api.test.ts | 2 +- .../{gen_ai => open_ai}/api.ts | 2 +- .../{gen_ai => open_ai}/connector.test.tsx | 62 +- .../{gen_ai => open_ai}/connector.tsx | 9 +- .../{gen_ai => open_ai}/constants.tsx | 2 +- .../public/connector_types/open_ai/index.ts | 8 + .../{gen_ai => open_ai}/logo.tsx | 0 .../open_ai.test.tsx} | 6 +- .../gen_ai.tsx => open_ai/open_ai.tsx} | 14 +- .../{gen_ai => open_ai}/params.test.tsx | 14 +- .../{gen_ai => open_ai}/params.tsx | 12 +- .../{gen_ai => open_ai}/translations.ts | 2 +- .../{gen_ai => open_ai}/types.ts | 21 +- .../use_get_dashboard.test.ts | 2 +- .../{gen_ai => open_ai}/use_get_dashboard.ts | 0 .../server/connector_types/bedrock/index.ts | 4 +- .../server/connector_types/index.ts | 4 +- .../create_dashboard.test.ts | 0 .../{gen_ai => open_ai}/create_dashboard.ts | 0 .../{gen_ai => open_ai}/dashboard.ts | 12 +- .../{gen_ai => open_ai}/index.test.ts | 16 +- .../{gen_ai => open_ai}/index.ts | 20 +- .../lib/azure_openai_utils.test.ts | 2 +- .../lib/azure_openai_utils.ts | 2 +- .../lib/openai_utils.test.ts | 2 +- .../{gen_ai => open_ai}/lib/openai_utils.ts | 5 +- .../{gen_ai => open_ai}/lib/utils.test.ts | 2 +- .../{gen_ai => open_ai}/lib/utils.ts | 2 +- .../open_ai.test.ts} | 22 +- .../{gen_ai/gen_ai.ts => open_ai/open_ai.ts} | 12 +- .../{gen_ai => open_ai}/render.test.ts | 2 +- .../{gen_ai => open_ai}/render.ts | 2 +- ...ai_simulation.ts => open_ai_simulation.ts} | 6 +- .../connector_types/{gen_ai.ts => open_ai.ts} | 18 +- .../group2/tests/actions/index.ts | 2 +- .../index_details_page/config.ts | 25 + .../index_details_page/index.ts | 14 + .../index_details_page/index_details_page.ts | 30 + .../generative_ai_connector.ts | 4 +- .../stack_connectors/xmatters_connector.ts | 2 +- 112 files changed, 4033 insertions(+), 281 deletions(-) rename docs/management/connectors/action-types/{gen-ai.asciidoc => openai.asciidoc} (65%) create mode 100644 more_more_more_GeneralFeature_to_GenerativeAIFeature_revert_a_few_changes_rename_gen_ai_to.patch create mode 100644 x-pack/plugins/data_visualizer/public/application/data_drift/data_drift_utils.test.ts create mode 100644 x-pack/plugins/fleet/public/services/get_cloud_formation_template_url_from_agent_policy.test.ts create mode 100644 x-pack/plugins/fleet/public/services/get_cloud_formation_template_url_from_agent_policy.ts create mode 100644 x-pack/plugins/fleet/public/services/get_cloud_formation_template_url_from_package_info.test.ts create mode 100644 x-pack/plugins/fleet/public/services/get_cloud_formation_template_url_from_package_info.ts create mode 100644 x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/detail_panel.container.d.ts create mode 100644 x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/detail_panel.container.js create mode 100644 x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/detail_panel.js create mode 100644 x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/edit_settings_json/edit_settings_json.container.js create mode 100644 x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/edit_settings_json/edit_settings_json.js create mode 100644 x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/edit_settings_json/index.js rename x-pack/plugins/{stack_connectors/public/connector_types/gen_ai => index_management/public/application/sections/home/index_list/detail_panel}/index.ts (76%) create mode 100644 x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/show_json/index.js create mode 100644 x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/show_json/show_json.container.js create mode 100644 x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/show_json/show_json.js create mode 100644 x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/summary/index.js create mode 100644 x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/summary/summary.container.js create mode 100644 x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/summary/summary.js create mode 100644 x-pack/plugins/index_management/public/application/store/actions/detail_panel.js create mode 100644 x-pack/plugins/index_management/public/application/store/actions/edit_index_settings.js create mode 100644 x-pack/plugins/index_management/public/application/store/actions/load_index_data.js create mode 100644 x-pack/plugins/index_management/public/application/store/actions/update_index_settings.js create mode 100644 x-pack/plugins/index_management/public/application/store/reducers/detail_panel.js create mode 100644 x-pack/plugins/infra/common/locators/discover_logs_locator.ts create mode 100644 x-pack/plugins/infra/common/locators/discover_node_logs_locator.ts create mode 100644 x-pack/plugins/infra/public/apps/discover_app.tsx rename x-pack/plugins/stack_connectors/common/{gen_ai => open_ai}/constants.ts (96%) rename x-pack/plugins/stack_connectors/common/{gen_ai => open_ai}/schema.ts (100%) rename x-pack/plugins/stack_connectors/common/{gen_ai => open_ai}/types.ts (100%) rename x-pack/plugins/stack_connectors/public/connector_types/{gen_ai => open_ai}/api.test.ts (94%) rename x-pack/plugins/stack_connectors/public/connector_types/{gen_ai => open_ai}/api.ts (94%) rename x-pack/plugins/stack_connectors/public/connector_types/{gen_ai => open_ai}/connector.test.tsx (81%) rename x-pack/plugins/stack_connectors/public/connector_types/{gen_ai => open_ai}/connector.tsx (93%) rename x-pack/plugins/stack_connectors/public/connector_types/{gen_ai => open_ai}/constants.tsx (99%) create mode 100644 x-pack/plugins/stack_connectors/public/connector_types/open_ai/index.ts rename x-pack/plugins/stack_connectors/public/connector_types/{gen_ai => open_ai}/logo.tsx (100%) rename x-pack/plugins/stack_connectors/public/connector_types/{gen_ai/gen_ai.test.tsx => open_ai/open_ai.test.tsx} (94%) rename x-pack/plugins/stack_connectors/public/connector_types/{gen_ai/gen_ai.tsx => open_ai/open_ai.tsx} (81%) rename x-pack/plugins/stack_connectors/public/connector_types/{gen_ai => open_ai}/params.test.tsx (94%) rename x-pack/plugins/stack_connectors/public/connector_types/{gen_ai => open_ai}/params.tsx (89%) rename x-pack/plugins/stack_connectors/public/connector_types/{gen_ai => open_ai}/translations.ts (97%) rename x-pack/plugins/stack_connectors/public/connector_types/{gen_ai => open_ai}/types.ts (65%) rename x-pack/plugins/stack_connectors/public/connector_types/{gen_ai => open_ai}/use_get_dashboard.test.ts (98%) rename x-pack/plugins/stack_connectors/public/connector_types/{gen_ai => open_ai}/use_get_dashboard.ts (100%) rename x-pack/plugins/stack_connectors/server/connector_types/{gen_ai => open_ai}/create_dashboard.test.ts (100%) rename x-pack/plugins/stack_connectors/server/connector_types/{gen_ai => open_ai}/create_dashboard.ts (100%) rename x-pack/plugins/stack_connectors/server/connector_types/{gen_ai => open_ai}/dashboard.ts (97%) rename x-pack/plugins/stack_connectors/server/connector_types/{gen_ai => open_ai}/index.test.ts (85%) rename x-pack/plugins/stack_connectors/server/connector_types/{gen_ai => open_ai}/index.ts (78%) rename x-pack/plugins/stack_connectors/server/connector_types/{gen_ai => open_ai}/lib/azure_openai_utils.test.ts (99%) rename x-pack/plugins/stack_connectors/server/connector_types/{gen_ai => open_ai}/lib/azure_openai_utils.ts (97%) rename x-pack/plugins/stack_connectors/server/connector_types/{gen_ai => open_ai}/lib/openai_utils.test.ts (99%) rename x-pack/plugins/stack_connectors/server/connector_types/{gen_ai => open_ai}/lib/openai_utils.ts (93%) rename x-pack/plugins/stack_connectors/server/connector_types/{gen_ai => open_ai}/lib/utils.test.ts (99%) rename x-pack/plugins/stack_connectors/server/connector_types/{gen_ai => open_ai}/lib/utils.ts (97%) rename x-pack/plugins/stack_connectors/server/connector_types/{gen_ai/gen_ai.test.ts => open_ai/open_ai.test.ts} (97%) rename x-pack/plugins/stack_connectors/server/connector_types/{gen_ai/gen_ai.ts => open_ai/open_ai.ts} (95%) rename x-pack/plugins/stack_connectors/server/connector_types/{gen_ai => open_ai}/render.test.ts (96%) rename x-pack/plugins/stack_connectors/server/connector_types/{gen_ai => open_ai}/render.ts (93%) rename x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/{gen_ai_simulation.ts => open_ai_simulation.ts} (91%) rename x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/{gen_ai.ts => open_ai.ts} (96%) create mode 100644 x-pack/test/functional/apps/index_management/index_details_page/config.ts create mode 100644 x-pack/test/functional/apps/index_management/index_details_page/index.ts create mode 100644 x-pack/test/functional/apps/index_management/index_details_page/index_details_page.ts diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 89f769c0f12ec..ff2196aa3adb6 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1208,9 +1208,9 @@ x-pack/plugins/cloud_integrations/cloud_full_story/server/config.ts @elastic/kib /x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users @elastic/security-threat-hunting-explore ## Explore owner connectors -/x-pack/plugins/stack_connectors/public/connector_types/gen_ai @elastic/security-threat-hunting-explore -/x-pack/plugins/stack_connectors/server/connector_types/gen_ai @elastic/security-threat-hunting-explore -/x-pack/plugins/stack_connectors/common/gen_ai @elastic/security-threat-hunting-explore +/x-pack/plugins/stack_connectors/public/connector_types/open_ai @elastic/security-threat-hunting-explore +/x-pack/plugins/stack_connectors/server/connector_types/open_ai @elastic/security-threat-hunting-explore +/x-pack/plugins/stack_connectors/common/open_ai @elastic/security-threat-hunting-explore ## Defend Workflows owner connectors /x-pack/plugins/stack_connectors/public/connector_types/sentinelone @elastic/security-defend-workflows diff --git a/api_docs/actions.devdocs.json b/api_docs/actions.devdocs.json index 4e648524c704d..247840029729f 100644 --- a/api_docs/actions.devdocs.json +++ b/api_docs/actions.devdocs.json @@ -5273,10 +5273,10 @@ }, { "parentPluginId": "actions", - "id": "def-common.GeneralConnectorFeatureId", + "id": "def-common.GenerativeAIConnectorFeatureId", "type": "string", "tags": [], - "label": "GeneralConnectorFeatureId", + "label": "GenerativeAIConnectorFeatureId", "description": [], "signature": [ "\"general\"" @@ -5613,10 +5613,10 @@ }, { "parentPluginId": "actions", - "id": "def-common.GeneralFeature", + "id": "def-common.GenerativeAIFeature", "type": "Object", "tags": [], - "label": "GeneralFeature", + "label": "GenerativeAIFeature", "description": [], "path": "x-pack/plugins/actions/common/connector_feature_config.ts", "deprecated": false, @@ -5624,7 +5624,7 @@ "children": [ { "parentPluginId": "actions", - "id": "def-common.GeneralFeature.id", + "id": "def-common.GenerativeAIFeature.id", "type": "string", "tags": [], "label": "id", @@ -5635,7 +5635,7 @@ }, { "parentPluginId": "actions", - "id": "def-common.GeneralFeature.name", + "id": "def-common.GenerativeAIFeature.name", "type": "string", "tags": [], "label": "name", @@ -5646,7 +5646,7 @@ }, { "parentPluginId": "actions", - "id": "def-common.GeneralFeature.compatibility", + "id": "def-common.GenerativeAIFeature.compatibility", "type": "string", "tags": [], "label": "compatibility", @@ -5769,4 +5769,4 @@ } ] } -} \ No newline at end of file +} diff --git a/docs/api-generated/connectors/connector-apis-passthru.asciidoc b/docs/api-generated/connectors/connector-apis-passthru.asciidoc index fb1a9b87dbcda..d3495cecf9edf 100644 --- a/docs/api-generated/connectors/connector-apis-passthru.asciidoc +++ b/docs/api-generated/connectors/connector-apis-passthru.asciidoc @@ -1004,7 +1004,7 @@ Any modifications made to this file will be overwritten.
  • config_properties_cases_webhook - Connector request properties for Webhook - Case Management connector
  • config_properties_d3security - Connector request properties for a D3 Security connector
  • config_properties_email - Connector request properties for an email connector
  • -
  • config_properties_genai - Connector request properties for a generative AI connector
  • +
  • config_properties_genai - Connector request properties for an OpenAI connector
  • config_properties_genai_oneOf -
  • config_properties_genai_oneOf_1 -
  • config_properties_index - Connector request properties for an index connector
  • @@ -1044,7 +1044,7 @@ Any modifications made to this file will be overwritten.
  • create_connector_request_cases_webhook - Create Webhook - Case Managment connector request
  • create_connector_request_d3security - Create D3 Security connector request
  • create_connector_request_email - Create email connector request
  • -
  • create_connector_request_genai - Create generative AI connector request
  • +
  • create_connector_request_genai - Create OpenAI connector request
  • create_connector_request_index - Create index connector request
  • create_connector_request_jira - Create Jira connector request
  • create_connector_request_opsgenie - Create Opsgenie connector request
  • @@ -1100,7 +1100,7 @@ Any modifications made to this file will be overwritten.
  • secrets_properties_cases_webhook - Connector secrets properties for Webhook - Case Management connector
  • secrets_properties_d3security - Connector secrets properties for a D3 Security connector
  • secrets_properties_email - Connector secrets properties for an email connector
  • -
  • secrets_properties_genai - Connector secrets properties for a generative AI connector
  • +
  • secrets_properties_genai - Connector secrets properties for an OpenAI connector
  • secrets_properties_jira - Connector secrets properties for a Jira connector
  • secrets_properties_opsgenie - Connector secrets properties for an Opsgenie connector
  • secrets_properties_pagerduty - Connector secrets properties for a PagerDuty connector
  • @@ -1432,7 +1432,7 @@ Any modifications made to this file will be overwritten.
    -

    config_properties_genai - Connector request properties for a generative AI connector Up

    +

    config_properties_genai - Connector request properties for an OpenAI connector Up

    Defines properties for connectors when type is .gen-ai.
    apiProvider
    String The OpenAI API provider.
    @@ -1958,8 +1958,8 @@ Any modifications made to this file will be overwritten.
    -

    create_connector_request_genai - Create generative AI connector request Up

    -
    The generative AI connector uses axios to send a POST request to either OpenAI or Azure OpenAPI.
    +

    create_connector_request_genai - Create OpenAI connector request Up

    +
    The OpenAI connector uses axios to send a POST request to either OpenAI or Azure OpenAPI.
    config
    connector_type_id
    String The type of connector.
    @@ -2535,7 +2535,7 @@ Any modifications made to this file will be overwritten.
    -

    secrets_properties_genai - Connector secrets properties for a generative AI connector Up

    +

    secrets_properties_genai - Connector secrets properties for an OpenAI connector Up

    Defines secrets for connectors when type is .gen-ai.
    apiKey (optional)
    String The OpenAI API key.
    diff --git a/docs/management/action-types.asciidoc b/docs/management/action-types.asciidoc index 67dd4e3fd0019..357d0e5de50ea 100644 --- a/docs/management/action-types.asciidoc +++ b/docs/management/action-types.asciidoc @@ -35,7 +35,7 @@ a| <> | Send a message to a Microsoft Teams channel. -a| <> +a| <> | Send a request to OpenAI. diff --git a/docs/management/connectors/action-types/gen-ai.asciidoc b/docs/management/connectors/action-types/openai.asciidoc similarity index 65% rename from docs/management/connectors/action-types/gen-ai.asciidoc rename to docs/management/connectors/action-types/openai.asciidoc index 6388a483e7fc3..49033b92cd740 100644 --- a/docs/management/connectors/action-types/gen-ai.asciidoc +++ b/docs/management/connectors/action-types/openai.asciidoc @@ -1,7 +1,7 @@ -[[gen-ai-action-type]] -== Generative AI connector and action +[[openai-action-type]] +== OpenAI connector and action ++++ -Generative AI +OpenAI ++++ :frontmatter-description: Add a connector that can send requests to an OpenAI provider. :frontmatter-tags-products: [kibana] @@ -9,7 +9,7 @@ :frontmatter-tags-user-goals: [configure] -The Generative AI connector uses https://github.com/axios/axios[axios] to send a POST request to an OpenAI provider, either OpenAI or Azure OpenAI. The connector uses the <> to send the request. +The OpenAI connector uses https://github.com/axios/axios[axios] to send a POST request to an OpenAI provider, either OpenAI or Azure OpenAI. The connector uses the <> to send the request. [float] [[define-gen-ai-ui]] @@ -18,14 +18,14 @@ The Generative AI connector uses https://github.com/axios/axios[axios] to send a You can create connectors in *{stack-manage-app} > {connectors-ui}*. For example: [role="screenshot"] -image::management/connectors/images/gen-ai-connector.png[Generative AI connector] +image::management/connectors/images/gen-ai-connector.png[OpenAI connector] // NOTE: This is an autogenerated screenshot. Do not edit it directly. [float] -[[gen-ai-connector-configuration]] +[[openai-connector-configuration]] ==== Connector configuration -Generative AI connectors have the following configuration properties: +OpenAI connectors have the following configuration properties: Name:: The name of the connector. OpenAI provider:: The OpenAI API provider, either OpenAI or Azure OpenAI. @@ -41,10 +41,10 @@ You can test connectors with the <> or as you're creating or editing the connector in {kib}. For example: [role="screenshot"] -image::management/connectors/images/gen-ai-params-test.png[Generative AI params test] +image::management/connectors/images/gen-ai-params-test.png[OpenAI params test] // NOTE: This is an autogenerated screenshot. Do not edit it directly. -The Generative AI actions have the following configuration properties. +The OpenAI actions have the following configuration properties. Body:: A JSON payload sent to the OpenAI API URL. For example: + @@ -61,15 +61,15 @@ Body:: A JSON payload sent to the OpenAI API URL. For example: } -- [float] -[[gen-ai-connector-networking-configuration]] +[[openai-connector-networking-configuration]] === Connector networking configuration Use the <> to customize connector networking configurations, such as proxies, certificates, or TLS settings. You can set configurations that apply to all your connectors or use `xpack.actions.customHostSettings` to set per-host configurations. [float] -[[gen-ai-connector-token-dashboard]] +[[openai-connector-token-dashboard]] === Token usage dashboard -Once you've created a Generative AI connector, you can monitor its token usage using the *Generative AI Token Usage* dashboard. Select the connector in *{stack-manage-app}* > *{connectors-ui}* to view its details, then click the *View OpenAI Usage Dashboard for "__" Connector* link to open the dashboard. +Once you've created a OpenAI connector, you can monitor its token usage using the *OpenAI Token Usage* dashboard. Select the connector in *{stack-manage-app}* > *{connectors-ui}* to view its details, then click the *View OpenAI Usage Dashboard for "__" Connector* link to open the dashboard. NOTE: To view the dashboard, you need at least `read` and `view_index_metadata` privileges for the `.kibana-event-log-*` index and the `Read` feature privilege for {kib}. You can set up a role with these minimum privileges and assign it to non-admin users who need to view this dashboard. diff --git a/docs/management/connectors/index.asciidoc b/docs/management/connectors/index.asciidoc index e7ef07ba4f737..cf17927941863 100644 --- a/docs/management/connectors/index.asciidoc +++ b/docs/management/connectors/index.asciidoc @@ -1,7 +1,7 @@ include::action-types/bedrock.asciidoc[leveloffset=+1] include::action-types/d3security.asciidoc[leveloffset=+1] include::action-types/email.asciidoc[leveloffset=+1] -include::action-types/gen-ai.asciidoc[leveloffset=+1] +include::action-types/openai.asciidoc[leveloffset=+1] include::action-types/resilient.asciidoc[leveloffset=+1] include::action-types/index.asciidoc[leveloffset=+1] include::action-types/jira.asciidoc[leveloffset=+1] diff --git a/docs/management/connectors/pre-configured-connectors.asciidoc b/docs/management/connectors/pre-configured-connectors.asciidoc index 8f40554d5bbf3..79b4e331fa19a 100644 --- a/docs/management/connectors/pre-configured-connectors.asciidoc +++ b/docs/management/connectors/pre-configured-connectors.asciidoc @@ -282,15 +282,15 @@ secrets: [float] [[preconfigured-gen-ai-configuration]] -==== Generative AI connectors +==== OpenAI connectors -The following example creates a <>: +The following example creates a <>: [source,text] -- xpack.actions.preconfigured: - my-gen-ai: - name: preconfigured-gen-ai-connector-type + my-open-ai: + name: preconfigured-openai-connector-type actionTypeId: .gen-ai config: apiUrl: https://api.openai.com/v1/chat/completions <1> diff --git a/docs/settings/alert-action-settings.asciidoc b/docs/settings/alert-action-settings.asciidoc index fff867cc65a2a..f00c805829a83 100644 --- a/docs/settings/alert-action-settings.asciidoc +++ b/docs/settings/alert-action-settings.asciidoc @@ -261,13 +261,13 @@ For example: `.email`, `.index`, `.opsgenie`, `.server-log`, `.resilient`, `.sla The configuration details, which are specific to the type of preconfigured connector. `xpack.actions.preconfigured..config.apiProvider`:: -For a <>, specifies the OpenAI API provider, either `OpenAI` or `Azure OpenAI`. +For a <>, specifies the OpenAI API provider, either `OpenAI` or `Azure OpenAI`. `xpack.actions.preconfigured..config.apiUrl`:: A configuration URL that varies by connector: + -- -* For a <>, specifies the OpenAI request URL. +* For a <>, specifies the OpenAI request URL. * For a <>, specifies the {ibm-r} instance URL. * For a <>, specifies the Jira instance URL. * For an <>, specifies the {opsgenie} URL. For example, `https://api.opsgenie.com` or `https://api.eu.opsgenie.com`. @@ -321,7 +321,7 @@ NOTE: If you are using the `xpack.actions.allowedHosts` setting, make sure the h For a <>, specifies a string from the response body of the create case method that corresponds to the external service identifier. `xpack.actions.preconfigured..config.defaultModel`:: -For a <>, specifies the default model to use for requests. It is optional and applicable only when `xpack.actions.preconfigured..config.apiProvider` is `OpenAI`. +For a <>, specifies the default model to use for requests. It is optional and applicable only when `xpack.actions.preconfigured..config.apiProvider` is `OpenAI`. `xpack.actions.preconfigured..config.executionTimeField`:: For an <>, a field that indicates when the document was indexed. @@ -448,7 +448,7 @@ TIP: Sensitive properties, such as passwords, should be stored in the <>, specifies the OpenAI or Azure OpenAI API key for authentication. +* For a <>, specifies the OpenAI or Azure OpenAI API key for authentication. * For an <>, specifies the {opsgenie} API authentication key for HTTP basic authentication. -- diff --git a/more_more_more_GeneralFeature_to_GenerativeAIFeature_revert_a_few_changes_rename_gen_ai_to.patch b/more_more_more_GeneralFeature_to_GenerativeAIFeature_revert_a_few_changes_rename_gen_ai_to.patch new file mode 100644 index 0000000000000..f824098ffda7d --- /dev/null +++ b/more_more_more_GeneralFeature_to_GenerativeAIFeature_revert_a_few_changes_rename_gen_ai_to.patch @@ -0,0 +1,2423 @@ +Subject: [PATCH] more +more +more +GeneralFeature to GenerativeAIFeature +revert a few changes +rename gen ai to OpenAI +--- +Index: .github/CODEOWNERS +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS +--- a/.github/CODEOWNERS (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/.github/CODEOWNERS (revision f26c1b78fba7b88efe9f13c938daf875d8512498) +@@ -1202,9 +1202,9 @@ + /x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users @elastic/security-threat-hunting-explore + + ## Explore owner connectors +-/x-pack/plugins/stack_connectors/public/connector_types/gen_ai @elastic/security-threat-hunting-explore +-/x-pack/plugins/stack_connectors/server/connector_types/gen_ai @elastic/security-threat-hunting-explore +-/x-pack/plugins/stack_connectors/common/gen_ai @elastic/security-threat-hunting-explore ++/x-pack/plugins/stack_connectors/public/connector_types/open_ai @elastic/security-threat-hunting-explore ++/x-pack/plugins/stack_connectors/server/connector_types/open_ai @elastic/security-threat-hunting-explore ++/x-pack/plugins/stack_connectors/common/open_ai @elastic/security-threat-hunting-explore + + ## Defend Workflows owner connectors + /x-pack/plugins/stack_connectors/public/connector_types/sentinelone @elastic/security-defend-workflows +Index: docs/api-generated/connectors/connector-apis-passthru.asciidoc +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/docs/api-generated/connectors/connector-apis-passthru.asciidoc b/docs/api-generated/connectors/connector-apis-passthru.asciidoc +--- a/docs/api-generated/connectors/connector-apis-passthru.asciidoc (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/docs/api-generated/connectors/connector-apis-passthru.asciidoc (revision f26c1b78fba7b88efe9f13c938daf875d8512498) +@@ -1004,7 +1004,7 @@ +
  • config_properties_cases_webhook - Connector request properties for Webhook - Case Management connector
  • +
  • config_properties_d3security - Connector request properties for a D3 Security connector
  • +
  • config_properties_email - Connector request properties for an email connector
  • +-
  • config_properties_genai - Connector request properties for a generative AI connector
  • ++
  • config_properties_genai - Connector request properties for an OpenAI connector
  • +
  • config_properties_genai_oneOf -
  • +
  • config_properties_genai_oneOf_1 -
  • +
  • config_properties_index - Connector request properties for an index connector
  • +@@ -1043,7 +1043,7 @@ +
  • create_connector_request_cases_webhook - Create Webhook - Case Managment connector request
  • +
  • create_connector_request_d3security - Create D3 Security connector request
  • +
  • create_connector_request_email - Create email connector request
  • +-
  • create_connector_request_genai - Create generative AI connector request
  • ++
  • create_connector_request_genai - Create OpenAI connector request
  • +
  • create_connector_request_index - Create index connector request
  • +
  • create_connector_request_jira - Create Jira connector request
  • +
  • create_connector_request_opsgenie - Create Opsgenie connector request
  • +@@ -1099,7 +1099,7 @@ +
  • secrets_properties_cases_webhook - Connector secrets properties for Webhook - Case Management connector
  • +
  • secrets_properties_d3security - Connector secrets properties for a D3 Security connector
  • +
  • secrets_properties_email - Connector secrets properties for an email connector
  • +-
  • secrets_properties_genai - Connector secrets properties for a generative AI connector
  • ++
  • secrets_properties_genai - Connector secrets properties for an OpenAI connector
  • +
  • secrets_properties_jira - Connector secrets properties for a Jira connector
  • +
  • secrets_properties_opsgenie - Connector secrets properties for an Opsgenie connector
  • +
  • secrets_properties_pagerduty - Connector secrets properties for a PagerDuty connector
  • +@@ -1429,7 +1429,7 @@ +
    +
    +
    +-

    config_properties_genai - Connector request properties for a generative AI connector Up

    ++

    config_properties_genai - Connector request properties for an OpenAI connector Up

    +
    Defines properties for connectors when type is .gen-ai.
    +
    +
    apiProvider
    String The OpenAI API provider.
    +@@ -1948,8 +1948,8 @@ +
    +
    +
    +-

    create_connector_request_genai - Create generative AI connector request Up

    +-
    The generative AI connector uses axios to send a POST request to either OpenAI or Azure OpenAPI.
    ++

    create_connector_request_genai - Create OpenAI connector request Up

    ++
    The OpenAI connector uses axios to send a POST request to either OpenAI or Azure OpenAPI.
    +
    +
    config
    +
    connector_type_id
    String The type of connector.
    +@@ -2525,7 +2525,7 @@ +
    +
    +
    +-

    secrets_properties_genai - Connector secrets properties for a generative AI connector Up

    ++

    secrets_properties_genai - Connector secrets properties for an OpenAI connector Up

    +
    Defines secrets for connectors when type is .gen-ai.
    +
    +
    apiKey (optional)
    String The OpenAI API key.
    +Index: docs/management/connectors/pre-configured-connectors.asciidoc +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/docs/management/connectors/pre-configured-connectors.asciidoc b/docs/management/connectors/pre-configured-connectors.asciidoc +--- a/docs/management/connectors/pre-configured-connectors.asciidoc (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/docs/management/connectors/pre-configured-connectors.asciidoc (revision bc6c2a2dcb95ac781ee1ddcdb1cfeac0d882ee47) +@@ -281,15 +281,15 @@ + + [float] + [[preconfigured-gen-ai-configuration]] +-==== Generative AI connectors ++==== OpenAI connectors + +-The following example creates a <>: ++The following example creates a <>: + + [source,text] + -- + xpack.actions.preconfigured: +- my-gen-ai: +- name: preconfigured-gen-ai-connector-type ++ my-open-ai: ++ name: preconfigured-openai-connector-type + actionTypeId: .gen-ai + config: + apiUrl: https://api.openai.com/v1/chat/completions <1> +Index: docs/settings/alert-action-settings.asciidoc +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/docs/settings/alert-action-settings.asciidoc b/docs/settings/alert-action-settings.asciidoc +--- a/docs/settings/alert-action-settings.asciidoc (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/docs/settings/alert-action-settings.asciidoc (revision f26c1b78fba7b88efe9f13c938daf875d8512498) +@@ -261,13 +261,13 @@ + The configuration details, which are specific to the type of preconfigured connector. + + `xpack.actions.preconfigured..config.apiProvider`:: +-For a <>, specifies the OpenAI API provider, either `OpenAI` or `Azure OpenAI`. ++For a <>, specifies the OpenAI API provider, either `OpenAI` or `Azure OpenAI`. + + `xpack.actions.preconfigured..config.apiUrl`:: + A configuration URL that varies by connector: + + + -- +-* For a <>, specifies the OpenAI request URL. ++* For a <>, specifies the OpenAI request URL. + * For a <>, specifies the {ibm-r} instance URL. + * For a <>, specifies the Jira instance URL. + * For an <>, specifies the {opsgenie} URL. For example, `https://api.opsgenie.com` or `https://api.eu.opsgenie.com`. +@@ -321,7 +321,7 @@ + For a <>, specifies a string from the response body of the create case method that corresponds to the external service identifier. + + `xpack.actions.preconfigured..config.defaultModel`:: +-For a <>, specifies the default model to use for requests. It is optional and applicable only when `xpack.actions.preconfigured..config.apiProvider` is `OpenAI`. ++For a <>, specifies the default model to use for requests. It is optional and applicable only when `xpack.actions.preconfigured..config.apiProvider` is `OpenAI`. + + `xpack.actions.preconfigured..config.executionTimeField`:: + For an <>, a field that indicates when the document was indexed. +@@ -447,7 +447,7 @@ + An API key secret that varies by connector: + + + -- +-* For a <>, specifies the OpenAI or Azure OpenAI API key for authentication. ++* For a <>, specifies the OpenAI or Azure OpenAI API key for authentication. + * For an <>, specifies the {opsgenie} API authentication key for HTTP basic authentication. + -- + +Index: x-pack/examples/gen_ai_streaming_response_example/README.md +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/examples/gen_ai_streaming_response_example/README.md b/x-pack/examples/gen_ai_streaming_response_example/README.md +--- a/x-pack/examples/gen_ai_streaming_response_example/README.md (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/examples/gen_ai_streaming_response_example/README.md (revision f26c1b78fba7b88efe9f13c938daf875d8512498) +@@ -1,5 +1,5 @@ +-## Generative AI Connector Streaming Response Example ++## OpenAI Connector Streaming Response Example + +-This example plugin shows you how to stream a response from a Generative AI connector. ++This example plugin shows you how to stream a response from a OpenAI connector. + + To run this example, use the command `yarn start --run-examples`. +\ No newline at end of file +Index: x-pack/examples/gen_ai_streaming_response_example/public/components/list_connector.tsx +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/examples/gen_ai_streaming_response_example/public/components/list_connector.tsx b/x-pack/examples/gen_ai_streaming_response_example/public/components/list_connector.tsx +--- a/x-pack/examples/gen_ai_streaming_response_example/public/components/list_connector.tsx (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/examples/gen_ai_streaming_response_example/public/components/list_connector.tsx (revision f26c1b78fba7b88efe9f13c938daf875d8512498) +@@ -52,7 +52,7 @@ + label={i18n.translate( + 'genAiStreamingResponseExample.app.component.selectConnectorLabel', + { +- defaultMessage: 'Select a Generative AI Connector', ++ defaultMessage: 'Select a OpenAI Connector', + } + )} + labelAppend={ +Index: x-pack/examples/gen_ai_streaming_response_example/public/components/setup_connector.tsx +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/examples/gen_ai_streaming_response_example/public/components/setup_connector.tsx b/x-pack/examples/gen_ai_streaming_response_example/public/components/setup_connector.tsx +--- a/x-pack/examples/gen_ai_streaming_response_example/public/components/setup_connector.tsx (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/examples/gen_ai_streaming_response_example/public/components/setup_connector.tsx (revision bc6c2a2dcb95ac781ee1ddcdb1cfeac0d882ee47) +@@ -6,7 +6,7 @@ + */ + + import React from 'react'; +-import { GenAiLogo } from '@kbn/stack-connectors-plugin/public/common'; ++import { OpenAILogo } from '@kbn/stack-connectors-plugin/public/common'; + import { EuiFlexGroup, EuiCard, EuiFlexItem, EuiIcon } from '@elastic/eui'; + import { i18n } from '@kbn/i18n'; + +@@ -20,11 +20,11 @@ + + } ++ icon={} + title={i18n.translate( + 'genAiStreamingResponseExample.app.component.addConnectorCardTitle', + { +- defaultMessage: 'Add Generative AI Connector', ++ defaultMessage: 'Add OpenAI Connector', + } + )} + description={i18n.translate( +Index: x-pack/examples/gen_ai_streaming_response_example/public/gen_ai_streaming_response_example.tsx +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/examples/gen_ai_streaming_response_example/public/gen_ai_streaming_response_example.tsx b/x-pack/examples/gen_ai_streaming_response_example/public/gen_ai_streaming_response_example.tsx +--- a/x-pack/examples/gen_ai_streaming_response_example/public/gen_ai_streaming_response_example.tsx (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/examples/gen_ai_streaming_response_example/public/gen_ai_streaming_response_example.tsx (revision f26c1b78fba7b88efe9f13c938daf875d8512498) +@@ -65,7 +65,7 @@ + minimumLicenseRequired: 'platinum', + supportedFeatureIds: ['general'], + id: '.gen-ai', +- name: 'Generative AI', ++ name: 'OpenAI', + enabled: true, + }); + const [loading, setLoading] = useState(true); +Index: x-pack/examples/gen_ai_streaming_response_example/public/plugin.tsx +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/examples/gen_ai_streaming_response_example/public/plugin.tsx b/x-pack/examples/gen_ai_streaming_response_example/public/plugin.tsx +--- a/x-pack/examples/gen_ai_streaming_response_example/public/plugin.tsx (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/examples/gen_ai_streaming_response_example/public/plugin.tsx (revision f26c1b78fba7b88efe9f13c938daf875d8512498) +@@ -37,7 +37,7 @@ + ) { + core.application.register({ + id: 'GenAiStreamingResponseExample', +- title: 'Generative AI Streaming Response Example', ++ title: 'OpenAI Streaming Response Example', + navLinkStatus: AppNavLinkStatus.hidden, + async mount(params: AppMountParameters) { + const [coreStart, depsStart] = await core.getStartServices(); +@@ -48,9 +48,8 @@ + + developerExamples.register({ + appId: 'GenAiStreamingResponseExample', +- title: 'Generative AI Streaming Response Example', +- description: +- 'This example demonstrates how to stream a response from a Generative AI connector', ++ title: 'OpenAI Streaming Response Example', ++ description: 'This example demonstrates how to stream a response from an OpenAI connector', + }); + } + +Index: x-pack/examples/gen_ai_streaming_response_example/server/plugin.ts +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/examples/gen_ai_streaming_response_example/server/plugin.ts b/x-pack/examples/gen_ai_streaming_response_example/server/plugin.ts +--- a/x-pack/examples/gen_ai_streaming_response_example/server/plugin.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/examples/gen_ai_streaming_response_example/server/plugin.ts (revision f26c1b78fba7b88efe9f13c938daf875d8512498) +@@ -87,7 +87,7 @@ + }; + } else { + throw Boom.badRequest( +- `Invalid generative AI connector selected - ${connector.config?.apiProvider} is not a valid provider` ++ `Invalid OpenAI connector selected - ${connector.config?.apiProvider} is not a valid provider` + ); + } + +Index: x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_header/index.tsx +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_header/index.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_header/index.tsx +--- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_header/index.tsx (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_header/index.tsx (revision f26c1b78fba7b88efe9f13c938daf875d8512498) +@@ -17,7 +17,7 @@ + } from '@elastic/eui'; + import { css } from '@emotion/react'; + import { DocLinksStart } from '@kbn/core-doc-links-browser'; +-import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/gen_ai/constants'; ++import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/open_ai/constants'; + import { Conversation } from '../../..'; + import { AssistantTitle } from '../assistant_title'; + import { ConversationSelector } from '../conversations/conversation_selector'; +Index: x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector/index.tsx +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector/index.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector/index.tsx +--- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector/index.tsx (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector/index.tsx (revision f26c1b78fba7b88efe9f13c938daf875d8512498) +@@ -19,7 +19,7 @@ + import useEvent from 'react-use/lib/useEvent'; + import { css } from '@emotion/react'; + +-import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/gen_ai/constants'; ++import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/open_ai/constants'; + import { Conversation } from '../../../..'; + import { useAssistantContext } from '../../../assistant_context'; + import * as i18n from './translations'; +Index: x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector_settings/index.tsx +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector_settings/index.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector_settings/index.tsx +--- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector_settings/index.tsx (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector_settings/index.tsx (revision f26c1b78fba7b88efe9f13c938daf875d8512498) +@@ -18,7 +18,7 @@ + import React, { useCallback, useMemo, useState } from 'react'; + import { css } from '@emotion/react'; + +-import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/gen_ai/constants'; ++import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/open_ai/constants'; + import { Conversation, Prompt } from '../../../..'; + import { UseAssistantContext } from '../../../assistant_context'; + import * as i18n from './translations'; +Index: x-pack/packages/kbn-elastic-assistant/impl/assistant/index.tsx +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/index.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/index.tsx +--- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/index.tsx (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/index.tsx (revision f26c1b78fba7b88efe9f13c938daf875d8512498) +@@ -29,7 +29,7 @@ + import { createPortal } from 'react-dom'; + import { css } from '@emotion/react'; + +-import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/gen_ai/constants'; ++import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/open_ai/constants'; + import { ActionConnectorProps } from '@kbn/triggers-actions-ui-plugin/public/types'; + import { ChatSend } from './chat_send'; + import { BlockBotCallToAction } from './block_bot/cta'; +Index: x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings.tsx +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings.tsx +--- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings.tsx (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings.tsx (revision f26c1b78fba7b88efe9f13c938daf875d8512498) +@@ -23,7 +23,7 @@ + // eslint-disable-next-line @kbn/eslint/module_migration + import styled from 'styled-components'; + import { css } from '@emotion/react'; +-import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/gen_ai/constants'; ++import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/open_ai/constants'; + import { Conversation, Prompt, QuickPrompt } from '../../..'; + import * as i18n from './translations'; + import { useAssistantContext } from '../../assistant_context'; +Index: x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings_button.tsx +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings_button.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings_button.tsx +--- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings_button.tsx (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings_button.tsx (revision f26c1b78fba7b88efe9f13c938daf875d8512498) +@@ -8,7 +8,7 @@ + import React, { useCallback } from 'react'; + import { EuiButtonIcon, EuiToolTip } from '@elastic/eui'; + +-import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/gen_ai/constants'; ++import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/open_ai/constants'; + import { Conversation } from '../../..'; + import { AssistantSettings, CONVERSATIONS_TAB } from './assistant_settings'; + import * as i18n from './translations'; +Index: x-pack/packages/kbn-elastic-assistant/impl/assistant_context/types.tsx +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant_context/types.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant_context/types.tsx +--- a/x-pack/packages/kbn-elastic-assistant/impl/assistant_context/types.tsx (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant_context/types.tsx (revision f26c1b78fba7b88efe9f13c938daf875d8512498) +@@ -5,7 +5,7 @@ + * 2.0. + */ + +-import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/gen_ai/constants'; ++import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/open_ai/constants'; + + export type ConversationRole = 'system' | 'user' | 'assistant'; + +Index: x-pack/packages/kbn-elastic-assistant/impl/connectorland/helpers.tsx +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/packages/kbn-elastic-assistant/impl/connectorland/helpers.tsx b/x-pack/packages/kbn-elastic-assistant/impl/connectorland/helpers.tsx +--- a/x-pack/packages/kbn-elastic-assistant/impl/connectorland/helpers.tsx (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/packages/kbn-elastic-assistant/impl/connectorland/helpers.tsx (revision f26c1b78fba7b88efe9f13c938daf875d8512498) +@@ -7,7 +7,7 @@ + + import type { ActionConnector } from '@kbn/triggers-actions-ui-plugin/public'; + import { ActionConnectorProps } from '@kbn/triggers-actions-ui-plugin/public/types'; +-import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/gen_ai/constants'; ++import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/open_ai/constants'; + import { ActionTypeModel } from '@kbn/triggers-actions-ui-plugin/public'; + + interface GenAiConfig { +@@ -20,7 +20,7 @@ + * Returns the GenAiConfig for a given ActionConnector. Note that if the connector is preconfigured, + * the config will be undefined as the connector is neither available nor editable. + * +- * TODO: Extract and use separate types from GenAiConfig from '@kbn/stack-connectors-plugin/common/gen_ai/types' ++ * TODO: Extract and use separate types from GenAiConfig from '@kbn/stack-connectors-plugin/common/open_ai/types' + * + * @param connector + */ +Index: x-pack/packages/kbn-elastic-assistant/impl/content/prompts/welcome/translations.ts +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/packages/kbn-elastic-assistant/impl/content/prompts/welcome/translations.ts b/x-pack/packages/kbn-elastic-assistant/impl/content/prompts/welcome/translations.ts +--- a/x-pack/packages/kbn-elastic-assistant/impl/content/prompts/welcome/translations.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/packages/kbn-elastic-assistant/impl/content/prompts/welcome/translations.ts (revision 06445caf5021c473ab79d40f7975d7090b258a6f) +@@ -19,7 +19,7 @@ + 'xpack.elasticAssistant.securityAssistant.content.prompts.welcome.welcomeGeneral2Prompt', + { + defaultMessage: +- "First things first, we'll need to set up a Generative AI Connector to get this chat experience going! With the Generative AI Connector, you'll be able to configure access to either an Azure OpenAI Service or OpenAI API account, but you better believe you'll be able to deploy your own models within your Elastic Cloud instance and use those here in the future... 😉", ++ "First things first, we'll need to set up a Generative AI Connector to get this chat experience going! With the Generative AI Connector, you'll be able to configure access to either an OpenAI service or an AWS Bedrock service, but you better believe you'll be able to deploy your own models within your Elastic Cloud instance and use those here in the future... 😉", + } + ); + +Index: x-pack/packages/kbn-elastic-assistant/impl/mock/conversation.ts +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/packages/kbn-elastic-assistant/impl/mock/conversation.ts b/x-pack/packages/kbn-elastic-assistant/impl/mock/conversation.ts +--- a/x-pack/packages/kbn-elastic-assistant/impl/mock/conversation.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/packages/kbn-elastic-assistant/impl/mock/conversation.ts (revision f26c1b78fba7b88efe9f13c938daf875d8512498) +@@ -5,7 +5,7 @@ + * 2.0. + */ + +-import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/gen_ai/constants'; ++import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/open_ai/constants'; + import { Conversation } from '../..'; + + export const alertConvo: Conversation = { +Index: x-pack/plugins/actions/docs/openapi/bundled.json +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/plugins/actions/docs/openapi/bundled.json b/x-pack/plugins/actions/docs/openapi/bundled.json +--- a/x-pack/plugins/actions/docs/openapi/bundled.json (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/plugins/actions/docs/openapi/bundled.json (revision f26c1b78fba7b88efe9f13c938daf875d8512498) +@@ -1765,7 +1765,7 @@ + } + }, + "config_properties_genai": { +- "title": "Connector request properties for a generative AI connector", ++ "title": "Connector request properties for an OpenAI connector", + "description": "Defines properties for connectors when type is `.gen-ai`.", + "oneOf": [ + { +@@ -1818,7 +1818,7 @@ + } + }, + "secrets_properties_genai": { +- "title": "Connector secrets properties for a generative AI connector", ++ "title": "Connector secrets properties for an OpenAI connector", + "description": "Defines secrets for connectors when type is `.gen-ai`.", + "type": "object", + "properties": { +@@ -1829,8 +1829,8 @@ + } + }, + "create_connector_request_genai": { +- "title": "Create generative AI connector request", +- "description": "The generative AI connector uses axios to send a POST request to either OpenAI or Azure OpenAPI.\n", ++ "title": "Create OpenAI connector request", ++ "description": "The OpenAI connector uses axios to send a POST request to either OpenAI or Azure OpenAPI.\n", + "type": "object", + "required": [ + "config", +@@ -5677,4 +5677,4 @@ + } + } + } +-} +\ No newline at end of file ++} +Index: x-pack/plugins/actions/docs/openapi/bundled.yaml +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/plugins/actions/docs/openapi/bundled.yaml b/x-pack/plugins/actions/docs/openapi/bundled.yaml +--- a/x-pack/plugins/actions/docs/openapi/bundled.yaml (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/plugins/actions/docs/openapi/bundled.yaml (revision f26c1b78fba7b88efe9f13c938daf875d8512498) +@@ -1030,14 +1030,14 @@ + type: boolean + host: + description: | +- The host name of the service provider. If the `service` is `elastic_cloud` (for Elastic Cloud notifications) or one of Nodemailer's well-known email service providers, this property is ignored. If `service` is `other`, this property must be defined. ++ The host name of the service provider. If the `service` is `elastic_cloud` (for Elastic Cloud notifications) or one of Nodemailer's well-known email service providers, this property is ignored. If `service` is `other`, this property must be defined. + type: string + oauthTokenUrl: + type: string + nullable: true + port: + description: | +- The port to connect to on the service provider. If the `service` is `elastic_cloud` (for Elastic Cloud notifications) or one of Nodemailer's well-known email service providers, this property is ignored. If `service` is `other`, this property must be defined. ++ The port to connect to on the service provider. If the `service` is `elastic_cloud` (for Elastic Cloud notifications) or one of Nodemailer's well-known email service providers, this property is ignored. If `service` is `other`, this property must be defined. + type: integer + secure: + description: | +@@ -1102,7 +1102,7 @@ + secrets: + $ref: '#/components/schemas/secrets_properties_email' + config_properties_genai: +- title: Connector request properties for a generative AI connector ++ title: Connector request properties for an OpenAI connector + description: Defines properties for connectors when type is `.gen-ai`. + oneOf: + - type: object +@@ -1137,7 +1137,7 @@ + discriminator: + propertyName: apiProvider + secrets_properties_genai: +- title: Connector secrets properties for a generative AI connector ++ title: Connector secrets properties for an OpenAI connector + description: Defines secrets for connectors when type is `.gen-ai`. + type: object + properties: +@@ -1145,9 +1145,9 @@ + type: string + description: The OpenAI API key. + create_connector_request_genai: +- title: Create generative AI connector request ++ title: Create OpenAI connector request + description: | +- The generative AI connector uses axios to send a POST request to either OpenAI or Azure OpenAPI. ++ The OpenAI connector uses axios to send a POST request to either OpenAI or Azure OpenAPI. + type: object + required: + - config +Index: x-pack/plugins/actions/docs/openapi/components/schemas/config_properties_genai.yaml +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/config_properties_genai.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/config_properties_genai.yaml +--- a/x-pack/plugins/actions/docs/openapi/components/schemas/config_properties_genai.yaml (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/plugins/actions/docs/openapi/components/schemas/config_properties_genai.yaml (revision f26c1b78fba7b88efe9f13c938daf875d8512498) +@@ -1,4 +1,4 @@ +-title: Connector request properties for a generative AI connector ++title: Connector request properties for an OpenAI connector + description: Defines properties for connectors when type is `.gen-ai`. + oneOf: + - type: object +@@ -29,4 +29,4 @@ + type: string + description: The default model to use for requests. + discriminator: +- propertyName: apiProvider +\ No newline at end of file ++ propertyName: apiProvider +Index: x-pack/plugins/actions/docs/openapi/components/schemas/connector_response_properties_genai.yaml +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/connector_response_properties_genai.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/connector_response_properties_genai.yaml +--- a/x-pack/plugins/actions/docs/openapi/components/schemas/connector_response_properties_genai.yaml (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/plugins/actions/docs/openapi/components/schemas/connector_response_properties_genai.yaml (revision f26c1b78fba7b88efe9f13c938daf875d8512498) +@@ -1,4 +1,4 @@ +-title: Connector response properties for a generative AI connector ++title: Connector response properties for an OpenAI connector + type: object + required: + - config +Index: x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_genai.yaml +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_genai.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_genai.yaml +--- a/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_genai.yaml (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_genai.yaml (revision f26c1b78fba7b88efe9f13c938daf875d8512498) +@@ -1,6 +1,6 @@ +-title: Create generative AI connector request ++title: Create OpenAI connector request + description: > +- The generative AI connector uses axios to send a POST request to either ++ The OpenAI connector uses axios to send a POST request to either + OpenAI or Azure OpenAPI. + type: object + required: +@@ -22,4 +22,4 @@ + description: The display name for the connector. + example: my-connector + secrets: +- $ref: 'secrets_properties_genai.yaml' +\ No newline at end of file ++ $ref: 'secrets_properties_genai.yaml' +Index: x-pack/plugins/actions/docs/openapi/components/schemas/secrets_properties_genai.yaml +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/secrets_properties_genai.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/secrets_properties_genai.yaml +--- a/x-pack/plugins/actions/docs/openapi/components/schemas/secrets_properties_genai.yaml (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/plugins/actions/docs/openapi/components/schemas/secrets_properties_genai.yaml (revision f26c1b78fba7b88efe9f13c938daf875d8512498) +@@ -1,7 +1,7 @@ +-title: Connector secrets properties for a generative AI connector ++title: Connector secrets properties for an OpenAI connector + description: Defines secrets for connectors when type is `.gen-ai`. + type: object + properties: + apiKey: + type: string +- description: The OpenAI API key. +\ No newline at end of file ++ description: The OpenAI API key. +Index: x-pack/plugins/actions/docs/openapi/components/schemas/update_connector_request_genai.yaml +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/update_connector_request_genai.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/update_connector_request_genai.yaml +--- a/x-pack/plugins/actions/docs/openapi/components/schemas/update_connector_request_genai.yaml (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/plugins/actions/docs/openapi/components/schemas/update_connector_request_genai.yaml (revision f26c1b78fba7b88efe9f13c938daf875d8512498) +@@ -1,4 +1,4 @@ +-title: Update generative AI connector request ++title: Update OpenAI connector request + type: object + required: + - config +@@ -10,4 +10,4 @@ + type: string + description: The display name for the connector. + secrets: +- $ref: 'secrets_properties_genai.yaml' +\ No newline at end of file ++ $ref: 'secrets_properties_genai.yaml' +Index: x-pack/plugins/actions/server/lib/action_executor.test.ts +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/plugins/actions/server/lib/action_executor.test.ts b/x-pack/plugins/actions/server/lib/action_executor.test.ts +--- a/x-pack/plugins/actions/server/lib/action_executor.test.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/plugins/actions/server/lib/action_executor.test.ts (revision f26c1b78fba7b88efe9f13c938daf875d8512498) +@@ -1766,7 +1766,7 @@ + }); + }); + +-test('writes usage data to event log for gen ai events', async () => { ++test('writes usage data to event log for OpenAI events', async () => { + const executorMock = setupActionExecutorMock('.gen-ai'); + const mockGenAi = { + id: 'chatcmpl-7LztF5xsJl2z5jcNpJKvaPm4uWt8x', +Index: x-pack/plugins/actions/server/lib/action_executor.ts +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/plugins/actions/server/lib/action_executor.ts b/x-pack/plugins/actions/server/lib/action_executor.ts +--- a/x-pack/plugins/actions/server/lib/action_executor.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/plugins/actions/server/lib/action_executor.ts (revision 9a59bf47d9b8beb788fe724dff7302514251ea7c) +@@ -286,8 +286,8 @@ + + event.event = event.event || {}; + +- // start gen_ai extension +- // add event.kibana.action.execution.gen_ai to event log when GenerativeAi Connector is executed ++ // start open_ai extension ++ // add event.kibana.action.execution.open_ai to event log when OpenAI Connector is executed + if (result.status === 'ok' && actionTypeId === '.gen-ai') { + const data = result.data as unknown as { + usage: { prompt_tokens?: number; completion_tokens?: number; total_tokens?: number }; +@@ -311,7 +311,7 @@ + }, + }; + } +- // end gen_ai extension ++ // end open_ai extension + + const currentUser = security?.authc.getCurrentUser(request); + +Index: x-pack/plugins/observability_ai_assistant/README.md +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/plugins/observability_ai_assistant/README.md b/x-pack/plugins/observability_ai_assistant/README.md +--- a/x-pack/plugins/observability_ai_assistant/README.md (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/plugins/observability_ai_assistant/README.md (revision f26c1b78fba7b88efe9f13c938daf875d8512498) +@@ -6,7 +6,7 @@ + + #### **1.1. Configuration** + +-Users can connect to an LLM using [connectors](https://www.elastic.co/guide/en/kibana/current/action-types.html) - specifically the [Generative AI connector](https://www.elastic.co/guide/en/kibana/current/gen-ai-action-type.html), which currently supports both OpenAI and Azure OpenAI as providers. The connector is Enterprise-only. Users can also leverage [preconfigured connectors](https://www.elastic.co/guide/en/kibana/current/pre-configured-connectors.html), in which case the following should be added to `kibana.yml`: ++Users can connect to an LLM using [connectors](https://www.elastic.co/guide/en/kibana/current/action-types.html) - specifically the [OpenAI connector](https://www.elastic.co/guide/en/kibana/current/gen-ai-action-type.html), which currently supports both OpenAI and Azure OpenAI as providers. The connector is Enterprise-only. Users can also leverage [preconfigured connectors](https://www.elastic.co/guide/en/kibana/current/pre-configured-connectors.html), in which case the following should be added to `kibana.yml`: + + ```yaml + xpack.actions.preconfigured: +Index: x-pack/plugins/observability_ai_assistant/public/components/chat/initial_setup_panel.tsx +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/plugins/observability_ai_assistant/public/components/chat/initial_setup_panel.tsx b/x-pack/plugins/observability_ai_assistant/public/components/chat/initial_setup_panel.tsx +--- a/x-pack/plugins/observability_ai_assistant/public/components/chat/initial_setup_panel.tsx (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/plugins/observability_ai_assistant/public/components/chat/initial_setup_panel.tsx (revision f26c1b78fba7b88efe9f13c938daf875d8512498) +@@ -143,7 +143,7 @@ + {i18n.translate( + 'xpack.observabilityAiAssistant.initialSetupPanel.setupConnector.description1', + { +- defaultMessage: 'Set up a Generative AI connector with your AI provider.', ++ defaultMessage: 'Set up an OpenAI connector with your AI provider.', + } + )} +

    +@@ -153,7 +153,7 @@ + 'xpack.observabilityAiAssistant.initialSetupPanel.setupConnector.description2', + { + defaultMessage: +- 'The Generative AI model needs to support function calls. We strongly recommend using GPT4.', ++ 'The OpenAI model needs to support function calls. We strongly recommend using GPT4.', + } + )} + +Index: x-pack/plugins/stack_connectors/common/gen_ai/constants.ts +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/plugins/stack_connectors/common/gen_ai/constants.ts b/x-pack/plugins/stack_connectors/common/open_ai/constants.ts +rename from x-pack/plugins/stack_connectors/common/gen_ai/constants.ts +rename to x-pack/plugins/stack_connectors/common/open_ai/constants.ts +--- a/x-pack/plugins/stack_connectors/common/gen_ai/constants.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/plugins/stack_connectors/common/open_ai/constants.ts (revision f26c1b78fba7b88efe9f13c938daf875d8512498) +@@ -13,7 +13,7 @@ + defaultMessage: 'OpenAI', + } + ); +-export const GEN_AI_CONNECTOR_ID = '.gen-ai'; ++export const OPEN_AI_CONNECTOR_ID = '.gen-ai'; + export enum SUB_ACTION { + RUN = 'run', + INVOKE_AI = 'invokeAI', +Index: x-pack/plugins/stack_connectors/public/common/index.ts +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/plugins/stack_connectors/public/common/index.ts b/x-pack/plugins/stack_connectors/public/common/index.ts +--- a/x-pack/plugins/stack_connectors/public/common/index.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/plugins/stack_connectors/public/common/index.ts (revision f26c1b78fba7b88efe9f13c938daf875d8512498) +@@ -5,7 +5,7 @@ + * 2.0. + */ + +-import GenAiLogo from '../connector_types/gen_ai/logo'; ++import OpenAILogo from '../connector_types/open_ai/logo'; + +-export { GEN_AI_CONNECTOR_ID, OpenAiProviderType } from '../../common/gen_ai/constants'; +-export { GenAiLogo }; ++export { OPEN_AI_CONNECTOR_ID, OpenAiProviderType } from '../../common/open_ai/constants'; ++export { OpenAILogo }; +Index: x-pack/plugins/stack_connectors/public/connector_types/d3security/d3security.tsx +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/plugins/stack_connectors/public/connector_types/d3security/d3security.tsx b/x-pack/plugins/stack_connectors/public/connector_types/d3security/d3security.tsx +--- a/x-pack/plugins/stack_connectors/public/connector_types/d3security/d3security.tsx (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/plugins/stack_connectors/public/connector_types/d3security/d3security.tsx (revision f26c1b78fba7b88efe9f13c938daf875d8512498) +@@ -8,7 +8,7 @@ + import { lazy } from 'react'; + import { i18n } from '@kbn/i18n'; + import { GenericValidationResult } from '@kbn/triggers-actions-ui-plugin/public/types'; +-import { SUB_ACTION } from '../../../common/gen_ai/constants'; ++import { SUB_ACTION } from '../../../common/open_ai/constants'; + import { D3SecurityActionParams, D3SecurityConnector } from './types'; + import { D3_SECURITY_CONNECTOR_ID } from '../../../common/d3security/constants'; + interface ValidationErrors { +Index: x-pack/plugins/stack_connectors/public/connector_types/index.ts +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/plugins/stack_connectors/public/connector_types/index.ts b/x-pack/plugins/stack_connectors/public/connector_types/index.ts +--- a/x-pack/plugins/stack_connectors/public/connector_types/index.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/plugins/stack_connectors/public/connector_types/index.ts (revision 9a59bf47d9b8beb788fe724dff7302514251ea7c) +@@ -11,7 +11,7 @@ + import { getEmailConnectorType } from './email'; + import { getIndexConnectorType } from './es_index'; + import { getJiraConnectorType } from './jira'; +-import { getGenerativeAiConnectorType } from './gen_ai'; ++import { getOpenAIConnectorType } from './open_ai'; + import { getBedrockConnectorType } from './bedrock'; + import { getOpsgenieConnectorType } from './opsgenie'; + import { getPagerDutyConnectorType } from './pagerduty'; +@@ -60,7 +60,7 @@ + connectorTypeRegistry.register(getJiraConnectorType()); + connectorTypeRegistry.register(getResilientConnectorType()); + connectorTypeRegistry.register(getOpsgenieConnectorType()); +- connectorTypeRegistry.register(getGenerativeAiConnectorType()); ++ connectorTypeRegistry.register(getOpenAIConnectorType()); + connectorTypeRegistry.register(getBedrockConnectorType()); + connectorTypeRegistry.register(getTeamsConnectorType()); + connectorTypeRegistry.register(getTorqConnectorType()); +Index: x-pack/plugins/stack_connectors/public/connector_types/gen_ai/api.test.ts +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/api.test.ts b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/api.test.ts +rename from x-pack/plugins/stack_connectors/public/connector_types/gen_ai/api.test.ts +rename to x-pack/plugins/stack_connectors/public/connector_types/open_ai/api.test.ts +--- a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/api.test.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/api.test.ts (revision f26c1b78fba7b88efe9f13c938daf875d8512498) +@@ -7,7 +7,7 @@ + + import { httpServiceMock } from '@kbn/core-http-browser-mocks'; + import { getDashboard } from './api'; +-import { SUB_ACTION } from '../../../common/gen_ai/constants'; ++import { SUB_ACTION } from '../../../common/open_ai/constants'; + const response = { + available: true, + }; +Index: x-pack/plugins/stack_connectors/public/connector_types/gen_ai/api.ts +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/api.ts b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/api.ts +rename from x-pack/plugins/stack_connectors/public/connector_types/gen_ai/api.ts +rename to x-pack/plugins/stack_connectors/public/connector_types/open_ai/api.ts +--- a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/api.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/api.ts (revision f26c1b78fba7b88efe9f13c938daf875d8512498) +@@ -7,7 +7,7 @@ + + import { HttpSetup } from '@kbn/core-http-browser'; + import { ActionTypeExecutorResult, BASE_ACTION_API_PATH } from '@kbn/actions-plugin/common'; +-import { SUB_ACTION } from '../../../common/gen_ai/constants'; ++import { SUB_ACTION } from '../../../common/open_ai/constants'; + import { ConnectorExecutorResult, rewriteResponseToCamelCase } from '../lib/rewrite_response_body'; + + export async function getDashboard({ +Index: x-pack/plugins/stack_connectors/public/connector_types/gen_ai/connector.test.tsx +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/connector.test.tsx b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/connector.test.tsx +rename from x-pack/plugins/stack_connectors/public/connector_types/gen_ai/connector.test.tsx +rename to x-pack/plugins/stack_connectors/public/connector_types/open_ai/connector.test.tsx +--- a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/connector.test.tsx (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/connector.test.tsx (revision 9a59bf47d9b8beb788fe724dff7302514251ea7c) +@@ -6,11 +6,11 @@ + */ + + import React from 'react'; +-import GenerativeAiConnectorFields from './connector'; ++import ConnectorFields from './connector'; + import { ConnectorFormTestProvider } from '../lib/test_utils'; + import { act, fireEvent, render, waitFor } from '@testing-library/react'; + import userEvent from '@testing-library/user-event'; +-import { DEFAULT_OPENAI_MODEL, OpenAiProviderType } from '../../../common/gen_ai/constants'; ++import { DEFAULT_OPENAI_MODEL, OpenAiProviderType } from '../../../common/open_ai/constants'; + import { useKibana } from '@kbn/triggers-actions-ui-plugin/public'; + import { useGetDashboard } from './use_get_dashboard'; + +@@ -21,7 +21,7 @@ + const mockDashboard = useGetDashboard as jest.Mock; + const openAiConnector = { + actionTypeId: '.gen-ai', +- name: 'genAi', ++ name: 'OpenAI', + id: '123', + config: { + apiUrl: 'https://openaiurl.com', +@@ -46,7 +46,7 @@ + + const navigateToUrl = jest.fn(); + +-describe('GenerativeAiConnectorFields renders', () => { ++describe('ConnectorFields renders', () => { + beforeEach(() => { + jest.clearAllMocks(); + useKibanaMock().services.application.navigateToUrl = navigateToUrl; +@@ -57,11 +57,7 @@ + test('open ai connector fields are rendered', async () => { + const { getAllByTestId } = render( + +- {}} +- /> ++ {}} /> + + ); + expect(getAllByTestId('config.apiUrl-input')[0]).toBeInTheDocument(); +@@ -77,11 +73,7 @@ + test('azure ai connector fields are rendered', async () => { + const { getAllByTestId } = render( + +- {}} +- /> ++ {}} /> + + ); + expect(getAllByTestId('config.apiUrl-input')[0]).toBeInTheDocument(); +@@ -98,11 +90,7 @@ + it('Does not render if isEdit is false and dashboardUrl is defined', async () => { + const { queryByTestId } = render( + +- {}} +- /> ++ {}} /> + + ); + expect(queryByTestId('link-gen-ai-token-dashboard')).not.toBeInTheDocument(); +@@ -113,11 +101,7 @@ + })); + const { queryByTestId } = render( + +- {}} +- /> ++ {}} /> + + ); + expect(queryByTestId('link-gen-ai-token-dashboard')).not.toBeInTheDocument(); +@@ -125,11 +109,7 @@ + it('Renders if isEdit is true and dashboardUrl is defined', async () => { + const { getByTestId } = render( + +- {}} +- /> ++ {}} /> + + ); + expect(getByTestId('link-gen-ai-token-dashboard')).toBeInTheDocument(); +@@ -137,11 +117,7 @@ + it('On click triggers redirect with correct saved object id', async () => { + const { getByTestId } = render( + +- {}} +- /> ++ {}} /> + + ); + fireEvent.click(getByTestId('link-gen-ai-token-dashboard')); +@@ -158,11 +134,7 @@ + it('connector validation succeeds when connector config is valid', async () => { + const { getByTestId } = render( + +- {}} +- /> ++ {}} /> + + ); + +@@ -191,11 +163,7 @@ + + const res = render( + +- {}} +- /> ++ {}} /> + + ); + +@@ -224,11 +192,7 @@ + + const res = render( + +- {}} +- /> ++ {}} /> + + ); + +Index: x-pack/plugins/stack_connectors/public/connector_types/gen_ai/connector.tsx +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/connector.tsx b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/connector.tsx +rename from x-pack/plugins/stack_connectors/public/connector_types/gen_ai/connector.tsx +rename to x-pack/plugins/stack_connectors/public/connector_types/open_ai/connector.tsx +--- a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/connector.tsx (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/connector.tsx (revision 9a59bf47d9b8beb788fe724dff7302514251ea7c) +@@ -19,8 +19,8 @@ + } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; + import { useKibana } from '@kbn/triggers-actions-ui-plugin/public'; + import { fieldValidators } from '@kbn/es-ui-shared-plugin/static/forms/helpers'; ++import { OpenAiProviderType } from '../../../common/open_ai/constants'; + import { useGetDashboard } from './use_get_dashboard'; +-import { OpenAiProviderType } from '../../../common/gen_ai/constants'; + import * as i18n from './translations'; + import { + azureAiConfig, +@@ -31,10 +31,7 @@ + } from './constants'; + const { emptyField } = fieldValidators; + +-const GenerativeAiConnectorFields: React.FC = ({ +- readOnly, +- isEdit, +-}) => { ++const ConnectorFields: React.FC = ({ readOnly, isEdit }) => { + const { getFieldDefaultValue } = useFormContext(); + const [{ config, id, name }] = useFormData({ + watch: ['config.apiProvider'], +@@ -117,4 +114,4 @@ + }; + + // eslint-disable-next-line import/no-default-export +-export { GenerativeAiConnectorFields as default }; ++export { ConnectorFields as default }; +Index: x-pack/plugins/stack_connectors/public/connector_types/gen_ai/constants.tsx +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/constants.tsx b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/constants.tsx +rename from x-pack/plugins/stack_connectors/public/connector_types/gen_ai/constants.tsx +rename to x-pack/plugins/stack_connectors/public/connector_types/open_ai/constants.tsx +--- a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/constants.tsx (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/constants.tsx (revision f26c1b78fba7b88efe9f13c938daf875d8512498) +@@ -9,7 +9,7 @@ + import { ConfigFieldSchema, SecretsFieldSchema } from '@kbn/triggers-actions-ui-plugin/public'; + import { FormattedMessage } from '@kbn/i18n-react'; + import { EuiLink } from '@elastic/eui'; +-import { DEFAULT_OPENAI_MODEL, OpenAiProviderType } from '../../../common/gen_ai/constants'; ++import { DEFAULT_OPENAI_MODEL, OpenAiProviderType } from '../../../common/open_ai/constants'; + import * as i18n from './translations'; + + export const DEFAULT_URL = 'https://api.openai.com/v1/chat/completions' as const; +Index: x-pack/plugins/stack_connectors/public/connector_types/gen_ai/index.ts +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/index.ts b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/index.ts +rename from x-pack/plugins/stack_connectors/public/connector_types/gen_ai/index.ts +rename to x-pack/plugins/stack_connectors/public/connector_types/open_ai/index.ts +--- a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/index.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/index.ts (revision 9a59bf47d9b8beb788fe724dff7302514251ea7c) +@@ -5,4 +5,4 @@ + * 2.0. + */ + +-export { getConnectorType as getGenerativeAiConnectorType } from './gen_ai'; ++export { getConnectorType as getOpenAIConnectorType } from './open_ai'; +Index: x-pack/plugins/stack_connectors/public/connector_types/gen_ai/gen_ai.test.tsx +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/gen_ai.test.tsx b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/open_ai.test.tsx +rename from x-pack/plugins/stack_connectors/public/connector_types/gen_ai/gen_ai.test.tsx +rename to x-pack/plugins/stack_connectors/public/connector_types/open_ai/open_ai.test.tsx +--- a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/gen_ai.test.tsx (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/open_ai.test.tsx (revision f26c1b78fba7b88efe9f13c938daf875d8512498) +@@ -9,7 +9,7 @@ + import { registerConnectorTypes } from '..'; + import type { ActionTypeModel } from '@kbn/triggers-actions-ui-plugin/public/types'; + import { registrationServicesMock } from '../../mocks'; +-import { SUB_ACTION } from '../../../common/gen_ai/constants'; ++import { SUB_ACTION } from '../../../common/open_ai/constants'; + + const ACTION_TYPE_ID = '.gen-ai'; + let actionTypeModel: ActionTypeModel; +@@ -26,12 +26,12 @@ + describe('actionTypeRegistry.get() works', () => { + test('connector type static data is as expected', () => { + expect(actionTypeModel.id).toEqual(ACTION_TYPE_ID); +- expect(actionTypeModel.selectMessage).toBe('Send a request to generative AI systems.'); ++ expect(actionTypeModel.selectMessage).toBe('Send a request to OpenAI systems.'); + expect(actionTypeModel.actionTypeTitle).toBe('OpenAI'); + }); + }); + +-describe('gen ai action params validation', () => { ++describe('OpenAI action params validation', () => { + test('action params validation succeeds when action params is valid', async () => { + const actionParams = { + subAction: SUB_ACTION.RUN, +Index: x-pack/plugins/stack_connectors/public/connector_types/gen_ai/gen_ai.tsx +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/gen_ai.tsx b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/open_ai.tsx +rename from x-pack/plugins/stack_connectors/public/connector_types/gen_ai/gen_ai.tsx +rename to x-pack/plugins/stack_connectors/public/connector_types/open_ai/open_ai.tsx +--- a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/gen_ai.tsx (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/open_ai.tsx (revision 9a59bf47d9b8beb788fe724dff7302514251ea7c) +@@ -8,24 +8,24 @@ + import { lazy } from 'react'; + import { i18n } from '@kbn/i18n'; + import type { GenericValidationResult } from '@kbn/triggers-actions-ui-plugin/public/types'; +-import { SUB_ACTION } from '../../../common/gen_ai/constants'; +-import { GEN_AI_CONNECTOR_ID, OPEN_AI_TITLE } from '../../../common/gen_ai/constants'; +-import { GenerativeAiActionParams, GenerativeAiConnector } from './types'; ++import { SUB_ACTION } from '../../../common/open_ai/constants'; ++import { OPEN_AI_CONNECTOR_ID, OPEN_AI_TITLE } from '../../../common/open_ai/constants'; ++import { ActionParams, OpenAIConnector } from './types'; + + interface ValidationErrors { + subAction: string[]; + body: string[]; + } +-export function getConnectorType(): GenerativeAiConnector { ++export function getConnectorType(): OpenAIConnector { + return { +- id: GEN_AI_CONNECTOR_ID, ++ id: OPEN_AI_CONNECTOR_ID, + iconClass: lazy(() => import('./logo')), + selectMessage: i18n.translate('xpack.stackConnectors.components.genAi.selectMessageText', { +- defaultMessage: 'Send a request to generative AI systems.', ++ defaultMessage: 'Send a request to OpenAI systems.', + }), + actionTypeTitle: OPEN_AI_TITLE, + validateParams: async ( +- actionParams: GenerativeAiActionParams ++ actionParams: ActionParams + ): Promise> => { + const { subAction, subActionParams } = actionParams; + const translations = await import('./translations'); +Index: x-pack/plugins/stack_connectors/public/connector_types/gen_ai/params.test.tsx +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/params.test.tsx b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/params.test.tsx +rename from x-pack/plugins/stack_connectors/public/connector_types/gen_ai/params.test.tsx +rename to x-pack/plugins/stack_connectors/public/connector_types/open_ai/params.test.tsx +--- a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/params.test.tsx (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/params.test.tsx (revision 9a59bf47d9b8beb788fe724dff7302514251ea7c) +@@ -7,9 +7,9 @@ + + import React from 'react'; + import { fireEvent, render } from '@testing-library/react'; +-import GenerativeAiParamsFields from './params'; ++import ParamsFields from './params'; + import { MockCodeEditor } from '@kbn/triggers-actions-ui-plugin/public/application/code_editor.mock'; +-import { OpenAiProviderType, SUB_ACTION } from '../../../common/gen_ai/constants'; ++import { OpenAiProviderType, SUB_ACTION } from '../../../common/open_ai/constants'; + import { DEFAULT_BODY, DEFAULT_BODY_AZURE, DEFAULT_URL } from './constants'; + + const kibanaReactPath = '../../../../../../src/plugins/kibana_react/public'; +@@ -34,7 +34,7 @@ + describe('Gen AI Params Fields renders', () => { + test('all params fields are rendered', () => { + const { getByTestId } = render( +- UTF-8 +=================================================================== +diff --git a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/params.tsx b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/params.tsx +rename from x-pack/plugins/stack_connectors/public/connector_types/gen_ai/params.tsx +rename to x-pack/plugins/stack_connectors/public/connector_types/open_ai/params.tsx +--- a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/params.tsx (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/params.tsx (revision 9a59bf47d9b8beb788fe724dff7302514251ea7c) +@@ -12,13 +12,11 @@ + ActionConnectorMode, + JsonEditorWithMessageVariables, + } from '@kbn/triggers-actions-ui-plugin/public'; ++import { OpenAiProviderType, SUB_ACTION } from '../../../common/open_ai/constants'; + import { DEFAULT_BODY, DEFAULT_BODY_AZURE } from './constants'; +-import { OpenAiProviderType, SUB_ACTION } from '../../../common/gen_ai/constants'; +-import { GenerativeAiActionConnector, GenerativeAiActionParams } from './types'; ++import { GenerativeAiActionConnector, ActionParams } from './types'; + +-const GenerativeAiParamsFields: React.FunctionComponent< +- ActionParamsProps +-> = ({ ++const ParamsFields: React.FunctionComponent> = ({ + actionConnector, + actionParams, + editAction, +@@ -55,7 +53,7 @@ + }, [typedActionConnector?.config?.apiProvider, editAction, index, subActionParams]); + + const editSubActionParams = useCallback( +- (params: GenerativeAiActionParams['subActionParams']) => { ++ (params: ActionParams['subActionParams']) => { + editAction('subActionParams', { ...subActionParams, ...params }, index); + }, + [editAction, index, subActionParams] +@@ -87,4 +85,4 @@ + }; + + // eslint-disable-next-line import/no-default-export +-export { GenerativeAiParamsFields as default }; ++export { ParamsFields as default }; +Index: x-pack/plugins/stack_connectors/public/connector_types/gen_ai/translations.ts +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/translations.ts b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/translations.ts +rename from x-pack/plugins/stack_connectors/public/connector_types/gen_ai/translations.ts +rename to x-pack/plugins/stack_connectors/public/connector_types/open_ai/translations.ts +--- a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/translations.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/translations.ts (revision 9a59bf47d9b8beb788fe724dff7302514251ea7c) +@@ -25,14 +25,6 @@ + } + ); + +-export const DEFAULT_MODEL_TOOLTIP_CONTENT = i18n.translate( +- 'xpack.stackConnectors.components.genAi.defaultModelTooltipContent', +- { +- defaultMessage: +- 'The model can be set on a per request basis by including a "model" parameter in the request body. If no model is provided, the fallback will be the default model.', +- } +-); +- + export const API_PROVIDER_LABEL = i18n.translate( + 'xpack.stackConnectors.components.genAi.apiProviderLabel', + { +@@ -105,6 +97,6 @@ + export const GET_DASHBOARD_API_ERROR = i18n.translate( + 'xpack.stackConnectors.components.genAi.error.dashboardApiError', + { +- defaultMessage: 'Error finding Generative AI Token Usage Dashboard.', ++ defaultMessage: 'Error finding OpenAI Token Usage Dashboard.', + } + ); +Index: x-pack/plugins/stack_connectors/public/connector_types/gen_ai/types.ts +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/types.ts b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/types.ts +rename from x-pack/plugins/stack_connectors/public/connector_types/gen_ai/types.ts +rename to x-pack/plugins/stack_connectors/public/connector_types/open_ai/types.ts +--- a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/types.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/types.ts (revision 9a59bf47d9b8beb788fe724dff7302514251ea7c) +@@ -7,29 +7,22 @@ + + import { ActionTypeModel as ConnectorTypeModel } from '@kbn/triggers-actions-ui-plugin/public'; + import { UserConfiguredActionConnector } from '@kbn/triggers-actions-ui-plugin/public/types'; +-import { OpenAiProviderType, SUB_ACTION } from '../../../common/gen_ai/constants'; +-import { RunActionParams } from '../../../common/gen_ai/types'; ++import { OpenAiProviderType, SUB_ACTION } from '../../../common/open_ai/constants'; ++import { RunActionParams } from '../../../common/open_ai/types'; + +-export interface GenerativeAiActionParams { ++export interface ActionParams { + subAction: SUB_ACTION.RUN | SUB_ACTION.TEST; + subActionParams: RunActionParams; + } + +-export interface GenerativeAiConfig { ++export interface Config { + apiProvider: OpenAiProviderType; + apiUrl: string; + } + +-export interface GenerativeAiSecrets { ++export interface Secrets { + apiKey: string; + } + +-export type GenerativeAiConnector = ConnectorTypeModel< +- GenerativeAiConfig, +- GenerativeAiSecrets, +- GenerativeAiActionParams +->; +-export type GenerativeAiActionConnector = UserConfiguredActionConnector< +- GenerativeAiConfig, +- GenerativeAiSecrets +->; ++export type OpenAIConnector = ConnectorTypeModel; ++export type GenerativeAiActionConnector = UserConfiguredActionConnector; +Index: x-pack/plugins/stack_connectors/public/connector_types/gen_ai/use_get_dashboard.test.ts +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/use_get_dashboard.test.ts b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/use_get_dashboard.test.ts +rename from x-pack/plugins/stack_connectors/public/connector_types/gen_ai/use_get_dashboard.test.ts +rename to x-pack/plugins/stack_connectors/public/connector_types/open_ai/use_get_dashboard.test.ts +--- a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/use_get_dashboard.test.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/use_get_dashboard.test.ts (revision f26c1b78fba7b88efe9f13c938daf875d8512498) +@@ -123,7 +123,7 @@ + await waitForNextUpdate(); + expect(result.current.isLoading).toBe(false); + expect(mockToasts.addDanger).toHaveBeenCalledWith({ +- title: 'Error finding Generative AI Token Usage Dashboard.', ++ title: 'Error finding OpenAI Token Usage Dashboard.', + text: 'Error fetching dashboard', + }); + }); +Index: x-pack/plugins/stack_connectors/server/connector_types/index.ts +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/plugins/stack_connectors/server/connector_types/index.ts b/x-pack/plugins/stack_connectors/server/connector_types/index.ts +--- a/x-pack/plugins/stack_connectors/server/connector_types/index.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/plugins/stack_connectors/server/connector_types/index.ts (revision 9a59bf47d9b8beb788fe724dff7302514251ea7c) +@@ -17,7 +17,7 @@ + import { getActionType as getTorqConnectorType } from './torq'; + import { getConnectorType as getEmailConnectorType } from './email'; + import { getConnectorType as getIndexConnectorType } from './es_index'; +-import { getConnectorType as getGenerativeAiConnectorType } from './gen_ai'; ++import { getConnectorType as getOpenAIConnectorType } from './open_ai'; + import { getConnectorType as getBedrockConnectorType } from './bedrock'; + import { getConnectorType as getPagerDutyConnectorType } from './pagerduty'; + import { getConnectorType as getSwimlaneConnectorType } from './swimlane'; +@@ -101,7 +101,7 @@ + + actions.registerSubActionConnectorType(getOpsgenieConnectorType()); + actions.registerSubActionConnectorType(getTinesConnectorType()); +- actions.registerSubActionConnectorType(getGenerativeAiConnectorType()); ++ actions.registerSubActionConnectorType(getOpenAIConnectorType()); + actions.registerSubActionConnectorType(getBedrockConnectorType()); + actions.registerSubActionConnectorType(getD3SecurityConnectorType()); + } +Index: x-pack/plugins/stack_connectors/server/connector_types/gen_ai/dashboard.ts +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/dashboard.ts b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/dashboard.ts +rename from x-pack/plugins/stack_connectors/server/connector_types/gen_ai/dashboard.ts +rename to x-pack/plugins/stack_connectors/server/connector_types/open_ai/dashboard.ts +--- a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/dashboard.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/dashboard.ts (revision f26c1b78fba7b88efe9f13c938daf875d8512498) +@@ -9,7 +9,7 @@ + import { v4 as uuidv4 } from 'uuid'; + import { SavedObject } from '@kbn/core-saved-objects-common/src/server_types'; + +-export const dashboardTitle = `Generative AI Token Usage`; ++export const dashboardTitle = `OpenAI Token Usage`; + + export const getDashboard = (dashboardId: string): SavedObject => { + const ids: Record = { +@@ -125,7 +125,7 @@ + yLeft: 0, + yRight: 0, + }, +- yTitle: 'Sum of GenAi Completion + Prompt Tokens', ++ yTitle: 'Sum of OpenAI Completion + Prompt Tokens', + axisTitlesVisibilitySettings: { + x: true, + yLeft: true, +@@ -143,7 +143,7 @@ + '475e8ca0-e78e-454a-8597-a5492f70dce3': { + columns: { + '0f9814ec-0964-4efa-93a3-c7f173df2483': { +- label: 'GenAI Completion Tokens', ++ label: 'OpenAI Completion Tokens', + dataType: 'number', + operationType: 'sum', + sourceField: 'kibana.action.execution.gen_ai.usage.completion_tokens', +@@ -177,7 +177,7 @@ + includeIsRegex: false, + excludeIsRegex: false, + orderAgg: { +- label: 'Sum of kibana.action.execution.gen_ai.usage.total_tokens', ++ label: 'Sum of kibana.action.execution.open_ai.usage.total_tokens', + dataType: 'number', + operationType: 'sum', + sourceField: 'kibana.action.execution.gen_ai.usage.total_tokens', +@@ -192,7 +192,7 @@ + customLabel: true, + }, + 'b0e390e4-d754-4eb4-9fcc-4347dadda394': { +- label: 'GenAi Prompt Tokens', ++ label: 'OpenAI Prompt Tokens', + dataType: 'number', + operationType: 'sum', + sourceField: 'kibana.action.execution.gen_ai.usage.prompt_tokens', +@@ -334,7 +334,7 @@ + customLabel: true, + }, + 'b0e390e4-d754-4eb4-9fcc-4347dadda394': { +- label: 'Sum of GenAI Total Tokens', ++ label: 'Sum of OpenAI Total Tokens', + dataType: 'number', + operationType: 'sum', + sourceField: 'kibana.action.execution.gen_ai.usage.total_tokens', +Index: x-pack/plugins/stack_connectors/server/connector_types/gen_ai/index.test.ts +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/index.test.ts b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/index.test.ts +rename from x-pack/plugins/stack_connectors/server/connector_types/gen_ai/index.test.ts +rename to x-pack/plugins/stack_connectors/server/connector_types/open_ai/index.test.ts +--- a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/index.test.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/index.test.ts (revision f26c1b78fba7b88efe9f13c938daf875d8512498) +@@ -9,9 +9,9 @@ + import { ActionsConfigurationUtilities } from '@kbn/actions-plugin/server/actions_config'; + import axios from 'axios'; + import { configValidator, getConnectorType } from '.'; +-import { Config, Secrets } from '../../../common/gen_ai/types'; ++import { Config, Secrets } from '../../../common/open_ai/types'; + import { SubActionConnectorType } from '@kbn/actions-plugin/server/sub_action_framework/types'; +-import { DEFAULT_OPENAI_MODEL, OpenAiProviderType } from '../../../common/gen_ai/constants'; ++import { DEFAULT_OPENAI_MODEL, OpenAiProviderType } from '../../../common/open_ai/constants'; + + jest.mock('axios'); + jest.mock('@kbn/actions-plugin/server/lib/axios_utils', () => { +@@ -30,12 +30,12 @@ + let connectorType: SubActionConnectorType; + let configurationUtilities: jest.Mocked; + +-describe('Generative AI Connector', () => { ++describe('OpenAI Connector', () => { + beforeEach(() => { + configurationUtilities = actionsConfigMock.create(); + connectorType = getConnectorType(); + }); +- test('exposes the connector as `Generative AI` with id `.gen-ai`', () => { ++ test('exposes the connector as `OpenAI` with id `.gen-ai`', () => { + expect(connectorType.id).toEqual('.gen-ai'); + expect(connectorType.name).toEqual('OpenAI'); + }); +@@ -59,7 +59,7 @@ + expect(() => { + configValidator(config, { configurationUtilities }); + }).toThrowErrorMatchingInlineSnapshot( +- '"Error configuring Generative AI action: Error: URL Error: Invalid URL: example.com/do-something"' ++ '"Error configuring OpenAI action: Error: URL Error: Invalid URL: example.com/do-something"' + ); + }); + +@@ -72,7 +72,7 @@ + expect(() => { + configValidator(config, { configurationUtilities }); + }).toThrowErrorMatchingInlineSnapshot( +- '"Error configuring Generative AI action: Error: API Provider is not supported"' ++ '"Error configuring OpenAI action: Error: API Provider is not supported"' + ); + }); + +@@ -85,7 +85,7 @@ + expect(() => { + configValidator(config, { configurationUtilities }); + }).toThrowErrorMatchingInlineSnapshot( +- '"Error configuring Generative AI action: Error: API Provider is not supported: bad-one"' ++ '"Error configuring OpenAI action: Error: API Provider is not supported: bad-one"' + ); + }); + +@@ -106,7 +106,7 @@ + expect(() => { + configValidator(config, { configurationUtilities: configUtils }); + }).toThrowErrorMatchingInlineSnapshot( +- `"Error configuring Generative AI action: Error: error validating url: target url is not present in allowedHosts"` ++ `"Error configuring OpenAI action: Error: error validating url: target url is not present in allowedHosts"` + ); + }); + }); +Index: x-pack/plugins/stack_connectors/server/connector_types/gen_ai/index.ts +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/index.ts b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/index.ts +rename from x-pack/plugins/stack_connectors/server/connector_types/gen_ai/index.ts +rename to x-pack/plugins/stack_connectors/server/connector_types/open_ai/index.ts +--- a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/index.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/index.ts (revision 71d2b0ceabdf7a6dbcfec328c0d4c6b29a2624dd) +@@ -10,30 +10,30 @@ + SubActionConnectorType, + ValidatorType, + } from '@kbn/actions-plugin/server/sub_action_framework/types'; +-import { GeneralConnectorFeatureId } from '@kbn/actions-plugin/common'; ++import { GenerativeAIConnectorFeatureId } from '@kbn/actions-plugin/common'; + import { urlAllowListValidator } from '@kbn/actions-plugin/server'; + import { ValidatorServices } from '@kbn/actions-plugin/server/types'; + import { assertURL } from '@kbn/actions-plugin/server/sub_action_framework/helpers/validators'; + import { +- GEN_AI_CONNECTOR_ID, ++ OPEN_AI_CONNECTOR_ID, + OPEN_AI_TITLE, + OpenAiProviderType, +-} from '../../../common/gen_ai/constants'; +-import { ConfigSchema, SecretsSchema } from '../../../common/gen_ai/schema'; +-import { Config, Secrets } from '../../../common/gen_ai/types'; +-import { GenAiConnector } from './gen_ai'; ++} from '../../../common/open_ai/constants'; ++import { ConfigSchema, SecretsSchema } from '../../../common/open_ai/schema'; ++import { Config, Secrets } from '../../../common/open_ai/types'; ++import { OpenAIConnector } from './open_ai'; + import { renderParameterTemplates } from './render'; + + export const getConnectorType = (): SubActionConnectorType => ({ +- id: GEN_AI_CONNECTOR_ID, ++ id: OPEN_AI_CONNECTOR_ID, + name: OPEN_AI_TITLE, +- Service: GenAiConnector, ++ Service: OpenAIConnector, + schema: { + config: ConfigSchema, + secrets: SecretsSchema, + }, + validators: [{ type: ValidatorType.CONFIG, validator: configValidator }], +- supportedFeatureIds: [GeneralConnectorFeatureId], ++ supportedFeatureIds: [GenerativeAIConnectorFeatureId], + minimumLicenseRequired: 'enterprise' as const, + renderParameterTemplates, + }); +@@ -57,7 +57,7 @@ + } catch (err) { + throw new Error( + i18n.translate('xpack.stackConnectors.genAi.configurationErrorApiProvider', { +- defaultMessage: 'Error configuring Generative AI action: {err}', ++ defaultMessage: 'Error configuring OpenAI action: {err}', + values: { + err, + }, +Index: x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/azure_openai_utils.test.ts +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/azure_openai_utils.test.ts b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/azure_openai_utils.test.ts +rename from x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/azure_openai_utils.test.ts +rename to x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/azure_openai_utils.test.ts +--- a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/azure_openai_utils.test.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/azure_openai_utils.test.ts (revision f26c1b78fba7b88efe9f13c938daf875d8512498) +@@ -14,7 +14,7 @@ + AZURE_OPENAI_CHAT_URL, + AZURE_OPENAI_COMPLETIONS_URL, + AZURE_OPENAI_COMPLETIONS_EXTENSIONS_URL, +-} from '../../../../common/gen_ai/constants'; ++} from '../../../../common/open_ai/constants'; + + describe('Azure Open AI Utils', () => { + const chatUrl = +Index: x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/azure_openai_utils.ts +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/azure_openai_utils.ts b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/azure_openai_utils.ts +rename from x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/azure_openai_utils.ts +rename to x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/azure_openai_utils.ts +--- a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/azure_openai_utils.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/azure_openai_utils.ts (revision f26c1b78fba7b88efe9f13c938daf875d8512498) +@@ -9,7 +9,7 @@ + AZURE_OPENAI_CHAT_URL, + AZURE_OPENAI_COMPLETIONS_URL, + AZURE_OPENAI_COMPLETIONS_EXTENSIONS_URL, +-} from '../../../../common/gen_ai/constants'; ++} from '../../../../common/open_ai/constants'; + + const APIS_ALLOWING_STREAMING = new Set([ + AZURE_OPENAI_CHAT_URL, +Index: x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/openai_utils.test.ts +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/openai_utils.test.ts b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/openai_utils.test.ts +rename from x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/openai_utils.test.ts +rename to x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/openai_utils.test.ts +--- a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/openai_utils.test.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/openai_utils.test.ts (revision f26c1b78fba7b88efe9f13c938daf875d8512498) +@@ -10,7 +10,7 @@ + DEFAULT_OPENAI_MODEL, + OPENAI_CHAT_URL, + OPENAI_LEGACY_COMPLETION_URL, +-} from '../../../../common/gen_ai/constants'; ++} from '../../../../common/open_ai/constants'; + + describe('Open AI Utils', () => { + describe('sanitizeRequest', () => { +Index: x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/openai_utils.ts +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/openai_utils.ts b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/openai_utils.ts +rename from x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/openai_utils.ts +rename to x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/openai_utils.ts +--- a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/openai_utils.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/openai_utils.ts (revision f26c1b78fba7b88efe9f13c938daf875d8512498) +@@ -5,7 +5,10 @@ + * 2.0. + */ + +-import { OPENAI_CHAT_URL, OPENAI_LEGACY_COMPLETION_URL } from '../../../../common/gen_ai/constants'; ++import { ++ OPENAI_CHAT_URL, ++ OPENAI_LEGACY_COMPLETION_URL, ++} from '../../../../common/open_ai/constants'; + + const APIS_ALLOWING_STREAMING = new Set([OPENAI_CHAT_URL, OPENAI_LEGACY_COMPLETION_URL]); + +Index: x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/utils.test.ts +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/utils.test.ts b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/utils.test.ts +rename from x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/utils.test.ts +rename to x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/utils.test.ts +--- a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/utils.test.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/utils.test.ts (revision f26c1b78fba7b88efe9f13c938daf875d8512498) +@@ -10,7 +10,7 @@ + DEFAULT_OPENAI_MODEL, + OpenAiProviderType, + OPENAI_CHAT_URL, +-} from '../../../../common/gen_ai/constants'; ++} from '../../../../common/open_ai/constants'; + import { + sanitizeRequest as openAiSanitizeRequest, + getRequestWithStreamOption as openAiGetRequestWithStreamOption, +Index: x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/utils.ts +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/utils.ts b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/utils.ts +rename from x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/utils.ts +rename to x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/utils.ts +--- a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/utils.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/utils.ts (revision f26c1b78fba7b88efe9f13c938daf875d8512498) +@@ -7,7 +7,7 @@ + + import { AxiosResponse, ResponseType } from 'axios'; + import { IncomingMessage } from 'http'; +-import { OpenAiProviderType } from '../../../../common/gen_ai/constants'; ++import { OpenAiProviderType } from '../../../../common/open_ai/constants'; + import { + sanitizeRequest as openAiSanitizeRequest, + getRequestWithStreamOption as openAiGetRequestWithStreamOption, +Index: x-pack/plugins/stack_connectors/server/connector_types/gen_ai/gen_ai.test.ts +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/gen_ai.test.ts b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/open_ai.test.ts +rename from x-pack/plugins/stack_connectors/server/connector_types/gen_ai/gen_ai.test.ts +rename to x-pack/plugins/stack_connectors/server/connector_types/open_ai/open_ai.test.ts +--- a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/gen_ai.test.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/open_ai.test.ts (revision 71d2b0ceabdf7a6dbcfec328c0d4c6b29a2624dd) +@@ -5,20 +5,20 @@ + * 2.0. + */ + +-import { GenAiConnector } from './gen_ai'; ++import { OpenAIConnector } from './open_ai'; + import { actionsConfigMock } from '@kbn/actions-plugin/server/actions_config.mock'; + import { + DEFAULT_OPENAI_MODEL, +- GEN_AI_CONNECTOR_ID, ++ OPEN_AI_CONNECTOR_ID, + OpenAiProviderType, +-} from '../../../common/gen_ai/constants'; ++} from '../../../common/open_ai/constants'; + import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; + import { actionsMock } from '@kbn/actions-plugin/server/mocks'; +-import { RunActionResponseSchema, StreamingResponseSchema } from '../../../common/gen_ai/schema'; ++import { RunActionResponseSchema, StreamingResponseSchema } from '../../../common/open_ai/schema'; + import { initDashboard } from './create_dashboard'; + jest.mock('./create_dashboard'); + +-describe('GenAiConnector', () => { ++describe('OpenAIConnector', () => { + let mockRequest: jest.Mock; + let mockError: jest.Mock; + const mockResponseString = 'Hello! How can I assist you today?'; +@@ -46,9 +46,9 @@ + }); + + describe('OpenAI', () => { +- const connector = new GenAiConnector({ ++ const connector = new OpenAIConnector({ + configurationUtilities: actionsConfigMock.create(), +- connector: { id: '1', type: GEN_AI_CONNECTOR_ID }, ++ connector: { id: '1', type: OPEN_AI_CONNECTOR_ID }, + config: { + apiUrl: 'https://api.openai.com/v1/chat/completions', + apiProvider: OpenAiProviderType.OpenAi, +@@ -285,9 +285,9 @@ + }); + + describe('AzureAI', () => { +- const connector = new GenAiConnector({ ++ const connector = new OpenAIConnector({ + configurationUtilities: actionsConfigMock.create(), +- connector: { id: '1', type: GEN_AI_CONNECTOR_ID }, ++ connector: { id: '1', type: OPEN_AI_CONNECTOR_ID }, + config: { + apiUrl: + 'https://My-test-resource-123.openai.azure.com/openai/deployments/NEW-DEPLOYMENT-321/chat/completions?api-version=2023-05-15', +@@ -455,9 +455,9 @@ + }); + + describe('Token dashboard', () => { +- const connector = new GenAiConnector({ ++ const connector = new OpenAIConnector({ + configurationUtilities: actionsConfigMock.create(), +- connector: { id: '1', type: GEN_AI_CONNECTOR_ID }, ++ connector: { id: '1', type: OPEN_AI_CONNECTOR_ID }, + config: { apiUrl: 'https://example.com/api', apiProvider: OpenAiProviderType.AzureAi }, + secrets: { apiKey: '123' }, + logger: loggingSystemMock.createLogger(), +Index: x-pack/plugins/stack_connectors/server/connector_types/gen_ai/gen_ai.ts +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/gen_ai.ts b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/open_ai.ts +rename from x-pack/plugins/stack_connectors/server/connector_types/gen_ai/gen_ai.ts +rename to x-pack/plugins/stack_connectors/server/connector_types/open_ai/open_ai.ts +--- a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/gen_ai.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/open_ai.ts (revision 71d2b0ceabdf7a6dbcfec328c0d4c6b29a2624dd) +@@ -7,7 +7,6 @@ + + import { ServiceParams, SubActionConnector } from '@kbn/actions-plugin/server'; + import type { AxiosError } from 'axios'; +-import { initDashboard } from './create_dashboard'; + import { + RunActionParamsSchema, + RunActionResponseSchema, +@@ -15,21 +14,22 @@ + StreamActionParamsSchema, + StreamingResponseSchema, + InvokeAIActionParamsSchema, +-} from '../../../common/gen_ai/schema'; ++} from '../../../common/open_ai/schema'; + import type { + Config, + Secrets, + RunActionParams, + RunActionResponse, + StreamActionParams, +-} from '../../../common/gen_ai/types'; +-import { SUB_ACTION } from '../../../common/gen_ai/constants'; ++} from '../../../common/open_ai/types'; ++import { SUB_ACTION } from '../../../common/open_ai/constants'; + import { + DashboardActionParams, + DashboardActionResponse, + InvokeAIActionParams, + InvokeAIActionResponse, +-} from '../../../common/gen_ai/types'; ++} from '../../../common/open_ai/types'; ++import { initDashboard } from './create_dashboard'; + import { + getAxiosOptions, + getRequestWithStreamOption, +@@ -37,7 +37,7 @@ + sanitizeRequest, + } from './lib/utils'; + +-export class GenAiConnector extends SubActionConnector { ++export class OpenAIConnector extends SubActionConnector { + private url; + private provider; + private key; +Index: x-pack/plugins/stack_connectors/server/connector_types/gen_ai/render.test.ts +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/render.test.ts b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/render.test.ts +rename from x-pack/plugins/stack_connectors/server/connector_types/gen_ai/render.test.ts +rename to x-pack/plugins/stack_connectors/server/connector_types/open_ai/render.test.ts +--- a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/render.test.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/render.test.ts (revision f26c1b78fba7b88efe9f13c938daf875d8512498) +@@ -17,7 +17,7 @@ + + const variables = { domain: 'm0zepcuuu2' }; + +-describe('GenAI - renderParameterTemplates', () => { ++describe('OpenAI - renderParameterTemplates', () => { + it('should not render body on test action', () => { + const testParams = { subAction: 'test', subActionParams: { body: 'test_json' } }; + const result = renderParameterTemplates(testParams, variables); +Index: x-pack/plugins/stack_connectors/server/connector_types/gen_ai/render.ts +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/render.ts b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/render.ts +rename from x-pack/plugins/stack_connectors/server/connector_types/gen_ai/render.ts +rename to x-pack/plugins/stack_connectors/server/connector_types/open_ai/render.ts +--- a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/render.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/render.ts (revision f26c1b78fba7b88efe9f13c938daf875d8512498) +@@ -8,7 +8,7 @@ + import { ExecutorParams } from '@kbn/actions-plugin/server/sub_action_framework/types'; + import { renderMustacheString } from '@kbn/actions-plugin/server/lib/mustache_renderer'; + import { RenderParameterTemplates } from '@kbn/actions-plugin/server/types'; +-import { SUB_ACTION } from '../../../common/gen_ai/constants'; ++import { SUB_ACTION } from '../../../common/open_ai/constants'; + + export const renderParameterTemplates: RenderParameterTemplates = ( + params, +Index: x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/index.ts +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/index.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/index.ts +--- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/index.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/index.ts (revision f26c1b78fba7b88efe9f13c938daf875d8512498) +@@ -39,7 +39,7 @@ + loadTestFile(require.resolve('./connector_types/xmatters')); + loadTestFile(require.resolve('./connector_types/tines')); + loadTestFile(require.resolve('./connector_types/torq')); +- loadTestFile(require.resolve('./connector_types/gen_ai')); ++ loadTestFile(require.resolve('./connector_types/open_ai')); + loadTestFile(require.resolve('./connector_types/d3security')); + loadTestFile(require.resolve('./connector_types/bedrock')); + loadTestFile(require.resolve('./create')); +Index: x-pack/test/screenshot_creation/apps/response_ops_docs/stack_connectors/generative_ai_connector.ts +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/test/screenshot_creation/apps/response_ops_docs/stack_connectors/generative_ai_connector.ts b/x-pack/test/screenshot_creation/apps/response_ops_docs/stack_connectors/generative_ai_connector.ts +--- a/x-pack/test/screenshot_creation/apps/response_ops_docs/stack_connectors/generative_ai_connector.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/test/screenshot_creation/apps/response_ops_docs/stack_connectors/generative_ai_connector.ts (revision f26c1b78fba7b88efe9f13c938daf875d8512498) +@@ -21,13 +21,13 @@ + `"content": "You are a cyber security analyst using Elastic Security. I would like you to evaluate the event below and format your output neatly in markdown syntax. Add your description, an accuracy rating, and a threat rating."\n` + + `}]`; + +- describe('generative ai connector', function () { ++ describe('OpenAI connector', function () { + beforeEach(async () => { + await pageObjects.common.navigateToApp('connectors'); + await pageObjects.header.waitUntilLoadingHasFinished(); + }); + +- it('generative ai connector screenshots', async () => { ++ it('OpenAI connector screenshots', async () => { + await pageObjects.common.navigateToApp('connectors'); + await pageObjects.header.waitUntilLoadingHasFinished(); + await actions.common.openNewConnectorForm('gen-ai'); +Index: x-pack/test/screenshot_creation/apps/response_ops_docs/stack_connectors/xmatters_connector.ts +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/test/screenshot_creation/apps/response_ops_docs/stack_connectors/xmatters_connector.ts b/x-pack/test/screenshot_creation/apps/response_ops_docs/stack_connectors/xmatters_connector.ts +--- a/x-pack/test/screenshot_creation/apps/response_ops_docs/stack_connectors/xmatters_connector.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/test/screenshot_creation/apps/response_ops_docs/stack_connectors/xmatters_connector.ts (revision f26c1b78fba7b88efe9f13c938daf875d8512498) +@@ -20,7 +20,7 @@ + await pageObjects.header.waitUntilLoadingHasFinished(); + }); + +- it('generative ai connector screenshots', async () => { ++ it('xmatters connector screenshots', async () => { + await pageObjects.common.navigateToApp('connectors'); + await pageObjects.header.waitUntilLoadingHasFinished(); + await actions.common.openNewConnectorForm('xmatters'); +Index: api_docs/actions.devdocs.json +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/api_docs/actions.devdocs.json b/api_docs/actions.devdocs.json +--- a/api_docs/actions.devdocs.json (revision 06445caf5021c473ab79d40f7975d7090b258a6f) ++++ b/api_docs/actions.devdocs.json (revision e3e527832a3a049f165d93e018dfb58d86900674) +@@ -5273,10 +5273,10 @@ + }, + { + "parentPluginId": "actions", +- "id": "def-common.GeneralConnectorFeatureId", ++ "id": "def-common.GenerativeAIConnectorFeatureId", + "type": "string", + "tags": [], +- "label": "GeneralConnectorFeatureId", ++ "label": "GenerativeAIConnectorFeatureId", + "description": [], + "signature": [ + "\"general\"" +@@ -5613,10 +5613,10 @@ + }, + { + "parentPluginId": "actions", +- "id": "def-common.GeneralFeature", ++ "id": "def-common.GenerativeAIFeature", + "type": "Object", + "tags": [], +- "label": "GeneralFeature", ++ "label": "GenerativeAIFeature", + "description": [], + "path": "x-pack/plugins/actions/common/connector_feature_config.ts", + "deprecated": false, +@@ -5624,7 +5624,7 @@ + "children": [ + { + "parentPluginId": "actions", +- "id": "def-common.GeneralFeature.id", ++ "id": "def-common.GenerativeAIFeature.id", + "type": "string", + "tags": [], + "label": "id", +@@ -5635,7 +5635,7 @@ + }, + { + "parentPluginId": "actions", +- "id": "def-common.GeneralFeature.name", ++ "id": "def-common.GenerativeAIFeature.name", + "type": "string", + "tags": [], + "label": "name", +@@ -5646,7 +5646,7 @@ + }, + { + "parentPluginId": "actions", +- "id": "def-common.GeneralFeature.compatibility", ++ "id": "def-common.GenerativeAIFeature.compatibility", + "type": "string", + "tags": [], + "label": "compatibility", +@@ -5769,4 +5769,4 @@ + } + ] + } +-} +\ No newline at end of file ++} +Index: x-pack/packages/kbn-elastic-assistant/impl/connectorland/use_load_action_types/index.tsx +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/packages/kbn-elastic-assistant/impl/connectorland/use_load_action_types/index.tsx b/x-pack/packages/kbn-elastic-assistant/impl/connectorland/use_load_action_types/index.tsx +--- a/x-pack/packages/kbn-elastic-assistant/impl/connectorland/use_load_action_types/index.tsx (revision 06445caf5021c473ab79d40f7975d7090b258a6f) ++++ b/x-pack/packages/kbn-elastic-assistant/impl/connectorland/use_load_action_types/index.tsx (revision e3e527832a3a049f165d93e018dfb58d86900674) +@@ -15,7 +15,7 @@ + import type { ActionType } from '@kbn/actions-plugin/common'; + import { HttpSetup } from '@kbn/core-http-browser'; + import { IToasts } from '@kbn/core-notifications-browser'; +-import { GeneralConnectorFeatureId } from '@kbn/actions-plugin/common'; ++import { GenerativeAIConnectorFeatureId } from '@kbn/actions-plugin/common'; + import * as i18n from '../translations'; + + /** +@@ -37,7 +37,10 @@ + QUERY_KEY, + + async () => { +- const queryResult = await loadActionTypes({ http, featureId: GeneralConnectorFeatureId }); ++ const queryResult = await loadActionTypes({ ++ http, ++ featureId: GenerativeAIConnectorFeatureId, ++ }); + const sortedData = queryResult.sort((a, b) => a.name.localeCompare(b.name)); + + return sortedData; +Index: x-pack/plugins/actions/common/connector_feature_config.ts +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/plugins/actions/common/connector_feature_config.ts b/x-pack/plugins/actions/common/connector_feature_config.ts +--- a/x-pack/plugins/actions/common/connector_feature_config.ts (revision 06445caf5021c473ab79d40f7975d7090b258a6f) ++++ b/x-pack/plugins/actions/common/connector_feature_config.ts (revision e3e527832a3a049f165d93e018dfb58d86900674) +@@ -25,12 +25,12 @@ + export const CasesConnectorFeatureId = 'cases'; + export const UptimeConnectorFeatureId = 'uptime'; + export const SecurityConnectorFeatureId = 'siem'; +-export const GeneralConnectorFeatureId = 'general'; ++export const GenerativeAIConnectorFeatureId = 'generativeAI'; + +-const compatibilityGeneral = i18n.translate( +- 'xpack.actions.availableConnectorFeatures.compatibility.general', ++const compatibilityGenerativeAI = i18n.translate( ++ 'xpack.actions.availableConnectorFeatures.compatibility.generativeAI', + { +- defaultMessage: 'General', ++ defaultMessage: 'Generative AI', + } + ); + +@@ -80,10 +80,10 @@ + compatibility: compatibilityAlertingRules, + }; + +-export const GeneralFeature: ConnectorFeatureConfig = { +- id: GeneralConnectorFeatureId, +- name: compatibilityGeneral, +- compatibility: compatibilityGeneral, ++export const GenerativeAIFeature: ConnectorFeatureConfig = { ++ id: GenerativeAIConnectorFeatureId, ++ name: compatibilityGenerativeAI, ++ compatibility: compatibilityGenerativeAI, + }; + + const AllAvailableConnectorFeatures = { +@@ -91,7 +91,7 @@ + [CasesConnectorFeature.id]: CasesConnectorFeature, + [UptimeConnectorFeature.id]: UptimeConnectorFeature, + [SecuritySolutionFeature.id]: SecuritySolutionFeature, +- [GeneralFeature.id]: GeneralFeature, ++ [GenerativeAIFeature.id]: GenerativeAIFeature, + }; + + export function areValidFeatures(ids: string[]) { +Index: x-pack/plugins/actions/common/types.ts +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/plugins/actions/common/types.ts b/x-pack/plugins/actions/common/types.ts +--- a/x-pack/plugins/actions/common/types.ts (revision 06445caf5021c473ab79d40f7975d7090b258a6f) ++++ b/x-pack/plugins/actions/common/types.ts (revision e3e527832a3a049f165d93e018dfb58d86900674) +@@ -12,7 +12,7 @@ + CasesConnectorFeatureId, + UptimeConnectorFeatureId, + SecurityConnectorFeatureId, +- GeneralConnectorFeatureId, ++ GenerativeAIConnectorFeatureId, + } from './connector_feature_config'; + export interface ActionType { + id: string; +Index: x-pack/plugins/stack_connectors/server/connector_types/bedrock/index.ts +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/plugins/stack_connectors/server/connector_types/bedrock/index.ts b/x-pack/plugins/stack_connectors/server/connector_types/bedrock/index.ts +--- a/x-pack/plugins/stack_connectors/server/connector_types/bedrock/index.ts (revision 06445caf5021c473ab79d40f7975d7090b258a6f) ++++ b/x-pack/plugins/stack_connectors/server/connector_types/bedrock/index.ts (revision e3e527832a3a049f165d93e018dfb58d86900674) +@@ -10,7 +10,7 @@ + SubActionConnectorType, + ValidatorType, + } from '@kbn/actions-plugin/server/sub_action_framework/types'; +-import { GeneralConnectorFeatureId } from '@kbn/actions-plugin/common'; ++import { GenerativeAIConnectorFeatureId } from '@kbn/actions-plugin/common'; + import { urlAllowListValidator } from '@kbn/actions-plugin/server'; + import { ValidatorServices } from '@kbn/actions-plugin/server/types'; + import { assertURL } from '@kbn/actions-plugin/server/sub_action_framework/helpers/validators'; +@@ -29,7 +29,7 @@ + secrets: SecretsSchema, + }, + validators: [{ type: ValidatorType.CONFIG, validator: configValidator }], +- supportedFeatureIds: [GeneralConnectorFeatureId], ++ supportedFeatureIds: [GenerativeAIConnectorFeatureId], + minimumLicenseRequired: 'enterprise' as const, + renderParameterTemplates, + }); +Index: docs/management/action-types.asciidoc +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/docs/management/action-types.asciidoc b/docs/management/action-types.asciidoc +--- a/docs/management/action-types.asciidoc (revision 9a59bf47d9b8beb788fe724dff7302514251ea7c) ++++ b/docs/management/action-types.asciidoc (revision bc6c2a2dcb95ac781ee1ddcdb1cfeac0d882ee47) +@@ -35,7 +35,7 @@ + + | Send a message to a Microsoft Teams channel. + +-a| <> ++a| <> + + | Send a request to OpenAI. + +Index: docs/management/connectors/action-types/gen-ai.asciidoc +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/docs/management/connectors/action-types/gen-ai.asciidoc b/docs/management/connectors/action-types/openai.asciidoc +rename from docs/management/connectors/action-types/gen-ai.asciidoc +rename to docs/management/connectors/action-types/openai.asciidoc +--- a/docs/management/connectors/action-types/gen-ai.asciidoc (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/docs/management/connectors/action-types/openai.asciidoc (revision bc6c2a2dcb95ac781ee1ddcdb1cfeac0d882ee47) +@@ -1,7 +1,7 @@ +-[[gen-ai-action-type]] +-== Generative AI connector and action ++[[openai-action-type]] ++== OpenAI connector and action + ++++ +-Generative AI ++OpenAI + ++++ + :frontmatter-description: Add a connector that can send requests to an OpenAI provider. + :frontmatter-tags-products: [kibana] +@@ -9,7 +9,7 @@ + :frontmatter-tags-user-goals: [configure] + + +-The Generative AI connector uses https://github.com/axios/axios[axios] to send a POST request to an OpenAI provider, either OpenAI or Azure OpenAI. The connector uses the <> to send the request. ++The OpenAI connector uses https://github.com/axios/axios[axios] to send a POST request to an OpenAI provider, either OpenAI or Azure OpenAI. The connector uses the <> to send the request. + + [float] + [[define-gen-ai-ui]] +@@ -18,14 +18,14 @@ + You can create connectors in *{stack-manage-app} > {connectors-ui}*. For example: + + [role="screenshot"] +-image::management/connectors/images/gen-ai-connector.png[Generative AI connector] ++image::management/connectors/images/gen-ai-connector.png[OpenAI connector] + // NOTE: This is an autogenerated screenshot. Do not edit it directly. + + [float] +-[[gen-ai-connector-configuration]] ++[[openai-connector-configuration]] + ==== Connector configuration + +-Generative AI connectors have the following configuration properties: ++OpenAI connectors have the following configuration properties: + + Name:: The name of the connector. + API Provider:: The OpenAI API provider, either OpenAI or Azure OpenAI. +@@ -40,10 +40,10 @@ + as you're creating or editing the connector in {kib}. For example: + + [role="screenshot"] +-image::management/connectors/images/gen-ai-params-test.png[Generative AI params test] ++image::management/connectors/images/gen-ai-params-test.png[OpenAI params test] + // NOTE: This is an autogenerated screenshot. Do not edit it directly. + +-The Generative AI actions have the following configuration properties. ++The OpenAI actions have the following configuration properties. + + Body:: A JSON payload sent to the OpenAI API URL. For example: + + +@@ -60,15 +60,15 @@ + } + -- + [float] +-[[gen-ai-connector-networking-configuration]] ++[[openai-connector-networking-configuration]] + === Connector networking configuration + + Use the <> to customize connector networking configurations, such as proxies, certificates, or TLS settings. You can set configurations that apply to all your connectors or use `xpack.actions.customHostSettings` to set per-host configurations. + + [float] +-[[gen-ai-connector-token-dashboard]] ++[[openai-connector-token-dashboard]] + === Token usage dashboard + +-Once you've created a Generative AI connector, you can monitor its token usage using the *Generative AI Token Usage* dashboard. Select the connector in *{stack-manage-app}* > *{connectors-ui}* to view its details, then click the *View OpenAI Usage Dashboard for "__" Connector* link to open the dashboard. ++Once you've created a OpenAI connector, you can monitor its token usage using the *OpenAI Token Usage* dashboard. Select the connector in *{stack-manage-app}* > *{connectors-ui}* to view its details, then click the *View OpenAI Usage Dashboard for "__" Connector* link to open the dashboard. + + NOTE: To view the dashboard, you need at least `read` and `view_index_metadata` privileges for the `.kibana-event-log-*` index and the `Read` feature privilege for {kib}. You can set up a role with these minimum privileges and assign it to non-admin users who need to view this dashboard. +Index: docs/management/connectors/index.asciidoc +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/docs/management/connectors/index.asciidoc b/docs/management/connectors/index.asciidoc +--- a/docs/management/connectors/index.asciidoc (revision 9a59bf47d9b8beb788fe724dff7302514251ea7c) ++++ b/docs/management/connectors/index.asciidoc (revision bc6c2a2dcb95ac781ee1ddcdb1cfeac0d882ee47) +@@ -1,7 +1,7 @@ + include::action-types/bedrock.asciidoc[leveloffset=+1] + include::action-types/d3security.asciidoc[leveloffset=+1] + include::action-types/email.asciidoc[leveloffset=+1] +-include::action-types/gen-ai.asciidoc[leveloffset=+1] ++include::action-types/openai.asciidoc[leveloffset=+1] + include::action-types/resilient.asciidoc[leveloffset=+1] + include::action-types/index.asciidoc[leveloffset=+1] + include::action-types/jira.asciidoc[leveloffset=+1] +Index: x-pack/packages/kbn-elastic-assistant/impl/connectorland/connector_button/index.tsx +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/packages/kbn-elastic-assistant/impl/connectorland/connector_button/index.tsx b/x-pack/packages/kbn-elastic-assistant/impl/connectorland/connector_button/index.tsx +--- a/x-pack/packages/kbn-elastic-assistant/impl/connectorland/connector_button/index.tsx (revision 9a59bf47d9b8beb788fe724dff7302514251ea7c) ++++ b/x-pack/packages/kbn-elastic-assistant/impl/connectorland/connector_button/index.tsx (revision bc6c2a2dcb95ac781ee1ddcdb1cfeac0d882ee47) +@@ -8,7 +8,7 @@ + import React, { useCallback } from 'react'; + import { EuiCard, EuiFlexGroup, EuiFlexItem, EuiIcon } from '@elastic/eui'; + +-import { GenAiLogo } from '@kbn/stack-connectors-plugin/public/common'; ++import { OpenAILogo } from '@kbn/stack-connectors-plugin/public/common'; + import * as i18n from '../translations'; + import { useAssistantContext } from '../../assistant_context'; + +@@ -41,7 +41,7 @@ + } ++ icon={} + title={title} + description={description} + onClick={assistantAvailability.hasConnectorsAllPrivilege ? onClick : undefined} +Index: x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/gen_ai_simulation.ts +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/gen_ai_simulation.ts b/x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/open_ai_simulation.ts +rename from x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/gen_ai_simulation.ts +rename to x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/open_ai_simulation.ts +--- a/x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/gen_ai_simulation.ts (revision bc6c2a2dcb95ac781ee1ddcdb1cfeac0d882ee47) ++++ b/x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/open_ai_simulation.ts (revision 71d2b0ceabdf7a6dbcfec328c0d4c6b29a2624dd) +@@ -9,7 +9,7 @@ + + import { ProxyArgs, Simulator } from './simulator'; + +-export class GenAiSimulator extends Simulator { ++export class OpenAISimulator extends Simulator { + private readonly returnError: boolean; + + constructor({ returnError = false, proxy }: { returnError?: boolean; proxy?: ProxyArgs }) { +@@ -24,10 +24,10 @@ + data: Record + ) { + if (this.returnError) { +- return GenAiSimulator.sendErrorResponse(response); ++ return OpenAISimulator.sendErrorResponse(response); + } + +- return GenAiSimulator.sendResponse(response); ++ return OpenAISimulator.sendResponse(response); + } + + private static sendResponse(response: http.ServerResponse) { +Index: x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/gen_ai.ts +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/gen_ai.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/open_ai.ts +rename from x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/gen_ai.ts +rename to x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/open_ai.ts +--- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/gen_ai.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) ++++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/open_ai.ts (revision 71d2b0ceabdf7a6dbcfec328c0d4c6b29a2624dd) +@@ -8,9 +8,9 @@ + import expect from '@kbn/expect'; + + import { +- GenAiSimulator, ++ OpenAISimulator, + genAiSuccessResponse, +-} from '@kbn/actions-simulators-plugin/server/gen_ai_simulation'; ++} from '@kbn/actions-simulators-plugin/server/open_ai_simulation'; + import { FtrProviderContext } from '../../../../../common/ftr_provider_context'; + import { getUrlPrefix, ObjectRemover } from '../../../../../common/lib'; + +@@ -51,7 +51,7 @@ + objectRemover.removeAll(); + }); + describe('action creation', () => { +- const simulator = new GenAiSimulator({ ++ const simulator = new OpenAISimulator({ + returnError: false, + proxy: { + config: configService.get('kbnTestServer.serverArgs'), +@@ -189,7 +189,7 @@ + statusCode: 400, + error: 'Bad Request', + message: +- 'error validating action type config: Error configuring Generative AI action: Error: error validating url: target url "http://genAi.mynonexistent.com" is not added to the Kibana config xpack.actions.allowedHosts', ++ 'error validating action type config: Error configuring OpenAI action: Error: error validating url: target url "http://genAi.mynonexistent.com" is not added to the Kibana config xpack.actions.allowedHosts', + }); + }); + }); +@@ -217,7 +217,7 @@ + + describe('executor', () => { + describe('validation', () => { +- const simulator = new GenAiSimulator({ ++ const simulator = new OpenAISimulator({ + proxy: { + config: configService.get('kbnTestServer.serverArgs'), + }, +@@ -272,7 +272,7 @@ + + describe('execution', () => { + describe('successful response simulator', () => { +- const simulator = new GenAiSimulator({ ++ const simulator = new OpenAISimulator({ + proxy: { + config: configService.get('kbnTestServer.serverArgs'), + }, +@@ -313,7 +313,7 @@ + data: genAiSuccessResponse, + }); + }); +- describe('gen ai dashboard', () => { ++ describe('OpenAI dashboard', () => { + const dashboardId = 'specific-dashboard-id-default'; + + it('should not create a dashboard when user does not have kibana event log permissions', async () => { +@@ -377,7 +377,7 @@ + }); + }); + describe('non-default space simulator', () => { +- const simulator = new GenAiSimulator({ ++ const simulator = new OpenAISimulator({ + proxy: { + config: configService.get('kbnTestServer.serverArgs'), + }, +@@ -428,7 +428,7 @@ + }); + + describe('error response simulator', () => { +- const simulator = new GenAiSimulator({ ++ const simulator = new OpenAISimulator({ + returnError: true, + proxy: { + config: configService.get('kbnTestServer.serverArgs'), +diff --git a/x-pack/plugins/stack_connectors/common/gen_ai/schema.ts b/x-pack/plugins/stack_connectors/common/open_ai/schema.ts +rename from x-pack/plugins/stack_connectors/common/gen_ai/schema.ts +rename to x-pack/plugins/stack_connectors/common/open_ai/schema.ts +diff --git a/x-pack/plugins/stack_connectors/common/gen_ai/types.ts b/x-pack/plugins/stack_connectors/common/open_ai/types.ts +rename from x-pack/plugins/stack_connectors/common/gen_ai/types.ts +rename to x-pack/plugins/stack_connectors/common/open_ai/types.ts +diff --git a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/logo.tsx b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/logo.tsx +rename from x-pack/plugins/stack_connectors/public/connector_types/gen_ai/logo.tsx +rename to x-pack/plugins/stack_connectors/public/connector_types/open_ai/logo.tsx +diff --git a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/use_get_dashboard.ts b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/use_get_dashboard.ts +rename from x-pack/plugins/stack_connectors/public/connector_types/gen_ai/use_get_dashboard.ts +rename to x-pack/plugins/stack_connectors/public/connector_types/open_ai/use_get_dashboard.ts +diff --git a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/create_dashboard.test.ts b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/create_dashboard.test.ts +rename from x-pack/plugins/stack_connectors/server/connector_types/gen_ai/create_dashboard.test.ts +rename to x-pack/plugins/stack_connectors/server/connector_types/open_ai/create_dashboard.test.ts +diff --git a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/create_dashboard.ts b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/create_dashboard.ts +rename from x-pack/plugins/stack_connectors/server/connector_types/gen_ai/create_dashboard.ts +rename to x-pack/plugins/stack_connectors/server/connector_types/open_ai/create_dashboard.ts diff --git a/x-pack/examples/gen_ai_streaming_response_example/README.md b/x-pack/examples/gen_ai_streaming_response_example/README.md index 30d9b35009304..7bac7351af235 100644 --- a/x-pack/examples/gen_ai_streaming_response_example/README.md +++ b/x-pack/examples/gen_ai_streaming_response_example/README.md @@ -1,5 +1,5 @@ -## Generative AI Connector Streaming Response Example +## OpenAI Connector Streaming Response Example -This example plugin shows you how to stream a response from a Generative AI connector. +This example plugin shows you how to stream a response from a OpenAI connector. To run this example, use the command `yarn start --run-examples`. \ No newline at end of file diff --git a/x-pack/examples/gen_ai_streaming_response_example/public/components/list_connector.tsx b/x-pack/examples/gen_ai_streaming_response_example/public/components/list_connector.tsx index 119a2ddb90d51..e2f1af3a9be26 100644 --- a/x-pack/examples/gen_ai_streaming_response_example/public/components/list_connector.tsx +++ b/x-pack/examples/gen_ai_streaming_response_example/public/components/list_connector.tsx @@ -52,7 +52,7 @@ export const ListConnectors = ({ label={i18n.translate( 'genAiStreamingResponseExample.app.component.selectConnectorLabel', { - defaultMessage: 'Select a Generative AI Connector', + defaultMessage: 'Select a OpenAI Connector', } )} labelAppend={ diff --git a/x-pack/examples/gen_ai_streaming_response_example/public/components/setup_connector.tsx b/x-pack/examples/gen_ai_streaming_response_example/public/components/setup_connector.tsx index 518a0d9ceb3c3..2aafcf1a79031 100644 --- a/x-pack/examples/gen_ai_streaming_response_example/public/components/setup_connector.tsx +++ b/x-pack/examples/gen_ai_streaming_response_example/public/components/setup_connector.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { GenAiLogo } from '@kbn/stack-connectors-plugin/public/common'; +import { OpenAILogo } from '@kbn/stack-connectors-plugin/public/common'; import { EuiFlexGroup, EuiCard, EuiFlexItem, EuiIcon } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; @@ -20,11 +20,11 @@ export const SetupConnector = ({ setIsConnectorModalVisible }: SetupConnectorPro } + icon={} title={i18n.translate( 'genAiStreamingResponseExample.app.component.addConnectorCardTitle', { - defaultMessage: 'Add Generative AI Connector', + defaultMessage: 'Add OpenAI Connector', } )} description={i18n.translate( diff --git a/x-pack/examples/gen_ai_streaming_response_example/public/gen_ai_streaming_response_example.tsx b/x-pack/examples/gen_ai_streaming_response_example/public/gen_ai_streaming_response_example.tsx index 8e671338c1bdb..2f300c49a992d 100644 --- a/x-pack/examples/gen_ai_streaming_response_example/public/gen_ai_streaming_response_example.tsx +++ b/x-pack/examples/gen_ai_streaming_response_example/public/gen_ai_streaming_response_example.tsx @@ -65,7 +65,7 @@ export const GenAiStreamingResponseExampleApp = ({ minimumLicenseRequired: 'platinum', supportedFeatureIds: ['general'], id: '.gen-ai', - name: 'Generative AI', + name: 'OpenAI', enabled: true, }); const [loading, setLoading] = useState(true); diff --git a/x-pack/examples/gen_ai_streaming_response_example/public/plugin.tsx b/x-pack/examples/gen_ai_streaming_response_example/public/plugin.tsx index ccf4fe8aa06b0..23cd797a61d06 100644 --- a/x-pack/examples/gen_ai_streaming_response_example/public/plugin.tsx +++ b/x-pack/examples/gen_ai_streaming_response_example/public/plugin.tsx @@ -37,7 +37,7 @@ export class GenAiStreamingResponseExamplePlugin ) { core.application.register({ id: 'GenAiStreamingResponseExample', - title: 'Generative AI Streaming Response Example', + title: 'OpenAI Streaming Response Example', navLinkStatus: AppNavLinkStatus.hidden, async mount(params: AppMountParameters) { const [coreStart, depsStart] = await core.getStartServices(); @@ -48,9 +48,8 @@ export class GenAiStreamingResponseExamplePlugin developerExamples.register({ appId: 'GenAiStreamingResponseExample', - title: 'Generative AI Streaming Response Example', - description: - 'This example demonstrates how to stream a response from a Generative AI connector', + title: 'OpenAI Streaming Response Example', + description: 'This example demonstrates how to stream a response from an OpenAI connector', }); } diff --git a/x-pack/examples/gen_ai_streaming_response_example/server/plugin.ts b/x-pack/examples/gen_ai_streaming_response_example/server/plugin.ts index 3d4dc4bcf33ab..05f9612bcf73d 100644 --- a/x-pack/examples/gen_ai_streaming_response_example/server/plugin.ts +++ b/x-pack/examples/gen_ai_streaming_response_example/server/plugin.ts @@ -87,7 +87,7 @@ export class GenAiStreamingResponseExamplePlugin implements Plugin { }; } else { throw Boom.badRequest( - `Invalid generative AI connector selected - ${connector.config?.apiProvider} is not a valid provider` + `Invalid OpenAI connector selected - ${connector.config?.apiProvider} is not a valid provider` ); } diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_header/index.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_header/index.tsx index 65c3c267e9a8e..fb7d8e20778a9 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_header/index.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_header/index.tsx @@ -17,7 +17,7 @@ import { } from '@elastic/eui'; import { css } from '@emotion/react'; import { DocLinksStart } from '@kbn/core-doc-links-browser'; -import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/gen_ai/constants'; +import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/open_ai/constants'; import { Conversation } from '../../..'; import { AssistantTitle } from '../assistant_title'; import { ConversationSelector } from '../conversations/conversation_selector'; diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector/index.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector/index.tsx index 4891df533fdf1..f823e6bb49eb0 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector/index.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector/index.tsx @@ -19,7 +19,7 @@ import React, { useCallback, useEffect, useMemo, useState } from 'react'; import useEvent from 'react-use/lib/useEvent'; import { css } from '@emotion/react'; -import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/gen_ai/constants'; +import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/open_ai/constants'; import { Conversation } from '../../../..'; import { useAssistantContext } from '../../../assistant_context'; import * as i18n from './translations'; diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector_settings/index.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector_settings/index.tsx index a4618c736eb60..8c18a01a2b3d0 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector_settings/index.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector_settings/index.tsx @@ -18,7 +18,7 @@ import { import React, { useCallback, useMemo, useState } from 'react'; import { css } from '@emotion/react'; -import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/gen_ai/constants'; +import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/open_ai/constants'; import { Conversation, Prompt } from '../../../..'; import { UseAssistantContext } from '../../../assistant_context'; import * as i18n from './translations'; diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/index.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/index.tsx index d119526a198c5..d838f45bb9e47 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/index.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/index.tsx @@ -29,7 +29,7 @@ import { import { createPortal } from 'react-dom'; import { css } from '@emotion/react'; -import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/gen_ai/constants'; +import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/open_ai/constants'; import { ActionConnectorProps } from '@kbn/triggers-actions-ui-plugin/public/types'; import { ChatSend } from './chat_send'; import { BlockBotCallToAction } from './block_bot/cta'; diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings.tsx index e8e1994e85ef7..87aebe74cdec0 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings.tsx @@ -23,7 +23,7 @@ import { // eslint-disable-next-line @kbn/eslint/module_migration import styled from 'styled-components'; import { css } from '@emotion/react'; -import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/gen_ai/constants'; +import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/open_ai/constants'; import { Conversation, Prompt, QuickPrompt } from '../../..'; import * as i18n from './translations'; import { useAssistantContext } from '../../assistant_context'; diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings_button.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings_button.tsx index 773c68bbccf0e..9a65e5b101d44 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings_button.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings_button.tsx @@ -8,7 +8,7 @@ import React, { useCallback } from 'react'; import { EuiButtonIcon, EuiToolTip } from '@elastic/eui'; -import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/gen_ai/constants'; +import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/open_ai/constants'; import { Conversation } from '../../..'; import { AssistantSettings, CONVERSATIONS_TAB } from './assistant_settings'; import * as i18n from './translations'; diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant_context/types.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant_context/types.tsx index 573581091eebf..706454f47e375 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant_context/types.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant_context/types.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/gen_ai/constants'; +import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/open_ai/constants'; export type ConversationRole = 'system' | 'user' | 'assistant'; diff --git a/x-pack/packages/kbn-elastic-assistant/impl/connectorland/connector_button/index.tsx b/x-pack/packages/kbn-elastic-assistant/impl/connectorland/connector_button/index.tsx index 8db849f64fdf6..8cfeb2ce0efdc 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/connectorland/connector_button/index.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/connectorland/connector_button/index.tsx @@ -8,7 +8,7 @@ import React, { useCallback } from 'react'; import { EuiCard, EuiFlexGroup, EuiFlexItem, EuiIcon } from '@elastic/eui'; -import { GenAiLogo } from '@kbn/stack-connectors-plugin/public/common'; +import { OpenAILogo } from '@kbn/stack-connectors-plugin/public/common'; import * as i18n from '../translations'; import { useAssistantContext } from '../../assistant_context'; @@ -41,7 +41,7 @@ export const ConnectorButton: React.FC = React.memo} + icon={} title={title} description={description} onClick={assistantAvailability.hasConnectorsAllPrivilege ? onClick : undefined} diff --git a/x-pack/packages/kbn-elastic-assistant/impl/connectorland/helpers.tsx b/x-pack/packages/kbn-elastic-assistant/impl/connectorland/helpers.tsx index b5db94fe041d3..231bf32c8af93 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/connectorland/helpers.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/connectorland/helpers.tsx @@ -7,7 +7,7 @@ import type { ActionConnector } from '@kbn/triggers-actions-ui-plugin/public'; import { ActionConnectorProps } from '@kbn/triggers-actions-ui-plugin/public/types'; -import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/gen_ai/constants'; +import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/open_ai/constants'; import { ActionTypeModel } from '@kbn/triggers-actions-ui-plugin/public'; interface GenAiConfig { @@ -20,7 +20,7 @@ interface GenAiConfig { * Returns the GenAiConfig for a given ActionConnector. Note that if the connector is preconfigured, * the config will be undefined as the connector is neither available nor editable. * - * TODO: Extract and use separate types from GenAiConfig from '@kbn/stack-connectors-plugin/common/gen_ai/types' + * TODO: Extract and use separate types from GenAiConfig from '@kbn/stack-connectors-plugin/common/open_ai/types' * * @param connector */ diff --git a/x-pack/packages/kbn-elastic-assistant/impl/connectorland/use_load_action_types/index.tsx b/x-pack/packages/kbn-elastic-assistant/impl/connectorland/use_load_action_types/index.tsx index 796ece694664a..b923471e8c368 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/connectorland/use_load_action_types/index.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/connectorland/use_load_action_types/index.tsx @@ -15,7 +15,7 @@ import type { IHttpFetchError } from '@kbn/core-http-browser'; import type { ActionType } from '@kbn/actions-plugin/common'; import { HttpSetup } from '@kbn/core-http-browser'; import { IToasts } from '@kbn/core-notifications-browser'; -import { GeneralConnectorFeatureId } from '@kbn/actions-plugin/common'; +import { GenerativeAIConnectorFeatureId } from '@kbn/actions-plugin/common'; import * as i18n from '../translations'; /** @@ -37,7 +37,10 @@ export const useLoadActionTypes = ({ QUERY_KEY, async () => { - const queryResult = await loadActionTypes({ http, featureId: GeneralConnectorFeatureId }); + const queryResult = await loadActionTypes({ + http, + featureId: GenerativeAIConnectorFeatureId, + }); const sortedData = queryResult.sort((a, b) => a.name.localeCompare(b.name)); return sortedData; diff --git a/x-pack/packages/kbn-elastic-assistant/impl/content/prompts/welcome/translations.ts b/x-pack/packages/kbn-elastic-assistant/impl/content/prompts/welcome/translations.ts index 85c355cf4456c..936d27fb1005a 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/content/prompts/welcome/translations.ts +++ b/x-pack/packages/kbn-elastic-assistant/impl/content/prompts/welcome/translations.ts @@ -19,7 +19,7 @@ export const WELCOME_GENERAL_2 = i18n.translate( 'xpack.elasticAssistant.securityAssistant.content.prompts.welcome.welcomeGeneral2Prompt', { defaultMessage: - "First things first, we'll need to set up a Generative AI Connector to get this chat experience going! With the Generative AI Connector, you'll be able to configure access to either an Azure OpenAI Service or OpenAI API account, but you better believe you'll be able to deploy your own models within your Elastic Cloud instance and use those here in the future... 😉", + "First things first, we'll need to set up a Generative AI Connector to get this chat experience going! With the Generative AI Connector, you'll be able to configure access to either an OpenAI service or an AWS Bedrock service, but you better believe you'll be able to deploy your own models within your Elastic Cloud instance and use those here in the future... 😉", } ); diff --git a/x-pack/packages/kbn-elastic-assistant/impl/mock/conversation.ts b/x-pack/packages/kbn-elastic-assistant/impl/mock/conversation.ts index 9444350e1a0e1..0296ca6fb7706 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/mock/conversation.ts +++ b/x-pack/packages/kbn-elastic-assistant/impl/mock/conversation.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/gen_ai/constants'; +import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/open_ai/constants'; import { Conversation } from '../..'; export const alertConvo: Conversation = { diff --git a/x-pack/plugins/actions/common/connector_feature_config.ts b/x-pack/plugins/actions/common/connector_feature_config.ts index 27c035546882b..61a67087da9fa 100644 --- a/x-pack/plugins/actions/common/connector_feature_config.ts +++ b/x-pack/plugins/actions/common/connector_feature_config.ts @@ -25,12 +25,12 @@ export const AlertingConnectorFeatureId = 'alerting'; export const CasesConnectorFeatureId = 'cases'; export const UptimeConnectorFeatureId = 'uptime'; export const SecurityConnectorFeatureId = 'siem'; -export const GeneralConnectorFeatureId = 'general'; +export const GenerativeAIConnectorFeatureId = 'generativeAI'; -const compatibilityGeneral = i18n.translate( - 'xpack.actions.availableConnectorFeatures.compatibility.general', +const compatibilityGenerativeAI = i18n.translate( + 'xpack.actions.availableConnectorFeatures.compatibility.generativeAI', { - defaultMessage: 'General', + defaultMessage: 'Generative AI', } ); @@ -80,10 +80,10 @@ export const SecuritySolutionFeature: ConnectorFeatureConfig = { compatibility: compatibilityAlertingRules, }; -export const GeneralFeature: ConnectorFeatureConfig = { - id: GeneralConnectorFeatureId, - name: compatibilityGeneral, - compatibility: compatibilityGeneral, +export const GenerativeAIFeature: ConnectorFeatureConfig = { + id: GenerativeAIConnectorFeatureId, + name: compatibilityGenerativeAI, + compatibility: compatibilityGenerativeAI, }; const AllAvailableConnectorFeatures = { @@ -91,7 +91,7 @@ const AllAvailableConnectorFeatures = { [CasesConnectorFeature.id]: CasesConnectorFeature, [UptimeConnectorFeature.id]: UptimeConnectorFeature, [SecuritySolutionFeature.id]: SecuritySolutionFeature, - [GeneralFeature.id]: GeneralFeature, + [GenerativeAIFeature.id]: GenerativeAIFeature, }; export function areValidFeatures(ids: string[]) { diff --git a/x-pack/plugins/actions/common/types.ts b/x-pack/plugins/actions/common/types.ts index c3e1b35777fff..44d7516595d19 100644 --- a/x-pack/plugins/actions/common/types.ts +++ b/x-pack/plugins/actions/common/types.ts @@ -12,7 +12,7 @@ export { CasesConnectorFeatureId, UptimeConnectorFeatureId, SecurityConnectorFeatureId, - GeneralConnectorFeatureId, + GenerativeAIConnectorFeatureId, } from './connector_feature_config'; export interface ActionType { id: string; diff --git a/x-pack/plugins/actions/docs/openapi/bundled.json b/x-pack/plugins/actions/docs/openapi/bundled.json index 94efaf061fb4f..801dd78a76936 100644 --- a/x-pack/plugins/actions/docs/openapi/bundled.json +++ b/x-pack/plugins/actions/docs/openapi/bundled.json @@ -1768,7 +1768,7 @@ } }, "config_properties_genai": { - "title": "Connector request properties for a generative AI connector", + "title": "Connector request properties for an OpenAI connector", "description": "Defines properties for connectors when type is `.gen-ai`.", "oneOf": [ { @@ -1821,7 +1821,7 @@ } }, "secrets_properties_genai": { - "title": "Connector secrets properties for a generative AI connector", + "title": "Connector secrets properties for an OpenAI connector", "description": "Defines secrets for connectors when type is `.gen-ai`.", "type": "object", "properties": { @@ -1832,8 +1832,8 @@ } }, "create_connector_request_genai": { - "title": "Create generative AI connector request", - "description": "The generative AI connector uses axios to send a POST request to either OpenAI or Azure OpenAPI.\n", + "title": "Create OpenAI connector request", + "description": "The OpenAI connector uses axios to send a POST request to either OpenAI or Azure OpenAPI.\n", "type": "object", "required": [ "config", @@ -5722,4 +5722,4 @@ } } } -} \ No newline at end of file +} diff --git a/x-pack/plugins/actions/docs/openapi/bundled.yaml b/x-pack/plugins/actions/docs/openapi/bundled.yaml index b1ff36d6f3370..63156405da018 100644 --- a/x-pack/plugins/actions/docs/openapi/bundled.yaml +++ b/x-pack/plugins/actions/docs/openapi/bundled.yaml @@ -1031,14 +1031,14 @@ components: type: boolean host: description: | - The host name of the service provider. If the `service` is `elastic_cloud` (for Elastic Cloud notifications) or one of Nodemailer's well-known email service providers, this property is ignored. If `service` is `other`, this property must be defined. + The host name of the service provider. If the `service` is `elastic_cloud` (for Elastic Cloud notifications) or one of Nodemailer's well-known email service providers, this property is ignored. If `service` is `other`, this property must be defined. type: string oauthTokenUrl: type: string nullable: true port: description: | - The port to connect to on the service provider. If the `service` is `elastic_cloud` (for Elastic Cloud notifications) or one of Nodemailer's well-known email service providers, this property is ignored. If `service` is `other`, this property must be defined. + The port to connect to on the service provider. If the `service` is `elastic_cloud` (for Elastic Cloud notifications) or one of Nodemailer's well-known email service providers, this property is ignored. If `service` is `other`, this property must be defined. type: integer secure: description: | @@ -1103,7 +1103,7 @@ components: secrets: $ref: '#/components/schemas/secrets_properties_email' config_properties_genai: - title: Connector request properties for a generative AI connector + title: Connector request properties for an OpenAI connector description: Defines properties for connectors when type is `.gen-ai`. oneOf: - type: object @@ -1138,7 +1138,7 @@ components: discriminator: propertyName: apiProvider secrets_properties_genai: - title: Connector secrets properties for a generative AI connector + title: Connector secrets properties for an OpenAI connector description: Defines secrets for connectors when type is `.gen-ai`. type: object properties: @@ -1146,9 +1146,9 @@ components: type: string description: The OpenAI API key. create_connector_request_genai: - title: Create generative AI connector request + title: Create OpenAI connector request description: | - The generative AI connector uses axios to send a POST request to either OpenAI or Azure OpenAPI. + The OpenAI connector uses axios to send a POST request to either OpenAI or Azure OpenAPI. type: object required: - config diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/config_properties_genai.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/config_properties_genai.yaml index ca4388303fd2c..8797f1b330374 100644 --- a/x-pack/plugins/actions/docs/openapi/components/schemas/config_properties_genai.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/schemas/config_properties_genai.yaml @@ -1,4 +1,4 @@ -title: Connector request properties for a generative AI connector +title: Connector request properties for an OpenAI connector description: Defines properties for connectors when type is `.gen-ai`. oneOf: - type: object @@ -29,4 +29,4 @@ oneOf: type: string description: The default model to use for requests. discriminator: - propertyName: apiProvider \ No newline at end of file + propertyName: apiProvider diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/connector_response_properties_genai.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/connector_response_properties_genai.yaml index 17e748216639d..928147ed87a69 100644 --- a/x-pack/plugins/actions/docs/openapi/components/schemas/connector_response_properties_genai.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/schemas/connector_response_properties_genai.yaml @@ -1,4 +1,4 @@ -title: Connector response properties for a generative AI connector +title: Connector response properties for an OpenAI connector type: object required: - config diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_genai.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_genai.yaml index 9aa605c136bb9..95d65bdb80919 100644 --- a/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_genai.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_genai.yaml @@ -1,6 +1,6 @@ -title: Create generative AI connector request +title: Create OpenAI connector request description: > - The generative AI connector uses axios to send a POST request to either + The OpenAI connector uses axios to send a POST request to either OpenAI or Azure OpenAPI. type: object required: @@ -22,4 +22,4 @@ properties: description: The display name for the connector. example: my-connector secrets: - $ref: 'secrets_properties_genai.yaml' \ No newline at end of file + $ref: 'secrets_properties_genai.yaml' diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/secrets_properties_genai.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/secrets_properties_genai.yaml index fae3f0ea131cc..586c50ddbbd37 100644 --- a/x-pack/plugins/actions/docs/openapi/components/schemas/secrets_properties_genai.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/schemas/secrets_properties_genai.yaml @@ -1,7 +1,7 @@ -title: Connector secrets properties for a generative AI connector +title: Connector secrets properties for an OpenAI connector description: Defines secrets for connectors when type is `.gen-ai`. type: object properties: apiKey: type: string - description: The OpenAI API key. \ No newline at end of file + description: The OpenAI API key. diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/update_connector_request_genai.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/update_connector_request_genai.yaml index a7fbf5cb7bcfa..709dea64280dc 100644 --- a/x-pack/plugins/actions/docs/openapi/components/schemas/update_connector_request_genai.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/schemas/update_connector_request_genai.yaml @@ -1,4 +1,4 @@ -title: Update generative AI connector request +title: Update OpenAI connector request type: object required: - config @@ -10,4 +10,4 @@ properties: type: string description: The display name for the connector. secrets: - $ref: 'secrets_properties_genai.yaml' \ No newline at end of file + $ref: 'secrets_properties_genai.yaml' diff --git a/x-pack/plugins/actions/server/lib/action_executor.test.ts b/x-pack/plugins/actions/server/lib/action_executor.test.ts index f0a11b9f90042..a966605bd3a4f 100644 --- a/x-pack/plugins/actions/server/lib/action_executor.test.ts +++ b/x-pack/plugins/actions/server/lib/action_executor.test.ts @@ -1766,7 +1766,7 @@ test('writes to event log for execute and execute start when consumer and relate }); }); -test('writes usage data to event log for gen ai events', async () => { +test('writes usage data to event log for OpenAI events', async () => { const executorMock = setupActionExecutorMock('.gen-ai'); const mockGenAi = { id: 'chatcmpl-7LztF5xsJl2z5jcNpJKvaPm4uWt8x', diff --git a/x-pack/plugins/actions/server/lib/action_executor.ts b/x-pack/plugins/actions/server/lib/action_executor.ts index d5257f4eb8450..d0c512aea7d88 100644 --- a/x-pack/plugins/actions/server/lib/action_executor.ts +++ b/x-pack/plugins/actions/server/lib/action_executor.ts @@ -286,8 +286,8 @@ export class ActionExecutor { event.event = event.event || {}; - // start gen_ai extension - // add event.kibana.action.execution.gen_ai to event log when GenerativeAi Connector is executed + // start open_ai extension + // add event.kibana.action.execution.open_ai to event log when OpenAI Connector is executed if (result.status === 'ok' && actionTypeId === '.gen-ai') { const data = result.data as unknown as { usage: { prompt_tokens?: number; completion_tokens?: number; total_tokens?: number }; @@ -311,7 +311,7 @@ export class ActionExecutor { }, }; } - // end gen_ai extension + // end open_ai extension const currentUser = security?.authc.getCurrentUser(request); diff --git a/x-pack/plugins/data_visualizer/public/application/data_drift/data_drift_utils.test.ts b/x-pack/plugins/data_visualizer/public/application/data_drift/data_drift_utils.test.ts new file mode 100644 index 0000000000000..66dd69f66fb07 --- /dev/null +++ b/x-pack/plugins/data_visualizer/public/application/data_drift/data_drift_utils.test.ts @@ -0,0 +1,88 @@ +/* + * 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. + */ + +import { computeChi2PValue } from './data_drift_utils'; +import { Histogram } from './types'; + +describe('computeChi2PValue()', () => { + test('should return close to 1 if datasets are both empty or nearly identical', () => { + const referenceTerms: Histogram[] = [ + { + key: 'ap-northwest-1', + doc_count: 40348, + percentage: 0.2712470588235294, + }, + { + key: 'us-east-1', + doc_count: 15134, + percentage: 0.10174117647058824, + }, + { + key: 'eu-central-1', + doc_count: 12614, + percentage: 0.0848, + }, + { + key: 'sa-east-1', + doc_count: 80654, + percentage: 0.5422117647058824, + }, + ]; + const comparisonTerms: Histogram[] = [ + { + key: 'ap-northwest-1', + doc_count: 40320, + percentage: 0.2609691846654714, + }, + { + key: 'us-east-1', + doc_count: 15127, + percentage: 0.09790875139966732, + }, + { + key: 'eu-central-1', + doc_count: 12614, + percentage: 0.08164348450819088, + }, + { + key: 'sa-east-1', + doc_count: 86440, + percentage: 0.5594785794266703, + }, + ]; + expect(computeChi2PValue([], [])).toStrictEqual(1); + expect(computeChi2PValue(referenceTerms, comparisonTerms)).toStrictEqual(0.99); + }); + + test('should return close to 0 if datasets differ', () => { + const referenceTerms: Histogram[] = [ + { + key: 'jackson', + doc_count: 1, + percentage: 1, + }, + { + key: 'yahya', + doc_count: 0, + percentage: 0, + }, + ]; + const comparisonTerms: Histogram[] = [ + { + key: 'jackson', + doc_count: 0, + percentage: 0, + }, + { + key: 'yahya', + doc_count: 1, + percentage: 1, + }, + ]; + expect(computeChi2PValue(referenceTerms, comparisonTerms)).toStrictEqual(0); + }); +}); diff --git a/x-pack/plugins/fleet/public/services/get_cloud_formation_template_url_from_agent_policy.test.ts b/x-pack/plugins/fleet/public/services/get_cloud_formation_template_url_from_agent_policy.test.ts new file mode 100644 index 0000000000000..6b4214044f2a0 --- /dev/null +++ b/x-pack/plugins/fleet/public/services/get_cloud_formation_template_url_from_agent_policy.test.ts @@ -0,0 +1,68 @@ +/* + * 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. + */ +import { getCloudFormationTemplateUrlFromAgentPolicy } from './get_cloud_formation_template_url_from_agent_policy'; + +describe('getCloudFormationTemplateUrlFromAgentPolicy', () => { + it('should return undefined when selectedPolicy is undefined', () => { + const result = getCloudFormationTemplateUrlFromAgentPolicy(); + expect(result).toBeUndefined(); + }); + + it('should return undefined when selectedPolicy has no package_policies', () => { + const selectedPolicy = {}; + // @ts-expect-error + const result = getCloudFormationTemplateUrlFromAgentPolicy(selectedPolicy); + expect(result).toBeUndefined(); + }); + + it('should return undefined when no input has enabled and config.cloud_formation_template_url', () => { + const selectedPolicy = { + package_policies: [ + { + inputs: [ + { enabled: false, config: {} }, + { enabled: true, config: {} }, + { enabled: true, config: { other_property: 'value' } }, + ], + }, + { + inputs: [ + { enabled: false, config: {} }, + { enabled: false, config: {} }, + ], + }, + ], + }; + // @ts-expect-error + const result = getCloudFormationTemplateUrlFromAgentPolicy(selectedPolicy); + expect(result).toBeUndefined(); + }); + + it('should return the first config.cloud_formation_template_url when available', () => { + const selectedPolicy = { + package_policies: [ + { + inputs: [ + { enabled: false, config: { cloud_formation_template_url: { value: 'url1' } } }, + { enabled: false, config: { cloud_formation_template_url: { value: 'url2' } } }, + { enabled: false, config: { other_property: 'value' } }, + ], + }, + { + inputs: [ + { enabled: false, config: {} }, + { enabled: true, config: { cloud_formation_template_url: { value: 'url3' } } }, + { enabled: true, config: { cloud_formation_template_url: { value: 'url4' } } }, + ], + }, + ], + }; + // @ts-expect-error + const result = getCloudFormationTemplateUrlFromAgentPolicy(selectedPolicy); + expect(result).toBe('url3'); + }); +}); diff --git a/x-pack/plugins/fleet/public/services/get_cloud_formation_template_url_from_agent_policy.ts b/x-pack/plugins/fleet/public/services/get_cloud_formation_template_url_from_agent_policy.ts new file mode 100644 index 0000000000000..81aaf5b3fd970 --- /dev/null +++ b/x-pack/plugins/fleet/public/services/get_cloud_formation_template_url_from_agent_policy.ts @@ -0,0 +1,38 @@ +/* + * 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. + */ + +import type { AgentPolicy } from '../types'; + +/** + * Get the cloud formation template url from a agent policy + * It looks for a config with a cloud_formation_template_url object present in + * the enabled package_policies inputs of the agent policy + */ +export const getCloudFormationTemplateUrlFromAgentPolicy = (selectedPolicy?: AgentPolicy) => { + const cloudFormationTemplateUrl = selectedPolicy?.package_policies?.reduce( + (acc, packagePolicy) => { + const findCloudFormationTemplateUrlConfig = packagePolicy.inputs?.reduce( + (accInput, input) => { + if (accInput !== '') { + return accInput; + } + if (input?.enabled && input?.config?.cloud_formation_template_url) { + return input.config.cloud_formation_template_url.value; + } + return accInput; + }, + '' + ); + if (findCloudFormationTemplateUrlConfig) { + return findCloudFormationTemplateUrlConfig; + } + return acc; + }, + '' + ); + return cloudFormationTemplateUrl !== '' ? cloudFormationTemplateUrl : undefined; +}; diff --git a/x-pack/plugins/fleet/public/services/get_cloud_formation_template_url_from_package_info.test.ts b/x-pack/plugins/fleet/public/services/get_cloud_formation_template_url_from_package_info.test.ts new file mode 100644 index 0000000000000..8ed2fb3ae389a --- /dev/null +++ b/x-pack/plugins/fleet/public/services/get_cloud_formation_template_url_from_package_info.test.ts @@ -0,0 +1,66 @@ +/* + * 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. + */ + +import { getCloudFormationTemplateUrlFromPackageInfo } from './get_cloud_formation_template_url_from_package_info'; + +describe('getCloudFormationTemplateUrlFromPackageInfo', () => { + test('returns undefined when packageInfo is undefined', () => { + const result = getCloudFormationTemplateUrlFromPackageInfo(undefined, 'test'); + expect(result).toBeUndefined(); + }); + + test('returns undefined when packageInfo has no policy_templates', () => { + const packageInfo = { inputs: [] }; + // @ts-expect-error + const result = getCloudFormationTemplateUrlFromPackageInfo(packageInfo, 'test'); + expect(result).toBeUndefined(); + }); + + test('returns undefined when integrationType is not found in policy_templates', () => { + const packageInfo = { policy_templates: [{ name: 'template1' }, { name: 'template2' }] }; + // @ts-expect-error + const result = getCloudFormationTemplateUrlFromPackageInfo(packageInfo, 'nonExistentTemplate'); + expect(result).toBeUndefined(); + }); + + test('returns undefined when no input in the policy template has a cloudFormationTemplate', () => { + const packageInfo = { + policy_templates: [ + { + name: 'template1', + inputs: [ + { name: 'input1', vars: [] }, + { name: 'input2', vars: [{ name: 'var1', default: 'value1' }] }, + ], + }, + ], + }; + // @ts-expect-error + const result = getCloudFormationTemplateUrlFromPackageInfo(packageInfo, 'template1'); + expect(result).toBeUndefined(); + }); + + test('returns the cloudFormationTemplate from the policy template', () => { + const packageInfo = { + policy_templates: [ + { + name: 'template1', + inputs: [ + { name: 'input1', vars: [] }, + { + name: 'input2', + vars: [{ name: 'cloud_formation_template', default: 'cloud_formation_template_url' }], + }, + ], + }, + ], + }; + // @ts-expect-error + const result = getCloudFormationTemplateUrlFromPackageInfo(packageInfo, 'template1'); + expect(result).toBe('cloud_formation_template_url'); + }); +}); diff --git a/x-pack/plugins/fleet/public/services/get_cloud_formation_template_url_from_package_info.ts b/x-pack/plugins/fleet/public/services/get_cloud_formation_template_url_from_package_info.ts new file mode 100644 index 0000000000000..4f5381ccedb3f --- /dev/null +++ b/x-pack/plugins/fleet/public/services/get_cloud_formation_template_url_from_package_info.ts @@ -0,0 +1,32 @@ +/* + * 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. + */ + +import type { PackageInfo } from '../types'; + +/** + * Get the cloud formation template url from the PackageInfo + * It looks for a input var with a object containing cloud_formation_template_url present in + * the package_policies inputs of the given integration type + */ +export const getCloudFormationTemplateUrlFromPackageInfo = ( + packageInfo: PackageInfo | undefined, + integrationType: string +): string | undefined => { + if (!packageInfo?.policy_templates) return undefined; + + const policyTemplate = packageInfo.policy_templates.find((p) => p.name === integrationType); + if (!policyTemplate) return undefined; + + if ('inputs' in policyTemplate) { + const cloudFormationTemplate = policyTemplate.inputs?.reduce((acc, input): string => { + if (!input.vars) return acc; + const template = input.vars.find((v) => v.name === 'cloud_formation_template')?.default; + return template ? String(template) : acc; + }, ''); + return cloudFormationTemplate !== '' ? cloudFormationTemplate : undefined; + } +}; diff --git a/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/detail_panel.container.d.ts b/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/detail_panel.container.d.ts new file mode 100644 index 0000000000000..9d9488cea33f2 --- /dev/null +++ b/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/detail_panel.container.d.ts @@ -0,0 +1,8 @@ +/* + * 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. + */ + +export declare function DetailPanel(props: any): any; diff --git a/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/detail_panel.container.js b/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/detail_panel.container.js new file mode 100644 index 0000000000000..e9c6c694d1fb0 --- /dev/null +++ b/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/detail_panel.container.js @@ -0,0 +1,64 @@ +/* + * 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. + */ + +import { connect } from 'react-redux'; +import { DetailPanel as PresentationComponent } from './detail_panel'; +import { + getDetailPanelType, + getDetailPanelIndexName, + getIndexByIndexName, +} from '../../../../store/selectors'; +import { + openDetailPanel, + closeDetailPanel, + clearCacheIndices, + closeIndices, + deleteIndices, + flushIndices, + forcemergeIndices, + openIndices, + refreshIndices, +} from '../../../../store/actions'; + +const mapStateToProps = (state) => { + const indexName = getDetailPanelIndexName(state); + return { + panelType: getDetailPanelType(state), + indexName, + index: getIndexByIndexName(state, indexName), + }; +}; + +const mapDispatchToProps = (dispatch) => { + return { + clearCacheIndex: (indexName) => { + dispatch(clearCacheIndices({ indexNames: [indexName] })); + }, + closeIndex: (indexName) => { + dispatch(closeIndices({ indexNames: [indexName] })); + }, + flushIndex: (indexName) => { + dispatch(flushIndices({ indexNames: [indexName] })); + }, + openIndex: (indexName) => { + dispatch(openIndices({ indexNames: [indexName] })); + }, + refreshIndex: (indexName) => { + dispatch(refreshIndices({ indexNames: [indexName] })); + }, + forcemergeIndex: (indexName) => { + dispatch(forcemergeIndices({ indexNames: [indexName] })); + }, + deleteIndex: (indexName) => { + dispatch(deleteIndices({ indexNames: [indexName] })); + }, + closeDetailPanel: () => dispatch(closeDetailPanel()), + openDetailPanel: (indexName, panelType) => dispatch(openDetailPanel(indexName, panelType)), + }; +}; + +export const DetailPanel = connect(mapStateToProps, mapDispatchToProps)(PresentationComponent); diff --git a/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/detail_panel.js b/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/detail_panel.js new file mode 100644 index 0000000000000..bddd3665f0b7c --- /dev/null +++ b/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/detail_panel.js @@ -0,0 +1,176 @@ +/* + * 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. + */ + +import React, { Fragment } from 'react'; +import { Route } from '@kbn/shared-ux-router'; +import { FormattedMessage } from '@kbn/i18n-react'; +import { + EuiCallOut, + EuiFlexGroup, + EuiFlexItem, + EuiFlyout, + EuiFlyoutBody, + EuiFlyoutFooter, + EuiFlyoutHeader, + EuiSpacer, + EuiTabs, + EuiTab, + EuiTitle, +} from '@elastic/eui'; +import { renderBadges } from '../../../../lib/render_badges'; +import { INDEX_OPEN } from '../../../../../../common/constants'; +import { + TAB_SUMMARY, + TAB_SETTINGS, + TAB_MAPPING, + TAB_STATS, + TAB_EDIT_SETTINGS, +} from '../../../../constants'; +import { IndexActionsContextMenu } from '../index_actions_context_menu'; +import { ShowJson } from './show_json'; +import { Summary } from './summary'; +import { EditSettingsJson } from './edit_settings_json'; +import { useServices, useAppContext } from '../../../../app_context'; +import { DiscoverLink } from '../../../../lib/discover_link'; + +const tabToHumanizedMap = { + [TAB_SUMMARY]: ( + + ), + [TAB_SETTINGS]: ( + + ), + [TAB_MAPPING]: ( + + ), + [TAB_STATS]: ( + + ), + [TAB_EDIT_SETTINGS]: ( + + ), +}; + +const getTabs = (showStats) => { + if (showStats) { + return [TAB_SUMMARY, TAB_SETTINGS, TAB_MAPPING, TAB_STATS, TAB_EDIT_SETTINGS]; + } + return [TAB_SUMMARY, TAB_SETTINGS, TAB_MAPPING, TAB_EDIT_SETTINGS]; +}; + +export const DetailPanel = ({ panelType, indexName, index, openDetailPanel, closeDetailPanel }) => { + const { extensionsService } = useServices(); + const { config } = useAppContext(); + + const renderTabs = () => { + const tabs = getTabs(config.enableIndexStats); + return tabs.map((tab, i) => { + const isSelected = tab === panelType; + return ( + openDetailPanel({ panelType: tab, indexName })} + isSelected={isSelected} + data-test-subj={`detailPanelTab${isSelected ? 'Selected' : ''}`} + disabled={tab === TAB_STATS && index.status !== INDEX_OPEN} + key={i} + > + {tabToHumanizedMap[tab]} + + ); + }); + }; + + if (!panelType) { + return null; + } + + let component = null; + switch (panelType) { + case TAB_EDIT_SETTINGS: + component = ; + break; + case TAB_MAPPING: + case TAB_SETTINGS: + case TAB_STATS: + component = ; + break; + default: + component = ; + } + + const content = index ? ( + + {component} + + + + ( + + } + /> + )} + /> + + + + + ) : ( + + + + } + color="danger" + iconType="cross" + > + + + + ); + + return ( + + + +

    + {indexName} + + {renderBadges(index, undefined, extensionsService)} +

    +
    + {index ? {renderTabs()} : null} +
    + {content} +
    + ); +}; diff --git a/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/edit_settings_json/edit_settings_json.container.js b/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/edit_settings_json/edit_settings_json.container.js new file mode 100644 index 0000000000000..75698874fac9d --- /dev/null +++ b/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/edit_settings_json/edit_settings_json.container.js @@ -0,0 +1,34 @@ +/* + * 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. + */ + +import { connect } from 'react-redux'; +import { EditSettingsJson as PresentationComponent } from './edit_settings_json'; +import { closeDetailPanel, loadIndexData, updateIndexSettings } from '../../../../../store/actions'; +import { + getDetailPanelData, + getDetailPanelError, + getDetailPanelIndexName, + getIndexStatusByIndexName, +} from '../../../../../store/selectors'; + +const mapStateToProps = (state) => { + const indexName = getDetailPanelIndexName(state); + return { + error: getDetailPanelError(state), + data: getDetailPanelData(state), + indexName, + indexStatus: getIndexStatusByIndexName(state, indexName), + }; +}; + +const mapDispatchToProps = { + loadIndexData, + closeDetailPanel, + updateIndexSettings, +}; + +export const EditSettingsJson = connect(mapStateToProps, mapDispatchToProps)(PresentationComponent); diff --git a/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/edit_settings_json/edit_settings_json.js b/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/edit_settings_json/edit_settings_json.js new file mode 100644 index 0000000000000..6d04a1a0d45d8 --- /dev/null +++ b/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/edit_settings_json/edit_settings_json.js @@ -0,0 +1,170 @@ +/* + * 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. + */ + +import React from 'react'; +import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@kbn/i18n-react'; +import { documentationService } from '../../../../../services/documentation'; + +import { + EuiButton, + EuiFlexGroup, + EuiFlexItem, + EuiCallOut, + EuiLink, + EuiSpacer, + EuiTitle, +} from '@elastic/eui'; +import { TAB_SETTINGS } from '../../../../../constants'; +import { settingsToDisplay, readOnlySettings } from '../../../../../lib/edit_settings'; +import { createAceEditor } from '../../../../../lib/ace'; +import _ from 'lodash'; + +import { flattenObject } from '../../../../../lib/flatten_object'; + +export class EditSettingsJson extends React.PureComponent { + constructor() { + super(); + this.state = { + valid: true, + }; + } + + //API expects settings in flattened dotted form, + //whereas they come back as nested objects from ES + transformSettingsForApi(data, isOpen) { + const { defaults, settings } = data; + //settings user has actually set + const flattenedSettings = flattenObject(settings); + //settings with their defaults + const flattenedDefaults = flattenObject(defaults); + const filteredDefaults = _.pick(flattenedDefaults, settingsToDisplay); + const newSettings = { ...filteredDefaults, ...flattenedSettings }; + //store these to be used as autocomplete values later + this.settingsKeys = Object.keys(newSettings); + readOnlySettings.forEach((e) => delete newSettings[e]); + //can't change codec on open index + if (isOpen) { + delete newSettings['index.codec']; + } + return newSettings; + } + UNSAFE_componentWillMount() { + const { indexName } = this.props; + this.props.loadIndexData({ dataType: TAB_SETTINGS, indexName }); + } + componentDidUpdate() { + const { data, indexStatus } = this.props; + if (data && !this.editor) { + const isOpen = indexStatus === 'open'; + const newSettings = this.transformSettingsForApi(data, isOpen); + this.originalSettings = newSettings; + const prettyJson = JSON.stringify(newSettings, null, 2); + const settingsKeys = Object.keys(newSettings); + const editor = (this.editor = createAceEditor(this.aceDiv, prettyJson, false, settingsKeys)); + const session = editor.getSession(); + session.on('changeAnnotation', () => { + const isEmptyString = session.getValue() === ''; + this.setState({ valid: !isEmptyString && session.getAnnotations().length === 0 }); + }); + } + } + componentWillUnmount() { + this.editor && this.editor.destroy(); + } + commitSettings = () => { + const { updateIndexSettings, indexName } = this.props; + const json = this.editor.getValue(); + const settings = JSON.parse(json); + //don't set if the values have not changed + Object.keys(this.originalSettings).forEach((key) => { + if (_.isEqual(this.originalSettings[key], settings[key])) { + delete settings[key]; + } + }); + updateIndexSettings({ indexName, settings }); + }; + errorMessage() { + const { error } = this.props; + + if (!error) { + return null; + } + + return ( + <> + + +

    {error}

    +
    + + ); + } + render() { + const { data } = this.props; + if (!data) { + return null; + } + return ( +
    + + + +

    + +

    +
    +
    + + + + + +
    + {this.errorMessage()} + + + + + +
    { + this.aceDiv = aceDiv; + }} + /> + +
    + ); + } +} diff --git a/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/edit_settings_json/index.js b/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/edit_settings_json/index.js new file mode 100644 index 0000000000000..52ff89ad74ed7 --- /dev/null +++ b/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/edit_settings_json/index.js @@ -0,0 +1,8 @@ +/* + * 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. + */ + +export { EditSettingsJson } from './edit_settings_json.container'; diff --git a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/index.ts b/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/index.ts similarity index 76% rename from x-pack/plugins/stack_connectors/public/connector_types/gen_ai/index.ts rename to x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/index.ts index dea9dbeaef3d7..1dabcb21fa93c 100644 --- a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/index.ts +++ b/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/index.ts @@ -5,4 +5,4 @@ * 2.0. */ -export { getConnectorType as getGenerativeAiConnectorType } from './gen_ai'; +export { DetailPanel } from './detail_panel.container'; diff --git a/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/show_json/index.js b/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/show_json/index.js new file mode 100644 index 0000000000000..86fe8d41bda63 --- /dev/null +++ b/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/show_json/index.js @@ -0,0 +1,8 @@ +/* + * 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. + */ + +export { ShowJson } from './show_json.container'; diff --git a/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/show_json/show_json.container.js b/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/show_json/show_json.container.js new file mode 100644 index 0000000000000..9bd506acc8bde --- /dev/null +++ b/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/show_json/show_json.container.js @@ -0,0 +1,36 @@ +/* + * 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. + */ + +import { connect } from 'react-redux'; +import { ShowJson as PresentationComponent } from './show_json'; +import { loadIndexData, closeDetailPanel } from '../../../../../store/actions'; + +import { + getDetailPanelData, + getDetailPanelError, + getDetailPanelIndexName, + getDetailPanelType, + getIndexStatusByIndexName, +} from '../../../../../store/selectors'; + +const mapStateToProps = (state) => { + const indexName = getDetailPanelIndexName(state); + return { + error: getDetailPanelError(state), + data: getDetailPanelData(state), + dataType: getDetailPanelType(state), + indexName, + indexStatus: getIndexStatusByIndexName(state, indexName), + }; +}; + +const mapDispatchToProps = { + loadIndexData, + closeDetailPanel, +}; + +export const ShowJson = connect(mapStateToProps, mapDispatchToProps)(PresentationComponent); diff --git a/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/show_json/show_json.js b/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/show_json/show_json.js new file mode 100644 index 0000000000000..6ad472e695936 --- /dev/null +++ b/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/show_json/show_json.js @@ -0,0 +1,31 @@ +/* + * 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. + */ + +import React from 'react'; +import { EuiCodeBlock } from '@elastic/eui'; + +import 'brace/theme/textmate'; + +export class ShowJson extends React.PureComponent { + UNSAFE_componentWillMount() { + this.props.loadIndexData(this.props); + } + UNSAFE_componentWillUpdate(newProps) { + const { data, loadIndexData } = newProps; + if (!data) { + loadIndexData(newProps); + } + } + render() { + const { data } = this.props; + if (!data) { + return null; + } + const json = JSON.stringify(data, null, 2); + return {json}; + } +} diff --git a/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/summary/index.js b/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/summary/index.js new file mode 100644 index 0000000000000..e05d63d45ec16 --- /dev/null +++ b/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/summary/index.js @@ -0,0 +1,8 @@ +/* + * 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. + */ + +export { Summary } from './summary.container'; diff --git a/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/summary/summary.container.js b/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/summary/summary.container.js new file mode 100644 index 0000000000000..f55bd3fa6ee19 --- /dev/null +++ b/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/summary/summary.container.js @@ -0,0 +1,21 @@ +/* + * 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. + */ + +import { connect } from 'react-redux'; +import { Summary as PresentationComponent } from './summary'; + +import { getIndexByIndexName, getDetailPanelIndexName } from '../../../../../store/selectors'; + +const mapStateToProps = (state) => { + const indexName = getDetailPanelIndexName(state); + return { + indexName, + index: getIndexByIndexName(state, indexName), + }; +}; + +export const Summary = connect(mapStateToProps)(PresentationComponent); diff --git a/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/summary/summary.js b/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/summary/summary.js new file mode 100644 index 0000000000000..7e680bbfe5bde --- /dev/null +++ b/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/summary/summary.js @@ -0,0 +1,147 @@ +/* + * 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. + */ + +import React, { Fragment } from 'react'; +import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@kbn/i18n-react'; +import { + EuiFlexGroup, + EuiFlexItem, + EuiDescriptionList, + EuiHorizontalRule, + EuiDescriptionListTitle, + EuiDescriptionListDescription, + EuiSpacer, + EuiTitle, +} from '@elastic/eui'; +import { DataHealth } from '../../../../../components'; +import { AppContextConsumer } from '../../../../../app_context'; + +const getHeaders = (showStats) => { + const baseHeaders = { + primary: i18n.translate('xpack.idxMgmt.summary.headers.primaryHeader', { + defaultMessage: 'Primaries', + }), + replica: i18n.translate('xpack.idxMgmt.summary.headers.replicaHeader', { + defaultMessage: 'Replicas', + }), + aliases: i18n.translate('xpack.idxMgmt.summary.headers.aliases', { + defaultMessage: 'Aliases', + }), + }; + + if (showStats) { + return { + ...baseHeaders, + health: i18n.translate('xpack.idxMgmt.summary.headers.healthHeader', { + defaultMessage: 'Health', + }), + status: i18n.translate('xpack.idxMgmt.summary.headers.statusHeader', { + defaultMessage: 'Status', + }), + documents: i18n.translate('xpack.idxMgmt.summary.headers.documentsHeader', { + defaultMessage: 'Docs count', + }), + documents_deleted: i18n.translate('xpack.idxMgmt.summary.headers.deletedDocumentsHeader', { + defaultMessage: 'Docs deleted', + }), + size: i18n.translate('xpack.idxMgmt.summary.headers.storageSizeHeader', { + defaultMessage: 'Storage size', + }), + primary_size: i18n.translate('xpack.idxMgmt.summary.headers.primaryStorageSizeHeader', { + defaultMessage: 'Primary storage size', + }), + }; + } + return baseHeaders; +}; + +export class Summary extends React.PureComponent { + getAdditionalContent(extensionsService, getUrlForApp) { + const { index } = this.props; + const extensions = extensionsService.summaries; + return extensions.map((summaryExtension, i) => { + const ExtensionSummaryComponent = summaryExtension; + return ( + + + + + ); + }); + } + + buildRows(config) { + const { index } = this.props; + const headers = getHeaders(config.enableIndexStats); + const rows = { + left: [], + right: [], + }; + Object.keys(headers).forEach((fieldName, arrayIndex) => { + const value = index[fieldName]; + let content = value; + if (fieldName === 'health') { + content = ; + } + if (Array.isArray(content)) { + content = content.join(', '); + } + const cell = [ + + {headers[fieldName]} + , + + {content} + , + ]; + if (arrayIndex % 2 === 0) { + rows.left.push(cell); + } else { + rows.right.push(cell); + } + }); + return rows; + } + + render() { + return ( + + {({ services, core, config }) => { + const { left, right } = this.buildRows(config); + const additionalContent = this.getAdditionalContent( + services.extensionsService, + core.getUrlForApp + ); + + return ( + + +

    + +

    +
    + + + + {left} + + + {right} + + + {additionalContent} +
    + ); + }} +
    + ); + } +} diff --git a/x-pack/plugins/index_management/public/application/store/actions/detail_panel.js b/x-pack/plugins/index_management/public/application/store/actions/detail_panel.js new file mode 100644 index 0000000000000..11d93a12eee9d --- /dev/null +++ b/x-pack/plugins/index_management/public/application/store/actions/detail_panel.js @@ -0,0 +1,11 @@ +/* + * 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. + */ + +import { createAction } from 'redux-actions'; + +export const openDetailPanel = createAction('INDEX_MANAGEMENT_OPEN_DETAIL_PANEL'); +export const closeDetailPanel = createAction('INDEX_MANAGEMENT_CLOSE_DETAIL_PANEL'); diff --git a/x-pack/plugins/index_management/public/application/store/actions/edit_index_settings.js b/x-pack/plugins/index_management/public/application/store/actions/edit_index_settings.js new file mode 100644 index 0000000000000..4a82ced82eb83 --- /dev/null +++ b/x-pack/plugins/index_management/public/application/store/actions/edit_index_settings.js @@ -0,0 +1,38 @@ +/* + * 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. + */ + +import { i18n } from '@kbn/i18n'; +import { loadIndexSettings as request } from '../../services'; +import { notificationService } from '../../services/notification'; +import { loadIndexDataSuccess } from './load_index_data'; + +export const editIndexSettings = + ({ indexName }) => + async (dispatch) => { + let indexSettings; + try { + indexSettings = await request(indexName); + } catch (error) { + return notificationService.showDangerToast(error.message); + } + notificationService.showSuccessToast( + i18n.translate( + 'xpack.idxMgmt.editIndexSettingsAction.successfullySavedSettingsForIndicesMessage', + { + defaultMessage: 'Successfully saved settings for {indexName}', + values: { indexName }, + } + ) + ); + dispatch( + loadIndexDataSuccess({ + data: indexSettings, + panelType: 'editIndexSettings', + indexName, + }) + ); + }; diff --git a/x-pack/plugins/index_management/public/application/store/actions/load_index_data.js b/x-pack/plugins/index_management/public/application/store/actions/load_index_data.js new file mode 100644 index 0000000000000..18925d6d05e64 --- /dev/null +++ b/x-pack/plugins/index_management/public/application/store/actions/load_index_data.js @@ -0,0 +1,24 @@ +/* + * 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. + */ + +import { createAction } from 'redux-actions'; +import { loadIndexData as request } from '../../services'; +import { notificationService } from '../../services/notification'; + +export const loadIndexDataSuccess = createAction('INDEX_MANAGEMENT_LOAD_INDEX_DATA_SUCCESS'); + +export const loadIndexData = + ({ indexName, dataType }) => + async (dispatch) => { + let data; + try { + data = await request(dataType, indexName); + } catch (error) { + notificationService.showDangerToast(error.message); + } + dispatch(loadIndexDataSuccess({ data, indexName })); + }; diff --git a/x-pack/plugins/index_management/public/application/store/actions/update_index_settings.js b/x-pack/plugins/index_management/public/application/store/actions/update_index_settings.js new file mode 100644 index 0000000000000..22ebf78fc5fe0 --- /dev/null +++ b/x-pack/plugins/index_management/public/application/store/actions/update_index_settings.js @@ -0,0 +1,39 @@ +/* + * 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. + */ + +import { createAction } from 'redux-actions'; +import { i18n } from '@kbn/i18n'; +import { updateIndexSettings as request } from '../../services'; +import { reloadIndices } from './reload_indices'; +import { notificationService } from '../../services/notification'; + +export const updateIndexSettingsSuccess = createAction( + 'INDEX_MANAGEMENT_UPDATE_INDEX_SETTINGS_SUCCESS' +); +export const updateIndexSettingsError = createAction( + 'INDEX_MANAGEMENT_UPDATE_INDEX_SETTINGS_ERROR' +); + +export const updateIndexSettings = + ({ indexName, settings }) => + async (dispatch) => { + if (Object.keys(settings).length !== 0) { + const { error } = await request(indexName, settings); + + if (error) { + return dispatch(updateIndexSettingsError({ error: error.message })); + } + } + dispatch(updateIndexSettingsSuccess()); + dispatch(reloadIndices([indexName])); + notificationService.showSuccessToast( + i18n.translate('xpack.idxMgmt.updateIndexSettingsAction.settingsSuccessUpdateMessage', { + defaultMessage: 'Successfully updated settings for index {indexName}', + values: { indexName }, + }) + ); + }; diff --git a/x-pack/plugins/index_management/public/application/store/reducers/detail_panel.js b/x-pack/plugins/index_management/public/application/store/reducers/detail_panel.js new file mode 100644 index 0000000000000..5868c590fa5d2 --- /dev/null +++ b/x-pack/plugins/index_management/public/application/store/reducers/detail_panel.js @@ -0,0 +1,91 @@ +/* + * 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. + */ + +import { handleActions } from 'redux-actions'; +import { + UIM_DETAIL_PANEL_SUMMARY_TAB, + UIM_DETAIL_PANEL_SETTINGS_TAB, + UIM_DETAIL_PANEL_MAPPING_TAB, + UIM_DETAIL_PANEL_STATS_TAB, + UIM_DETAIL_PANEL_EDIT_SETTINGS_TAB, +} from '../../../../common/constants'; +import { + TAB_SUMMARY, + TAB_SETTINGS, + TAB_MAPPING, + TAB_STATS, + TAB_EDIT_SETTINGS, +} from '../../constants'; +import { openDetailPanel, closeDetailPanel } from '../actions/detail_panel'; +import { loadIndexDataSuccess } from '../actions/load_index_data'; +import { + updateIndexSettingsSuccess, + updateIndexSettingsError, +} from '../actions/update_index_settings'; +import { deleteIndicesSuccess } from '../actions/delete_indices'; +import { METRIC_TYPE } from '@kbn/analytics'; + +const defaultState = {}; + +export const getDetailPanelReducer = (uiMetricService) => + handleActions( + { + [deleteIndicesSuccess](state, action) { + const { indexNames } = action.payload; + const { indexName } = state; + if (indexNames.includes(indexName)) { + return {}; + } else { + return state; + } + }, + [openDetailPanel](state, action) { + const { panelType, indexName, title } = action.payload; + + const panelTypeToUiMetricMap = { + [TAB_SUMMARY]: UIM_DETAIL_PANEL_SUMMARY_TAB, + [TAB_SETTINGS]: UIM_DETAIL_PANEL_SETTINGS_TAB, + [TAB_MAPPING]: UIM_DETAIL_PANEL_MAPPING_TAB, + [TAB_STATS]: UIM_DETAIL_PANEL_STATS_TAB, + [TAB_EDIT_SETTINGS]: UIM_DETAIL_PANEL_EDIT_SETTINGS_TAB, + }; + + if (panelTypeToUiMetricMap[panelType]) { + uiMetricService.trackMetric(METRIC_TYPE.COUNT, panelTypeToUiMetricMap[panelType]); + } + + return { + panelType: panelType || state.panelType || TAB_SUMMARY, + indexName, + title, + }; + }, + [closeDetailPanel]() { + return {}; + }, + [loadIndexDataSuccess](state, action) { + const { data } = action.payload; + const newState = { + ...state, + data, + }; + return newState; + }, + [updateIndexSettingsError](state, action) { + const { error } = action.payload; + const newState = { + ...state, + error, + }; + return newState; + }, + [updateIndexSettingsSuccess]() { + return {}; + }, + }, + defaultState + ); diff --git a/x-pack/plugins/infra/common/locators/discover_logs_locator.ts b/x-pack/plugins/infra/common/locators/discover_logs_locator.ts new file mode 100644 index 0000000000000..292105678388f --- /dev/null +++ b/x-pack/plugins/infra/common/locators/discover_logs_locator.ts @@ -0,0 +1,27 @@ +/* + * 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. + */ + +import type { LocatorDefinition, LocatorPublic } from '@kbn/share-plugin/public'; +import type { LogsLocatorDependencies, LogsLocatorParams } from './logs_locator'; +import { LOGS_LOCATOR_ID } from './logs_locator'; + +export type DiscoverLogsLocator = LocatorPublic; + +export class DiscoverLogsLocatorDefinition implements LocatorDefinition { + public readonly id = LOGS_LOCATOR_ID; + + constructor(protected readonly deps: LogsLocatorDependencies) {} + + public readonly getLocation = async (params: LogsLocatorParams) => { + const { getLocationToDiscover } = await import('./helpers'); + + return getLocationToDiscover({ + core: this.deps.core, + ...params, + }); + }; +} diff --git a/x-pack/plugins/infra/common/locators/discover_node_logs_locator.ts b/x-pack/plugins/infra/common/locators/discover_node_logs_locator.ts new file mode 100644 index 0000000000000..43418747ab502 --- /dev/null +++ b/x-pack/plugins/infra/common/locators/discover_node_logs_locator.ts @@ -0,0 +1,32 @@ +/* + * 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. + */ + +import type { LocatorDefinition, LocatorPublic } from '@kbn/share-plugin/public'; +import type { NodeLogsLocatorDependencies, NodeLogsLocatorParams } from './node_logs_locator'; +import { NODE_LOGS_LOCATOR_ID } from './node_logs_locator'; + +export type DiscoverNodeLogsLocator = LocatorPublic; + +export class DiscoverNodeLogsLocatorDefinition implements LocatorDefinition { + public readonly id = NODE_LOGS_LOCATOR_ID; + + constructor(protected readonly deps: NodeLogsLocatorDependencies) {} + + public readonly getLocation = async (params: NodeLogsLocatorParams) => { + const { createNodeLogsQuery, getLocationToDiscover } = await import('./helpers'); + + const { timeRange, logView } = params; + const query = createNodeLogsQuery(params); + + return getLocationToDiscover({ + core: this.deps.core, + timeRange, + filter: query, + logView, + }); + }; +} diff --git a/x-pack/plugins/infra/public/apps/discover_app.tsx b/x-pack/plugins/infra/public/apps/discover_app.tsx new file mode 100644 index 0000000000000..2ea704fa9b21f --- /dev/null +++ b/x-pack/plugins/infra/public/apps/discover_app.tsx @@ -0,0 +1,30 @@ +/* + * 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. + */ +import { createKbnUrlStateStorage } from '@kbn/kibana-utils-plugin/public'; +import type { AppMountParameters, CoreStart } from '@kbn/core/public'; +import { getLogViewReferenceFromUrl } from '@kbn/logs-shared-plugin/public'; +import type { InfraClientStartExports } from '../types'; + +export const renderApp = ( + core: CoreStart, + pluginStart: InfraClientStartExports, + params: AppMountParameters +) => { + const toastsService = core.notifications.toasts; + + const urlStateStorage = createKbnUrlStateStorage({ + history: params.history, + useHash: false, + useHashQuery: false, + }); + + const logView = getLogViewReferenceFromUrl({ toastsService, urlStateStorage }); + + pluginStart.locators.logsLocator.navigate({ ...(logView ? { logView } : {}) }, { replace: true }); + + return () => true; +}; diff --git a/x-pack/plugins/observability_ai_assistant/README.md b/x-pack/plugins/observability_ai_assistant/README.md index 11e6d7d38d659..ab63ab708ed2b 100644 --- a/x-pack/plugins/observability_ai_assistant/README.md +++ b/x-pack/plugins/observability_ai_assistant/README.md @@ -6,7 +6,7 @@ This document gives an overview of the features of the Observability AI Assistan #### **1.1. Configuration** -Users can connect to an LLM using [connectors](https://www.elastic.co/guide/en/kibana/current/action-types.html) - specifically the [Generative AI connector](https://www.elastic.co/guide/en/kibana/current/gen-ai-action-type.html), which currently supports both OpenAI and Azure OpenAI as providers. The connector is Enterprise-only. Users can also leverage [preconfigured connectors](https://www.elastic.co/guide/en/kibana/current/pre-configured-connectors.html), in which case the following should be added to `kibana.yml`: +Users can connect to an LLM using [connectors](https://www.elastic.co/guide/en/kibana/current/action-types.html) - specifically the [OpenAI connector](https://www.elastic.co/guide/en/kibana/current/gen-ai-action-type.html), which currently supports both OpenAI and Azure OpenAI as providers. The connector is Enterprise-only. Users can also leverage [preconfigured connectors](https://www.elastic.co/guide/en/kibana/current/pre-configured-connectors.html), in which case the following should be added to `kibana.yml`: ```yaml xpack.actions.preconfigured: diff --git a/x-pack/plugins/observability_ai_assistant/public/components/chat/initial_setup_panel.tsx b/x-pack/plugins/observability_ai_assistant/public/components/chat/initial_setup_panel.tsx index 281cf46c972bb..b8c99bbfa7cd4 100644 --- a/x-pack/plugins/observability_ai_assistant/public/components/chat/initial_setup_panel.tsx +++ b/x-pack/plugins/observability_ai_assistant/public/components/chat/initial_setup_panel.tsx @@ -143,7 +143,7 @@ export function InitialSetupPanel({ {i18n.translate( 'xpack.observabilityAiAssistant.initialSetupPanel.setupConnector.description1', { - defaultMessage: 'Set up a Generative AI connector with your AI provider.', + defaultMessage: 'Set up an OpenAI connector with your AI provider.', } )}

    @@ -153,7 +153,7 @@ export function InitialSetupPanel({ 'xpack.observabilityAiAssistant.initialSetupPanel.setupConnector.description2', { defaultMessage: - 'The Generative AI model needs to support function calls. We strongly recommend using GPT4.', + 'The OpenAI model needs to support function calls. We strongly recommend using GPT4.', } )} diff --git a/x-pack/plugins/stack_connectors/common/gen_ai/constants.ts b/x-pack/plugins/stack_connectors/common/open_ai/constants.ts similarity index 96% rename from x-pack/plugins/stack_connectors/common/gen_ai/constants.ts rename to x-pack/plugins/stack_connectors/common/open_ai/constants.ts index 8c8dd84c4e326..850c07f422347 100644 --- a/x-pack/plugins/stack_connectors/common/gen_ai/constants.ts +++ b/x-pack/plugins/stack_connectors/common/open_ai/constants.ts @@ -13,7 +13,7 @@ export const OPEN_AI_TITLE = i18n.translate( defaultMessage: 'OpenAI', } ); -export const GEN_AI_CONNECTOR_ID = '.gen-ai'; +export const OPEN_AI_CONNECTOR_ID = '.gen-ai'; export enum SUB_ACTION { RUN = 'run', INVOKE_AI = 'invokeAI', diff --git a/x-pack/plugins/stack_connectors/common/gen_ai/schema.ts b/x-pack/plugins/stack_connectors/common/open_ai/schema.ts similarity index 100% rename from x-pack/plugins/stack_connectors/common/gen_ai/schema.ts rename to x-pack/plugins/stack_connectors/common/open_ai/schema.ts diff --git a/x-pack/plugins/stack_connectors/common/gen_ai/types.ts b/x-pack/plugins/stack_connectors/common/open_ai/types.ts similarity index 100% rename from x-pack/plugins/stack_connectors/common/gen_ai/types.ts rename to x-pack/plugins/stack_connectors/common/open_ai/types.ts diff --git a/x-pack/plugins/stack_connectors/public/common/index.ts b/x-pack/plugins/stack_connectors/public/common/index.ts index ec0ce2960114b..38199afb17e3d 100644 --- a/x-pack/plugins/stack_connectors/public/common/index.ts +++ b/x-pack/plugins/stack_connectors/public/common/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import GenAiLogo from '../connector_types/gen_ai/logo'; +import OpenAILogo from '../connector_types/open_ai/logo'; -export { GEN_AI_CONNECTOR_ID, OpenAiProviderType } from '../../common/gen_ai/constants'; -export { GenAiLogo }; +export { OPEN_AI_CONNECTOR_ID, OpenAiProviderType } from '../../common/open_ai/constants'; +export { OpenAILogo }; diff --git a/x-pack/plugins/stack_connectors/public/connector_types/d3security/d3security.tsx b/x-pack/plugins/stack_connectors/public/connector_types/d3security/d3security.tsx index 41df7d3aed16d..6fec59791c2d1 100644 --- a/x-pack/plugins/stack_connectors/public/connector_types/d3security/d3security.tsx +++ b/x-pack/plugins/stack_connectors/public/connector_types/d3security/d3security.tsx @@ -8,7 +8,7 @@ import { lazy } from 'react'; import { i18n } from '@kbn/i18n'; import { GenericValidationResult } from '@kbn/triggers-actions-ui-plugin/public/types'; -import { SUB_ACTION } from '../../../common/gen_ai/constants'; +import { SUB_ACTION } from '../../../common/open_ai/constants'; import { D3SecurityActionParams, D3SecurityConnector } from './types'; import { D3_SECURITY_CONNECTOR_ID } from '../../../common/d3security/constants'; interface ValidationErrors { diff --git a/x-pack/plugins/stack_connectors/public/connector_types/index.ts b/x-pack/plugins/stack_connectors/public/connector_types/index.ts index 20964012607f8..8df13f9623767 100644 --- a/x-pack/plugins/stack_connectors/public/connector_types/index.ts +++ b/x-pack/plugins/stack_connectors/public/connector_types/index.ts @@ -11,7 +11,7 @@ import { getCasesWebhookConnectorType } from './cases_webhook'; import { getEmailConnectorType } from './email'; import { getIndexConnectorType } from './es_index'; import { getJiraConnectorType } from './jira'; -import { getGenerativeAiConnectorType } from './gen_ai'; +import { getOpenAIConnectorType } from './open_ai'; import { getBedrockConnectorType } from './bedrock'; import { getOpsgenieConnectorType } from './opsgenie'; import { getPagerDutyConnectorType } from './pagerduty'; @@ -60,7 +60,7 @@ export function registerConnectorTypes({ connectorTypeRegistry.register(getJiraConnectorType()); connectorTypeRegistry.register(getResilientConnectorType()); connectorTypeRegistry.register(getOpsgenieConnectorType()); - connectorTypeRegistry.register(getGenerativeAiConnectorType()); + connectorTypeRegistry.register(getOpenAIConnectorType()); connectorTypeRegistry.register(getBedrockConnectorType()); connectorTypeRegistry.register(getTeamsConnectorType()); connectorTypeRegistry.register(getTorqConnectorType()); diff --git a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/api.test.ts b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/api.test.ts similarity index 94% rename from x-pack/plugins/stack_connectors/public/connector_types/gen_ai/api.test.ts rename to x-pack/plugins/stack_connectors/public/connector_types/open_ai/api.test.ts index cf1197c487cd9..4841f73e74b51 100644 --- a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/api.test.ts +++ b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/api.test.ts @@ -7,7 +7,7 @@ import { httpServiceMock } from '@kbn/core-http-browser-mocks'; import { getDashboard } from './api'; -import { SUB_ACTION } from '../../../common/gen_ai/constants'; +import { SUB_ACTION } from '../../../common/open_ai/constants'; const response = { available: true, }; diff --git a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/api.ts b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/api.ts similarity index 94% rename from x-pack/plugins/stack_connectors/public/connector_types/gen_ai/api.ts rename to x-pack/plugins/stack_connectors/public/connector_types/open_ai/api.ts index da35d608239b1..21f3dd435c506 100644 --- a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/api.ts +++ b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/api.ts @@ -7,7 +7,7 @@ import { HttpSetup } from '@kbn/core-http-browser'; import { ActionTypeExecutorResult, BASE_ACTION_API_PATH } from '@kbn/actions-plugin/common'; -import { SUB_ACTION } from '../../../common/gen_ai/constants'; +import { SUB_ACTION } from '../../../common/open_ai/constants'; import { ConnectorExecutorResult, rewriteResponseToCamelCase } from '../lib/rewrite_response_body'; export async function getDashboard({ diff --git a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/connector.test.tsx b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/connector.test.tsx similarity index 81% rename from x-pack/plugins/stack_connectors/public/connector_types/gen_ai/connector.test.tsx rename to x-pack/plugins/stack_connectors/public/connector_types/open_ai/connector.test.tsx index 5e561615f0bcf..ed7db46085402 100644 --- a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/connector.test.tsx +++ b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/connector.test.tsx @@ -6,11 +6,11 @@ */ import React from 'react'; -import GenerativeAiConnectorFields from './connector'; +import ConnectorFields from './connector'; import { ConnectorFormTestProvider } from '../lib/test_utils'; import { act, fireEvent, render, waitFor } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; -import { DEFAULT_OPENAI_MODEL, OpenAiProviderType } from '../../../common/gen_ai/constants'; +import { DEFAULT_OPENAI_MODEL, OpenAiProviderType } from '../../../common/open_ai/constants'; import { useKibana } from '@kbn/triggers-actions-ui-plugin/public'; import { useGetDashboard } from './use_get_dashboard'; @@ -21,7 +21,7 @@ const useKibanaMock = useKibana as jest.Mocked; const mockDashboard = useGetDashboard as jest.Mock; const openAiConnector = { actionTypeId: '.gen-ai', - name: 'genAi', + name: 'OpenAI', id: '123', config: { apiUrl: 'https://openaiurl.com', @@ -46,7 +46,7 @@ const azureConnector = { const navigateToUrl = jest.fn(); -describe('GenerativeAiConnectorFields renders', () => { +describe('ConnectorFields renders', () => { beforeEach(() => { jest.clearAllMocks(); useKibanaMock().services.application.navigateToUrl = navigateToUrl; @@ -57,11 +57,7 @@ describe('GenerativeAiConnectorFields renders', () => { test('open ai connector fields are rendered', async () => { const { getAllByTestId } = render( - {}} - /> + {}} /> ); expect(getAllByTestId('config.apiUrl-input')[0]).toBeInTheDocument(); @@ -77,11 +73,7 @@ describe('GenerativeAiConnectorFields renders', () => { test('azure ai connector fields are rendered', async () => { const { getAllByTestId } = render( - {}} - /> + {}} /> ); expect(getAllByTestId('config.apiUrl-input')[0]).toBeInTheDocument(); @@ -98,11 +90,7 @@ describe('GenerativeAiConnectorFields renders', () => { it('Does not render if isEdit is false and dashboardUrl is defined', async () => { const { queryByTestId } = render( - {}} - /> + {}} /> ); expect(queryByTestId('link-gen-ai-token-dashboard')).not.toBeInTheDocument(); @@ -113,11 +101,7 @@ describe('GenerativeAiConnectorFields renders', () => { })); const { queryByTestId } = render( - {}} - /> + {}} /> ); expect(queryByTestId('link-gen-ai-token-dashboard')).not.toBeInTheDocument(); @@ -125,11 +109,7 @@ describe('GenerativeAiConnectorFields renders', () => { it('Renders if isEdit is true and dashboardUrl is defined', async () => { const { getByTestId } = render( - {}} - /> + {}} /> ); expect(getByTestId('link-gen-ai-token-dashboard')).toBeInTheDocument(); @@ -137,11 +117,7 @@ describe('GenerativeAiConnectorFields renders', () => { it('On click triggers redirect with correct saved object id', async () => { const { getByTestId } = render( - {}} - /> + {}} /> ); fireEvent.click(getByTestId('link-gen-ai-token-dashboard')); @@ -158,11 +134,7 @@ describe('GenerativeAiConnectorFields renders', () => { it('connector validation succeeds when connector config is valid', async () => { const { getByTestId } = render( - {}} - /> + {}} /> ); @@ -191,11 +163,7 @@ describe('GenerativeAiConnectorFields renders', () => { const res = render( - {}} - /> + {}} /> ); @@ -224,11 +192,7 @@ describe('GenerativeAiConnectorFields renders', () => { const res = render( - {}} - /> + {}} /> ); diff --git a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/connector.tsx b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/connector.tsx similarity index 93% rename from x-pack/plugins/stack_connectors/public/connector_types/gen_ai/connector.tsx rename to x-pack/plugins/stack_connectors/public/connector_types/open_ai/connector.tsx index 99b8bb701e60e..681842893a0eb 100644 --- a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/connector.tsx +++ b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/connector.tsx @@ -19,8 +19,8 @@ import { } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; import { useKibana } from '@kbn/triggers-actions-ui-plugin/public'; import { fieldValidators } from '@kbn/es-ui-shared-plugin/static/forms/helpers'; +import { OpenAiProviderType } from '../../../common/open_ai/constants'; import { useGetDashboard } from './use_get_dashboard'; -import { OpenAiProviderType } from '../../../common/gen_ai/constants'; import * as i18n from './translations'; import { azureAiConfig, @@ -31,10 +31,7 @@ import { } from './constants'; const { emptyField } = fieldValidators; -const GenerativeAiConnectorFields: React.FC = ({ - readOnly, - isEdit, -}) => { +const ConnectorFields: React.FC = ({ readOnly, isEdit }) => { const { getFieldDefaultValue } = useFormContext(); const [{ config, id, name }] = useFormData({ watch: ['config.apiProvider'], @@ -117,4 +114,4 @@ const GenerativeAiConnectorFields: React.FC = ({ }; // eslint-disable-next-line import/no-default-export -export { GenerativeAiConnectorFields as default }; +export { ConnectorFields as default }; diff --git a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/constants.tsx b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/constants.tsx similarity index 99% rename from x-pack/plugins/stack_connectors/public/connector_types/gen_ai/constants.tsx rename to x-pack/plugins/stack_connectors/public/connector_types/open_ai/constants.tsx index ab7f18e2be00f..31284d6bc273e 100644 --- a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/constants.tsx +++ b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/constants.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { ConfigFieldSchema, SecretsFieldSchema } from '@kbn/triggers-actions-ui-plugin/public'; import { FormattedMessage } from '@kbn/i18n-react'; import { EuiLink } from '@elastic/eui'; -import { DEFAULT_OPENAI_MODEL, OpenAiProviderType } from '../../../common/gen_ai/constants'; +import { DEFAULT_OPENAI_MODEL, OpenAiProviderType } from '../../../common/open_ai/constants'; import * as i18n from './translations'; export const DEFAULT_URL = 'https://api.openai.com/v1/chat/completions' as const; diff --git a/x-pack/plugins/stack_connectors/public/connector_types/open_ai/index.ts b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/index.ts new file mode 100644 index 0000000000000..57b71ca882084 --- /dev/null +++ b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/index.ts @@ -0,0 +1,8 @@ +/* + * 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. + */ + +export { getConnectorType as getOpenAIConnectorType } from './open_ai'; diff --git a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/logo.tsx b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/logo.tsx similarity index 100% rename from x-pack/plugins/stack_connectors/public/connector_types/gen_ai/logo.tsx rename to x-pack/plugins/stack_connectors/public/connector_types/open_ai/logo.tsx diff --git a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/gen_ai.test.tsx b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/open_ai.test.tsx similarity index 94% rename from x-pack/plugins/stack_connectors/public/connector_types/gen_ai/gen_ai.test.tsx rename to x-pack/plugins/stack_connectors/public/connector_types/open_ai/open_ai.test.tsx index 3bed686dca025..edb7e2a319b1a 100644 --- a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/gen_ai.test.tsx +++ b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/open_ai.test.tsx @@ -9,7 +9,7 @@ import { TypeRegistry } from '@kbn/triggers-actions-ui-plugin/public/application import { registerConnectorTypes } from '..'; import type { ActionTypeModel } from '@kbn/triggers-actions-ui-plugin/public/types'; import { registrationServicesMock } from '../../mocks'; -import { SUB_ACTION } from '../../../common/gen_ai/constants'; +import { SUB_ACTION } from '../../../common/open_ai/constants'; const ACTION_TYPE_ID = '.gen-ai'; let actionTypeModel: ActionTypeModel; @@ -26,12 +26,12 @@ beforeAll(() => { describe('actionTypeRegistry.get() works', () => { test('connector type static data is as expected', () => { expect(actionTypeModel.id).toEqual(ACTION_TYPE_ID); - expect(actionTypeModel.selectMessage).toBe('Send a request to generative AI systems.'); + expect(actionTypeModel.selectMessage).toBe('Send a request to OpenAI systems.'); expect(actionTypeModel.actionTypeTitle).toBe('OpenAI'); }); }); -describe('gen ai action params validation', () => { +describe('OpenAI action params validation', () => { test('action params validation succeeds when action params is valid', async () => { const actionParams = { subAction: SUB_ACTION.RUN, diff --git a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/gen_ai.tsx b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/open_ai.tsx similarity index 81% rename from x-pack/plugins/stack_connectors/public/connector_types/gen_ai/gen_ai.tsx rename to x-pack/plugins/stack_connectors/public/connector_types/open_ai/open_ai.tsx index 7a4c798763c46..f0164645c1b2d 100644 --- a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/gen_ai.tsx +++ b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/open_ai.tsx @@ -8,24 +8,24 @@ import { lazy } from 'react'; import { i18n } from '@kbn/i18n'; import type { GenericValidationResult } from '@kbn/triggers-actions-ui-plugin/public/types'; -import { SUB_ACTION } from '../../../common/gen_ai/constants'; -import { GEN_AI_CONNECTOR_ID, OPEN_AI_TITLE } from '../../../common/gen_ai/constants'; -import { GenerativeAiActionParams, GenerativeAiConnector } from './types'; +import { SUB_ACTION } from '../../../common/open_ai/constants'; +import { OPEN_AI_CONNECTOR_ID, OPEN_AI_TITLE } from '../../../common/open_ai/constants'; +import { ActionParams, OpenAIConnector } from './types'; interface ValidationErrors { subAction: string[]; body: string[]; } -export function getConnectorType(): GenerativeAiConnector { +export function getConnectorType(): OpenAIConnector { return { - id: GEN_AI_CONNECTOR_ID, + id: OPEN_AI_CONNECTOR_ID, iconClass: lazy(() => import('./logo')), selectMessage: i18n.translate('xpack.stackConnectors.components.genAi.selectMessageText', { - defaultMessage: 'Send a request to generative AI systems.', + defaultMessage: 'Send a request to OpenAI systems.', }), actionTypeTitle: OPEN_AI_TITLE, validateParams: async ( - actionParams: GenerativeAiActionParams + actionParams: ActionParams ): Promise> => { const { subAction, subActionParams } = actionParams; const translations = await import('./translations'); diff --git a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/params.test.tsx b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/params.test.tsx similarity index 94% rename from x-pack/plugins/stack_connectors/public/connector_types/gen_ai/params.test.tsx rename to x-pack/plugins/stack_connectors/public/connector_types/open_ai/params.test.tsx index ef418bd16965d..97ed648e0bbd2 100644 --- a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/params.test.tsx +++ b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/params.test.tsx @@ -7,9 +7,9 @@ import React from 'react'; import { fireEvent, render } from '@testing-library/react'; -import GenerativeAiParamsFields from './params'; +import ParamsFields from './params'; import { MockCodeEditor } from '@kbn/triggers-actions-ui-plugin/public/application/code_editor.mock'; -import { OpenAiProviderType, SUB_ACTION } from '../../../common/gen_ai/constants'; +import { OpenAiProviderType, SUB_ACTION } from '../../../common/open_ai/constants'; import { DEFAULT_BODY, DEFAULT_BODY_AZURE, DEFAULT_URL } from './constants'; const kibanaReactPath = '../../../../../../src/plugins/kibana_react/public'; @@ -34,7 +34,7 @@ const messageVariables = [ describe('Gen AI Params Fields renders', () => { test('all params fields are rendered', () => { const { getByTestId } = render( - { isPreconfigured: false, isSystemAction: false as const, isDeprecated: false, - name: 'My GenAI Connector', + name: 'My OpenAI Connector', config: { apiProvider, apiUrl: DEFAULT_URL, }, }; render( - { const editAction = jest.fn(); const errors = {}; render( - { const editAction = jest.fn(); const errors = {}; const { getByTestId } = render( - -> = ({ +const ParamsFields: React.FunctionComponent> = ({ actionConnector, actionParams, editAction, @@ -55,7 +53,7 @@ const GenerativeAiParamsFields: React.FunctionComponent< }, [typedActionConnector?.config?.apiProvider, editAction, index, subActionParams]); const editSubActionParams = useCallback( - (params: GenerativeAiActionParams['subActionParams']) => { + (params: ActionParams['subActionParams']) => { editAction('subActionParams', { ...subActionParams, ...params }, index); }, [editAction, index, subActionParams] @@ -87,4 +85,4 @@ const GenerativeAiParamsFields: React.FunctionComponent< }; // eslint-disable-next-line import/no-default-export -export { GenerativeAiParamsFields as default }; +export { ParamsFields as default }; diff --git a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/translations.ts b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/translations.ts similarity index 97% rename from x-pack/plugins/stack_connectors/public/connector_types/gen_ai/translations.ts rename to x-pack/plugins/stack_connectors/public/connector_types/open_ai/translations.ts index ef6ccd07d386b..6d439d95a1183 100644 --- a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/translations.ts +++ b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/translations.ts @@ -104,6 +104,6 @@ export const USAGE_DASHBOARD_LINK = (apiProvider: string, connectorName: string) export const GET_DASHBOARD_API_ERROR = i18n.translate( 'xpack.stackConnectors.components.genAi.error.dashboardApiError', { - defaultMessage: 'Error finding Generative AI Token Usage Dashboard.', + defaultMessage: 'Error finding OpenAI Token Usage Dashboard.', } ); diff --git a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/types.ts b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/types.ts similarity index 65% rename from x-pack/plugins/stack_connectors/public/connector_types/gen_ai/types.ts rename to x-pack/plugins/stack_connectors/public/connector_types/open_ai/types.ts index ddb0f8e871b19..9ddc9c662d94f 100644 --- a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/types.ts +++ b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/types.ts @@ -7,29 +7,22 @@ import { ActionTypeModel as ConnectorTypeModel } from '@kbn/triggers-actions-ui-plugin/public'; import { UserConfiguredActionConnector } from '@kbn/triggers-actions-ui-plugin/public/types'; -import { OpenAiProviderType, SUB_ACTION } from '../../../common/gen_ai/constants'; -import { RunActionParams } from '../../../common/gen_ai/types'; +import { OpenAiProviderType, SUB_ACTION } from '../../../common/open_ai/constants'; +import { RunActionParams } from '../../../common/open_ai/types'; -export interface GenerativeAiActionParams { +export interface ActionParams { subAction: SUB_ACTION.RUN | SUB_ACTION.TEST; subActionParams: RunActionParams; } -export interface GenerativeAiConfig { +export interface Config { apiProvider: OpenAiProviderType; apiUrl: string; } -export interface GenerativeAiSecrets { +export interface Secrets { apiKey: string; } -export type GenerativeAiConnector = ConnectorTypeModel< - GenerativeAiConfig, - GenerativeAiSecrets, - GenerativeAiActionParams ->; -export type GenerativeAiActionConnector = UserConfiguredActionConnector< - GenerativeAiConfig, - GenerativeAiSecrets ->; +export type OpenAIConnector = ConnectorTypeModel; +export type GenerativeAiActionConnector = UserConfiguredActionConnector; diff --git a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/use_get_dashboard.test.ts b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/use_get_dashboard.test.ts similarity index 98% rename from x-pack/plugins/stack_connectors/public/connector_types/gen_ai/use_get_dashboard.test.ts rename to x-pack/plugins/stack_connectors/public/connector_types/open_ai/use_get_dashboard.test.ts index 255e2aba1b000..8e78c522712bd 100644 --- a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/use_get_dashboard.test.ts +++ b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/use_get_dashboard.test.ts @@ -123,7 +123,7 @@ describe('useGetDashboard_function', () => { await waitForNextUpdate(); expect(result.current.isLoading).toBe(false); expect(mockToasts.addDanger).toHaveBeenCalledWith({ - title: 'Error finding Generative AI Token Usage Dashboard.', + title: 'Error finding OpenAI Token Usage Dashboard.', text: 'Error fetching dashboard', }); }); diff --git a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/use_get_dashboard.ts b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/use_get_dashboard.ts similarity index 100% rename from x-pack/plugins/stack_connectors/public/connector_types/gen_ai/use_get_dashboard.ts rename to x-pack/plugins/stack_connectors/public/connector_types/open_ai/use_get_dashboard.ts diff --git a/x-pack/plugins/stack_connectors/server/connector_types/bedrock/index.ts b/x-pack/plugins/stack_connectors/server/connector_types/bedrock/index.ts index 661771f6df124..11050628203a9 100644 --- a/x-pack/plugins/stack_connectors/server/connector_types/bedrock/index.ts +++ b/x-pack/plugins/stack_connectors/server/connector_types/bedrock/index.ts @@ -10,7 +10,7 @@ import { SubActionConnectorType, ValidatorType, } from '@kbn/actions-plugin/server/sub_action_framework/types'; -import { GeneralConnectorFeatureId } from '@kbn/actions-plugin/common'; +import { GenerativeAIConnectorFeatureId } from '@kbn/actions-plugin/common'; import { urlAllowListValidator } from '@kbn/actions-plugin/server'; import { ValidatorServices } from '@kbn/actions-plugin/server/types'; import { assertURL } from '@kbn/actions-plugin/server/sub_action_framework/helpers/validators'; @@ -29,7 +29,7 @@ export const getConnectorType = (): SubActionConnectorType => ( secrets: SecretsSchema, }, validators: [{ type: ValidatorType.CONFIG, validator: configValidator }], - supportedFeatureIds: [GeneralConnectorFeatureId], + supportedFeatureIds: [GenerativeAIConnectorFeatureId], minimumLicenseRequired: 'enterprise' as const, renderParameterTemplates, }); diff --git a/x-pack/plugins/stack_connectors/server/connector_types/index.ts b/x-pack/plugins/stack_connectors/server/connector_types/index.ts index 743f2664ed0b5..ba95be41cdd2c 100644 --- a/x-pack/plugins/stack_connectors/server/connector_types/index.ts +++ b/x-pack/plugins/stack_connectors/server/connector_types/index.ts @@ -17,7 +17,7 @@ import { getTinesConnectorType } from './tines'; import { getActionType as getTorqConnectorType } from './torq'; import { getConnectorType as getEmailConnectorType } from './email'; import { getConnectorType as getIndexConnectorType } from './es_index'; -import { getConnectorType as getGenerativeAiConnectorType } from './gen_ai'; +import { getConnectorType as getOpenAIConnectorType } from './open_ai'; import { getConnectorType as getBedrockConnectorType } from './bedrock'; import { getConnectorType as getPagerDutyConnectorType } from './pagerduty'; import { getConnectorType as getSwimlaneConnectorType } from './swimlane'; @@ -101,7 +101,7 @@ export function registerConnectorTypes({ actions.registerSubActionConnectorType(getOpsgenieConnectorType()); actions.registerSubActionConnectorType(getTinesConnectorType()); - actions.registerSubActionConnectorType(getGenerativeAiConnectorType()); + actions.registerSubActionConnectorType(getOpenAIConnectorType()); actions.registerSubActionConnectorType(getBedrockConnectorType()); actions.registerSubActionConnectorType(getD3SecurityConnectorType()); } diff --git a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/create_dashboard.test.ts b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/create_dashboard.test.ts similarity index 100% rename from x-pack/plugins/stack_connectors/server/connector_types/gen_ai/create_dashboard.test.ts rename to x-pack/plugins/stack_connectors/server/connector_types/open_ai/create_dashboard.test.ts diff --git a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/create_dashboard.ts b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/create_dashboard.ts similarity index 100% rename from x-pack/plugins/stack_connectors/server/connector_types/gen_ai/create_dashboard.ts rename to x-pack/plugins/stack_connectors/server/connector_types/open_ai/create_dashboard.ts diff --git a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/dashboard.ts b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/dashboard.ts similarity index 97% rename from x-pack/plugins/stack_connectors/server/connector_types/gen_ai/dashboard.ts rename to x-pack/plugins/stack_connectors/server/connector_types/open_ai/dashboard.ts index 6470f088577b7..c430f369be57b 100644 --- a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/dashboard.ts +++ b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/dashboard.ts @@ -9,7 +9,7 @@ import { DashboardAttributes } from '@kbn/dashboard-plugin/common'; import { v4 as uuidv4 } from 'uuid'; import { SavedObject } from '@kbn/core-saved-objects-common/src/server_types'; -export const dashboardTitle = `Generative AI Token Usage`; +export const dashboardTitle = `OpenAI Token Usage`; export const getDashboard = (dashboardId: string): SavedObject => { const ids: Record = { @@ -125,7 +125,7 @@ export const getDashboard = (dashboardId: string): SavedObject { @@ -30,12 +30,12 @@ axios.create = jest.fn(() => axios); let connectorType: SubActionConnectorType; let configurationUtilities: jest.Mocked; -describe('Generative AI Connector', () => { +describe('OpenAI Connector', () => { beforeEach(() => { configurationUtilities = actionsConfigMock.create(); connectorType = getConnectorType(); }); - test('exposes the connector as `Generative AI` with id `.gen-ai`', () => { + test('exposes the connector as `OpenAI` with id `.gen-ai`', () => { expect(connectorType.id).toEqual('.gen-ai'); expect(connectorType.name).toEqual('OpenAI'); }); @@ -59,7 +59,7 @@ describe('Generative AI Connector', () => { expect(() => { configValidator(config, { configurationUtilities }); }).toThrowErrorMatchingInlineSnapshot( - '"Error configuring Generative AI action: Error: URL Error: Invalid URL: example.com/do-something"' + '"Error configuring OpenAI action: Error: URL Error: Invalid URL: example.com/do-something"' ); }); @@ -72,7 +72,7 @@ describe('Generative AI Connector', () => { expect(() => { configValidator(config, { configurationUtilities }); }).toThrowErrorMatchingInlineSnapshot( - '"Error configuring Generative AI action: Error: API Provider is not supported"' + '"Error configuring OpenAI action: Error: API Provider is not supported"' ); }); @@ -85,7 +85,7 @@ describe('Generative AI Connector', () => { expect(() => { configValidator(config, { configurationUtilities }); }).toThrowErrorMatchingInlineSnapshot( - '"Error configuring Generative AI action: Error: API Provider is not supported: bad-one"' + '"Error configuring OpenAI action: Error: API Provider is not supported: bad-one"' ); }); @@ -106,7 +106,7 @@ describe('Generative AI Connector', () => { expect(() => { configValidator(config, { configurationUtilities: configUtils }); }).toThrowErrorMatchingInlineSnapshot( - `"Error configuring Generative AI action: Error: error validating url: target url is not present in allowedHosts"` + `"Error configuring OpenAI action: Error: error validating url: target url is not present in allowedHosts"` ); }); }); diff --git a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/index.ts b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/index.ts similarity index 78% rename from x-pack/plugins/stack_connectors/server/connector_types/gen_ai/index.ts rename to x-pack/plugins/stack_connectors/server/connector_types/open_ai/index.ts index cc43a05fd346d..75dace0da60ec 100644 --- a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/index.ts +++ b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/index.ts @@ -10,30 +10,30 @@ import { SubActionConnectorType, ValidatorType, } from '@kbn/actions-plugin/server/sub_action_framework/types'; -import { GeneralConnectorFeatureId } from '@kbn/actions-plugin/common'; +import { GenerativeAIConnectorFeatureId } from '@kbn/actions-plugin/common'; import { urlAllowListValidator } from '@kbn/actions-plugin/server'; import { ValidatorServices } from '@kbn/actions-plugin/server/types'; import { assertURL } from '@kbn/actions-plugin/server/sub_action_framework/helpers/validators'; import { - GEN_AI_CONNECTOR_ID, + OPEN_AI_CONNECTOR_ID, OPEN_AI_TITLE, OpenAiProviderType, -} from '../../../common/gen_ai/constants'; -import { ConfigSchema, SecretsSchema } from '../../../common/gen_ai/schema'; -import { Config, Secrets } from '../../../common/gen_ai/types'; -import { GenAiConnector } from './gen_ai'; +} from '../../../common/open_ai/constants'; +import { ConfigSchema, SecretsSchema } from '../../../common/open_ai/schema'; +import { Config, Secrets } from '../../../common/open_ai/types'; +import { OpenAIConnector } from './open_ai'; import { renderParameterTemplates } from './render'; export const getConnectorType = (): SubActionConnectorType => ({ - id: GEN_AI_CONNECTOR_ID, + id: OPEN_AI_CONNECTOR_ID, name: OPEN_AI_TITLE, - Service: GenAiConnector, + Service: OpenAIConnector, schema: { config: ConfigSchema, secrets: SecretsSchema, }, validators: [{ type: ValidatorType.CONFIG, validator: configValidator }], - supportedFeatureIds: [GeneralConnectorFeatureId], + supportedFeatureIds: [GenerativeAIConnectorFeatureId], minimumLicenseRequired: 'enterprise' as const, renderParameterTemplates, }); @@ -57,7 +57,7 @@ export const configValidator = (configObject: Config, validatorServices: Validat } catch (err) { throw new Error( i18n.translate('xpack.stackConnectors.genAi.configurationErrorApiProvider', { - defaultMessage: 'Error configuring Generative AI action: {err}', + defaultMessage: 'Error configuring OpenAI action: {err}', values: { err, }, diff --git a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/azure_openai_utils.test.ts b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/azure_openai_utils.test.ts similarity index 99% rename from x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/azure_openai_utils.test.ts rename to x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/azure_openai_utils.test.ts index 7e064fcd6fc1e..1d2d24e3bc3a4 100644 --- a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/azure_openai_utils.test.ts +++ b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/azure_openai_utils.test.ts @@ -14,7 +14,7 @@ import { AZURE_OPENAI_CHAT_URL, AZURE_OPENAI_COMPLETIONS_URL, AZURE_OPENAI_COMPLETIONS_EXTENSIONS_URL, -} from '../../../../common/gen_ai/constants'; +} from '../../../../common/open_ai/constants'; describe('Azure Open AI Utils', () => { const chatUrl = diff --git a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/azure_openai_utils.ts b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/azure_openai_utils.ts similarity index 97% rename from x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/azure_openai_utils.ts rename to x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/azure_openai_utils.ts index f892fdbfff093..7c15a57e48a4f 100644 --- a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/azure_openai_utils.ts +++ b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/azure_openai_utils.ts @@ -9,7 +9,7 @@ import { AZURE_OPENAI_CHAT_URL, AZURE_OPENAI_COMPLETIONS_URL, AZURE_OPENAI_COMPLETIONS_EXTENSIONS_URL, -} from '../../../../common/gen_ai/constants'; +} from '../../../../common/open_ai/constants'; const APIS_ALLOWING_STREAMING = new Set([ AZURE_OPENAI_CHAT_URL, diff --git a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/openai_utils.test.ts b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/openai_utils.test.ts similarity index 99% rename from x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/openai_utils.test.ts rename to x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/openai_utils.test.ts index 17e9b2365ae9f..4e85ddaff6dbd 100644 --- a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/openai_utils.test.ts +++ b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/openai_utils.test.ts @@ -10,7 +10,7 @@ import { DEFAULT_OPENAI_MODEL, OPENAI_CHAT_URL, OPENAI_LEGACY_COMPLETION_URL, -} from '../../../../common/gen_ai/constants'; +} from '../../../../common/open_ai/constants'; describe('Open AI Utils', () => { describe('sanitizeRequest', () => { diff --git a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/openai_utils.ts b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/openai_utils.ts similarity index 93% rename from x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/openai_utils.ts rename to x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/openai_utils.ts index aacae0d7bc0c6..427424a31b590 100644 --- a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/openai_utils.ts +++ b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/openai_utils.ts @@ -5,7 +5,10 @@ * 2.0. */ -import { OPENAI_CHAT_URL, OPENAI_LEGACY_COMPLETION_URL } from '../../../../common/gen_ai/constants'; +import { + OPENAI_CHAT_URL, + OPENAI_LEGACY_COMPLETION_URL, +} from '../../../../common/open_ai/constants'; const APIS_ALLOWING_STREAMING = new Set([OPENAI_CHAT_URL, OPENAI_LEGACY_COMPLETION_URL]); diff --git a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/utils.test.ts b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/utils.test.ts similarity index 99% rename from x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/utils.test.ts rename to x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/utils.test.ts index c50b513661ba3..643ef57a3ae1f 100644 --- a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/utils.test.ts +++ b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/utils.test.ts @@ -10,7 +10,7 @@ import { DEFAULT_OPENAI_MODEL, OpenAiProviderType, OPENAI_CHAT_URL, -} from '../../../../common/gen_ai/constants'; +} from '../../../../common/open_ai/constants'; import { sanitizeRequest as openAiSanitizeRequest, getRequestWithStreamOption as openAiGetRequestWithStreamOption, diff --git a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/utils.ts b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/utils.ts similarity index 97% rename from x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/utils.ts rename to x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/utils.ts index d51f85c7aa514..41baedc4559c9 100644 --- a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/utils.ts +++ b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/utils.ts @@ -7,7 +7,7 @@ import { AxiosResponse, ResponseType } from 'axios'; import { IncomingMessage } from 'http'; -import { OpenAiProviderType } from '../../../../common/gen_ai/constants'; +import { OpenAiProviderType } from '../../../../common/open_ai/constants'; import { sanitizeRequest as openAiSanitizeRequest, getRequestWithStreamOption as openAiGetRequestWithStreamOption, diff --git a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/gen_ai.test.ts b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/open_ai.test.ts similarity index 97% rename from x-pack/plugins/stack_connectors/server/connector_types/gen_ai/gen_ai.test.ts rename to x-pack/plugins/stack_connectors/server/connector_types/open_ai/open_ai.test.ts index 650ff4dd5cdc3..980423fd7c194 100644 --- a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/gen_ai.test.ts +++ b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/open_ai.test.ts @@ -5,20 +5,20 @@ * 2.0. */ -import { GenAiConnector } from './gen_ai'; +import { OpenAIConnector } from './open_ai'; import { actionsConfigMock } from '@kbn/actions-plugin/server/actions_config.mock'; import { DEFAULT_OPENAI_MODEL, - GEN_AI_CONNECTOR_ID, + OPEN_AI_CONNECTOR_ID, OpenAiProviderType, -} from '../../../common/gen_ai/constants'; +} from '../../../common/open_ai/constants'; import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; import { actionsMock } from '@kbn/actions-plugin/server/mocks'; -import { RunActionResponseSchema, StreamingResponseSchema } from '../../../common/gen_ai/schema'; +import { RunActionResponseSchema, StreamingResponseSchema } from '../../../common/open_ai/schema'; import { initDashboard } from './create_dashboard'; jest.mock('./create_dashboard'); -describe('GenAiConnector', () => { +describe('OpenAIConnector', () => { let mockRequest: jest.Mock; let mockError: jest.Mock; const mockResponseString = 'Hello! How can I assist you today?'; @@ -46,9 +46,9 @@ describe('GenAiConnector', () => { }); describe('OpenAI', () => { - const connector = new GenAiConnector({ + const connector = new OpenAIConnector({ configurationUtilities: actionsConfigMock.create(), - connector: { id: '1', type: GEN_AI_CONNECTOR_ID }, + connector: { id: '1', type: OPEN_AI_CONNECTOR_ID }, config: { apiUrl: 'https://api.openai.com/v1/chat/completions', apiProvider: OpenAiProviderType.OpenAi, @@ -285,9 +285,9 @@ describe('GenAiConnector', () => { }); describe('AzureAI', () => { - const connector = new GenAiConnector({ + const connector = new OpenAIConnector({ configurationUtilities: actionsConfigMock.create(), - connector: { id: '1', type: GEN_AI_CONNECTOR_ID }, + connector: { id: '1', type: OPEN_AI_CONNECTOR_ID }, config: { apiUrl: 'https://My-test-resource-123.openai.azure.com/openai/deployments/NEW-DEPLOYMENT-321/chat/completions?api-version=2023-05-15', @@ -455,9 +455,9 @@ describe('GenAiConnector', () => { }); describe('Token dashboard', () => { - const connector = new GenAiConnector({ + const connector = new OpenAIConnector({ configurationUtilities: actionsConfigMock.create(), - connector: { id: '1', type: GEN_AI_CONNECTOR_ID }, + connector: { id: '1', type: OPEN_AI_CONNECTOR_ID }, config: { apiUrl: 'https://example.com/api', apiProvider: OpenAiProviderType.AzureAi }, secrets: { apiKey: '123' }, logger: loggingSystemMock.createLogger(), diff --git a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/gen_ai.ts b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/open_ai.ts similarity index 95% rename from x-pack/plugins/stack_connectors/server/connector_types/gen_ai/gen_ai.ts rename to x-pack/plugins/stack_connectors/server/connector_types/open_ai/open_ai.ts index 4a0efbe11d472..102c3d4543a63 100644 --- a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/gen_ai.ts +++ b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/open_ai.ts @@ -7,7 +7,6 @@ import { ServiceParams, SubActionConnector } from '@kbn/actions-plugin/server'; import type { AxiosError } from 'axios'; -import { initDashboard } from './create_dashboard'; import { RunActionParamsSchema, RunActionResponseSchema, @@ -15,21 +14,22 @@ import { StreamActionParamsSchema, StreamingResponseSchema, InvokeAIActionParamsSchema, -} from '../../../common/gen_ai/schema'; +} from '../../../common/open_ai/schema'; import type { Config, Secrets, RunActionParams, RunActionResponse, StreamActionParams, -} from '../../../common/gen_ai/types'; -import { SUB_ACTION } from '../../../common/gen_ai/constants'; +} from '../../../common/open_ai/types'; +import { SUB_ACTION } from '../../../common/open_ai/constants'; import { DashboardActionParams, DashboardActionResponse, InvokeAIActionParams, InvokeAIActionResponse, -} from '../../../common/gen_ai/types'; +} from '../../../common/open_ai/types'; +import { initDashboard } from './create_dashboard'; import { getAxiosOptions, getRequestWithStreamOption, @@ -37,7 +37,7 @@ import { sanitizeRequest, } from './lib/utils'; -export class GenAiConnector extends SubActionConnector { +export class OpenAIConnector extends SubActionConnector { private url; private provider; private key; diff --git a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/render.test.ts b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/render.test.ts similarity index 96% rename from x-pack/plugins/stack_connectors/server/connector_types/gen_ai/render.test.ts rename to x-pack/plugins/stack_connectors/server/connector_types/open_ai/render.test.ts index 301e096ad35bb..b9fff0362913c 100644 --- a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/render.test.ts +++ b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/render.test.ts @@ -17,7 +17,7 @@ const params = { const variables = { domain: 'm0zepcuuu2' }; -describe('GenAI - renderParameterTemplates', () => { +describe('OpenAI - renderParameterTemplates', () => { it('should not render body on test action', () => { const testParams = { subAction: 'test', subActionParams: { body: 'test_json' } }; const result = renderParameterTemplates(testParams, variables); diff --git a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/render.ts b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/render.ts similarity index 93% rename from x-pack/plugins/stack_connectors/server/connector_types/gen_ai/render.ts rename to x-pack/plugins/stack_connectors/server/connector_types/open_ai/render.ts index aae342a5acd8f..883e731a65729 100644 --- a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/render.ts +++ b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/render.ts @@ -8,7 +8,7 @@ import { ExecutorParams } from '@kbn/actions-plugin/server/sub_action_framework/types'; import { renderMustacheString } from '@kbn/actions-plugin/server/lib/mustache_renderer'; import { RenderParameterTemplates } from '@kbn/actions-plugin/server/types'; -import { SUB_ACTION } from '../../../common/gen_ai/constants'; +import { SUB_ACTION } from '../../../common/open_ai/constants'; export const renderParameterTemplates: RenderParameterTemplates = ( params, diff --git a/x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/gen_ai_simulation.ts b/x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/open_ai_simulation.ts similarity index 91% rename from x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/gen_ai_simulation.ts rename to x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/open_ai_simulation.ts index b10c5b6aa5f7c..3ab2c3b0dd54e 100644 --- a/x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/gen_ai_simulation.ts +++ b/x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/open_ai_simulation.ts @@ -9,7 +9,7 @@ import http from 'http'; import { ProxyArgs, Simulator } from './simulator'; -export class GenAiSimulator extends Simulator { +export class OpenAISimulator extends Simulator { private readonly returnError: boolean; constructor({ returnError = false, proxy }: { returnError?: boolean; proxy?: ProxyArgs }) { @@ -24,10 +24,10 @@ export class GenAiSimulator extends Simulator { data: Record ) { if (this.returnError) { - return GenAiSimulator.sendErrorResponse(response); + return OpenAISimulator.sendErrorResponse(response); } - return GenAiSimulator.sendResponse(response); + return OpenAISimulator.sendResponse(response); } private static sendResponse(response: http.ServerResponse) { diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/gen_ai.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/open_ai.ts similarity index 96% rename from x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/gen_ai.ts rename to x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/open_ai.ts index 5cfe992171dac..2166ac5627cd2 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/gen_ai.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/open_ai.ts @@ -8,9 +8,9 @@ import expect from '@kbn/expect'; import { - GenAiSimulator, + OpenAISimulator, genAiSuccessResponse, -} from '@kbn/actions-simulators-plugin/server/gen_ai_simulation'; +} from '@kbn/actions-simulators-plugin/server/open_ai_simulation'; import { FtrProviderContext } from '../../../../../common/ftr_provider_context'; import { getUrlPrefix, ObjectRemover } from '../../../../../common/lib'; @@ -51,7 +51,7 @@ export default function genAiTest({ getService }: FtrProviderContext) { objectRemover.removeAll(); }); describe('action creation', () => { - const simulator = new GenAiSimulator({ + const simulator = new OpenAISimulator({ returnError: false, proxy: { config: configService.get('kbnTestServer.serverArgs'), @@ -189,7 +189,7 @@ export default function genAiTest({ getService }: FtrProviderContext) { statusCode: 400, error: 'Bad Request', message: - 'error validating action type config: Error configuring Generative AI action: Error: error validating url: target url "http://genAi.mynonexistent.com" is not added to the Kibana config xpack.actions.allowedHosts', + 'error validating action type config: Error configuring OpenAI action: Error: error validating url: target url "http://genAi.mynonexistent.com" is not added to the Kibana config xpack.actions.allowedHosts', }); }); }); @@ -217,7 +217,7 @@ export default function genAiTest({ getService }: FtrProviderContext) { describe('executor', () => { describe('validation', () => { - const simulator = new GenAiSimulator({ + const simulator = new OpenAISimulator({ proxy: { config: configService.get('kbnTestServer.serverArgs'), }, @@ -272,7 +272,7 @@ export default function genAiTest({ getService }: FtrProviderContext) { describe('execution', () => { describe('successful response simulator', () => { - const simulator = new GenAiSimulator({ + const simulator = new OpenAISimulator({ proxy: { config: configService.get('kbnTestServer.serverArgs'), }, @@ -313,7 +313,7 @@ export default function genAiTest({ getService }: FtrProviderContext) { data: genAiSuccessResponse, }); }); - describe('gen ai dashboard', () => { + describe('OpenAI dashboard', () => { const dashboardId = 'specific-dashboard-id-default'; it('should not create a dashboard when user does not have kibana event log permissions', async () => { @@ -377,7 +377,7 @@ export default function genAiTest({ getService }: FtrProviderContext) { }); }); describe('non-default space simulator', () => { - const simulator = new GenAiSimulator({ + const simulator = new OpenAISimulator({ proxy: { config: configService.get('kbnTestServer.serverArgs'), }, @@ -428,7 +428,7 @@ export default function genAiTest({ getService }: FtrProviderContext) { }); describe('error response simulator', () => { - const simulator = new GenAiSimulator({ + const simulator = new OpenAISimulator({ returnError: true, proxy: { config: configService.get('kbnTestServer.serverArgs'), diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/index.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/index.ts index fd667f8f1025a..d7bd25dfbd528 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/index.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/index.ts @@ -39,7 +39,7 @@ export default function connectorsTests({ loadTestFile, getService }: FtrProvide loadTestFile(require.resolve('./connector_types/xmatters')); loadTestFile(require.resolve('./connector_types/tines')); loadTestFile(require.resolve('./connector_types/torq')); - loadTestFile(require.resolve('./connector_types/gen_ai')); + loadTestFile(require.resolve('./connector_types/open_ai')); loadTestFile(require.resolve('./connector_types/d3security')); loadTestFile(require.resolve('./connector_types/bedrock')); loadTestFile(require.resolve('./create')); diff --git a/x-pack/test/functional/apps/index_management/index_details_page/config.ts b/x-pack/test/functional/apps/index_management/index_details_page/config.ts new file mode 100644 index 0000000000000..dde646c885221 --- /dev/null +++ b/x-pack/test/functional/apps/index_management/index_details_page/config.ts @@ -0,0 +1,25 @@ +/* + * 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. + */ + +import { FtrConfigProviderContext } from '@kbn/test'; + +export default async function ({ readConfigFile }: FtrConfigProviderContext) { + const functionalConfig = await readConfigFile(require.resolve('../config.ts')); + + return { + ...functionalConfig.getAll(), + testFiles: [require.resolve('.')], + kbnTestServer: { + ...functionalConfig.get('kbnTestServer'), + serverArgs: [ + ...functionalConfig.get('kbnTestServer.serverArgs'), + // setting the feature flag to enable details page + `--xpack.index_management.dev.enableIndexDetailsPage=true`, + ], + }, + }; +} diff --git a/x-pack/test/functional/apps/index_management/index_details_page/index.ts b/x-pack/test/functional/apps/index_management/index_details_page/index.ts new file mode 100644 index 0000000000000..20915ab416e31 --- /dev/null +++ b/x-pack/test/functional/apps/index_management/index_details_page/index.ts @@ -0,0 +1,14 @@ +/* + * 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. + */ + +import { FtrProviderContext } from '../../../ftr_provider_context'; + +export default ({ loadTestFile }: FtrProviderContext) => { + describe('Index Management: index details page', function () { + loadTestFile(require.resolve('./index_details_page')); + }); +}; diff --git a/x-pack/test/functional/apps/index_management/index_details_page/index_details_page.ts b/x-pack/test/functional/apps/index_management/index_details_page/index_details_page.ts new file mode 100644 index 0000000000000..58eae49837882 --- /dev/null +++ b/x-pack/test/functional/apps/index_management/index_details_page/index_details_page.ts @@ -0,0 +1,30 @@ +/* + * 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. + */ + +import { FtrProviderContext } from '../../../ftr_provider_context'; + +export default ({ getPageObjects, getService }: FtrProviderContext) => { + const pageObjects = getPageObjects(['common', 'indexManagement', 'header']); + const log = getService('log'); + const security = getService('security'); + + describe('Index details page', function () { + before(async () => { + await security.testUser.setRoles(['index_management_user']); + await pageObjects.common.navigateToApp('indexManagement'); + }); + + it('Navigates to the index details page from the home page', async () => { + await log.debug('Navigating to the index details page'); + + // display hidden indices to have some rows in the indices table + await pageObjects.indexManagement.toggleHiddenIndices(); + // click the first index in the table and wait for the index details page + await pageObjects.indexManagement.indexDetailsPage.openIndexDetailsPage(0); + }); + }); +}; diff --git a/x-pack/test/screenshot_creation/apps/response_ops_docs/stack_connectors/generative_ai_connector.ts b/x-pack/test/screenshot_creation/apps/response_ops_docs/stack_connectors/generative_ai_connector.ts index 69fa2448a7818..4dc7d6d3fa26e 100644 --- a/x-pack/test/screenshot_creation/apps/response_ops_docs/stack_connectors/generative_ai_connector.ts +++ b/x-pack/test/screenshot_creation/apps/response_ops_docs/stack_connectors/generative_ai_connector.ts @@ -21,13 +21,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { `"content": "You are a cyber security analyst using Elastic Security. I would like you to evaluate the event below and format your output neatly in markdown syntax. Add your description, an accuracy rating, and a threat rating."\n` + `}]`; - describe('generative ai connector', function () { + describe('OpenAI connector', function () { beforeEach(async () => { await pageObjects.common.navigateToApp('connectors'); await pageObjects.header.waitUntilLoadingHasFinished(); }); - it('generative ai connector screenshots', async () => { + it('OpenAI connector screenshots', async () => { await pageObjects.common.navigateToApp('connectors'); await pageObjects.header.waitUntilLoadingHasFinished(); await actions.common.openNewConnectorForm('gen-ai'); diff --git a/x-pack/test/screenshot_creation/apps/response_ops_docs/stack_connectors/xmatters_connector.ts b/x-pack/test/screenshot_creation/apps/response_ops_docs/stack_connectors/xmatters_connector.ts index 80aafd27dc63b..709d9bdfae76e 100644 --- a/x-pack/test/screenshot_creation/apps/response_ops_docs/stack_connectors/xmatters_connector.ts +++ b/x-pack/test/screenshot_creation/apps/response_ops_docs/stack_connectors/xmatters_connector.ts @@ -20,7 +20,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await pageObjects.header.waitUntilLoadingHasFinished(); }); - it('generative ai connector screenshots', async () => { + it('xmatters connector screenshots', async () => { await pageObjects.common.navigateToApp('connectors'); await pageObjects.header.waitUntilLoadingHasFinished(); await actions.common.openNewConnectorForm('xmatters'); From d70c4eaaba2b6b4bf5a2fd3024892310cdd6fa59 Mon Sep 17 00:00:00 2001 From: Steph Milovic Date: Thu, 28 Sep 2023 08:25:49 -0600 Subject: [PATCH 02/11] revert changes that i do not understand --- ...evert_a_few_changes_rename_gen_ai_to.patch | 2423 ----------------- .../public/components/list_connector.tsx | 2 +- .../data_drift/data_drift_utils.test.ts | 88 - ...ion_template_url_from_agent_policy.test.ts | 68 - ...ormation_template_url_from_agent_policy.ts | 38 - ...ion_template_url_from_package_info.test.ts | 66 - .../detail_panel/detail_panel.container.d.ts | 8 - .../detail_panel/detail_panel.container.js | 64 - .../index_list/detail_panel/detail_panel.js | 176 -- .../edit_settings_json.container.js | 34 - .../edit_settings_json/edit_settings_json.js | 170 -- .../detail_panel/edit_settings_json/index.js | 8 - .../home/index_list/detail_panel/index.ts | 8 - .../show_json/show_json.container.js | 36 - .../detail_panel/show_json/show_json.js | 31 - .../index_list/detail_panel/summary/index.js | 8 - .../detail_panel/summary/summary.container.js | 21 - .../detail_panel/summary/summary.js | 147 - .../application/store/actions/detail_panel.js | 11 - .../store/actions/edit_index_settings.js | 38 - .../store/actions/load_index_data.js | 24 - .../store/actions/update_index_settings.js | 39 - .../store/reducers/detail_panel.js | 91 - .../common/locators/discover_logs_locator.ts | 27 - .../locators/discover_node_logs_locator.ts | 32 - .../infra/public/apps/discover_app.tsx | 30 - .../index_details_page/config.ts | 25 - .../index_details_page/index.ts | 14 - .../index_details_page/index_details_page.ts | 30 - 29 files changed, 1 insertion(+), 3756 deletions(-) delete mode 100644 more_more_more_GeneralFeature_to_GenerativeAIFeature_revert_a_few_changes_rename_gen_ai_to.patch delete mode 100644 x-pack/plugins/data_visualizer/public/application/data_drift/data_drift_utils.test.ts delete mode 100644 x-pack/plugins/fleet/public/services/get_cloud_formation_template_url_from_agent_policy.test.ts delete mode 100644 x-pack/plugins/fleet/public/services/get_cloud_formation_template_url_from_agent_policy.ts delete mode 100644 x-pack/plugins/fleet/public/services/get_cloud_formation_template_url_from_package_info.test.ts delete mode 100644 x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/detail_panel.container.d.ts delete mode 100644 x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/detail_panel.container.js delete mode 100644 x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/detail_panel.js delete mode 100644 x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/edit_settings_json/edit_settings_json.container.js delete mode 100644 x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/edit_settings_json/edit_settings_json.js delete mode 100644 x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/edit_settings_json/index.js delete mode 100644 x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/index.ts delete mode 100644 x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/show_json/show_json.container.js delete mode 100644 x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/show_json/show_json.js delete mode 100644 x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/summary/index.js delete mode 100644 x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/summary/summary.container.js delete mode 100644 x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/summary/summary.js delete mode 100644 x-pack/plugins/index_management/public/application/store/actions/detail_panel.js delete mode 100644 x-pack/plugins/index_management/public/application/store/actions/edit_index_settings.js delete mode 100644 x-pack/plugins/index_management/public/application/store/actions/load_index_data.js delete mode 100644 x-pack/plugins/index_management/public/application/store/actions/update_index_settings.js delete mode 100644 x-pack/plugins/index_management/public/application/store/reducers/detail_panel.js delete mode 100644 x-pack/plugins/infra/common/locators/discover_logs_locator.ts delete mode 100644 x-pack/plugins/infra/common/locators/discover_node_logs_locator.ts delete mode 100644 x-pack/plugins/infra/public/apps/discover_app.tsx delete mode 100644 x-pack/test/functional/apps/index_management/index_details_page/config.ts delete mode 100644 x-pack/test/functional/apps/index_management/index_details_page/index.ts delete mode 100644 x-pack/test/functional/apps/index_management/index_details_page/index_details_page.ts diff --git a/more_more_more_GeneralFeature_to_GenerativeAIFeature_revert_a_few_changes_rename_gen_ai_to.patch b/more_more_more_GeneralFeature_to_GenerativeAIFeature_revert_a_few_changes_rename_gen_ai_to.patch deleted file mode 100644 index f824098ffda7d..0000000000000 --- a/more_more_more_GeneralFeature_to_GenerativeAIFeature_revert_a_few_changes_rename_gen_ai_to.patch +++ /dev/null @@ -1,2423 +0,0 @@ -Subject: [PATCH] more -more -more -GeneralFeature to GenerativeAIFeature -revert a few changes -rename gen ai to OpenAI ---- -Index: .github/CODEOWNERS -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS ---- a/.github/CODEOWNERS (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/.github/CODEOWNERS (revision f26c1b78fba7b88efe9f13c938daf875d8512498) -@@ -1202,9 +1202,9 @@ - /x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users @elastic/security-threat-hunting-explore - - ## Explore owner connectors --/x-pack/plugins/stack_connectors/public/connector_types/gen_ai @elastic/security-threat-hunting-explore --/x-pack/plugins/stack_connectors/server/connector_types/gen_ai @elastic/security-threat-hunting-explore --/x-pack/plugins/stack_connectors/common/gen_ai @elastic/security-threat-hunting-explore -+/x-pack/plugins/stack_connectors/public/connector_types/open_ai @elastic/security-threat-hunting-explore -+/x-pack/plugins/stack_connectors/server/connector_types/open_ai @elastic/security-threat-hunting-explore -+/x-pack/plugins/stack_connectors/common/open_ai @elastic/security-threat-hunting-explore - - ## Defend Workflows owner connectors - /x-pack/plugins/stack_connectors/public/connector_types/sentinelone @elastic/security-defend-workflows -Index: docs/api-generated/connectors/connector-apis-passthru.asciidoc -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/docs/api-generated/connectors/connector-apis-passthru.asciidoc b/docs/api-generated/connectors/connector-apis-passthru.asciidoc ---- a/docs/api-generated/connectors/connector-apis-passthru.asciidoc (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/docs/api-generated/connectors/connector-apis-passthru.asciidoc (revision f26c1b78fba7b88efe9f13c938daf875d8512498) -@@ -1004,7 +1004,7 @@ -
  • config_properties_cases_webhook - Connector request properties for Webhook - Case Management connector
  • -
  • config_properties_d3security - Connector request properties for a D3 Security connector
  • -
  • config_properties_email - Connector request properties for an email connector
  • --
  • config_properties_genai - Connector request properties for a generative AI connector
  • -+
  • config_properties_genai - Connector request properties for an OpenAI connector
  • -
  • config_properties_genai_oneOf -
  • -
  • config_properties_genai_oneOf_1 -
  • -
  • config_properties_index - Connector request properties for an index connector
  • -@@ -1043,7 +1043,7 @@ -
  • create_connector_request_cases_webhook - Create Webhook - Case Managment connector request
  • -
  • create_connector_request_d3security - Create D3 Security connector request
  • -
  • create_connector_request_email - Create email connector request
  • --
  • create_connector_request_genai - Create generative AI connector request
  • -+
  • create_connector_request_genai - Create OpenAI connector request
  • -
  • create_connector_request_index - Create index connector request
  • -
  • create_connector_request_jira - Create Jira connector request
  • -
  • create_connector_request_opsgenie - Create Opsgenie connector request
  • -@@ -1099,7 +1099,7 @@ -
  • secrets_properties_cases_webhook - Connector secrets properties for Webhook - Case Management connector
  • -
  • secrets_properties_d3security - Connector secrets properties for a D3 Security connector
  • -
  • secrets_properties_email - Connector secrets properties for an email connector
  • --
  • secrets_properties_genai - Connector secrets properties for a generative AI connector
  • -+
  • secrets_properties_genai - Connector secrets properties for an OpenAI connector
  • -
  • secrets_properties_jira - Connector secrets properties for a Jira connector
  • -
  • secrets_properties_opsgenie - Connector secrets properties for an Opsgenie connector
  • -
  • secrets_properties_pagerduty - Connector secrets properties for a PagerDuty connector
  • -@@ -1429,7 +1429,7 @@ -
    -
    -
    --

    config_properties_genai - Connector request properties for a generative AI connector Up

    -+

    config_properties_genai - Connector request properties for an OpenAI connector Up

    -
    Defines properties for connectors when type is .gen-ai.
    -
    -
    apiProvider
    String The OpenAI API provider.
    -@@ -1948,8 +1948,8 @@ -
    -
    -
    --

    create_connector_request_genai - Create generative AI connector request Up

    --
    The generative AI connector uses axios to send a POST request to either OpenAI or Azure OpenAPI.
    -+

    create_connector_request_genai - Create OpenAI connector request Up

    -+
    The OpenAI connector uses axios to send a POST request to either OpenAI or Azure OpenAPI.
    -
    -
    config
    -
    connector_type_id
    String The type of connector.
    -@@ -2525,7 +2525,7 @@ -
    -
    -
    --

    secrets_properties_genai - Connector secrets properties for a generative AI connector Up

    -+

    secrets_properties_genai - Connector secrets properties for an OpenAI connector Up

    -
    Defines secrets for connectors when type is .gen-ai.
    -
    -
    apiKey (optional)
    String The OpenAI API key.
    -Index: docs/management/connectors/pre-configured-connectors.asciidoc -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/docs/management/connectors/pre-configured-connectors.asciidoc b/docs/management/connectors/pre-configured-connectors.asciidoc ---- a/docs/management/connectors/pre-configured-connectors.asciidoc (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/docs/management/connectors/pre-configured-connectors.asciidoc (revision bc6c2a2dcb95ac781ee1ddcdb1cfeac0d882ee47) -@@ -281,15 +281,15 @@ - - [float] - [[preconfigured-gen-ai-configuration]] --==== Generative AI connectors -+==== OpenAI connectors - --The following example creates a <>: -+The following example creates a <>: - - [source,text] - -- - xpack.actions.preconfigured: -- my-gen-ai: -- name: preconfigured-gen-ai-connector-type -+ my-open-ai: -+ name: preconfigured-openai-connector-type - actionTypeId: .gen-ai - config: - apiUrl: https://api.openai.com/v1/chat/completions <1> -Index: docs/settings/alert-action-settings.asciidoc -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/docs/settings/alert-action-settings.asciidoc b/docs/settings/alert-action-settings.asciidoc ---- a/docs/settings/alert-action-settings.asciidoc (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/docs/settings/alert-action-settings.asciidoc (revision f26c1b78fba7b88efe9f13c938daf875d8512498) -@@ -261,13 +261,13 @@ - The configuration details, which are specific to the type of preconfigured connector. - - `xpack.actions.preconfigured..config.apiProvider`:: --For a <>, specifies the OpenAI API provider, either `OpenAI` or `Azure OpenAI`. -+For a <>, specifies the OpenAI API provider, either `OpenAI` or `Azure OpenAI`. - - `xpack.actions.preconfigured..config.apiUrl`:: - A configuration URL that varies by connector: - + - -- --* For a <>, specifies the OpenAI request URL. -+* For a <>, specifies the OpenAI request URL. - * For a <>, specifies the {ibm-r} instance URL. - * For a <>, specifies the Jira instance URL. - * For an <>, specifies the {opsgenie} URL. For example, `https://api.opsgenie.com` or `https://api.eu.opsgenie.com`. -@@ -321,7 +321,7 @@ - For a <>, specifies a string from the response body of the create case method that corresponds to the external service identifier. - - `xpack.actions.preconfigured..config.defaultModel`:: --For a <>, specifies the default model to use for requests. It is optional and applicable only when `xpack.actions.preconfigured..config.apiProvider` is `OpenAI`. -+For a <>, specifies the default model to use for requests. It is optional and applicable only when `xpack.actions.preconfigured..config.apiProvider` is `OpenAI`. - - `xpack.actions.preconfigured..config.executionTimeField`:: - For an <>, a field that indicates when the document was indexed. -@@ -447,7 +447,7 @@ - An API key secret that varies by connector: - + - -- --* For a <>, specifies the OpenAI or Azure OpenAI API key for authentication. -+* For a <>, specifies the OpenAI or Azure OpenAI API key for authentication. - * For an <>, specifies the {opsgenie} API authentication key for HTTP basic authentication. - -- - -Index: x-pack/examples/gen_ai_streaming_response_example/README.md -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/examples/gen_ai_streaming_response_example/README.md b/x-pack/examples/gen_ai_streaming_response_example/README.md ---- a/x-pack/examples/gen_ai_streaming_response_example/README.md (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/examples/gen_ai_streaming_response_example/README.md (revision f26c1b78fba7b88efe9f13c938daf875d8512498) -@@ -1,5 +1,5 @@ --## Generative AI Connector Streaming Response Example -+## OpenAI Connector Streaming Response Example - --This example plugin shows you how to stream a response from a Generative AI connector. -+This example plugin shows you how to stream a response from a OpenAI connector. - - To run this example, use the command `yarn start --run-examples`. -\ No newline at end of file -Index: x-pack/examples/gen_ai_streaming_response_example/public/components/list_connector.tsx -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/examples/gen_ai_streaming_response_example/public/components/list_connector.tsx b/x-pack/examples/gen_ai_streaming_response_example/public/components/list_connector.tsx ---- a/x-pack/examples/gen_ai_streaming_response_example/public/components/list_connector.tsx (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/examples/gen_ai_streaming_response_example/public/components/list_connector.tsx (revision f26c1b78fba7b88efe9f13c938daf875d8512498) -@@ -52,7 +52,7 @@ - label={i18n.translate( - 'genAiStreamingResponseExample.app.component.selectConnectorLabel', - { -- defaultMessage: 'Select a Generative AI Connector', -+ defaultMessage: 'Select a OpenAI Connector', - } - )} - labelAppend={ -Index: x-pack/examples/gen_ai_streaming_response_example/public/components/setup_connector.tsx -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/examples/gen_ai_streaming_response_example/public/components/setup_connector.tsx b/x-pack/examples/gen_ai_streaming_response_example/public/components/setup_connector.tsx ---- a/x-pack/examples/gen_ai_streaming_response_example/public/components/setup_connector.tsx (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/examples/gen_ai_streaming_response_example/public/components/setup_connector.tsx (revision bc6c2a2dcb95ac781ee1ddcdb1cfeac0d882ee47) -@@ -6,7 +6,7 @@ - */ - - import React from 'react'; --import { GenAiLogo } from '@kbn/stack-connectors-plugin/public/common'; -+import { OpenAILogo } from '@kbn/stack-connectors-plugin/public/common'; - import { EuiFlexGroup, EuiCard, EuiFlexItem, EuiIcon } from '@elastic/eui'; - import { i18n } from '@kbn/i18n'; - -@@ -20,11 +20,11 @@ - - } -+ icon={} - title={i18n.translate( - 'genAiStreamingResponseExample.app.component.addConnectorCardTitle', - { -- defaultMessage: 'Add Generative AI Connector', -+ defaultMessage: 'Add OpenAI Connector', - } - )} - description={i18n.translate( -Index: x-pack/examples/gen_ai_streaming_response_example/public/gen_ai_streaming_response_example.tsx -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/examples/gen_ai_streaming_response_example/public/gen_ai_streaming_response_example.tsx b/x-pack/examples/gen_ai_streaming_response_example/public/gen_ai_streaming_response_example.tsx ---- a/x-pack/examples/gen_ai_streaming_response_example/public/gen_ai_streaming_response_example.tsx (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/examples/gen_ai_streaming_response_example/public/gen_ai_streaming_response_example.tsx (revision f26c1b78fba7b88efe9f13c938daf875d8512498) -@@ -65,7 +65,7 @@ - minimumLicenseRequired: 'platinum', - supportedFeatureIds: ['general'], - id: '.gen-ai', -- name: 'Generative AI', -+ name: 'OpenAI', - enabled: true, - }); - const [loading, setLoading] = useState(true); -Index: x-pack/examples/gen_ai_streaming_response_example/public/plugin.tsx -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/examples/gen_ai_streaming_response_example/public/plugin.tsx b/x-pack/examples/gen_ai_streaming_response_example/public/plugin.tsx ---- a/x-pack/examples/gen_ai_streaming_response_example/public/plugin.tsx (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/examples/gen_ai_streaming_response_example/public/plugin.tsx (revision f26c1b78fba7b88efe9f13c938daf875d8512498) -@@ -37,7 +37,7 @@ - ) { - core.application.register({ - id: 'GenAiStreamingResponseExample', -- title: 'Generative AI Streaming Response Example', -+ title: 'OpenAI Streaming Response Example', - navLinkStatus: AppNavLinkStatus.hidden, - async mount(params: AppMountParameters) { - const [coreStart, depsStart] = await core.getStartServices(); -@@ -48,9 +48,8 @@ - - developerExamples.register({ - appId: 'GenAiStreamingResponseExample', -- title: 'Generative AI Streaming Response Example', -- description: -- 'This example demonstrates how to stream a response from a Generative AI connector', -+ title: 'OpenAI Streaming Response Example', -+ description: 'This example demonstrates how to stream a response from an OpenAI connector', - }); - } - -Index: x-pack/examples/gen_ai_streaming_response_example/server/plugin.ts -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/examples/gen_ai_streaming_response_example/server/plugin.ts b/x-pack/examples/gen_ai_streaming_response_example/server/plugin.ts ---- a/x-pack/examples/gen_ai_streaming_response_example/server/plugin.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/examples/gen_ai_streaming_response_example/server/plugin.ts (revision f26c1b78fba7b88efe9f13c938daf875d8512498) -@@ -87,7 +87,7 @@ - }; - } else { - throw Boom.badRequest( -- `Invalid generative AI connector selected - ${connector.config?.apiProvider} is not a valid provider` -+ `Invalid OpenAI connector selected - ${connector.config?.apiProvider} is not a valid provider` - ); - } - -Index: x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_header/index.tsx -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_header/index.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_header/index.tsx ---- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_header/index.tsx (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_header/index.tsx (revision f26c1b78fba7b88efe9f13c938daf875d8512498) -@@ -17,7 +17,7 @@ - } from '@elastic/eui'; - import { css } from '@emotion/react'; - import { DocLinksStart } from '@kbn/core-doc-links-browser'; --import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/gen_ai/constants'; -+import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/open_ai/constants'; - import { Conversation } from '../../..'; - import { AssistantTitle } from '../assistant_title'; - import { ConversationSelector } from '../conversations/conversation_selector'; -Index: x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector/index.tsx -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector/index.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector/index.tsx ---- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector/index.tsx (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector/index.tsx (revision f26c1b78fba7b88efe9f13c938daf875d8512498) -@@ -19,7 +19,7 @@ - import useEvent from 'react-use/lib/useEvent'; - import { css } from '@emotion/react'; - --import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/gen_ai/constants'; -+import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/open_ai/constants'; - import { Conversation } from '../../../..'; - import { useAssistantContext } from '../../../assistant_context'; - import * as i18n from './translations'; -Index: x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector_settings/index.tsx -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector_settings/index.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector_settings/index.tsx ---- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector_settings/index.tsx (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector_settings/index.tsx (revision f26c1b78fba7b88efe9f13c938daf875d8512498) -@@ -18,7 +18,7 @@ - import React, { useCallback, useMemo, useState } from 'react'; - import { css } from '@emotion/react'; - --import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/gen_ai/constants'; -+import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/open_ai/constants'; - import { Conversation, Prompt } from '../../../..'; - import { UseAssistantContext } from '../../../assistant_context'; - import * as i18n from './translations'; -Index: x-pack/packages/kbn-elastic-assistant/impl/assistant/index.tsx -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/index.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/index.tsx ---- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/index.tsx (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/index.tsx (revision f26c1b78fba7b88efe9f13c938daf875d8512498) -@@ -29,7 +29,7 @@ - import { createPortal } from 'react-dom'; - import { css } from '@emotion/react'; - --import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/gen_ai/constants'; -+import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/open_ai/constants'; - import { ActionConnectorProps } from '@kbn/triggers-actions-ui-plugin/public/types'; - import { ChatSend } from './chat_send'; - import { BlockBotCallToAction } from './block_bot/cta'; -Index: x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings.tsx -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings.tsx ---- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings.tsx (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings.tsx (revision f26c1b78fba7b88efe9f13c938daf875d8512498) -@@ -23,7 +23,7 @@ - // eslint-disable-next-line @kbn/eslint/module_migration - import styled from 'styled-components'; - import { css } from '@emotion/react'; --import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/gen_ai/constants'; -+import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/open_ai/constants'; - import { Conversation, Prompt, QuickPrompt } from '../../..'; - import * as i18n from './translations'; - import { useAssistantContext } from '../../assistant_context'; -Index: x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings_button.tsx -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings_button.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings_button.tsx ---- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings_button.tsx (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings_button.tsx (revision f26c1b78fba7b88efe9f13c938daf875d8512498) -@@ -8,7 +8,7 @@ - import React, { useCallback } from 'react'; - import { EuiButtonIcon, EuiToolTip } from '@elastic/eui'; - --import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/gen_ai/constants'; -+import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/open_ai/constants'; - import { Conversation } from '../../..'; - import { AssistantSettings, CONVERSATIONS_TAB } from './assistant_settings'; - import * as i18n from './translations'; -Index: x-pack/packages/kbn-elastic-assistant/impl/assistant_context/types.tsx -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant_context/types.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant_context/types.tsx ---- a/x-pack/packages/kbn-elastic-assistant/impl/assistant_context/types.tsx (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant_context/types.tsx (revision f26c1b78fba7b88efe9f13c938daf875d8512498) -@@ -5,7 +5,7 @@ - * 2.0. - */ - --import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/gen_ai/constants'; -+import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/open_ai/constants'; - - export type ConversationRole = 'system' | 'user' | 'assistant'; - -Index: x-pack/packages/kbn-elastic-assistant/impl/connectorland/helpers.tsx -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/packages/kbn-elastic-assistant/impl/connectorland/helpers.tsx b/x-pack/packages/kbn-elastic-assistant/impl/connectorland/helpers.tsx ---- a/x-pack/packages/kbn-elastic-assistant/impl/connectorland/helpers.tsx (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/packages/kbn-elastic-assistant/impl/connectorland/helpers.tsx (revision f26c1b78fba7b88efe9f13c938daf875d8512498) -@@ -7,7 +7,7 @@ - - import type { ActionConnector } from '@kbn/triggers-actions-ui-plugin/public'; - import { ActionConnectorProps } from '@kbn/triggers-actions-ui-plugin/public/types'; --import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/gen_ai/constants'; -+import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/open_ai/constants'; - import { ActionTypeModel } from '@kbn/triggers-actions-ui-plugin/public'; - - interface GenAiConfig { -@@ -20,7 +20,7 @@ - * Returns the GenAiConfig for a given ActionConnector. Note that if the connector is preconfigured, - * the config will be undefined as the connector is neither available nor editable. - * -- * TODO: Extract and use separate types from GenAiConfig from '@kbn/stack-connectors-plugin/common/gen_ai/types' -+ * TODO: Extract and use separate types from GenAiConfig from '@kbn/stack-connectors-plugin/common/open_ai/types' - * - * @param connector - */ -Index: x-pack/packages/kbn-elastic-assistant/impl/content/prompts/welcome/translations.ts -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/packages/kbn-elastic-assistant/impl/content/prompts/welcome/translations.ts b/x-pack/packages/kbn-elastic-assistant/impl/content/prompts/welcome/translations.ts ---- a/x-pack/packages/kbn-elastic-assistant/impl/content/prompts/welcome/translations.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/packages/kbn-elastic-assistant/impl/content/prompts/welcome/translations.ts (revision 06445caf5021c473ab79d40f7975d7090b258a6f) -@@ -19,7 +19,7 @@ - 'xpack.elasticAssistant.securityAssistant.content.prompts.welcome.welcomeGeneral2Prompt', - { - defaultMessage: -- "First things first, we'll need to set up a Generative AI Connector to get this chat experience going! With the Generative AI Connector, you'll be able to configure access to either an Azure OpenAI Service or OpenAI API account, but you better believe you'll be able to deploy your own models within your Elastic Cloud instance and use those here in the future... 😉", -+ "First things first, we'll need to set up a Generative AI Connector to get this chat experience going! With the Generative AI Connector, you'll be able to configure access to either an OpenAI service or an AWS Bedrock service, but you better believe you'll be able to deploy your own models within your Elastic Cloud instance and use those here in the future... 😉", - } - ); - -Index: x-pack/packages/kbn-elastic-assistant/impl/mock/conversation.ts -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/packages/kbn-elastic-assistant/impl/mock/conversation.ts b/x-pack/packages/kbn-elastic-assistant/impl/mock/conversation.ts ---- a/x-pack/packages/kbn-elastic-assistant/impl/mock/conversation.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/packages/kbn-elastic-assistant/impl/mock/conversation.ts (revision f26c1b78fba7b88efe9f13c938daf875d8512498) -@@ -5,7 +5,7 @@ - * 2.0. - */ - --import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/gen_ai/constants'; -+import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/open_ai/constants'; - import { Conversation } from '../..'; - - export const alertConvo: Conversation = { -Index: x-pack/plugins/actions/docs/openapi/bundled.json -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/plugins/actions/docs/openapi/bundled.json b/x-pack/plugins/actions/docs/openapi/bundled.json ---- a/x-pack/plugins/actions/docs/openapi/bundled.json (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/plugins/actions/docs/openapi/bundled.json (revision f26c1b78fba7b88efe9f13c938daf875d8512498) -@@ -1765,7 +1765,7 @@ - } - }, - "config_properties_genai": { -- "title": "Connector request properties for a generative AI connector", -+ "title": "Connector request properties for an OpenAI connector", - "description": "Defines properties for connectors when type is `.gen-ai`.", - "oneOf": [ - { -@@ -1818,7 +1818,7 @@ - } - }, - "secrets_properties_genai": { -- "title": "Connector secrets properties for a generative AI connector", -+ "title": "Connector secrets properties for an OpenAI connector", - "description": "Defines secrets for connectors when type is `.gen-ai`.", - "type": "object", - "properties": { -@@ -1829,8 +1829,8 @@ - } - }, - "create_connector_request_genai": { -- "title": "Create generative AI connector request", -- "description": "The generative AI connector uses axios to send a POST request to either OpenAI or Azure OpenAPI.\n", -+ "title": "Create OpenAI connector request", -+ "description": "The OpenAI connector uses axios to send a POST request to either OpenAI or Azure OpenAPI.\n", - "type": "object", - "required": [ - "config", -@@ -5677,4 +5677,4 @@ - } - } - } --} -\ No newline at end of file -+} -Index: x-pack/plugins/actions/docs/openapi/bundled.yaml -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/plugins/actions/docs/openapi/bundled.yaml b/x-pack/plugins/actions/docs/openapi/bundled.yaml ---- a/x-pack/plugins/actions/docs/openapi/bundled.yaml (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/plugins/actions/docs/openapi/bundled.yaml (revision f26c1b78fba7b88efe9f13c938daf875d8512498) -@@ -1030,14 +1030,14 @@ - type: boolean - host: - description: | -- The host name of the service provider. If the `service` is `elastic_cloud` (for Elastic Cloud notifications) or one of Nodemailer's well-known email service providers, this property is ignored. If `service` is `other`, this property must be defined. -+ The host name of the service provider. If the `service` is `elastic_cloud` (for Elastic Cloud notifications) or one of Nodemailer's well-known email service providers, this property is ignored. If `service` is `other`, this property must be defined. - type: string - oauthTokenUrl: - type: string - nullable: true - port: - description: | -- The port to connect to on the service provider. If the `service` is `elastic_cloud` (for Elastic Cloud notifications) or one of Nodemailer's well-known email service providers, this property is ignored. If `service` is `other`, this property must be defined. -+ The port to connect to on the service provider. If the `service` is `elastic_cloud` (for Elastic Cloud notifications) or one of Nodemailer's well-known email service providers, this property is ignored. If `service` is `other`, this property must be defined. - type: integer - secure: - description: | -@@ -1102,7 +1102,7 @@ - secrets: - $ref: '#/components/schemas/secrets_properties_email' - config_properties_genai: -- title: Connector request properties for a generative AI connector -+ title: Connector request properties for an OpenAI connector - description: Defines properties for connectors when type is `.gen-ai`. - oneOf: - - type: object -@@ -1137,7 +1137,7 @@ - discriminator: - propertyName: apiProvider - secrets_properties_genai: -- title: Connector secrets properties for a generative AI connector -+ title: Connector secrets properties for an OpenAI connector - description: Defines secrets for connectors when type is `.gen-ai`. - type: object - properties: -@@ -1145,9 +1145,9 @@ - type: string - description: The OpenAI API key. - create_connector_request_genai: -- title: Create generative AI connector request -+ title: Create OpenAI connector request - description: | -- The generative AI connector uses axios to send a POST request to either OpenAI or Azure OpenAPI. -+ The OpenAI connector uses axios to send a POST request to either OpenAI or Azure OpenAPI. - type: object - required: - - config -Index: x-pack/plugins/actions/docs/openapi/components/schemas/config_properties_genai.yaml -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/config_properties_genai.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/config_properties_genai.yaml ---- a/x-pack/plugins/actions/docs/openapi/components/schemas/config_properties_genai.yaml (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/plugins/actions/docs/openapi/components/schemas/config_properties_genai.yaml (revision f26c1b78fba7b88efe9f13c938daf875d8512498) -@@ -1,4 +1,4 @@ --title: Connector request properties for a generative AI connector -+title: Connector request properties for an OpenAI connector - description: Defines properties for connectors when type is `.gen-ai`. - oneOf: - - type: object -@@ -29,4 +29,4 @@ - type: string - description: The default model to use for requests. - discriminator: -- propertyName: apiProvider -\ No newline at end of file -+ propertyName: apiProvider -Index: x-pack/plugins/actions/docs/openapi/components/schemas/connector_response_properties_genai.yaml -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/connector_response_properties_genai.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/connector_response_properties_genai.yaml ---- a/x-pack/plugins/actions/docs/openapi/components/schemas/connector_response_properties_genai.yaml (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/plugins/actions/docs/openapi/components/schemas/connector_response_properties_genai.yaml (revision f26c1b78fba7b88efe9f13c938daf875d8512498) -@@ -1,4 +1,4 @@ --title: Connector response properties for a generative AI connector -+title: Connector response properties for an OpenAI connector - type: object - required: - - config -Index: x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_genai.yaml -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_genai.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_genai.yaml ---- a/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_genai.yaml (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_genai.yaml (revision f26c1b78fba7b88efe9f13c938daf875d8512498) -@@ -1,6 +1,6 @@ --title: Create generative AI connector request -+title: Create OpenAI connector request - description: > -- The generative AI connector uses axios to send a POST request to either -+ The OpenAI connector uses axios to send a POST request to either - OpenAI or Azure OpenAPI. - type: object - required: -@@ -22,4 +22,4 @@ - description: The display name for the connector. - example: my-connector - secrets: -- $ref: 'secrets_properties_genai.yaml' -\ No newline at end of file -+ $ref: 'secrets_properties_genai.yaml' -Index: x-pack/plugins/actions/docs/openapi/components/schemas/secrets_properties_genai.yaml -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/secrets_properties_genai.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/secrets_properties_genai.yaml ---- a/x-pack/plugins/actions/docs/openapi/components/schemas/secrets_properties_genai.yaml (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/plugins/actions/docs/openapi/components/schemas/secrets_properties_genai.yaml (revision f26c1b78fba7b88efe9f13c938daf875d8512498) -@@ -1,7 +1,7 @@ --title: Connector secrets properties for a generative AI connector -+title: Connector secrets properties for an OpenAI connector - description: Defines secrets for connectors when type is `.gen-ai`. - type: object - properties: - apiKey: - type: string -- description: The OpenAI API key. -\ No newline at end of file -+ description: The OpenAI API key. -Index: x-pack/plugins/actions/docs/openapi/components/schemas/update_connector_request_genai.yaml -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/update_connector_request_genai.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/update_connector_request_genai.yaml ---- a/x-pack/plugins/actions/docs/openapi/components/schemas/update_connector_request_genai.yaml (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/plugins/actions/docs/openapi/components/schemas/update_connector_request_genai.yaml (revision f26c1b78fba7b88efe9f13c938daf875d8512498) -@@ -1,4 +1,4 @@ --title: Update generative AI connector request -+title: Update OpenAI connector request - type: object - required: - - config -@@ -10,4 +10,4 @@ - type: string - description: The display name for the connector. - secrets: -- $ref: 'secrets_properties_genai.yaml' -\ No newline at end of file -+ $ref: 'secrets_properties_genai.yaml' -Index: x-pack/plugins/actions/server/lib/action_executor.test.ts -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/plugins/actions/server/lib/action_executor.test.ts b/x-pack/plugins/actions/server/lib/action_executor.test.ts ---- a/x-pack/plugins/actions/server/lib/action_executor.test.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/plugins/actions/server/lib/action_executor.test.ts (revision f26c1b78fba7b88efe9f13c938daf875d8512498) -@@ -1766,7 +1766,7 @@ - }); - }); - --test('writes usage data to event log for gen ai events', async () => { -+test('writes usage data to event log for OpenAI events', async () => { - const executorMock = setupActionExecutorMock('.gen-ai'); - const mockGenAi = { - id: 'chatcmpl-7LztF5xsJl2z5jcNpJKvaPm4uWt8x', -Index: x-pack/plugins/actions/server/lib/action_executor.ts -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/plugins/actions/server/lib/action_executor.ts b/x-pack/plugins/actions/server/lib/action_executor.ts ---- a/x-pack/plugins/actions/server/lib/action_executor.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/plugins/actions/server/lib/action_executor.ts (revision 9a59bf47d9b8beb788fe724dff7302514251ea7c) -@@ -286,8 +286,8 @@ - - event.event = event.event || {}; - -- // start gen_ai extension -- // add event.kibana.action.execution.gen_ai to event log when GenerativeAi Connector is executed -+ // start open_ai extension -+ // add event.kibana.action.execution.open_ai to event log when OpenAI Connector is executed - if (result.status === 'ok' && actionTypeId === '.gen-ai') { - const data = result.data as unknown as { - usage: { prompt_tokens?: number; completion_tokens?: number; total_tokens?: number }; -@@ -311,7 +311,7 @@ - }, - }; - } -- // end gen_ai extension -+ // end open_ai extension - - const currentUser = security?.authc.getCurrentUser(request); - -Index: x-pack/plugins/observability_ai_assistant/README.md -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/plugins/observability_ai_assistant/README.md b/x-pack/plugins/observability_ai_assistant/README.md ---- a/x-pack/plugins/observability_ai_assistant/README.md (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/plugins/observability_ai_assistant/README.md (revision f26c1b78fba7b88efe9f13c938daf875d8512498) -@@ -6,7 +6,7 @@ - - #### **1.1. Configuration** - --Users can connect to an LLM using [connectors](https://www.elastic.co/guide/en/kibana/current/action-types.html) - specifically the [Generative AI connector](https://www.elastic.co/guide/en/kibana/current/gen-ai-action-type.html), which currently supports both OpenAI and Azure OpenAI as providers. The connector is Enterprise-only. Users can also leverage [preconfigured connectors](https://www.elastic.co/guide/en/kibana/current/pre-configured-connectors.html), in which case the following should be added to `kibana.yml`: -+Users can connect to an LLM using [connectors](https://www.elastic.co/guide/en/kibana/current/action-types.html) - specifically the [OpenAI connector](https://www.elastic.co/guide/en/kibana/current/gen-ai-action-type.html), which currently supports both OpenAI and Azure OpenAI as providers. The connector is Enterprise-only. Users can also leverage [preconfigured connectors](https://www.elastic.co/guide/en/kibana/current/pre-configured-connectors.html), in which case the following should be added to `kibana.yml`: - - ```yaml - xpack.actions.preconfigured: -Index: x-pack/plugins/observability_ai_assistant/public/components/chat/initial_setup_panel.tsx -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/plugins/observability_ai_assistant/public/components/chat/initial_setup_panel.tsx b/x-pack/plugins/observability_ai_assistant/public/components/chat/initial_setup_panel.tsx ---- a/x-pack/plugins/observability_ai_assistant/public/components/chat/initial_setup_panel.tsx (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/plugins/observability_ai_assistant/public/components/chat/initial_setup_panel.tsx (revision f26c1b78fba7b88efe9f13c938daf875d8512498) -@@ -143,7 +143,7 @@ - {i18n.translate( - 'xpack.observabilityAiAssistant.initialSetupPanel.setupConnector.description1', - { -- defaultMessage: 'Set up a Generative AI connector with your AI provider.', -+ defaultMessage: 'Set up an OpenAI connector with your AI provider.', - } - )} -

    -@@ -153,7 +153,7 @@ - 'xpack.observabilityAiAssistant.initialSetupPanel.setupConnector.description2', - { - defaultMessage: -- 'The Generative AI model needs to support function calls. We strongly recommend using GPT4.', -+ 'The OpenAI model needs to support function calls. We strongly recommend using GPT4.', - } - )} - -Index: x-pack/plugins/stack_connectors/common/gen_ai/constants.ts -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/plugins/stack_connectors/common/gen_ai/constants.ts b/x-pack/plugins/stack_connectors/common/open_ai/constants.ts -rename from x-pack/plugins/stack_connectors/common/gen_ai/constants.ts -rename to x-pack/plugins/stack_connectors/common/open_ai/constants.ts ---- a/x-pack/plugins/stack_connectors/common/gen_ai/constants.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/plugins/stack_connectors/common/open_ai/constants.ts (revision f26c1b78fba7b88efe9f13c938daf875d8512498) -@@ -13,7 +13,7 @@ - defaultMessage: 'OpenAI', - } - ); --export const GEN_AI_CONNECTOR_ID = '.gen-ai'; -+export const OPEN_AI_CONNECTOR_ID = '.gen-ai'; - export enum SUB_ACTION { - RUN = 'run', - INVOKE_AI = 'invokeAI', -Index: x-pack/plugins/stack_connectors/public/common/index.ts -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/plugins/stack_connectors/public/common/index.ts b/x-pack/plugins/stack_connectors/public/common/index.ts ---- a/x-pack/plugins/stack_connectors/public/common/index.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/plugins/stack_connectors/public/common/index.ts (revision f26c1b78fba7b88efe9f13c938daf875d8512498) -@@ -5,7 +5,7 @@ - * 2.0. - */ - --import GenAiLogo from '../connector_types/gen_ai/logo'; -+import OpenAILogo from '../connector_types/open_ai/logo'; - --export { GEN_AI_CONNECTOR_ID, OpenAiProviderType } from '../../common/gen_ai/constants'; --export { GenAiLogo }; -+export { OPEN_AI_CONNECTOR_ID, OpenAiProviderType } from '../../common/open_ai/constants'; -+export { OpenAILogo }; -Index: x-pack/plugins/stack_connectors/public/connector_types/d3security/d3security.tsx -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/plugins/stack_connectors/public/connector_types/d3security/d3security.tsx b/x-pack/plugins/stack_connectors/public/connector_types/d3security/d3security.tsx ---- a/x-pack/plugins/stack_connectors/public/connector_types/d3security/d3security.tsx (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/plugins/stack_connectors/public/connector_types/d3security/d3security.tsx (revision f26c1b78fba7b88efe9f13c938daf875d8512498) -@@ -8,7 +8,7 @@ - import { lazy } from 'react'; - import { i18n } from '@kbn/i18n'; - import { GenericValidationResult } from '@kbn/triggers-actions-ui-plugin/public/types'; --import { SUB_ACTION } from '../../../common/gen_ai/constants'; -+import { SUB_ACTION } from '../../../common/open_ai/constants'; - import { D3SecurityActionParams, D3SecurityConnector } from './types'; - import { D3_SECURITY_CONNECTOR_ID } from '../../../common/d3security/constants'; - interface ValidationErrors { -Index: x-pack/plugins/stack_connectors/public/connector_types/index.ts -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/plugins/stack_connectors/public/connector_types/index.ts b/x-pack/plugins/stack_connectors/public/connector_types/index.ts ---- a/x-pack/plugins/stack_connectors/public/connector_types/index.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/plugins/stack_connectors/public/connector_types/index.ts (revision 9a59bf47d9b8beb788fe724dff7302514251ea7c) -@@ -11,7 +11,7 @@ - import { getEmailConnectorType } from './email'; - import { getIndexConnectorType } from './es_index'; - import { getJiraConnectorType } from './jira'; --import { getGenerativeAiConnectorType } from './gen_ai'; -+import { getOpenAIConnectorType } from './open_ai'; - import { getBedrockConnectorType } from './bedrock'; - import { getOpsgenieConnectorType } from './opsgenie'; - import { getPagerDutyConnectorType } from './pagerduty'; -@@ -60,7 +60,7 @@ - connectorTypeRegistry.register(getJiraConnectorType()); - connectorTypeRegistry.register(getResilientConnectorType()); - connectorTypeRegistry.register(getOpsgenieConnectorType()); -- connectorTypeRegistry.register(getGenerativeAiConnectorType()); -+ connectorTypeRegistry.register(getOpenAIConnectorType()); - connectorTypeRegistry.register(getBedrockConnectorType()); - connectorTypeRegistry.register(getTeamsConnectorType()); - connectorTypeRegistry.register(getTorqConnectorType()); -Index: x-pack/plugins/stack_connectors/public/connector_types/gen_ai/api.test.ts -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/api.test.ts b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/api.test.ts -rename from x-pack/plugins/stack_connectors/public/connector_types/gen_ai/api.test.ts -rename to x-pack/plugins/stack_connectors/public/connector_types/open_ai/api.test.ts ---- a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/api.test.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/api.test.ts (revision f26c1b78fba7b88efe9f13c938daf875d8512498) -@@ -7,7 +7,7 @@ - - import { httpServiceMock } from '@kbn/core-http-browser-mocks'; - import { getDashboard } from './api'; --import { SUB_ACTION } from '../../../common/gen_ai/constants'; -+import { SUB_ACTION } from '../../../common/open_ai/constants'; - const response = { - available: true, - }; -Index: x-pack/plugins/stack_connectors/public/connector_types/gen_ai/api.ts -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/api.ts b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/api.ts -rename from x-pack/plugins/stack_connectors/public/connector_types/gen_ai/api.ts -rename to x-pack/plugins/stack_connectors/public/connector_types/open_ai/api.ts ---- a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/api.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/api.ts (revision f26c1b78fba7b88efe9f13c938daf875d8512498) -@@ -7,7 +7,7 @@ - - import { HttpSetup } from '@kbn/core-http-browser'; - import { ActionTypeExecutorResult, BASE_ACTION_API_PATH } from '@kbn/actions-plugin/common'; --import { SUB_ACTION } from '../../../common/gen_ai/constants'; -+import { SUB_ACTION } from '../../../common/open_ai/constants'; - import { ConnectorExecutorResult, rewriteResponseToCamelCase } from '../lib/rewrite_response_body'; - - export async function getDashboard({ -Index: x-pack/plugins/stack_connectors/public/connector_types/gen_ai/connector.test.tsx -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/connector.test.tsx b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/connector.test.tsx -rename from x-pack/plugins/stack_connectors/public/connector_types/gen_ai/connector.test.tsx -rename to x-pack/plugins/stack_connectors/public/connector_types/open_ai/connector.test.tsx ---- a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/connector.test.tsx (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/connector.test.tsx (revision 9a59bf47d9b8beb788fe724dff7302514251ea7c) -@@ -6,11 +6,11 @@ - */ - - import React from 'react'; --import GenerativeAiConnectorFields from './connector'; -+import ConnectorFields from './connector'; - import { ConnectorFormTestProvider } from '../lib/test_utils'; - import { act, fireEvent, render, waitFor } from '@testing-library/react'; - import userEvent from '@testing-library/user-event'; --import { DEFAULT_OPENAI_MODEL, OpenAiProviderType } from '../../../common/gen_ai/constants'; -+import { DEFAULT_OPENAI_MODEL, OpenAiProviderType } from '../../../common/open_ai/constants'; - import { useKibana } from '@kbn/triggers-actions-ui-plugin/public'; - import { useGetDashboard } from './use_get_dashboard'; - -@@ -21,7 +21,7 @@ - const mockDashboard = useGetDashboard as jest.Mock; - const openAiConnector = { - actionTypeId: '.gen-ai', -- name: 'genAi', -+ name: 'OpenAI', - id: '123', - config: { - apiUrl: 'https://openaiurl.com', -@@ -46,7 +46,7 @@ - - const navigateToUrl = jest.fn(); - --describe('GenerativeAiConnectorFields renders', () => { -+describe('ConnectorFields renders', () => { - beforeEach(() => { - jest.clearAllMocks(); - useKibanaMock().services.application.navigateToUrl = navigateToUrl; -@@ -57,11 +57,7 @@ - test('open ai connector fields are rendered', async () => { - const { getAllByTestId } = render( - -- {}} -- /> -+ {}} /> - - ); - expect(getAllByTestId('config.apiUrl-input')[0]).toBeInTheDocument(); -@@ -77,11 +73,7 @@ - test('azure ai connector fields are rendered', async () => { - const { getAllByTestId } = render( - -- {}} -- /> -+ {}} /> - - ); - expect(getAllByTestId('config.apiUrl-input')[0]).toBeInTheDocument(); -@@ -98,11 +90,7 @@ - it('Does not render if isEdit is false and dashboardUrl is defined', async () => { - const { queryByTestId } = render( - -- {}} -- /> -+ {}} /> - - ); - expect(queryByTestId('link-gen-ai-token-dashboard')).not.toBeInTheDocument(); -@@ -113,11 +101,7 @@ - })); - const { queryByTestId } = render( - -- {}} -- /> -+ {}} /> - - ); - expect(queryByTestId('link-gen-ai-token-dashboard')).not.toBeInTheDocument(); -@@ -125,11 +109,7 @@ - it('Renders if isEdit is true and dashboardUrl is defined', async () => { - const { getByTestId } = render( - -- {}} -- /> -+ {}} /> - - ); - expect(getByTestId('link-gen-ai-token-dashboard')).toBeInTheDocument(); -@@ -137,11 +117,7 @@ - it('On click triggers redirect with correct saved object id', async () => { - const { getByTestId } = render( - -- {}} -- /> -+ {}} /> - - ); - fireEvent.click(getByTestId('link-gen-ai-token-dashboard')); -@@ -158,11 +134,7 @@ - it('connector validation succeeds when connector config is valid', async () => { - const { getByTestId } = render( - -- {}} -- /> -+ {}} /> - - ); - -@@ -191,11 +163,7 @@ - - const res = render( - -- {}} -- /> -+ {}} /> - - ); - -@@ -224,11 +192,7 @@ - - const res = render( - -- {}} -- /> -+ {}} /> - - ); - -Index: x-pack/plugins/stack_connectors/public/connector_types/gen_ai/connector.tsx -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/connector.tsx b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/connector.tsx -rename from x-pack/plugins/stack_connectors/public/connector_types/gen_ai/connector.tsx -rename to x-pack/plugins/stack_connectors/public/connector_types/open_ai/connector.tsx ---- a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/connector.tsx (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/connector.tsx (revision 9a59bf47d9b8beb788fe724dff7302514251ea7c) -@@ -19,8 +19,8 @@ - } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; - import { useKibana } from '@kbn/triggers-actions-ui-plugin/public'; - import { fieldValidators } from '@kbn/es-ui-shared-plugin/static/forms/helpers'; -+import { OpenAiProviderType } from '../../../common/open_ai/constants'; - import { useGetDashboard } from './use_get_dashboard'; --import { OpenAiProviderType } from '../../../common/gen_ai/constants'; - import * as i18n from './translations'; - import { - azureAiConfig, -@@ -31,10 +31,7 @@ - } from './constants'; - const { emptyField } = fieldValidators; - --const GenerativeAiConnectorFields: React.FC = ({ -- readOnly, -- isEdit, --}) => { -+const ConnectorFields: React.FC = ({ readOnly, isEdit }) => { - const { getFieldDefaultValue } = useFormContext(); - const [{ config, id, name }] = useFormData({ - watch: ['config.apiProvider'], -@@ -117,4 +114,4 @@ - }; - - // eslint-disable-next-line import/no-default-export --export { GenerativeAiConnectorFields as default }; -+export { ConnectorFields as default }; -Index: x-pack/plugins/stack_connectors/public/connector_types/gen_ai/constants.tsx -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/constants.tsx b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/constants.tsx -rename from x-pack/plugins/stack_connectors/public/connector_types/gen_ai/constants.tsx -rename to x-pack/plugins/stack_connectors/public/connector_types/open_ai/constants.tsx ---- a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/constants.tsx (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/constants.tsx (revision f26c1b78fba7b88efe9f13c938daf875d8512498) -@@ -9,7 +9,7 @@ - import { ConfigFieldSchema, SecretsFieldSchema } from '@kbn/triggers-actions-ui-plugin/public'; - import { FormattedMessage } from '@kbn/i18n-react'; - import { EuiLink } from '@elastic/eui'; --import { DEFAULT_OPENAI_MODEL, OpenAiProviderType } from '../../../common/gen_ai/constants'; -+import { DEFAULT_OPENAI_MODEL, OpenAiProviderType } from '../../../common/open_ai/constants'; - import * as i18n from './translations'; - - export const DEFAULT_URL = 'https://api.openai.com/v1/chat/completions' as const; -Index: x-pack/plugins/stack_connectors/public/connector_types/gen_ai/index.ts -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/index.ts b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/index.ts -rename from x-pack/plugins/stack_connectors/public/connector_types/gen_ai/index.ts -rename to x-pack/plugins/stack_connectors/public/connector_types/open_ai/index.ts ---- a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/index.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/index.ts (revision 9a59bf47d9b8beb788fe724dff7302514251ea7c) -@@ -5,4 +5,4 @@ - * 2.0. - */ - --export { getConnectorType as getGenerativeAiConnectorType } from './gen_ai'; -+export { getConnectorType as getOpenAIConnectorType } from './open_ai'; -Index: x-pack/plugins/stack_connectors/public/connector_types/gen_ai/gen_ai.test.tsx -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/gen_ai.test.tsx b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/open_ai.test.tsx -rename from x-pack/plugins/stack_connectors/public/connector_types/gen_ai/gen_ai.test.tsx -rename to x-pack/plugins/stack_connectors/public/connector_types/open_ai/open_ai.test.tsx ---- a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/gen_ai.test.tsx (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/open_ai.test.tsx (revision f26c1b78fba7b88efe9f13c938daf875d8512498) -@@ -9,7 +9,7 @@ - import { registerConnectorTypes } from '..'; - import type { ActionTypeModel } from '@kbn/triggers-actions-ui-plugin/public/types'; - import { registrationServicesMock } from '../../mocks'; --import { SUB_ACTION } from '../../../common/gen_ai/constants'; -+import { SUB_ACTION } from '../../../common/open_ai/constants'; - - const ACTION_TYPE_ID = '.gen-ai'; - let actionTypeModel: ActionTypeModel; -@@ -26,12 +26,12 @@ - describe('actionTypeRegistry.get() works', () => { - test('connector type static data is as expected', () => { - expect(actionTypeModel.id).toEqual(ACTION_TYPE_ID); -- expect(actionTypeModel.selectMessage).toBe('Send a request to generative AI systems.'); -+ expect(actionTypeModel.selectMessage).toBe('Send a request to OpenAI systems.'); - expect(actionTypeModel.actionTypeTitle).toBe('OpenAI'); - }); - }); - --describe('gen ai action params validation', () => { -+describe('OpenAI action params validation', () => { - test('action params validation succeeds when action params is valid', async () => { - const actionParams = { - subAction: SUB_ACTION.RUN, -Index: x-pack/plugins/stack_connectors/public/connector_types/gen_ai/gen_ai.tsx -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/gen_ai.tsx b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/open_ai.tsx -rename from x-pack/plugins/stack_connectors/public/connector_types/gen_ai/gen_ai.tsx -rename to x-pack/plugins/stack_connectors/public/connector_types/open_ai/open_ai.tsx ---- a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/gen_ai.tsx (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/open_ai.tsx (revision 9a59bf47d9b8beb788fe724dff7302514251ea7c) -@@ -8,24 +8,24 @@ - import { lazy } from 'react'; - import { i18n } from '@kbn/i18n'; - import type { GenericValidationResult } from '@kbn/triggers-actions-ui-plugin/public/types'; --import { SUB_ACTION } from '../../../common/gen_ai/constants'; --import { GEN_AI_CONNECTOR_ID, OPEN_AI_TITLE } from '../../../common/gen_ai/constants'; --import { GenerativeAiActionParams, GenerativeAiConnector } from './types'; -+import { SUB_ACTION } from '../../../common/open_ai/constants'; -+import { OPEN_AI_CONNECTOR_ID, OPEN_AI_TITLE } from '../../../common/open_ai/constants'; -+import { ActionParams, OpenAIConnector } from './types'; - - interface ValidationErrors { - subAction: string[]; - body: string[]; - } --export function getConnectorType(): GenerativeAiConnector { -+export function getConnectorType(): OpenAIConnector { - return { -- id: GEN_AI_CONNECTOR_ID, -+ id: OPEN_AI_CONNECTOR_ID, - iconClass: lazy(() => import('./logo')), - selectMessage: i18n.translate('xpack.stackConnectors.components.genAi.selectMessageText', { -- defaultMessage: 'Send a request to generative AI systems.', -+ defaultMessage: 'Send a request to OpenAI systems.', - }), - actionTypeTitle: OPEN_AI_TITLE, - validateParams: async ( -- actionParams: GenerativeAiActionParams -+ actionParams: ActionParams - ): Promise> => { - const { subAction, subActionParams } = actionParams; - const translations = await import('./translations'); -Index: x-pack/plugins/stack_connectors/public/connector_types/gen_ai/params.test.tsx -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/params.test.tsx b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/params.test.tsx -rename from x-pack/plugins/stack_connectors/public/connector_types/gen_ai/params.test.tsx -rename to x-pack/plugins/stack_connectors/public/connector_types/open_ai/params.test.tsx ---- a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/params.test.tsx (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/params.test.tsx (revision 9a59bf47d9b8beb788fe724dff7302514251ea7c) -@@ -7,9 +7,9 @@ - - import React from 'react'; - import { fireEvent, render } from '@testing-library/react'; --import GenerativeAiParamsFields from './params'; -+import ParamsFields from './params'; - import { MockCodeEditor } from '@kbn/triggers-actions-ui-plugin/public/application/code_editor.mock'; --import { OpenAiProviderType, SUB_ACTION } from '../../../common/gen_ai/constants'; -+import { OpenAiProviderType, SUB_ACTION } from '../../../common/open_ai/constants'; - import { DEFAULT_BODY, DEFAULT_BODY_AZURE, DEFAULT_URL } from './constants'; - - const kibanaReactPath = '../../../../../../src/plugins/kibana_react/public'; -@@ -34,7 +34,7 @@ - describe('Gen AI Params Fields renders', () => { - test('all params fields are rendered', () => { - const { getByTestId } = render( -- UTF-8 -=================================================================== -diff --git a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/params.tsx b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/params.tsx -rename from x-pack/plugins/stack_connectors/public/connector_types/gen_ai/params.tsx -rename to x-pack/plugins/stack_connectors/public/connector_types/open_ai/params.tsx ---- a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/params.tsx (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/params.tsx (revision 9a59bf47d9b8beb788fe724dff7302514251ea7c) -@@ -12,13 +12,11 @@ - ActionConnectorMode, - JsonEditorWithMessageVariables, - } from '@kbn/triggers-actions-ui-plugin/public'; -+import { OpenAiProviderType, SUB_ACTION } from '../../../common/open_ai/constants'; - import { DEFAULT_BODY, DEFAULT_BODY_AZURE } from './constants'; --import { OpenAiProviderType, SUB_ACTION } from '../../../common/gen_ai/constants'; --import { GenerativeAiActionConnector, GenerativeAiActionParams } from './types'; -+import { GenerativeAiActionConnector, ActionParams } from './types'; - --const GenerativeAiParamsFields: React.FunctionComponent< -- ActionParamsProps --> = ({ -+const ParamsFields: React.FunctionComponent> = ({ - actionConnector, - actionParams, - editAction, -@@ -55,7 +53,7 @@ - }, [typedActionConnector?.config?.apiProvider, editAction, index, subActionParams]); - - const editSubActionParams = useCallback( -- (params: GenerativeAiActionParams['subActionParams']) => { -+ (params: ActionParams['subActionParams']) => { - editAction('subActionParams', { ...subActionParams, ...params }, index); - }, - [editAction, index, subActionParams] -@@ -87,4 +85,4 @@ - }; - - // eslint-disable-next-line import/no-default-export --export { GenerativeAiParamsFields as default }; -+export { ParamsFields as default }; -Index: x-pack/plugins/stack_connectors/public/connector_types/gen_ai/translations.ts -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/translations.ts b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/translations.ts -rename from x-pack/plugins/stack_connectors/public/connector_types/gen_ai/translations.ts -rename to x-pack/plugins/stack_connectors/public/connector_types/open_ai/translations.ts ---- a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/translations.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/translations.ts (revision 9a59bf47d9b8beb788fe724dff7302514251ea7c) -@@ -25,14 +25,6 @@ - } - ); - --export const DEFAULT_MODEL_TOOLTIP_CONTENT = i18n.translate( -- 'xpack.stackConnectors.components.genAi.defaultModelTooltipContent', -- { -- defaultMessage: -- 'The model can be set on a per request basis by including a "model" parameter in the request body. If no model is provided, the fallback will be the default model.', -- } --); -- - export const API_PROVIDER_LABEL = i18n.translate( - 'xpack.stackConnectors.components.genAi.apiProviderLabel', - { -@@ -105,6 +97,6 @@ - export const GET_DASHBOARD_API_ERROR = i18n.translate( - 'xpack.stackConnectors.components.genAi.error.dashboardApiError', - { -- defaultMessage: 'Error finding Generative AI Token Usage Dashboard.', -+ defaultMessage: 'Error finding OpenAI Token Usage Dashboard.', - } - ); -Index: x-pack/plugins/stack_connectors/public/connector_types/gen_ai/types.ts -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/types.ts b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/types.ts -rename from x-pack/plugins/stack_connectors/public/connector_types/gen_ai/types.ts -rename to x-pack/plugins/stack_connectors/public/connector_types/open_ai/types.ts ---- a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/types.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/types.ts (revision 9a59bf47d9b8beb788fe724dff7302514251ea7c) -@@ -7,29 +7,22 @@ - - import { ActionTypeModel as ConnectorTypeModel } from '@kbn/triggers-actions-ui-plugin/public'; - import { UserConfiguredActionConnector } from '@kbn/triggers-actions-ui-plugin/public/types'; --import { OpenAiProviderType, SUB_ACTION } from '../../../common/gen_ai/constants'; --import { RunActionParams } from '../../../common/gen_ai/types'; -+import { OpenAiProviderType, SUB_ACTION } from '../../../common/open_ai/constants'; -+import { RunActionParams } from '../../../common/open_ai/types'; - --export interface GenerativeAiActionParams { -+export interface ActionParams { - subAction: SUB_ACTION.RUN | SUB_ACTION.TEST; - subActionParams: RunActionParams; - } - --export interface GenerativeAiConfig { -+export interface Config { - apiProvider: OpenAiProviderType; - apiUrl: string; - } - --export interface GenerativeAiSecrets { -+export interface Secrets { - apiKey: string; - } - --export type GenerativeAiConnector = ConnectorTypeModel< -- GenerativeAiConfig, -- GenerativeAiSecrets, -- GenerativeAiActionParams -->; --export type GenerativeAiActionConnector = UserConfiguredActionConnector< -- GenerativeAiConfig, -- GenerativeAiSecrets -->; -+export type OpenAIConnector = ConnectorTypeModel; -+export type GenerativeAiActionConnector = UserConfiguredActionConnector; -Index: x-pack/plugins/stack_connectors/public/connector_types/gen_ai/use_get_dashboard.test.ts -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/use_get_dashboard.test.ts b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/use_get_dashboard.test.ts -rename from x-pack/plugins/stack_connectors/public/connector_types/gen_ai/use_get_dashboard.test.ts -rename to x-pack/plugins/stack_connectors/public/connector_types/open_ai/use_get_dashboard.test.ts ---- a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/use_get_dashboard.test.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/use_get_dashboard.test.ts (revision f26c1b78fba7b88efe9f13c938daf875d8512498) -@@ -123,7 +123,7 @@ - await waitForNextUpdate(); - expect(result.current.isLoading).toBe(false); - expect(mockToasts.addDanger).toHaveBeenCalledWith({ -- title: 'Error finding Generative AI Token Usage Dashboard.', -+ title: 'Error finding OpenAI Token Usage Dashboard.', - text: 'Error fetching dashboard', - }); - }); -Index: x-pack/plugins/stack_connectors/server/connector_types/index.ts -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/plugins/stack_connectors/server/connector_types/index.ts b/x-pack/plugins/stack_connectors/server/connector_types/index.ts ---- a/x-pack/plugins/stack_connectors/server/connector_types/index.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/plugins/stack_connectors/server/connector_types/index.ts (revision 9a59bf47d9b8beb788fe724dff7302514251ea7c) -@@ -17,7 +17,7 @@ - import { getActionType as getTorqConnectorType } from './torq'; - import { getConnectorType as getEmailConnectorType } from './email'; - import { getConnectorType as getIndexConnectorType } from './es_index'; --import { getConnectorType as getGenerativeAiConnectorType } from './gen_ai'; -+import { getConnectorType as getOpenAIConnectorType } from './open_ai'; - import { getConnectorType as getBedrockConnectorType } from './bedrock'; - import { getConnectorType as getPagerDutyConnectorType } from './pagerduty'; - import { getConnectorType as getSwimlaneConnectorType } from './swimlane'; -@@ -101,7 +101,7 @@ - - actions.registerSubActionConnectorType(getOpsgenieConnectorType()); - actions.registerSubActionConnectorType(getTinesConnectorType()); -- actions.registerSubActionConnectorType(getGenerativeAiConnectorType()); -+ actions.registerSubActionConnectorType(getOpenAIConnectorType()); - actions.registerSubActionConnectorType(getBedrockConnectorType()); - actions.registerSubActionConnectorType(getD3SecurityConnectorType()); - } -Index: x-pack/plugins/stack_connectors/server/connector_types/gen_ai/dashboard.ts -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/dashboard.ts b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/dashboard.ts -rename from x-pack/plugins/stack_connectors/server/connector_types/gen_ai/dashboard.ts -rename to x-pack/plugins/stack_connectors/server/connector_types/open_ai/dashboard.ts ---- a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/dashboard.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/dashboard.ts (revision f26c1b78fba7b88efe9f13c938daf875d8512498) -@@ -9,7 +9,7 @@ - import { v4 as uuidv4 } from 'uuid'; - import { SavedObject } from '@kbn/core-saved-objects-common/src/server_types'; - --export const dashboardTitle = `Generative AI Token Usage`; -+export const dashboardTitle = `OpenAI Token Usage`; - - export const getDashboard = (dashboardId: string): SavedObject => { - const ids: Record = { -@@ -125,7 +125,7 @@ - yLeft: 0, - yRight: 0, - }, -- yTitle: 'Sum of GenAi Completion + Prompt Tokens', -+ yTitle: 'Sum of OpenAI Completion + Prompt Tokens', - axisTitlesVisibilitySettings: { - x: true, - yLeft: true, -@@ -143,7 +143,7 @@ - '475e8ca0-e78e-454a-8597-a5492f70dce3': { - columns: { - '0f9814ec-0964-4efa-93a3-c7f173df2483': { -- label: 'GenAI Completion Tokens', -+ label: 'OpenAI Completion Tokens', - dataType: 'number', - operationType: 'sum', - sourceField: 'kibana.action.execution.gen_ai.usage.completion_tokens', -@@ -177,7 +177,7 @@ - includeIsRegex: false, - excludeIsRegex: false, - orderAgg: { -- label: 'Sum of kibana.action.execution.gen_ai.usage.total_tokens', -+ label: 'Sum of kibana.action.execution.open_ai.usage.total_tokens', - dataType: 'number', - operationType: 'sum', - sourceField: 'kibana.action.execution.gen_ai.usage.total_tokens', -@@ -192,7 +192,7 @@ - customLabel: true, - }, - 'b0e390e4-d754-4eb4-9fcc-4347dadda394': { -- label: 'GenAi Prompt Tokens', -+ label: 'OpenAI Prompt Tokens', - dataType: 'number', - operationType: 'sum', - sourceField: 'kibana.action.execution.gen_ai.usage.prompt_tokens', -@@ -334,7 +334,7 @@ - customLabel: true, - }, - 'b0e390e4-d754-4eb4-9fcc-4347dadda394': { -- label: 'Sum of GenAI Total Tokens', -+ label: 'Sum of OpenAI Total Tokens', - dataType: 'number', - operationType: 'sum', - sourceField: 'kibana.action.execution.gen_ai.usage.total_tokens', -Index: x-pack/plugins/stack_connectors/server/connector_types/gen_ai/index.test.ts -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/index.test.ts b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/index.test.ts -rename from x-pack/plugins/stack_connectors/server/connector_types/gen_ai/index.test.ts -rename to x-pack/plugins/stack_connectors/server/connector_types/open_ai/index.test.ts ---- a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/index.test.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/index.test.ts (revision f26c1b78fba7b88efe9f13c938daf875d8512498) -@@ -9,9 +9,9 @@ - import { ActionsConfigurationUtilities } from '@kbn/actions-plugin/server/actions_config'; - import axios from 'axios'; - import { configValidator, getConnectorType } from '.'; --import { Config, Secrets } from '../../../common/gen_ai/types'; -+import { Config, Secrets } from '../../../common/open_ai/types'; - import { SubActionConnectorType } from '@kbn/actions-plugin/server/sub_action_framework/types'; --import { DEFAULT_OPENAI_MODEL, OpenAiProviderType } from '../../../common/gen_ai/constants'; -+import { DEFAULT_OPENAI_MODEL, OpenAiProviderType } from '../../../common/open_ai/constants'; - - jest.mock('axios'); - jest.mock('@kbn/actions-plugin/server/lib/axios_utils', () => { -@@ -30,12 +30,12 @@ - let connectorType: SubActionConnectorType; - let configurationUtilities: jest.Mocked; - --describe('Generative AI Connector', () => { -+describe('OpenAI Connector', () => { - beforeEach(() => { - configurationUtilities = actionsConfigMock.create(); - connectorType = getConnectorType(); - }); -- test('exposes the connector as `Generative AI` with id `.gen-ai`', () => { -+ test('exposes the connector as `OpenAI` with id `.gen-ai`', () => { - expect(connectorType.id).toEqual('.gen-ai'); - expect(connectorType.name).toEqual('OpenAI'); - }); -@@ -59,7 +59,7 @@ - expect(() => { - configValidator(config, { configurationUtilities }); - }).toThrowErrorMatchingInlineSnapshot( -- '"Error configuring Generative AI action: Error: URL Error: Invalid URL: example.com/do-something"' -+ '"Error configuring OpenAI action: Error: URL Error: Invalid URL: example.com/do-something"' - ); - }); - -@@ -72,7 +72,7 @@ - expect(() => { - configValidator(config, { configurationUtilities }); - }).toThrowErrorMatchingInlineSnapshot( -- '"Error configuring Generative AI action: Error: API Provider is not supported"' -+ '"Error configuring OpenAI action: Error: API Provider is not supported"' - ); - }); - -@@ -85,7 +85,7 @@ - expect(() => { - configValidator(config, { configurationUtilities }); - }).toThrowErrorMatchingInlineSnapshot( -- '"Error configuring Generative AI action: Error: API Provider is not supported: bad-one"' -+ '"Error configuring OpenAI action: Error: API Provider is not supported: bad-one"' - ); - }); - -@@ -106,7 +106,7 @@ - expect(() => { - configValidator(config, { configurationUtilities: configUtils }); - }).toThrowErrorMatchingInlineSnapshot( -- `"Error configuring Generative AI action: Error: error validating url: target url is not present in allowedHosts"` -+ `"Error configuring OpenAI action: Error: error validating url: target url is not present in allowedHosts"` - ); - }); - }); -Index: x-pack/plugins/stack_connectors/server/connector_types/gen_ai/index.ts -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/index.ts b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/index.ts -rename from x-pack/plugins/stack_connectors/server/connector_types/gen_ai/index.ts -rename to x-pack/plugins/stack_connectors/server/connector_types/open_ai/index.ts ---- a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/index.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/index.ts (revision 71d2b0ceabdf7a6dbcfec328c0d4c6b29a2624dd) -@@ -10,30 +10,30 @@ - SubActionConnectorType, - ValidatorType, - } from '@kbn/actions-plugin/server/sub_action_framework/types'; --import { GeneralConnectorFeatureId } from '@kbn/actions-plugin/common'; -+import { GenerativeAIConnectorFeatureId } from '@kbn/actions-plugin/common'; - import { urlAllowListValidator } from '@kbn/actions-plugin/server'; - import { ValidatorServices } from '@kbn/actions-plugin/server/types'; - import { assertURL } from '@kbn/actions-plugin/server/sub_action_framework/helpers/validators'; - import { -- GEN_AI_CONNECTOR_ID, -+ OPEN_AI_CONNECTOR_ID, - OPEN_AI_TITLE, - OpenAiProviderType, --} from '../../../common/gen_ai/constants'; --import { ConfigSchema, SecretsSchema } from '../../../common/gen_ai/schema'; --import { Config, Secrets } from '../../../common/gen_ai/types'; --import { GenAiConnector } from './gen_ai'; -+} from '../../../common/open_ai/constants'; -+import { ConfigSchema, SecretsSchema } from '../../../common/open_ai/schema'; -+import { Config, Secrets } from '../../../common/open_ai/types'; -+import { OpenAIConnector } from './open_ai'; - import { renderParameterTemplates } from './render'; - - export const getConnectorType = (): SubActionConnectorType => ({ -- id: GEN_AI_CONNECTOR_ID, -+ id: OPEN_AI_CONNECTOR_ID, - name: OPEN_AI_TITLE, -- Service: GenAiConnector, -+ Service: OpenAIConnector, - schema: { - config: ConfigSchema, - secrets: SecretsSchema, - }, - validators: [{ type: ValidatorType.CONFIG, validator: configValidator }], -- supportedFeatureIds: [GeneralConnectorFeatureId], -+ supportedFeatureIds: [GenerativeAIConnectorFeatureId], - minimumLicenseRequired: 'enterprise' as const, - renderParameterTemplates, - }); -@@ -57,7 +57,7 @@ - } catch (err) { - throw new Error( - i18n.translate('xpack.stackConnectors.genAi.configurationErrorApiProvider', { -- defaultMessage: 'Error configuring Generative AI action: {err}', -+ defaultMessage: 'Error configuring OpenAI action: {err}', - values: { - err, - }, -Index: x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/azure_openai_utils.test.ts -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/azure_openai_utils.test.ts b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/azure_openai_utils.test.ts -rename from x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/azure_openai_utils.test.ts -rename to x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/azure_openai_utils.test.ts ---- a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/azure_openai_utils.test.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/azure_openai_utils.test.ts (revision f26c1b78fba7b88efe9f13c938daf875d8512498) -@@ -14,7 +14,7 @@ - AZURE_OPENAI_CHAT_URL, - AZURE_OPENAI_COMPLETIONS_URL, - AZURE_OPENAI_COMPLETIONS_EXTENSIONS_URL, --} from '../../../../common/gen_ai/constants'; -+} from '../../../../common/open_ai/constants'; - - describe('Azure Open AI Utils', () => { - const chatUrl = -Index: x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/azure_openai_utils.ts -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/azure_openai_utils.ts b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/azure_openai_utils.ts -rename from x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/azure_openai_utils.ts -rename to x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/azure_openai_utils.ts ---- a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/azure_openai_utils.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/azure_openai_utils.ts (revision f26c1b78fba7b88efe9f13c938daf875d8512498) -@@ -9,7 +9,7 @@ - AZURE_OPENAI_CHAT_URL, - AZURE_OPENAI_COMPLETIONS_URL, - AZURE_OPENAI_COMPLETIONS_EXTENSIONS_URL, --} from '../../../../common/gen_ai/constants'; -+} from '../../../../common/open_ai/constants'; - - const APIS_ALLOWING_STREAMING = new Set([ - AZURE_OPENAI_CHAT_URL, -Index: x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/openai_utils.test.ts -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/openai_utils.test.ts b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/openai_utils.test.ts -rename from x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/openai_utils.test.ts -rename to x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/openai_utils.test.ts ---- a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/openai_utils.test.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/openai_utils.test.ts (revision f26c1b78fba7b88efe9f13c938daf875d8512498) -@@ -10,7 +10,7 @@ - DEFAULT_OPENAI_MODEL, - OPENAI_CHAT_URL, - OPENAI_LEGACY_COMPLETION_URL, --} from '../../../../common/gen_ai/constants'; -+} from '../../../../common/open_ai/constants'; - - describe('Open AI Utils', () => { - describe('sanitizeRequest', () => { -Index: x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/openai_utils.ts -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/openai_utils.ts b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/openai_utils.ts -rename from x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/openai_utils.ts -rename to x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/openai_utils.ts ---- a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/openai_utils.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/openai_utils.ts (revision f26c1b78fba7b88efe9f13c938daf875d8512498) -@@ -5,7 +5,10 @@ - * 2.0. - */ - --import { OPENAI_CHAT_URL, OPENAI_LEGACY_COMPLETION_URL } from '../../../../common/gen_ai/constants'; -+import { -+ OPENAI_CHAT_URL, -+ OPENAI_LEGACY_COMPLETION_URL, -+} from '../../../../common/open_ai/constants'; - - const APIS_ALLOWING_STREAMING = new Set([OPENAI_CHAT_URL, OPENAI_LEGACY_COMPLETION_URL]); - -Index: x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/utils.test.ts -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/utils.test.ts b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/utils.test.ts -rename from x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/utils.test.ts -rename to x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/utils.test.ts ---- a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/utils.test.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/utils.test.ts (revision f26c1b78fba7b88efe9f13c938daf875d8512498) -@@ -10,7 +10,7 @@ - DEFAULT_OPENAI_MODEL, - OpenAiProviderType, - OPENAI_CHAT_URL, --} from '../../../../common/gen_ai/constants'; -+} from '../../../../common/open_ai/constants'; - import { - sanitizeRequest as openAiSanitizeRequest, - getRequestWithStreamOption as openAiGetRequestWithStreamOption, -Index: x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/utils.ts -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/utils.ts b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/utils.ts -rename from x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/utils.ts -rename to x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/utils.ts ---- a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/lib/utils.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/utils.ts (revision f26c1b78fba7b88efe9f13c938daf875d8512498) -@@ -7,7 +7,7 @@ - - import { AxiosResponse, ResponseType } from 'axios'; - import { IncomingMessage } from 'http'; --import { OpenAiProviderType } from '../../../../common/gen_ai/constants'; -+import { OpenAiProviderType } from '../../../../common/open_ai/constants'; - import { - sanitizeRequest as openAiSanitizeRequest, - getRequestWithStreamOption as openAiGetRequestWithStreamOption, -Index: x-pack/plugins/stack_connectors/server/connector_types/gen_ai/gen_ai.test.ts -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/gen_ai.test.ts b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/open_ai.test.ts -rename from x-pack/plugins/stack_connectors/server/connector_types/gen_ai/gen_ai.test.ts -rename to x-pack/plugins/stack_connectors/server/connector_types/open_ai/open_ai.test.ts ---- a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/gen_ai.test.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/open_ai.test.ts (revision 71d2b0ceabdf7a6dbcfec328c0d4c6b29a2624dd) -@@ -5,20 +5,20 @@ - * 2.0. - */ - --import { GenAiConnector } from './gen_ai'; -+import { OpenAIConnector } from './open_ai'; - import { actionsConfigMock } from '@kbn/actions-plugin/server/actions_config.mock'; - import { - DEFAULT_OPENAI_MODEL, -- GEN_AI_CONNECTOR_ID, -+ OPEN_AI_CONNECTOR_ID, - OpenAiProviderType, --} from '../../../common/gen_ai/constants'; -+} from '../../../common/open_ai/constants'; - import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; - import { actionsMock } from '@kbn/actions-plugin/server/mocks'; --import { RunActionResponseSchema, StreamingResponseSchema } from '../../../common/gen_ai/schema'; -+import { RunActionResponseSchema, StreamingResponseSchema } from '../../../common/open_ai/schema'; - import { initDashboard } from './create_dashboard'; - jest.mock('./create_dashboard'); - --describe('GenAiConnector', () => { -+describe('OpenAIConnector', () => { - let mockRequest: jest.Mock; - let mockError: jest.Mock; - const mockResponseString = 'Hello! How can I assist you today?'; -@@ -46,9 +46,9 @@ - }); - - describe('OpenAI', () => { -- const connector = new GenAiConnector({ -+ const connector = new OpenAIConnector({ - configurationUtilities: actionsConfigMock.create(), -- connector: { id: '1', type: GEN_AI_CONNECTOR_ID }, -+ connector: { id: '1', type: OPEN_AI_CONNECTOR_ID }, - config: { - apiUrl: 'https://api.openai.com/v1/chat/completions', - apiProvider: OpenAiProviderType.OpenAi, -@@ -285,9 +285,9 @@ - }); - - describe('AzureAI', () => { -- const connector = new GenAiConnector({ -+ const connector = new OpenAIConnector({ - configurationUtilities: actionsConfigMock.create(), -- connector: { id: '1', type: GEN_AI_CONNECTOR_ID }, -+ connector: { id: '1', type: OPEN_AI_CONNECTOR_ID }, - config: { - apiUrl: - 'https://My-test-resource-123.openai.azure.com/openai/deployments/NEW-DEPLOYMENT-321/chat/completions?api-version=2023-05-15', -@@ -455,9 +455,9 @@ - }); - - describe('Token dashboard', () => { -- const connector = new GenAiConnector({ -+ const connector = new OpenAIConnector({ - configurationUtilities: actionsConfigMock.create(), -- connector: { id: '1', type: GEN_AI_CONNECTOR_ID }, -+ connector: { id: '1', type: OPEN_AI_CONNECTOR_ID }, - config: { apiUrl: 'https://example.com/api', apiProvider: OpenAiProviderType.AzureAi }, - secrets: { apiKey: '123' }, - logger: loggingSystemMock.createLogger(), -Index: x-pack/plugins/stack_connectors/server/connector_types/gen_ai/gen_ai.ts -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/gen_ai.ts b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/open_ai.ts -rename from x-pack/plugins/stack_connectors/server/connector_types/gen_ai/gen_ai.ts -rename to x-pack/plugins/stack_connectors/server/connector_types/open_ai/open_ai.ts ---- a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/gen_ai.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/open_ai.ts (revision 71d2b0ceabdf7a6dbcfec328c0d4c6b29a2624dd) -@@ -7,7 +7,6 @@ - - import { ServiceParams, SubActionConnector } from '@kbn/actions-plugin/server'; - import type { AxiosError } from 'axios'; --import { initDashboard } from './create_dashboard'; - import { - RunActionParamsSchema, - RunActionResponseSchema, -@@ -15,21 +14,22 @@ - StreamActionParamsSchema, - StreamingResponseSchema, - InvokeAIActionParamsSchema, --} from '../../../common/gen_ai/schema'; -+} from '../../../common/open_ai/schema'; - import type { - Config, - Secrets, - RunActionParams, - RunActionResponse, - StreamActionParams, --} from '../../../common/gen_ai/types'; --import { SUB_ACTION } from '../../../common/gen_ai/constants'; -+} from '../../../common/open_ai/types'; -+import { SUB_ACTION } from '../../../common/open_ai/constants'; - import { - DashboardActionParams, - DashboardActionResponse, - InvokeAIActionParams, - InvokeAIActionResponse, --} from '../../../common/gen_ai/types'; -+} from '../../../common/open_ai/types'; -+import { initDashboard } from './create_dashboard'; - import { - getAxiosOptions, - getRequestWithStreamOption, -@@ -37,7 +37,7 @@ - sanitizeRequest, - } from './lib/utils'; - --export class GenAiConnector extends SubActionConnector { -+export class OpenAIConnector extends SubActionConnector { - private url; - private provider; - private key; -Index: x-pack/plugins/stack_connectors/server/connector_types/gen_ai/render.test.ts -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/render.test.ts b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/render.test.ts -rename from x-pack/plugins/stack_connectors/server/connector_types/gen_ai/render.test.ts -rename to x-pack/plugins/stack_connectors/server/connector_types/open_ai/render.test.ts ---- a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/render.test.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/render.test.ts (revision f26c1b78fba7b88efe9f13c938daf875d8512498) -@@ -17,7 +17,7 @@ - - const variables = { domain: 'm0zepcuuu2' }; - --describe('GenAI - renderParameterTemplates', () => { -+describe('OpenAI - renderParameterTemplates', () => { - it('should not render body on test action', () => { - const testParams = { subAction: 'test', subActionParams: { body: 'test_json' } }; - const result = renderParameterTemplates(testParams, variables); -Index: x-pack/plugins/stack_connectors/server/connector_types/gen_ai/render.ts -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/render.ts b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/render.ts -rename from x-pack/plugins/stack_connectors/server/connector_types/gen_ai/render.ts -rename to x-pack/plugins/stack_connectors/server/connector_types/open_ai/render.ts ---- a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/render.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/render.ts (revision f26c1b78fba7b88efe9f13c938daf875d8512498) -@@ -8,7 +8,7 @@ - import { ExecutorParams } from '@kbn/actions-plugin/server/sub_action_framework/types'; - import { renderMustacheString } from '@kbn/actions-plugin/server/lib/mustache_renderer'; - import { RenderParameterTemplates } from '@kbn/actions-plugin/server/types'; --import { SUB_ACTION } from '../../../common/gen_ai/constants'; -+import { SUB_ACTION } from '../../../common/open_ai/constants'; - - export const renderParameterTemplates: RenderParameterTemplates = ( - params, -Index: x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/index.ts -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/index.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/index.ts ---- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/index.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/index.ts (revision f26c1b78fba7b88efe9f13c938daf875d8512498) -@@ -39,7 +39,7 @@ - loadTestFile(require.resolve('./connector_types/xmatters')); - loadTestFile(require.resolve('./connector_types/tines')); - loadTestFile(require.resolve('./connector_types/torq')); -- loadTestFile(require.resolve('./connector_types/gen_ai')); -+ loadTestFile(require.resolve('./connector_types/open_ai')); - loadTestFile(require.resolve('./connector_types/d3security')); - loadTestFile(require.resolve('./connector_types/bedrock')); - loadTestFile(require.resolve('./create')); -Index: x-pack/test/screenshot_creation/apps/response_ops_docs/stack_connectors/generative_ai_connector.ts -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/test/screenshot_creation/apps/response_ops_docs/stack_connectors/generative_ai_connector.ts b/x-pack/test/screenshot_creation/apps/response_ops_docs/stack_connectors/generative_ai_connector.ts ---- a/x-pack/test/screenshot_creation/apps/response_ops_docs/stack_connectors/generative_ai_connector.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/test/screenshot_creation/apps/response_ops_docs/stack_connectors/generative_ai_connector.ts (revision f26c1b78fba7b88efe9f13c938daf875d8512498) -@@ -21,13 +21,13 @@ - `"content": "You are a cyber security analyst using Elastic Security. I would like you to evaluate the event below and format your output neatly in markdown syntax. Add your description, an accuracy rating, and a threat rating."\n` + - `}]`; - -- describe('generative ai connector', function () { -+ describe('OpenAI connector', function () { - beforeEach(async () => { - await pageObjects.common.navigateToApp('connectors'); - await pageObjects.header.waitUntilLoadingHasFinished(); - }); - -- it('generative ai connector screenshots', async () => { -+ it('OpenAI connector screenshots', async () => { - await pageObjects.common.navigateToApp('connectors'); - await pageObjects.header.waitUntilLoadingHasFinished(); - await actions.common.openNewConnectorForm('gen-ai'); -Index: x-pack/test/screenshot_creation/apps/response_ops_docs/stack_connectors/xmatters_connector.ts -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/test/screenshot_creation/apps/response_ops_docs/stack_connectors/xmatters_connector.ts b/x-pack/test/screenshot_creation/apps/response_ops_docs/stack_connectors/xmatters_connector.ts ---- a/x-pack/test/screenshot_creation/apps/response_ops_docs/stack_connectors/xmatters_connector.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/test/screenshot_creation/apps/response_ops_docs/stack_connectors/xmatters_connector.ts (revision f26c1b78fba7b88efe9f13c938daf875d8512498) -@@ -20,7 +20,7 @@ - await pageObjects.header.waitUntilLoadingHasFinished(); - }); - -- it('generative ai connector screenshots', async () => { -+ it('xmatters connector screenshots', async () => { - await pageObjects.common.navigateToApp('connectors'); - await pageObjects.header.waitUntilLoadingHasFinished(); - await actions.common.openNewConnectorForm('xmatters'); -Index: api_docs/actions.devdocs.json -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/api_docs/actions.devdocs.json b/api_docs/actions.devdocs.json ---- a/api_docs/actions.devdocs.json (revision 06445caf5021c473ab79d40f7975d7090b258a6f) -+++ b/api_docs/actions.devdocs.json (revision e3e527832a3a049f165d93e018dfb58d86900674) -@@ -5273,10 +5273,10 @@ - }, - { - "parentPluginId": "actions", -- "id": "def-common.GeneralConnectorFeatureId", -+ "id": "def-common.GenerativeAIConnectorFeatureId", - "type": "string", - "tags": [], -- "label": "GeneralConnectorFeatureId", -+ "label": "GenerativeAIConnectorFeatureId", - "description": [], - "signature": [ - "\"general\"" -@@ -5613,10 +5613,10 @@ - }, - { - "parentPluginId": "actions", -- "id": "def-common.GeneralFeature", -+ "id": "def-common.GenerativeAIFeature", - "type": "Object", - "tags": [], -- "label": "GeneralFeature", -+ "label": "GenerativeAIFeature", - "description": [], - "path": "x-pack/plugins/actions/common/connector_feature_config.ts", - "deprecated": false, -@@ -5624,7 +5624,7 @@ - "children": [ - { - "parentPluginId": "actions", -- "id": "def-common.GeneralFeature.id", -+ "id": "def-common.GenerativeAIFeature.id", - "type": "string", - "tags": [], - "label": "id", -@@ -5635,7 +5635,7 @@ - }, - { - "parentPluginId": "actions", -- "id": "def-common.GeneralFeature.name", -+ "id": "def-common.GenerativeAIFeature.name", - "type": "string", - "tags": [], - "label": "name", -@@ -5646,7 +5646,7 @@ - }, - { - "parentPluginId": "actions", -- "id": "def-common.GeneralFeature.compatibility", -+ "id": "def-common.GenerativeAIFeature.compatibility", - "type": "string", - "tags": [], - "label": "compatibility", -@@ -5769,4 +5769,4 @@ - } - ] - } --} -\ No newline at end of file -+} -Index: x-pack/packages/kbn-elastic-assistant/impl/connectorland/use_load_action_types/index.tsx -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/packages/kbn-elastic-assistant/impl/connectorland/use_load_action_types/index.tsx b/x-pack/packages/kbn-elastic-assistant/impl/connectorland/use_load_action_types/index.tsx ---- a/x-pack/packages/kbn-elastic-assistant/impl/connectorland/use_load_action_types/index.tsx (revision 06445caf5021c473ab79d40f7975d7090b258a6f) -+++ b/x-pack/packages/kbn-elastic-assistant/impl/connectorland/use_load_action_types/index.tsx (revision e3e527832a3a049f165d93e018dfb58d86900674) -@@ -15,7 +15,7 @@ - import type { ActionType } from '@kbn/actions-plugin/common'; - import { HttpSetup } from '@kbn/core-http-browser'; - import { IToasts } from '@kbn/core-notifications-browser'; --import { GeneralConnectorFeatureId } from '@kbn/actions-plugin/common'; -+import { GenerativeAIConnectorFeatureId } from '@kbn/actions-plugin/common'; - import * as i18n from '../translations'; - - /** -@@ -37,7 +37,10 @@ - QUERY_KEY, - - async () => { -- const queryResult = await loadActionTypes({ http, featureId: GeneralConnectorFeatureId }); -+ const queryResult = await loadActionTypes({ -+ http, -+ featureId: GenerativeAIConnectorFeatureId, -+ }); - const sortedData = queryResult.sort((a, b) => a.name.localeCompare(b.name)); - - return sortedData; -Index: x-pack/plugins/actions/common/connector_feature_config.ts -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/plugins/actions/common/connector_feature_config.ts b/x-pack/plugins/actions/common/connector_feature_config.ts ---- a/x-pack/plugins/actions/common/connector_feature_config.ts (revision 06445caf5021c473ab79d40f7975d7090b258a6f) -+++ b/x-pack/plugins/actions/common/connector_feature_config.ts (revision e3e527832a3a049f165d93e018dfb58d86900674) -@@ -25,12 +25,12 @@ - export const CasesConnectorFeatureId = 'cases'; - export const UptimeConnectorFeatureId = 'uptime'; - export const SecurityConnectorFeatureId = 'siem'; --export const GeneralConnectorFeatureId = 'general'; -+export const GenerativeAIConnectorFeatureId = 'generativeAI'; - --const compatibilityGeneral = i18n.translate( -- 'xpack.actions.availableConnectorFeatures.compatibility.general', -+const compatibilityGenerativeAI = i18n.translate( -+ 'xpack.actions.availableConnectorFeatures.compatibility.generativeAI', - { -- defaultMessage: 'General', -+ defaultMessage: 'Generative AI', - } - ); - -@@ -80,10 +80,10 @@ - compatibility: compatibilityAlertingRules, - }; - --export const GeneralFeature: ConnectorFeatureConfig = { -- id: GeneralConnectorFeatureId, -- name: compatibilityGeneral, -- compatibility: compatibilityGeneral, -+export const GenerativeAIFeature: ConnectorFeatureConfig = { -+ id: GenerativeAIConnectorFeatureId, -+ name: compatibilityGenerativeAI, -+ compatibility: compatibilityGenerativeAI, - }; - - const AllAvailableConnectorFeatures = { -@@ -91,7 +91,7 @@ - [CasesConnectorFeature.id]: CasesConnectorFeature, - [UptimeConnectorFeature.id]: UptimeConnectorFeature, - [SecuritySolutionFeature.id]: SecuritySolutionFeature, -- [GeneralFeature.id]: GeneralFeature, -+ [GenerativeAIFeature.id]: GenerativeAIFeature, - }; - - export function areValidFeatures(ids: string[]) { -Index: x-pack/plugins/actions/common/types.ts -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/plugins/actions/common/types.ts b/x-pack/plugins/actions/common/types.ts ---- a/x-pack/plugins/actions/common/types.ts (revision 06445caf5021c473ab79d40f7975d7090b258a6f) -+++ b/x-pack/plugins/actions/common/types.ts (revision e3e527832a3a049f165d93e018dfb58d86900674) -@@ -12,7 +12,7 @@ - CasesConnectorFeatureId, - UptimeConnectorFeatureId, - SecurityConnectorFeatureId, -- GeneralConnectorFeatureId, -+ GenerativeAIConnectorFeatureId, - } from './connector_feature_config'; - export interface ActionType { - id: string; -Index: x-pack/plugins/stack_connectors/server/connector_types/bedrock/index.ts -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/plugins/stack_connectors/server/connector_types/bedrock/index.ts b/x-pack/plugins/stack_connectors/server/connector_types/bedrock/index.ts ---- a/x-pack/plugins/stack_connectors/server/connector_types/bedrock/index.ts (revision 06445caf5021c473ab79d40f7975d7090b258a6f) -+++ b/x-pack/plugins/stack_connectors/server/connector_types/bedrock/index.ts (revision e3e527832a3a049f165d93e018dfb58d86900674) -@@ -10,7 +10,7 @@ - SubActionConnectorType, - ValidatorType, - } from '@kbn/actions-plugin/server/sub_action_framework/types'; --import { GeneralConnectorFeatureId } from '@kbn/actions-plugin/common'; -+import { GenerativeAIConnectorFeatureId } from '@kbn/actions-plugin/common'; - import { urlAllowListValidator } from '@kbn/actions-plugin/server'; - import { ValidatorServices } from '@kbn/actions-plugin/server/types'; - import { assertURL } from '@kbn/actions-plugin/server/sub_action_framework/helpers/validators'; -@@ -29,7 +29,7 @@ - secrets: SecretsSchema, - }, - validators: [{ type: ValidatorType.CONFIG, validator: configValidator }], -- supportedFeatureIds: [GeneralConnectorFeatureId], -+ supportedFeatureIds: [GenerativeAIConnectorFeatureId], - minimumLicenseRequired: 'enterprise' as const, - renderParameterTemplates, - }); -Index: docs/management/action-types.asciidoc -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/docs/management/action-types.asciidoc b/docs/management/action-types.asciidoc ---- a/docs/management/action-types.asciidoc (revision 9a59bf47d9b8beb788fe724dff7302514251ea7c) -+++ b/docs/management/action-types.asciidoc (revision bc6c2a2dcb95ac781ee1ddcdb1cfeac0d882ee47) -@@ -35,7 +35,7 @@ - - | Send a message to a Microsoft Teams channel. - --a| <> -+a| <> - - | Send a request to OpenAI. - -Index: docs/management/connectors/action-types/gen-ai.asciidoc -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/docs/management/connectors/action-types/gen-ai.asciidoc b/docs/management/connectors/action-types/openai.asciidoc -rename from docs/management/connectors/action-types/gen-ai.asciidoc -rename to docs/management/connectors/action-types/openai.asciidoc ---- a/docs/management/connectors/action-types/gen-ai.asciidoc (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/docs/management/connectors/action-types/openai.asciidoc (revision bc6c2a2dcb95ac781ee1ddcdb1cfeac0d882ee47) -@@ -1,7 +1,7 @@ --[[gen-ai-action-type]] --== Generative AI connector and action -+[[openai-action-type]] -+== OpenAI connector and action - ++++ --Generative AI -+OpenAI - ++++ - :frontmatter-description: Add a connector that can send requests to an OpenAI provider. - :frontmatter-tags-products: [kibana] -@@ -9,7 +9,7 @@ - :frontmatter-tags-user-goals: [configure] - - --The Generative AI connector uses https://github.com/axios/axios[axios] to send a POST request to an OpenAI provider, either OpenAI or Azure OpenAI. The connector uses the <> to send the request. -+The OpenAI connector uses https://github.com/axios/axios[axios] to send a POST request to an OpenAI provider, either OpenAI or Azure OpenAI. The connector uses the <> to send the request. - - [float] - [[define-gen-ai-ui]] -@@ -18,14 +18,14 @@ - You can create connectors in *{stack-manage-app} > {connectors-ui}*. For example: - - [role="screenshot"] --image::management/connectors/images/gen-ai-connector.png[Generative AI connector] -+image::management/connectors/images/gen-ai-connector.png[OpenAI connector] - // NOTE: This is an autogenerated screenshot. Do not edit it directly. - - [float] --[[gen-ai-connector-configuration]] -+[[openai-connector-configuration]] - ==== Connector configuration - --Generative AI connectors have the following configuration properties: -+OpenAI connectors have the following configuration properties: - - Name:: The name of the connector. - API Provider:: The OpenAI API provider, either OpenAI or Azure OpenAI. -@@ -40,10 +40,10 @@ - as you're creating or editing the connector in {kib}. For example: - - [role="screenshot"] --image::management/connectors/images/gen-ai-params-test.png[Generative AI params test] -+image::management/connectors/images/gen-ai-params-test.png[OpenAI params test] - // NOTE: This is an autogenerated screenshot. Do not edit it directly. - --The Generative AI actions have the following configuration properties. -+The OpenAI actions have the following configuration properties. - - Body:: A JSON payload sent to the OpenAI API URL. For example: - + -@@ -60,15 +60,15 @@ - } - -- - [float] --[[gen-ai-connector-networking-configuration]] -+[[openai-connector-networking-configuration]] - === Connector networking configuration - - Use the <> to customize connector networking configurations, such as proxies, certificates, or TLS settings. You can set configurations that apply to all your connectors or use `xpack.actions.customHostSettings` to set per-host configurations. - - [float] --[[gen-ai-connector-token-dashboard]] -+[[openai-connector-token-dashboard]] - === Token usage dashboard - --Once you've created a Generative AI connector, you can monitor its token usage using the *Generative AI Token Usage* dashboard. Select the connector in *{stack-manage-app}* > *{connectors-ui}* to view its details, then click the *View OpenAI Usage Dashboard for "__" Connector* link to open the dashboard. -+Once you've created a OpenAI connector, you can monitor its token usage using the *OpenAI Token Usage* dashboard. Select the connector in *{stack-manage-app}* > *{connectors-ui}* to view its details, then click the *View OpenAI Usage Dashboard for "__" Connector* link to open the dashboard. - - NOTE: To view the dashboard, you need at least `read` and `view_index_metadata` privileges for the `.kibana-event-log-*` index and the `Read` feature privilege for {kib}. You can set up a role with these minimum privileges and assign it to non-admin users who need to view this dashboard. -Index: docs/management/connectors/index.asciidoc -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/docs/management/connectors/index.asciidoc b/docs/management/connectors/index.asciidoc ---- a/docs/management/connectors/index.asciidoc (revision 9a59bf47d9b8beb788fe724dff7302514251ea7c) -+++ b/docs/management/connectors/index.asciidoc (revision bc6c2a2dcb95ac781ee1ddcdb1cfeac0d882ee47) -@@ -1,7 +1,7 @@ - include::action-types/bedrock.asciidoc[leveloffset=+1] - include::action-types/d3security.asciidoc[leveloffset=+1] - include::action-types/email.asciidoc[leveloffset=+1] --include::action-types/gen-ai.asciidoc[leveloffset=+1] -+include::action-types/openai.asciidoc[leveloffset=+1] - include::action-types/resilient.asciidoc[leveloffset=+1] - include::action-types/index.asciidoc[leveloffset=+1] - include::action-types/jira.asciidoc[leveloffset=+1] -Index: x-pack/packages/kbn-elastic-assistant/impl/connectorland/connector_button/index.tsx -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/packages/kbn-elastic-assistant/impl/connectorland/connector_button/index.tsx b/x-pack/packages/kbn-elastic-assistant/impl/connectorland/connector_button/index.tsx ---- a/x-pack/packages/kbn-elastic-assistant/impl/connectorland/connector_button/index.tsx (revision 9a59bf47d9b8beb788fe724dff7302514251ea7c) -+++ b/x-pack/packages/kbn-elastic-assistant/impl/connectorland/connector_button/index.tsx (revision bc6c2a2dcb95ac781ee1ddcdb1cfeac0d882ee47) -@@ -8,7 +8,7 @@ - import React, { useCallback } from 'react'; - import { EuiCard, EuiFlexGroup, EuiFlexItem, EuiIcon } from '@elastic/eui'; - --import { GenAiLogo } from '@kbn/stack-connectors-plugin/public/common'; -+import { OpenAILogo } from '@kbn/stack-connectors-plugin/public/common'; - import * as i18n from '../translations'; - import { useAssistantContext } from '../../assistant_context'; - -@@ -41,7 +41,7 @@ - } -+ icon={} - title={title} - description={description} - onClick={assistantAvailability.hasConnectorsAllPrivilege ? onClick : undefined} -Index: x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/gen_ai_simulation.ts -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/gen_ai_simulation.ts b/x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/open_ai_simulation.ts -rename from x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/gen_ai_simulation.ts -rename to x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/open_ai_simulation.ts ---- a/x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/gen_ai_simulation.ts (revision bc6c2a2dcb95ac781ee1ddcdb1cfeac0d882ee47) -+++ b/x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/open_ai_simulation.ts (revision 71d2b0ceabdf7a6dbcfec328c0d4c6b29a2624dd) -@@ -9,7 +9,7 @@ - - import { ProxyArgs, Simulator } from './simulator'; - --export class GenAiSimulator extends Simulator { -+export class OpenAISimulator extends Simulator { - private readonly returnError: boolean; - - constructor({ returnError = false, proxy }: { returnError?: boolean; proxy?: ProxyArgs }) { -@@ -24,10 +24,10 @@ - data: Record - ) { - if (this.returnError) { -- return GenAiSimulator.sendErrorResponse(response); -+ return OpenAISimulator.sendErrorResponse(response); - } - -- return GenAiSimulator.sendResponse(response); -+ return OpenAISimulator.sendResponse(response); - } - - private static sendResponse(response: http.ServerResponse) { -Index: x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/gen_ai.ts -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/gen_ai.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/open_ai.ts -rename from x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/gen_ai.ts -rename to x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/open_ai.ts ---- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/gen_ai.ts (revision c6d7e9422865c74b79e11dd9f763f720b9b0cea8) -+++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/open_ai.ts (revision 71d2b0ceabdf7a6dbcfec328c0d4c6b29a2624dd) -@@ -8,9 +8,9 @@ - import expect from '@kbn/expect'; - - import { -- GenAiSimulator, -+ OpenAISimulator, - genAiSuccessResponse, --} from '@kbn/actions-simulators-plugin/server/gen_ai_simulation'; -+} from '@kbn/actions-simulators-plugin/server/open_ai_simulation'; - import { FtrProviderContext } from '../../../../../common/ftr_provider_context'; - import { getUrlPrefix, ObjectRemover } from '../../../../../common/lib'; - -@@ -51,7 +51,7 @@ - objectRemover.removeAll(); - }); - describe('action creation', () => { -- const simulator = new GenAiSimulator({ -+ const simulator = new OpenAISimulator({ - returnError: false, - proxy: { - config: configService.get('kbnTestServer.serverArgs'), -@@ -189,7 +189,7 @@ - statusCode: 400, - error: 'Bad Request', - message: -- 'error validating action type config: Error configuring Generative AI action: Error: error validating url: target url "http://genAi.mynonexistent.com" is not added to the Kibana config xpack.actions.allowedHosts', -+ 'error validating action type config: Error configuring OpenAI action: Error: error validating url: target url "http://genAi.mynonexistent.com" is not added to the Kibana config xpack.actions.allowedHosts', - }); - }); - }); -@@ -217,7 +217,7 @@ - - describe('executor', () => { - describe('validation', () => { -- const simulator = new GenAiSimulator({ -+ const simulator = new OpenAISimulator({ - proxy: { - config: configService.get('kbnTestServer.serverArgs'), - }, -@@ -272,7 +272,7 @@ - - describe('execution', () => { - describe('successful response simulator', () => { -- const simulator = new GenAiSimulator({ -+ const simulator = new OpenAISimulator({ - proxy: { - config: configService.get('kbnTestServer.serverArgs'), - }, -@@ -313,7 +313,7 @@ - data: genAiSuccessResponse, - }); - }); -- describe('gen ai dashboard', () => { -+ describe('OpenAI dashboard', () => { - const dashboardId = 'specific-dashboard-id-default'; - - it('should not create a dashboard when user does not have kibana event log permissions', async () => { -@@ -377,7 +377,7 @@ - }); - }); - describe('non-default space simulator', () => { -- const simulator = new GenAiSimulator({ -+ const simulator = new OpenAISimulator({ - proxy: { - config: configService.get('kbnTestServer.serverArgs'), - }, -@@ -428,7 +428,7 @@ - }); - - describe('error response simulator', () => { -- const simulator = new GenAiSimulator({ -+ const simulator = new OpenAISimulator({ - returnError: true, - proxy: { - config: configService.get('kbnTestServer.serverArgs'), -diff --git a/x-pack/plugins/stack_connectors/common/gen_ai/schema.ts b/x-pack/plugins/stack_connectors/common/open_ai/schema.ts -rename from x-pack/plugins/stack_connectors/common/gen_ai/schema.ts -rename to x-pack/plugins/stack_connectors/common/open_ai/schema.ts -diff --git a/x-pack/plugins/stack_connectors/common/gen_ai/types.ts b/x-pack/plugins/stack_connectors/common/open_ai/types.ts -rename from x-pack/plugins/stack_connectors/common/gen_ai/types.ts -rename to x-pack/plugins/stack_connectors/common/open_ai/types.ts -diff --git a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/logo.tsx b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/logo.tsx -rename from x-pack/plugins/stack_connectors/public/connector_types/gen_ai/logo.tsx -rename to x-pack/plugins/stack_connectors/public/connector_types/open_ai/logo.tsx -diff --git a/x-pack/plugins/stack_connectors/public/connector_types/gen_ai/use_get_dashboard.ts b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/use_get_dashboard.ts -rename from x-pack/plugins/stack_connectors/public/connector_types/gen_ai/use_get_dashboard.ts -rename to x-pack/plugins/stack_connectors/public/connector_types/open_ai/use_get_dashboard.ts -diff --git a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/create_dashboard.test.ts b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/create_dashboard.test.ts -rename from x-pack/plugins/stack_connectors/server/connector_types/gen_ai/create_dashboard.test.ts -rename to x-pack/plugins/stack_connectors/server/connector_types/open_ai/create_dashboard.test.ts -diff --git a/x-pack/plugins/stack_connectors/server/connector_types/gen_ai/create_dashboard.ts b/x-pack/plugins/stack_connectors/server/connector_types/open_ai/create_dashboard.ts -rename from x-pack/plugins/stack_connectors/server/connector_types/gen_ai/create_dashboard.ts -rename to x-pack/plugins/stack_connectors/server/connector_types/open_ai/create_dashboard.ts diff --git a/x-pack/examples/gen_ai_streaming_response_example/public/components/list_connector.tsx b/x-pack/examples/gen_ai_streaming_response_example/public/components/list_connector.tsx index e2f1af3a9be26..06e33429892c1 100644 --- a/x-pack/examples/gen_ai_streaming_response_example/public/components/list_connector.tsx +++ b/x-pack/examples/gen_ai_streaming_response_example/public/components/list_connector.tsx @@ -52,7 +52,7 @@ export const ListConnectors = ({ label={i18n.translate( 'genAiStreamingResponseExample.app.component.selectConnectorLabel', { - defaultMessage: 'Select a OpenAI Connector', + defaultMessage: 'Select an OpenAI Connector', } )} labelAppend={ diff --git a/x-pack/plugins/data_visualizer/public/application/data_drift/data_drift_utils.test.ts b/x-pack/plugins/data_visualizer/public/application/data_drift/data_drift_utils.test.ts deleted file mode 100644 index 66dd69f66fb07..0000000000000 --- a/x-pack/plugins/data_visualizer/public/application/data_drift/data_drift_utils.test.ts +++ /dev/null @@ -1,88 +0,0 @@ -/* - * 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. - */ - -import { computeChi2PValue } from './data_drift_utils'; -import { Histogram } from './types'; - -describe('computeChi2PValue()', () => { - test('should return close to 1 if datasets are both empty or nearly identical', () => { - const referenceTerms: Histogram[] = [ - { - key: 'ap-northwest-1', - doc_count: 40348, - percentage: 0.2712470588235294, - }, - { - key: 'us-east-1', - doc_count: 15134, - percentage: 0.10174117647058824, - }, - { - key: 'eu-central-1', - doc_count: 12614, - percentage: 0.0848, - }, - { - key: 'sa-east-1', - doc_count: 80654, - percentage: 0.5422117647058824, - }, - ]; - const comparisonTerms: Histogram[] = [ - { - key: 'ap-northwest-1', - doc_count: 40320, - percentage: 0.2609691846654714, - }, - { - key: 'us-east-1', - doc_count: 15127, - percentage: 0.09790875139966732, - }, - { - key: 'eu-central-1', - doc_count: 12614, - percentage: 0.08164348450819088, - }, - { - key: 'sa-east-1', - doc_count: 86440, - percentage: 0.5594785794266703, - }, - ]; - expect(computeChi2PValue([], [])).toStrictEqual(1); - expect(computeChi2PValue(referenceTerms, comparisonTerms)).toStrictEqual(0.99); - }); - - test('should return close to 0 if datasets differ', () => { - const referenceTerms: Histogram[] = [ - { - key: 'jackson', - doc_count: 1, - percentage: 1, - }, - { - key: 'yahya', - doc_count: 0, - percentage: 0, - }, - ]; - const comparisonTerms: Histogram[] = [ - { - key: 'jackson', - doc_count: 0, - percentage: 0, - }, - { - key: 'yahya', - doc_count: 1, - percentage: 1, - }, - ]; - expect(computeChi2PValue(referenceTerms, comparisonTerms)).toStrictEqual(0); - }); -}); diff --git a/x-pack/plugins/fleet/public/services/get_cloud_formation_template_url_from_agent_policy.test.ts b/x-pack/plugins/fleet/public/services/get_cloud_formation_template_url_from_agent_policy.test.ts deleted file mode 100644 index 6b4214044f2a0..0000000000000 --- a/x-pack/plugins/fleet/public/services/get_cloud_formation_template_url_from_agent_policy.test.ts +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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. - */ -import { getCloudFormationTemplateUrlFromAgentPolicy } from './get_cloud_formation_template_url_from_agent_policy'; - -describe('getCloudFormationTemplateUrlFromAgentPolicy', () => { - it('should return undefined when selectedPolicy is undefined', () => { - const result = getCloudFormationTemplateUrlFromAgentPolicy(); - expect(result).toBeUndefined(); - }); - - it('should return undefined when selectedPolicy has no package_policies', () => { - const selectedPolicy = {}; - // @ts-expect-error - const result = getCloudFormationTemplateUrlFromAgentPolicy(selectedPolicy); - expect(result).toBeUndefined(); - }); - - it('should return undefined when no input has enabled and config.cloud_formation_template_url', () => { - const selectedPolicy = { - package_policies: [ - { - inputs: [ - { enabled: false, config: {} }, - { enabled: true, config: {} }, - { enabled: true, config: { other_property: 'value' } }, - ], - }, - { - inputs: [ - { enabled: false, config: {} }, - { enabled: false, config: {} }, - ], - }, - ], - }; - // @ts-expect-error - const result = getCloudFormationTemplateUrlFromAgentPolicy(selectedPolicy); - expect(result).toBeUndefined(); - }); - - it('should return the first config.cloud_formation_template_url when available', () => { - const selectedPolicy = { - package_policies: [ - { - inputs: [ - { enabled: false, config: { cloud_formation_template_url: { value: 'url1' } } }, - { enabled: false, config: { cloud_formation_template_url: { value: 'url2' } } }, - { enabled: false, config: { other_property: 'value' } }, - ], - }, - { - inputs: [ - { enabled: false, config: {} }, - { enabled: true, config: { cloud_formation_template_url: { value: 'url3' } } }, - { enabled: true, config: { cloud_formation_template_url: { value: 'url4' } } }, - ], - }, - ], - }; - // @ts-expect-error - const result = getCloudFormationTemplateUrlFromAgentPolicy(selectedPolicy); - expect(result).toBe('url3'); - }); -}); diff --git a/x-pack/plugins/fleet/public/services/get_cloud_formation_template_url_from_agent_policy.ts b/x-pack/plugins/fleet/public/services/get_cloud_formation_template_url_from_agent_policy.ts deleted file mode 100644 index 81aaf5b3fd970..0000000000000 --- a/x-pack/plugins/fleet/public/services/get_cloud_formation_template_url_from_agent_policy.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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. - */ - -import type { AgentPolicy } from '../types'; - -/** - * Get the cloud formation template url from a agent policy - * It looks for a config with a cloud_formation_template_url object present in - * the enabled package_policies inputs of the agent policy - */ -export const getCloudFormationTemplateUrlFromAgentPolicy = (selectedPolicy?: AgentPolicy) => { - const cloudFormationTemplateUrl = selectedPolicy?.package_policies?.reduce( - (acc, packagePolicy) => { - const findCloudFormationTemplateUrlConfig = packagePolicy.inputs?.reduce( - (accInput, input) => { - if (accInput !== '') { - return accInput; - } - if (input?.enabled && input?.config?.cloud_formation_template_url) { - return input.config.cloud_formation_template_url.value; - } - return accInput; - }, - '' - ); - if (findCloudFormationTemplateUrlConfig) { - return findCloudFormationTemplateUrlConfig; - } - return acc; - }, - '' - ); - return cloudFormationTemplateUrl !== '' ? cloudFormationTemplateUrl : undefined; -}; diff --git a/x-pack/plugins/fleet/public/services/get_cloud_formation_template_url_from_package_info.test.ts b/x-pack/plugins/fleet/public/services/get_cloud_formation_template_url_from_package_info.test.ts deleted file mode 100644 index 8ed2fb3ae389a..0000000000000 --- a/x-pack/plugins/fleet/public/services/get_cloud_formation_template_url_from_package_info.test.ts +++ /dev/null @@ -1,66 +0,0 @@ -/* - * 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. - */ - -import { getCloudFormationTemplateUrlFromPackageInfo } from './get_cloud_formation_template_url_from_package_info'; - -describe('getCloudFormationTemplateUrlFromPackageInfo', () => { - test('returns undefined when packageInfo is undefined', () => { - const result = getCloudFormationTemplateUrlFromPackageInfo(undefined, 'test'); - expect(result).toBeUndefined(); - }); - - test('returns undefined when packageInfo has no policy_templates', () => { - const packageInfo = { inputs: [] }; - // @ts-expect-error - const result = getCloudFormationTemplateUrlFromPackageInfo(packageInfo, 'test'); - expect(result).toBeUndefined(); - }); - - test('returns undefined when integrationType is not found in policy_templates', () => { - const packageInfo = { policy_templates: [{ name: 'template1' }, { name: 'template2' }] }; - // @ts-expect-error - const result = getCloudFormationTemplateUrlFromPackageInfo(packageInfo, 'nonExistentTemplate'); - expect(result).toBeUndefined(); - }); - - test('returns undefined when no input in the policy template has a cloudFormationTemplate', () => { - const packageInfo = { - policy_templates: [ - { - name: 'template1', - inputs: [ - { name: 'input1', vars: [] }, - { name: 'input2', vars: [{ name: 'var1', default: 'value1' }] }, - ], - }, - ], - }; - // @ts-expect-error - const result = getCloudFormationTemplateUrlFromPackageInfo(packageInfo, 'template1'); - expect(result).toBeUndefined(); - }); - - test('returns the cloudFormationTemplate from the policy template', () => { - const packageInfo = { - policy_templates: [ - { - name: 'template1', - inputs: [ - { name: 'input1', vars: [] }, - { - name: 'input2', - vars: [{ name: 'cloud_formation_template', default: 'cloud_formation_template_url' }], - }, - ], - }, - ], - }; - // @ts-expect-error - const result = getCloudFormationTemplateUrlFromPackageInfo(packageInfo, 'template1'); - expect(result).toBe('cloud_formation_template_url'); - }); -}); diff --git a/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/detail_panel.container.d.ts b/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/detail_panel.container.d.ts deleted file mode 100644 index 9d9488cea33f2..0000000000000 --- a/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/detail_panel.container.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* - * 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. - */ - -export declare function DetailPanel(props: any): any; diff --git a/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/detail_panel.container.js b/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/detail_panel.container.js deleted file mode 100644 index e9c6c694d1fb0..0000000000000 --- a/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/detail_panel.container.js +++ /dev/null @@ -1,64 +0,0 @@ -/* - * 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. - */ - -import { connect } from 'react-redux'; -import { DetailPanel as PresentationComponent } from './detail_panel'; -import { - getDetailPanelType, - getDetailPanelIndexName, - getIndexByIndexName, -} from '../../../../store/selectors'; -import { - openDetailPanel, - closeDetailPanel, - clearCacheIndices, - closeIndices, - deleteIndices, - flushIndices, - forcemergeIndices, - openIndices, - refreshIndices, -} from '../../../../store/actions'; - -const mapStateToProps = (state) => { - const indexName = getDetailPanelIndexName(state); - return { - panelType: getDetailPanelType(state), - indexName, - index: getIndexByIndexName(state, indexName), - }; -}; - -const mapDispatchToProps = (dispatch) => { - return { - clearCacheIndex: (indexName) => { - dispatch(clearCacheIndices({ indexNames: [indexName] })); - }, - closeIndex: (indexName) => { - dispatch(closeIndices({ indexNames: [indexName] })); - }, - flushIndex: (indexName) => { - dispatch(flushIndices({ indexNames: [indexName] })); - }, - openIndex: (indexName) => { - dispatch(openIndices({ indexNames: [indexName] })); - }, - refreshIndex: (indexName) => { - dispatch(refreshIndices({ indexNames: [indexName] })); - }, - forcemergeIndex: (indexName) => { - dispatch(forcemergeIndices({ indexNames: [indexName] })); - }, - deleteIndex: (indexName) => { - dispatch(deleteIndices({ indexNames: [indexName] })); - }, - closeDetailPanel: () => dispatch(closeDetailPanel()), - openDetailPanel: (indexName, panelType) => dispatch(openDetailPanel(indexName, panelType)), - }; -}; - -export const DetailPanel = connect(mapStateToProps, mapDispatchToProps)(PresentationComponent); diff --git a/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/detail_panel.js b/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/detail_panel.js deleted file mode 100644 index bddd3665f0b7c..0000000000000 --- a/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/detail_panel.js +++ /dev/null @@ -1,176 +0,0 @@ -/* - * 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. - */ - -import React, { Fragment } from 'react'; -import { Route } from '@kbn/shared-ux-router'; -import { FormattedMessage } from '@kbn/i18n-react'; -import { - EuiCallOut, - EuiFlexGroup, - EuiFlexItem, - EuiFlyout, - EuiFlyoutBody, - EuiFlyoutFooter, - EuiFlyoutHeader, - EuiSpacer, - EuiTabs, - EuiTab, - EuiTitle, -} from '@elastic/eui'; -import { renderBadges } from '../../../../lib/render_badges'; -import { INDEX_OPEN } from '../../../../../../common/constants'; -import { - TAB_SUMMARY, - TAB_SETTINGS, - TAB_MAPPING, - TAB_STATS, - TAB_EDIT_SETTINGS, -} from '../../../../constants'; -import { IndexActionsContextMenu } from '../index_actions_context_menu'; -import { ShowJson } from './show_json'; -import { Summary } from './summary'; -import { EditSettingsJson } from './edit_settings_json'; -import { useServices, useAppContext } from '../../../../app_context'; -import { DiscoverLink } from '../../../../lib/discover_link'; - -const tabToHumanizedMap = { - [TAB_SUMMARY]: ( - - ), - [TAB_SETTINGS]: ( - - ), - [TAB_MAPPING]: ( - - ), - [TAB_STATS]: ( - - ), - [TAB_EDIT_SETTINGS]: ( - - ), -}; - -const getTabs = (showStats) => { - if (showStats) { - return [TAB_SUMMARY, TAB_SETTINGS, TAB_MAPPING, TAB_STATS, TAB_EDIT_SETTINGS]; - } - return [TAB_SUMMARY, TAB_SETTINGS, TAB_MAPPING, TAB_EDIT_SETTINGS]; -}; - -export const DetailPanel = ({ panelType, indexName, index, openDetailPanel, closeDetailPanel }) => { - const { extensionsService } = useServices(); - const { config } = useAppContext(); - - const renderTabs = () => { - const tabs = getTabs(config.enableIndexStats); - return tabs.map((tab, i) => { - const isSelected = tab === panelType; - return ( - openDetailPanel({ panelType: tab, indexName })} - isSelected={isSelected} - data-test-subj={`detailPanelTab${isSelected ? 'Selected' : ''}`} - disabled={tab === TAB_STATS && index.status !== INDEX_OPEN} - key={i} - > - {tabToHumanizedMap[tab]} - - ); - }); - }; - - if (!panelType) { - return null; - } - - let component = null; - switch (panelType) { - case TAB_EDIT_SETTINGS: - component = ; - break; - case TAB_MAPPING: - case TAB_SETTINGS: - case TAB_STATS: - component = ; - break; - default: - component = ; - } - - const content = index ? ( - - {component} - - - - ( - - } - /> - )} - /> - - - - - ) : ( - - - - } - color="danger" - iconType="cross" - > - - - - ); - - return ( - - - -

    - {indexName} - - {renderBadges(index, undefined, extensionsService)} -

    -
    - {index ? {renderTabs()} : null} -
    - {content} -
    - ); -}; diff --git a/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/edit_settings_json/edit_settings_json.container.js b/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/edit_settings_json/edit_settings_json.container.js deleted file mode 100644 index 75698874fac9d..0000000000000 --- a/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/edit_settings_json/edit_settings_json.container.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - * 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. - */ - -import { connect } from 'react-redux'; -import { EditSettingsJson as PresentationComponent } from './edit_settings_json'; -import { closeDetailPanel, loadIndexData, updateIndexSettings } from '../../../../../store/actions'; -import { - getDetailPanelData, - getDetailPanelError, - getDetailPanelIndexName, - getIndexStatusByIndexName, -} from '../../../../../store/selectors'; - -const mapStateToProps = (state) => { - const indexName = getDetailPanelIndexName(state); - return { - error: getDetailPanelError(state), - data: getDetailPanelData(state), - indexName, - indexStatus: getIndexStatusByIndexName(state, indexName), - }; -}; - -const mapDispatchToProps = { - loadIndexData, - closeDetailPanel, - updateIndexSettings, -}; - -export const EditSettingsJson = connect(mapStateToProps, mapDispatchToProps)(PresentationComponent); diff --git a/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/edit_settings_json/edit_settings_json.js b/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/edit_settings_json/edit_settings_json.js deleted file mode 100644 index 6d04a1a0d45d8..0000000000000 --- a/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/edit_settings_json/edit_settings_json.js +++ /dev/null @@ -1,170 +0,0 @@ -/* - * 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. - */ - -import React from 'react'; -import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n-react'; -import { documentationService } from '../../../../../services/documentation'; - -import { - EuiButton, - EuiFlexGroup, - EuiFlexItem, - EuiCallOut, - EuiLink, - EuiSpacer, - EuiTitle, -} from '@elastic/eui'; -import { TAB_SETTINGS } from '../../../../../constants'; -import { settingsToDisplay, readOnlySettings } from '../../../../../lib/edit_settings'; -import { createAceEditor } from '../../../../../lib/ace'; -import _ from 'lodash'; - -import { flattenObject } from '../../../../../lib/flatten_object'; - -export class EditSettingsJson extends React.PureComponent { - constructor() { - super(); - this.state = { - valid: true, - }; - } - - //API expects settings in flattened dotted form, - //whereas they come back as nested objects from ES - transformSettingsForApi(data, isOpen) { - const { defaults, settings } = data; - //settings user has actually set - const flattenedSettings = flattenObject(settings); - //settings with their defaults - const flattenedDefaults = flattenObject(defaults); - const filteredDefaults = _.pick(flattenedDefaults, settingsToDisplay); - const newSettings = { ...filteredDefaults, ...flattenedSettings }; - //store these to be used as autocomplete values later - this.settingsKeys = Object.keys(newSettings); - readOnlySettings.forEach((e) => delete newSettings[e]); - //can't change codec on open index - if (isOpen) { - delete newSettings['index.codec']; - } - return newSettings; - } - UNSAFE_componentWillMount() { - const { indexName } = this.props; - this.props.loadIndexData({ dataType: TAB_SETTINGS, indexName }); - } - componentDidUpdate() { - const { data, indexStatus } = this.props; - if (data && !this.editor) { - const isOpen = indexStatus === 'open'; - const newSettings = this.transformSettingsForApi(data, isOpen); - this.originalSettings = newSettings; - const prettyJson = JSON.stringify(newSettings, null, 2); - const settingsKeys = Object.keys(newSettings); - const editor = (this.editor = createAceEditor(this.aceDiv, prettyJson, false, settingsKeys)); - const session = editor.getSession(); - session.on('changeAnnotation', () => { - const isEmptyString = session.getValue() === ''; - this.setState({ valid: !isEmptyString && session.getAnnotations().length === 0 }); - }); - } - } - componentWillUnmount() { - this.editor && this.editor.destroy(); - } - commitSettings = () => { - const { updateIndexSettings, indexName } = this.props; - const json = this.editor.getValue(); - const settings = JSON.parse(json); - //don't set if the values have not changed - Object.keys(this.originalSettings).forEach((key) => { - if (_.isEqual(this.originalSettings[key], settings[key])) { - delete settings[key]; - } - }); - updateIndexSettings({ indexName, settings }); - }; - errorMessage() { - const { error } = this.props; - - if (!error) { - return null; - } - - return ( - <> - - -

    {error}

    -
    - - ); - } - render() { - const { data } = this.props; - if (!data) { - return null; - } - return ( -
    - - - -

    - -

    -
    -
    - - - - - -
    - {this.errorMessage()} - - - - - -
    { - this.aceDiv = aceDiv; - }} - /> - -
    - ); - } -} diff --git a/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/edit_settings_json/index.js b/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/edit_settings_json/index.js deleted file mode 100644 index 52ff89ad74ed7..0000000000000 --- a/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/edit_settings_json/index.js +++ /dev/null @@ -1,8 +0,0 @@ -/* - * 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. - */ - -export { EditSettingsJson } from './edit_settings_json.container'; diff --git a/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/index.ts b/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/index.ts deleted file mode 100644 index 1dabcb21fa93c..0000000000000 --- a/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* - * 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. - */ - -export { DetailPanel } from './detail_panel.container'; diff --git a/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/show_json/show_json.container.js b/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/show_json/show_json.container.js deleted file mode 100644 index 9bd506acc8bde..0000000000000 --- a/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/show_json/show_json.container.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 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. - */ - -import { connect } from 'react-redux'; -import { ShowJson as PresentationComponent } from './show_json'; -import { loadIndexData, closeDetailPanel } from '../../../../../store/actions'; - -import { - getDetailPanelData, - getDetailPanelError, - getDetailPanelIndexName, - getDetailPanelType, - getIndexStatusByIndexName, -} from '../../../../../store/selectors'; - -const mapStateToProps = (state) => { - const indexName = getDetailPanelIndexName(state); - return { - error: getDetailPanelError(state), - data: getDetailPanelData(state), - dataType: getDetailPanelType(state), - indexName, - indexStatus: getIndexStatusByIndexName(state, indexName), - }; -}; - -const mapDispatchToProps = { - loadIndexData, - closeDetailPanel, -}; - -export const ShowJson = connect(mapStateToProps, mapDispatchToProps)(PresentationComponent); diff --git a/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/show_json/show_json.js b/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/show_json/show_json.js deleted file mode 100644 index 6ad472e695936..0000000000000 --- a/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/show_json/show_json.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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. - */ - -import React from 'react'; -import { EuiCodeBlock } from '@elastic/eui'; - -import 'brace/theme/textmate'; - -export class ShowJson extends React.PureComponent { - UNSAFE_componentWillMount() { - this.props.loadIndexData(this.props); - } - UNSAFE_componentWillUpdate(newProps) { - const { data, loadIndexData } = newProps; - if (!data) { - loadIndexData(newProps); - } - } - render() { - const { data } = this.props; - if (!data) { - return null; - } - const json = JSON.stringify(data, null, 2); - return {json}; - } -} diff --git a/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/summary/index.js b/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/summary/index.js deleted file mode 100644 index e05d63d45ec16..0000000000000 --- a/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/summary/index.js +++ /dev/null @@ -1,8 +0,0 @@ -/* - * 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. - */ - -export { Summary } from './summary.container'; diff --git a/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/summary/summary.container.js b/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/summary/summary.container.js deleted file mode 100644 index f55bd3fa6ee19..0000000000000 --- a/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/summary/summary.container.js +++ /dev/null @@ -1,21 +0,0 @@ -/* - * 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. - */ - -import { connect } from 'react-redux'; -import { Summary as PresentationComponent } from './summary'; - -import { getIndexByIndexName, getDetailPanelIndexName } from '../../../../../store/selectors'; - -const mapStateToProps = (state) => { - const indexName = getDetailPanelIndexName(state); - return { - indexName, - index: getIndexByIndexName(state, indexName), - }; -}; - -export const Summary = connect(mapStateToProps)(PresentationComponent); diff --git a/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/summary/summary.js b/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/summary/summary.js deleted file mode 100644 index 7e680bbfe5bde..0000000000000 --- a/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/summary/summary.js +++ /dev/null @@ -1,147 +0,0 @@ -/* - * 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. - */ - -import React, { Fragment } from 'react'; -import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n-react'; -import { - EuiFlexGroup, - EuiFlexItem, - EuiDescriptionList, - EuiHorizontalRule, - EuiDescriptionListTitle, - EuiDescriptionListDescription, - EuiSpacer, - EuiTitle, -} from '@elastic/eui'; -import { DataHealth } from '../../../../../components'; -import { AppContextConsumer } from '../../../../../app_context'; - -const getHeaders = (showStats) => { - const baseHeaders = { - primary: i18n.translate('xpack.idxMgmt.summary.headers.primaryHeader', { - defaultMessage: 'Primaries', - }), - replica: i18n.translate('xpack.idxMgmt.summary.headers.replicaHeader', { - defaultMessage: 'Replicas', - }), - aliases: i18n.translate('xpack.idxMgmt.summary.headers.aliases', { - defaultMessage: 'Aliases', - }), - }; - - if (showStats) { - return { - ...baseHeaders, - health: i18n.translate('xpack.idxMgmt.summary.headers.healthHeader', { - defaultMessage: 'Health', - }), - status: i18n.translate('xpack.idxMgmt.summary.headers.statusHeader', { - defaultMessage: 'Status', - }), - documents: i18n.translate('xpack.idxMgmt.summary.headers.documentsHeader', { - defaultMessage: 'Docs count', - }), - documents_deleted: i18n.translate('xpack.idxMgmt.summary.headers.deletedDocumentsHeader', { - defaultMessage: 'Docs deleted', - }), - size: i18n.translate('xpack.idxMgmt.summary.headers.storageSizeHeader', { - defaultMessage: 'Storage size', - }), - primary_size: i18n.translate('xpack.idxMgmt.summary.headers.primaryStorageSizeHeader', { - defaultMessage: 'Primary storage size', - }), - }; - } - return baseHeaders; -}; - -export class Summary extends React.PureComponent { - getAdditionalContent(extensionsService, getUrlForApp) { - const { index } = this.props; - const extensions = extensionsService.summaries; - return extensions.map((summaryExtension, i) => { - const ExtensionSummaryComponent = summaryExtension; - return ( - - - - - ); - }); - } - - buildRows(config) { - const { index } = this.props; - const headers = getHeaders(config.enableIndexStats); - const rows = { - left: [], - right: [], - }; - Object.keys(headers).forEach((fieldName, arrayIndex) => { - const value = index[fieldName]; - let content = value; - if (fieldName === 'health') { - content = ; - } - if (Array.isArray(content)) { - content = content.join(', '); - } - const cell = [ - - {headers[fieldName]} - , - - {content} - , - ]; - if (arrayIndex % 2 === 0) { - rows.left.push(cell); - } else { - rows.right.push(cell); - } - }); - return rows; - } - - render() { - return ( - - {({ services, core, config }) => { - const { left, right } = this.buildRows(config); - const additionalContent = this.getAdditionalContent( - services.extensionsService, - core.getUrlForApp - ); - - return ( - - -

    - -

    -
    - - - - {left} - - - {right} - - - {additionalContent} -
    - ); - }} -
    - ); - } -} diff --git a/x-pack/plugins/index_management/public/application/store/actions/detail_panel.js b/x-pack/plugins/index_management/public/application/store/actions/detail_panel.js deleted file mode 100644 index 11d93a12eee9d..0000000000000 --- a/x-pack/plugins/index_management/public/application/store/actions/detail_panel.js +++ /dev/null @@ -1,11 +0,0 @@ -/* - * 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. - */ - -import { createAction } from 'redux-actions'; - -export const openDetailPanel = createAction('INDEX_MANAGEMENT_OPEN_DETAIL_PANEL'); -export const closeDetailPanel = createAction('INDEX_MANAGEMENT_CLOSE_DETAIL_PANEL'); diff --git a/x-pack/plugins/index_management/public/application/store/actions/edit_index_settings.js b/x-pack/plugins/index_management/public/application/store/actions/edit_index_settings.js deleted file mode 100644 index 4a82ced82eb83..0000000000000 --- a/x-pack/plugins/index_management/public/application/store/actions/edit_index_settings.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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. - */ - -import { i18n } from '@kbn/i18n'; -import { loadIndexSettings as request } from '../../services'; -import { notificationService } from '../../services/notification'; -import { loadIndexDataSuccess } from './load_index_data'; - -export const editIndexSettings = - ({ indexName }) => - async (dispatch) => { - let indexSettings; - try { - indexSettings = await request(indexName); - } catch (error) { - return notificationService.showDangerToast(error.message); - } - notificationService.showSuccessToast( - i18n.translate( - 'xpack.idxMgmt.editIndexSettingsAction.successfullySavedSettingsForIndicesMessage', - { - defaultMessage: 'Successfully saved settings for {indexName}', - values: { indexName }, - } - ) - ); - dispatch( - loadIndexDataSuccess({ - data: indexSettings, - panelType: 'editIndexSettings', - indexName, - }) - ); - }; diff --git a/x-pack/plugins/index_management/public/application/store/actions/load_index_data.js b/x-pack/plugins/index_management/public/application/store/actions/load_index_data.js deleted file mode 100644 index 18925d6d05e64..0000000000000 --- a/x-pack/plugins/index_management/public/application/store/actions/load_index_data.js +++ /dev/null @@ -1,24 +0,0 @@ -/* - * 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. - */ - -import { createAction } from 'redux-actions'; -import { loadIndexData as request } from '../../services'; -import { notificationService } from '../../services/notification'; - -export const loadIndexDataSuccess = createAction('INDEX_MANAGEMENT_LOAD_INDEX_DATA_SUCCESS'); - -export const loadIndexData = - ({ indexName, dataType }) => - async (dispatch) => { - let data; - try { - data = await request(dataType, indexName); - } catch (error) { - notificationService.showDangerToast(error.message); - } - dispatch(loadIndexDataSuccess({ data, indexName })); - }; diff --git a/x-pack/plugins/index_management/public/application/store/actions/update_index_settings.js b/x-pack/plugins/index_management/public/application/store/actions/update_index_settings.js deleted file mode 100644 index 22ebf78fc5fe0..0000000000000 --- a/x-pack/plugins/index_management/public/application/store/actions/update_index_settings.js +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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. - */ - -import { createAction } from 'redux-actions'; -import { i18n } from '@kbn/i18n'; -import { updateIndexSettings as request } from '../../services'; -import { reloadIndices } from './reload_indices'; -import { notificationService } from '../../services/notification'; - -export const updateIndexSettingsSuccess = createAction( - 'INDEX_MANAGEMENT_UPDATE_INDEX_SETTINGS_SUCCESS' -); -export const updateIndexSettingsError = createAction( - 'INDEX_MANAGEMENT_UPDATE_INDEX_SETTINGS_ERROR' -); - -export const updateIndexSettings = - ({ indexName, settings }) => - async (dispatch) => { - if (Object.keys(settings).length !== 0) { - const { error } = await request(indexName, settings); - - if (error) { - return dispatch(updateIndexSettingsError({ error: error.message })); - } - } - dispatch(updateIndexSettingsSuccess()); - dispatch(reloadIndices([indexName])); - notificationService.showSuccessToast( - i18n.translate('xpack.idxMgmt.updateIndexSettingsAction.settingsSuccessUpdateMessage', { - defaultMessage: 'Successfully updated settings for index {indexName}', - values: { indexName }, - }) - ); - }; diff --git a/x-pack/plugins/index_management/public/application/store/reducers/detail_panel.js b/x-pack/plugins/index_management/public/application/store/reducers/detail_panel.js deleted file mode 100644 index 5868c590fa5d2..0000000000000 --- a/x-pack/plugins/index_management/public/application/store/reducers/detail_panel.js +++ /dev/null @@ -1,91 +0,0 @@ -/* - * 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. - */ - -import { handleActions } from 'redux-actions'; -import { - UIM_DETAIL_PANEL_SUMMARY_TAB, - UIM_DETAIL_PANEL_SETTINGS_TAB, - UIM_DETAIL_PANEL_MAPPING_TAB, - UIM_DETAIL_PANEL_STATS_TAB, - UIM_DETAIL_PANEL_EDIT_SETTINGS_TAB, -} from '../../../../common/constants'; -import { - TAB_SUMMARY, - TAB_SETTINGS, - TAB_MAPPING, - TAB_STATS, - TAB_EDIT_SETTINGS, -} from '../../constants'; -import { openDetailPanel, closeDetailPanel } from '../actions/detail_panel'; -import { loadIndexDataSuccess } from '../actions/load_index_data'; -import { - updateIndexSettingsSuccess, - updateIndexSettingsError, -} from '../actions/update_index_settings'; -import { deleteIndicesSuccess } from '../actions/delete_indices'; -import { METRIC_TYPE } from '@kbn/analytics'; - -const defaultState = {}; - -export const getDetailPanelReducer = (uiMetricService) => - handleActions( - { - [deleteIndicesSuccess](state, action) { - const { indexNames } = action.payload; - const { indexName } = state; - if (indexNames.includes(indexName)) { - return {}; - } else { - return state; - } - }, - [openDetailPanel](state, action) { - const { panelType, indexName, title } = action.payload; - - const panelTypeToUiMetricMap = { - [TAB_SUMMARY]: UIM_DETAIL_PANEL_SUMMARY_TAB, - [TAB_SETTINGS]: UIM_DETAIL_PANEL_SETTINGS_TAB, - [TAB_MAPPING]: UIM_DETAIL_PANEL_MAPPING_TAB, - [TAB_STATS]: UIM_DETAIL_PANEL_STATS_TAB, - [TAB_EDIT_SETTINGS]: UIM_DETAIL_PANEL_EDIT_SETTINGS_TAB, - }; - - if (panelTypeToUiMetricMap[panelType]) { - uiMetricService.trackMetric(METRIC_TYPE.COUNT, panelTypeToUiMetricMap[panelType]); - } - - return { - panelType: panelType || state.panelType || TAB_SUMMARY, - indexName, - title, - }; - }, - [closeDetailPanel]() { - return {}; - }, - [loadIndexDataSuccess](state, action) { - const { data } = action.payload; - const newState = { - ...state, - data, - }; - return newState; - }, - [updateIndexSettingsError](state, action) { - const { error } = action.payload; - const newState = { - ...state, - error, - }; - return newState; - }, - [updateIndexSettingsSuccess]() { - return {}; - }, - }, - defaultState - ); diff --git a/x-pack/plugins/infra/common/locators/discover_logs_locator.ts b/x-pack/plugins/infra/common/locators/discover_logs_locator.ts deleted file mode 100644 index 292105678388f..0000000000000 --- a/x-pack/plugins/infra/common/locators/discover_logs_locator.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 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. - */ - -import type { LocatorDefinition, LocatorPublic } from '@kbn/share-plugin/public'; -import type { LogsLocatorDependencies, LogsLocatorParams } from './logs_locator'; -import { LOGS_LOCATOR_ID } from './logs_locator'; - -export type DiscoverLogsLocator = LocatorPublic; - -export class DiscoverLogsLocatorDefinition implements LocatorDefinition { - public readonly id = LOGS_LOCATOR_ID; - - constructor(protected readonly deps: LogsLocatorDependencies) {} - - public readonly getLocation = async (params: LogsLocatorParams) => { - const { getLocationToDiscover } = await import('./helpers'); - - return getLocationToDiscover({ - core: this.deps.core, - ...params, - }); - }; -} diff --git a/x-pack/plugins/infra/common/locators/discover_node_logs_locator.ts b/x-pack/plugins/infra/common/locators/discover_node_logs_locator.ts deleted file mode 100644 index 43418747ab502..0000000000000 --- a/x-pack/plugins/infra/common/locators/discover_node_logs_locator.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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. - */ - -import type { LocatorDefinition, LocatorPublic } from '@kbn/share-plugin/public'; -import type { NodeLogsLocatorDependencies, NodeLogsLocatorParams } from './node_logs_locator'; -import { NODE_LOGS_LOCATOR_ID } from './node_logs_locator'; - -export type DiscoverNodeLogsLocator = LocatorPublic; - -export class DiscoverNodeLogsLocatorDefinition implements LocatorDefinition { - public readonly id = NODE_LOGS_LOCATOR_ID; - - constructor(protected readonly deps: NodeLogsLocatorDependencies) {} - - public readonly getLocation = async (params: NodeLogsLocatorParams) => { - const { createNodeLogsQuery, getLocationToDiscover } = await import('./helpers'); - - const { timeRange, logView } = params; - const query = createNodeLogsQuery(params); - - return getLocationToDiscover({ - core: this.deps.core, - timeRange, - filter: query, - logView, - }); - }; -} diff --git a/x-pack/plugins/infra/public/apps/discover_app.tsx b/x-pack/plugins/infra/public/apps/discover_app.tsx deleted file mode 100644 index 2ea704fa9b21f..0000000000000 --- a/x-pack/plugins/infra/public/apps/discover_app.tsx +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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. - */ -import { createKbnUrlStateStorage } from '@kbn/kibana-utils-plugin/public'; -import type { AppMountParameters, CoreStart } from '@kbn/core/public'; -import { getLogViewReferenceFromUrl } from '@kbn/logs-shared-plugin/public'; -import type { InfraClientStartExports } from '../types'; - -export const renderApp = ( - core: CoreStart, - pluginStart: InfraClientStartExports, - params: AppMountParameters -) => { - const toastsService = core.notifications.toasts; - - const urlStateStorage = createKbnUrlStateStorage({ - history: params.history, - useHash: false, - useHashQuery: false, - }); - - const logView = getLogViewReferenceFromUrl({ toastsService, urlStateStorage }); - - pluginStart.locators.logsLocator.navigate({ ...(logView ? { logView } : {}) }, { replace: true }); - - return () => true; -}; diff --git a/x-pack/test/functional/apps/index_management/index_details_page/config.ts b/x-pack/test/functional/apps/index_management/index_details_page/config.ts deleted file mode 100644 index dde646c885221..0000000000000 --- a/x-pack/test/functional/apps/index_management/index_details_page/config.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * 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. - */ - -import { FtrConfigProviderContext } from '@kbn/test'; - -export default async function ({ readConfigFile }: FtrConfigProviderContext) { - const functionalConfig = await readConfigFile(require.resolve('../config.ts')); - - return { - ...functionalConfig.getAll(), - testFiles: [require.resolve('.')], - kbnTestServer: { - ...functionalConfig.get('kbnTestServer'), - serverArgs: [ - ...functionalConfig.get('kbnTestServer.serverArgs'), - // setting the feature flag to enable details page - `--xpack.index_management.dev.enableIndexDetailsPage=true`, - ], - }, - }; -} diff --git a/x-pack/test/functional/apps/index_management/index_details_page/index.ts b/x-pack/test/functional/apps/index_management/index_details_page/index.ts deleted file mode 100644 index 20915ab416e31..0000000000000 --- a/x-pack/test/functional/apps/index_management/index_details_page/index.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* - * 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. - */ - -import { FtrProviderContext } from '../../../ftr_provider_context'; - -export default ({ loadTestFile }: FtrProviderContext) => { - describe('Index Management: index details page', function () { - loadTestFile(require.resolve('./index_details_page')); - }); -}; diff --git a/x-pack/test/functional/apps/index_management/index_details_page/index_details_page.ts b/x-pack/test/functional/apps/index_management/index_details_page/index_details_page.ts deleted file mode 100644 index 58eae49837882..0000000000000 --- a/x-pack/test/functional/apps/index_management/index_details_page/index_details_page.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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. - */ - -import { FtrProviderContext } from '../../../ftr_provider_context'; - -export default ({ getPageObjects, getService }: FtrProviderContext) => { - const pageObjects = getPageObjects(['common', 'indexManagement', 'header']); - const log = getService('log'); - const security = getService('security'); - - describe('Index details page', function () { - before(async () => { - await security.testUser.setRoles(['index_management_user']); - await pageObjects.common.navigateToApp('indexManagement'); - }); - - it('Navigates to the index details page from the home page', async () => { - await log.debug('Navigating to the index details page'); - - // display hidden indices to have some rows in the indices table - await pageObjects.indexManagement.toggleHiddenIndices(); - // click the first index in the table and wait for the index details page - await pageObjects.indexManagement.indexDetailsPage.openIndexDetailsPage(0); - }); - }); -}; From 05b48f454f70af00e2b68f5711f8010a24cfcf37 Mon Sep 17 00:00:00 2001 From: Steph Milovic Date: Thu, 28 Sep 2023 08:26:58 -0600 Subject: [PATCH 03/11] rm more files idk how got there --- ...ormation_template_url_from_package_info.ts | 32 ------------------- 1 file changed, 32 deletions(-) delete mode 100644 x-pack/plugins/fleet/public/services/get_cloud_formation_template_url_from_package_info.ts diff --git a/x-pack/plugins/fleet/public/services/get_cloud_formation_template_url_from_package_info.ts b/x-pack/plugins/fleet/public/services/get_cloud_formation_template_url_from_package_info.ts deleted file mode 100644 index 4f5381ccedb3f..0000000000000 --- a/x-pack/plugins/fleet/public/services/get_cloud_formation_template_url_from_package_info.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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. - */ - -import type { PackageInfo } from '../types'; - -/** - * Get the cloud formation template url from the PackageInfo - * It looks for a input var with a object containing cloud_formation_template_url present in - * the package_policies inputs of the given integration type - */ -export const getCloudFormationTemplateUrlFromPackageInfo = ( - packageInfo: PackageInfo | undefined, - integrationType: string -): string | undefined => { - if (!packageInfo?.policy_templates) return undefined; - - const policyTemplate = packageInfo.policy_templates.find((p) => p.name === integrationType); - if (!policyTemplate) return undefined; - - if ('inputs' in policyTemplate) { - const cloudFormationTemplate = policyTemplate.inputs?.reduce((acc, input): string => { - if (!input.vars) return acc; - const template = input.vars.find((v) => v.name === 'cloud_formation_template')?.default; - return template ? String(template) : acc; - }, ''); - return cloudFormationTemplate !== '' ? cloudFormationTemplate : undefined; - } -}; From 82149886b95c57f19a01a52dec0d0364c566ad64 Mon Sep 17 00:00:00 2001 From: Steph Milovic Date: Thu, 28 Sep 2023 08:30:24 -0600 Subject: [PATCH 04/11] one more revert --- .../home/index_list/detail_panel/show_json/index.js | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/show_json/index.js diff --git a/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/show_json/index.js b/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/show_json/index.js deleted file mode 100644 index 86fe8d41bda63..0000000000000 --- a/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/show_json/index.js +++ /dev/null @@ -1,8 +0,0 @@ -/* - * 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. - */ - -export { ShowJson } from './show_json.container'; From b7977d3f1576a47e2636c4e252b27ecd9cf7f8a4 Mon Sep 17 00:00:00 2001 From: Steph Milovic Date: Thu, 28 Sep 2023 10:34:46 -0600 Subject: [PATCH 05/11] fix translation --- x-pack/plugins/translations/translations/fr-FR.json | 3 +-- x-pack/plugins/translations/translations/ja-JP.json | 3 +-- x-pack/plugins/translations/translations/zh-CN.json | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/x-pack/plugins/translations/translations/fr-FR.json b/x-pack/plugins/translations/translations/fr-FR.json index 8981de9b982c7..7d0c71a5040e3 100644 --- a/x-pack/plugins/translations/translations/fr-FR.json +++ b/x-pack/plugins/translations/translations/fr-FR.json @@ -7076,7 +7076,6 @@ "xpack.actions.availableConnectorFeatures.cases": "Cas", "xpack.actions.availableConnectorFeatures.compatibility.alertingRules": "Règles d'alerting", "xpack.actions.availableConnectorFeatures.compatibility.cases": "Cas", - "xpack.actions.availableConnectorFeatures.compatibility.general": "Général", "xpack.actions.availableConnectorFeatures.securitySolution": "Solution de sécurité", "xpack.actions.availableConnectorFeatures.uptime": "Uptime", "xpack.actions.builtin.cases.jiraTitle": "Jira", @@ -39800,4 +39799,4 @@ "xpack.painlessLab.walkthroughButtonLabel": "Présentation", "xpack.serverlessObservability.nav.getStarted": "Démarrer" } -} \ No newline at end of file +} diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index 41665e626fc8c..8341f9b886f36 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -7092,7 +7092,6 @@ "xpack.actions.availableConnectorFeatures.cases": "ケース", "xpack.actions.availableConnectorFeatures.compatibility.alertingRules": "アラートルール", "xpack.actions.availableConnectorFeatures.compatibility.cases": "ケース", - "xpack.actions.availableConnectorFeatures.compatibility.general": "一般", "xpack.actions.availableConnectorFeatures.securitySolution": "セキュリティソリューション", "xpack.actions.availableConnectorFeatures.uptime": "アップタイム", "xpack.actions.builtin.cases.jiraTitle": "Jira", @@ -39791,4 +39790,4 @@ "xpack.painlessLab.walkthroughButtonLabel": "実地検証", "xpack.serverlessObservability.nav.getStarted": "使ってみる" } -} \ No newline at end of file +} diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 33625a62a6356..efc9638dc9619 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -7091,7 +7091,6 @@ "xpack.actions.availableConnectorFeatures.cases": "案例", "xpack.actions.availableConnectorFeatures.compatibility.alertingRules": "告警规则", "xpack.actions.availableConnectorFeatures.compatibility.cases": "案例", - "xpack.actions.availableConnectorFeatures.compatibility.general": "常规", "xpack.actions.availableConnectorFeatures.securitySolution": "安全解决方案", "xpack.actions.availableConnectorFeatures.uptime": "运行时间", "xpack.actions.builtin.cases.jiraTitle": "Jira", @@ -39785,4 +39784,4 @@ "xpack.painlessLab.walkthroughButtonLabel": "指导", "xpack.serverlessObservability.nav.getStarted": "开始使用" } -} \ No newline at end of file +} From be6fd3a7ffb0f57b3ef74b4f279ef9e096d92f71 Mon Sep 17 00:00:00 2001 From: Steph Milovic Date: Thu, 28 Sep 2023 10:37:14 -0600 Subject: [PATCH 06/11] fix test --- .../actions/common/connector_feature_config.test.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/x-pack/plugins/actions/common/connector_feature_config.test.ts b/x-pack/plugins/actions/common/connector_feature_config.test.ts index cb571dfa8714d..c12e3db21127f 100644 --- a/x-pack/plugins/actions/common/connector_feature_config.test.ts +++ b/x-pack/plugins/actions/common/connector_feature_config.test.ts @@ -13,7 +13,7 @@ import { describe('areValidFeatures', () => { it('returns true when all inputs are valid features', () => { - expect(areValidFeatures(['alerting', 'cases', 'general'])).toBeTruthy(); + expect(areValidFeatures(['alerting', 'cases', 'generativeAI'])).toBeTruthy(); }); it('returns true when only one input and it is a valid feature', () => { @@ -42,11 +42,9 @@ describe('getConnectorFeatureName', () => { describe('getConnectorCompatibility', () => { it('returns the compatibility list for valid feature ids', () => { - expect(getConnectorCompatibility(['alerting', 'cases', 'uptime', 'siem', 'general'])).toEqual([ - 'Alerting Rules', - 'Cases', - 'General', - ]); + expect( + getConnectorCompatibility(['alerting', 'cases', 'uptime', 'siem', 'generativeAI']) + ).toEqual(['Alerting Rules', 'Cases', 'Generative AI']); }); it('skips invalid feature ids', () => { From 422401340c511db7ab578af2d01de6ea72e12c85 Mon Sep 17 00:00:00 2001 From: Steph Milovic Date: Thu, 28 Sep 2023 11:02:44 -0600 Subject: [PATCH 07/11] one more update --- docs/settings/alert-action-settings.asciidoc | 8 ++++---- x-pack/plugins/observability_ai_assistant/README.md | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/settings/alert-action-settings.asciidoc b/docs/settings/alert-action-settings.asciidoc index f00c805829a83..76b1ebadc98d1 100644 --- a/docs/settings/alert-action-settings.asciidoc +++ b/docs/settings/alert-action-settings.asciidoc @@ -261,13 +261,13 @@ For example: `.email`, `.index`, `.opsgenie`, `.server-log`, `.resilient`, `.sla The configuration details, which are specific to the type of preconfigured connector. `xpack.actions.preconfigured..config.apiProvider`:: -For a <>, specifies the OpenAI API provider, either `OpenAI` or `Azure OpenAI`. +For a <>, specifies the OpenAI API provider, either `OpenAI` or `Azure OpenAI`. `xpack.actions.preconfigured..config.apiUrl`:: A configuration URL that varies by connector: + -- -* For a <>, specifies the OpenAI request URL. +* For a <>, specifies the OpenAI request URL. * For a <>, specifies the {ibm-r} instance URL. * For a <>, specifies the Jira instance URL. * For an <>, specifies the {opsgenie} URL. For example, `https://api.opsgenie.com` or `https://api.eu.opsgenie.com`. @@ -321,7 +321,7 @@ NOTE: If you are using the `xpack.actions.allowedHosts` setting, make sure the h For a <>, specifies a string from the response body of the create case method that corresponds to the external service identifier. `xpack.actions.preconfigured..config.defaultModel`:: -For a <>, specifies the default model to use for requests. It is optional and applicable only when `xpack.actions.preconfigured..config.apiProvider` is `OpenAI`. +For a <>, specifies the default model to use for requests. It is optional and applicable only when `xpack.actions.preconfigured..config.apiProvider` is `OpenAI`. `xpack.actions.preconfigured..config.executionTimeField`:: For an <>, a field that indicates when the document was indexed. @@ -448,7 +448,7 @@ TIP: Sensitive properties, such as passwords, should be stored in the <>, specifies the OpenAI or Azure OpenAI API key for authentication. +* For a <>, specifies the OpenAI or Azure OpenAI API key for authentication. * For an <>, specifies the {opsgenie} API authentication key for HTTP basic authentication. -- diff --git a/x-pack/plugins/observability_ai_assistant/README.md b/x-pack/plugins/observability_ai_assistant/README.md index ab63ab708ed2b..8d5e166883995 100644 --- a/x-pack/plugins/observability_ai_assistant/README.md +++ b/x-pack/plugins/observability_ai_assistant/README.md @@ -6,7 +6,7 @@ This document gives an overview of the features of the Observability AI Assistan #### **1.1. Configuration** -Users can connect to an LLM using [connectors](https://www.elastic.co/guide/en/kibana/current/action-types.html) - specifically the [OpenAI connector](https://www.elastic.co/guide/en/kibana/current/gen-ai-action-type.html), which currently supports both OpenAI and Azure OpenAI as providers. The connector is Enterprise-only. Users can also leverage [preconfigured connectors](https://www.elastic.co/guide/en/kibana/current/pre-configured-connectors.html), in which case the following should be added to `kibana.yml`: +Users can connect to an LLM using [connectors](https://www.elastic.co/guide/en/kibana/current/action-types.html) - specifically the [OpenAI connector](https://www.elastic.co/guide/en/kibana/current/openai-action-type.html), which currently supports both OpenAI and Azure OpenAI as providers. The connector is Enterprise-only. Users can also leverage [preconfigured connectors](https://www.elastic.co/guide/en/kibana/current/pre-configured-connectors.html), in which case the following should be added to `kibana.yml`: ```yaml xpack.actions.preconfigured: From 5a97a98302a1333a0499f5415c2e51b97a3bb99b Mon Sep 17 00:00:00 2001 From: Steph Milovic Date: Thu, 28 Sep 2023 12:59:09 -0600 Subject: [PATCH 08/11] GenerativeAiActionConnector to OpenAIActionConnector --- .../public/connector_types/open_ai/params.tsx | 4 ++-- .../stack_connectors/public/connector_types/open_ai/types.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/x-pack/plugins/stack_connectors/public/connector_types/open_ai/params.tsx b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/params.tsx index c2092c6198252..14384d2d86412 100644 --- a/x-pack/plugins/stack_connectors/public/connector_types/open_ai/params.tsx +++ b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/params.tsx @@ -14,7 +14,7 @@ import { } from '@kbn/triggers-actions-ui-plugin/public'; import { OpenAiProviderType, SUB_ACTION } from '../../../common/open_ai/constants'; import { DEFAULT_BODY, DEFAULT_BODY_AZURE } from './constants'; -import { GenerativeAiActionConnector, ActionParams } from './types'; +import { OpenAIActionConnector, ActionParams } from './types'; const ParamsFields: React.FunctionComponent> = ({ actionConnector, @@ -29,7 +29,7 @@ const ParamsFields: React.FunctionComponent> = ( const { body } = subActionParams ?? {}; - const typedActionConnector = actionConnector as unknown as GenerativeAiActionConnector; + const typedActionConnector = actionConnector as unknown as OpenAIActionConnector; const isTest = useMemo(() => executionMode === ActionConnectorMode.Test, [executionMode]); diff --git a/x-pack/plugins/stack_connectors/public/connector_types/open_ai/types.ts b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/types.ts index 9ddc9c662d94f..354c40845c4fa 100644 --- a/x-pack/plugins/stack_connectors/public/connector_types/open_ai/types.ts +++ b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/types.ts @@ -25,4 +25,4 @@ export interface Secrets { } export type OpenAIConnector = ConnectorTypeModel; -export type GenerativeAiActionConnector = UserConfiguredActionConnector; +export type OpenAIActionConnector = UserConfiguredActionConnector; From 95e8fc99a517f183b93d6486283b094360ad874c Mon Sep 17 00:00:00 2001 From: lcawl Date: Thu, 28 Sep 2023 17:57:53 -0700 Subject: [PATCH 09/11] [DOCS] Add redirect for links --- docs/management/connectors/index.asciidoc | 2 +- docs/redirects.asciidoc | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/management/connectors/index.asciidoc b/docs/management/connectors/index.asciidoc index cf17927941863..14cfd57fd3c80 100644 --- a/docs/management/connectors/index.asciidoc +++ b/docs/management/connectors/index.asciidoc @@ -1,11 +1,11 @@ include::action-types/bedrock.asciidoc[leveloffset=+1] include::action-types/d3security.asciidoc[leveloffset=+1] include::action-types/email.asciidoc[leveloffset=+1] -include::action-types/openai.asciidoc[leveloffset=+1] include::action-types/resilient.asciidoc[leveloffset=+1] include::action-types/index.asciidoc[leveloffset=+1] include::action-types/jira.asciidoc[leveloffset=+1] include::action-types/teams.asciidoc[leveloffset=+1] +include::action-types/openai.asciidoc[leveloffset=+1] include::action-types/opsgenie.asciidoc[leveloffset=+1] include::action-types/pagerduty.asciidoc[leveloffset=+1] include::action-types/server-log.asciidoc[leveloffset=+1] diff --git a/docs/redirects.asciidoc b/docs/redirects.asciidoc index f4ac0f11739b0..eac4ff0c800d8 100644 --- a/docs/redirects.asciidoc +++ b/docs/redirects.asciidoc @@ -422,3 +422,8 @@ This page has been deleted. Refer to <>. == Enhancements and bug fixes for 8.10.0 This content has moved. Refer to <> for 8.10.0. + +[role="exclude",id="gen-ai-action-type"] +== Generative AI connector and action + +This connector was renamed. Refer to <>. \ No newline at end of file From 91365d6d89a49f373d12e23f598c71bbb8ec0e43 Mon Sep 17 00:00:00 2001 From: Steph Milovic Date: Fri, 29 Sep 2023 08:08:15 -0600 Subject: [PATCH 10/11] update d3 --- .../public/connector_types/d3security/d3security.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/stack_connectors/public/connector_types/d3security/d3security.tsx b/x-pack/plugins/stack_connectors/public/connector_types/d3security/d3security.tsx index 6fec59791c2d1..f3223eb8314f3 100644 --- a/x-pack/plugins/stack_connectors/public/connector_types/d3security/d3security.tsx +++ b/x-pack/plugins/stack_connectors/public/connector_types/d3security/d3security.tsx @@ -8,7 +8,7 @@ import { lazy } from 'react'; import { i18n } from '@kbn/i18n'; import { GenericValidationResult } from '@kbn/triggers-actions-ui-plugin/public/types'; -import { SUB_ACTION } from '../../../common/open_ai/constants'; +import { SUB_ACTION } from '../../../common/d3security/constants'; import { D3SecurityActionParams, D3SecurityConnector } from './types'; import { D3_SECURITY_CONNECTOR_ID } from '../../../common/d3security/constants'; interface ValidationErrors { From c9e2e98abba9ec3d1f0549ee896d82f9c01cedaf Mon Sep 17 00:00:00 2001 From: Steph Milovic Date: Fri, 29 Sep 2023 08:13:32 -0600 Subject: [PATCH 11/11] open_ai to openai --- .github/CODEOWNERS | 6 +++--- .../impl/assistant/assistant_header/index.tsx | 2 +- .../conversation_selector/index.tsx | 2 +- .../conversation_selector_settings/index.tsx | 2 +- .../impl/assistant/index.tsx | 2 +- .../assistant/settings/assistant_settings.tsx | 2 +- .../settings/assistant_settings_button.tsx | 2 +- .../impl/assistant_context/types.tsx | 2 +- .../impl/connectorland/helpers.tsx | 4 ++-- .../impl/mock/conversation.ts | 2 +- .../actions/server/lib/action_executor.ts | 6 +++--- .../common/{open_ai => openai}/constants.ts | 4 ++-- .../common/{open_ai => openai}/schema.ts | 0 .../common/{open_ai => openai}/types.ts | 0 .../stack_connectors/public/common/index.ts | 4 ++-- .../public/connector_types/index.ts | 2 +- .../{open_ai => openai}/api.test.ts | 2 +- .../connector_types/{open_ai => openai}/api.ts | 2 +- .../{open_ai => openai}/connector.test.tsx | 2 +- .../{open_ai => openai}/connector.tsx | 2 +- .../{open_ai => openai}/constants.tsx | 10 +++++----- .../connector_types/{open_ai => openai}/index.ts | 2 +- .../connector_types/{open_ai => openai}/logo.tsx | 0 .../open_ai.test.tsx => openai/openai.test.tsx} | 2 +- .../{open_ai/open_ai.tsx => openai/openai.tsx} | 8 ++++---- .../{open_ai => openai}/params.test.tsx | 2 +- .../{open_ai => openai}/params.tsx | 2 +- .../{open_ai => openai}/translations.ts | 2 +- .../connector_types/{open_ai => openai}/types.ts | 4 ++-- .../use_get_dashboard.test.ts | 0 .../{open_ai => openai}/use_get_dashboard.ts | 0 .../server/connector_types/index.ts | 2 +- .../{open_ai => openai}/create_dashboard.test.ts | 0 .../{open_ai => openai}/create_dashboard.ts | 0 .../{open_ai => openai}/dashboard.ts | 2 +- .../{open_ai => openai}/index.test.ts | 4 ++-- .../connector_types/{open_ai => openai}/index.ts | 16 ++++++++-------- .../lib/azure_openai_utils.test.ts | 2 +- .../lib/azure_openai_utils.ts | 2 +- .../{open_ai => openai}/lib/openai_utils.test.ts | 2 +- .../{open_ai => openai}/lib/openai_utils.ts | 5 +---- .../{open_ai => openai}/lib/utils.test.ts | 2 +- .../{open_ai => openai}/lib/utils.ts | 2 +- .../open_ai.test.ts => openai/openai.test.ts} | 14 +++++++------- .../{open_ai/open_ai.ts => openai/openai.ts} | 8 ++++---- .../{open_ai => openai}/render.test.ts | 0 .../{open_ai => openai}/render.ts | 2 +- ...pen_ai_simulation.ts => openai_simulation.ts} | 0 .../connector_types/{open_ai.ts => openai.ts} | 2 +- .../group2/tests/actions/index.ts | 2 +- 50 files changed, 73 insertions(+), 76 deletions(-) rename x-pack/plugins/stack_connectors/common/{open_ai => openai}/constants.ts (93%) rename x-pack/plugins/stack_connectors/common/{open_ai => openai}/schema.ts (100%) rename x-pack/plugins/stack_connectors/common/{open_ai => openai}/types.ts (100%) rename x-pack/plugins/stack_connectors/public/connector_types/{open_ai => openai}/api.test.ts (94%) rename x-pack/plugins/stack_connectors/public/connector_types/{open_ai => openai}/api.ts (94%) rename x-pack/plugins/stack_connectors/public/connector_types/{open_ai => openai}/connector.test.tsx (99%) rename x-pack/plugins/stack_connectors/public/connector_types/{open_ai => openai}/connector.tsx (97%) rename x-pack/plugins/stack_connectors/public/connector_types/{open_ai => openai}/constants.tsx (96%) rename x-pack/plugins/stack_connectors/public/connector_types/{open_ai => openai}/index.ts (97%) rename x-pack/plugins/stack_connectors/public/connector_types/{open_ai => openai}/logo.tsx (100%) rename x-pack/plugins/stack_connectors/public/connector_types/{open_ai/open_ai.test.tsx => openai/openai.test.tsx} (97%) rename x-pack/plugins/stack_connectors/public/connector_types/{open_ai/open_ai.tsx => openai/openai.tsx} (90%) rename x-pack/plugins/stack_connectors/public/connector_types/{open_ai => openai}/params.test.tsx (99%) rename x-pack/plugins/stack_connectors/public/connector_types/{open_ai => openai}/params.tsx (99%) rename x-pack/plugins/stack_connectors/public/connector_types/{open_ai => openai}/translations.ts (97%) rename x-pack/plugins/stack_connectors/public/connector_types/{open_ai => openai}/types.ts (91%) rename x-pack/plugins/stack_connectors/public/connector_types/{open_ai => openai}/use_get_dashboard.test.ts (100%) rename x-pack/plugins/stack_connectors/public/connector_types/{open_ai => openai}/use_get_dashboard.ts (100%) rename x-pack/plugins/stack_connectors/server/connector_types/{open_ai => openai}/create_dashboard.test.ts (100%) rename x-pack/plugins/stack_connectors/server/connector_types/{open_ai => openai}/create_dashboard.ts (100%) rename x-pack/plugins/stack_connectors/server/connector_types/{open_ai => openai}/dashboard.ts (99%) rename x-pack/plugins/stack_connectors/server/connector_types/{open_ai => openai}/index.test.ts (97%) rename x-pack/plugins/stack_connectors/server/connector_types/{open_ai => openai}/index.ts (88%) rename x-pack/plugins/stack_connectors/server/connector_types/{open_ai => openai}/lib/azure_openai_utils.test.ts (99%) rename x-pack/plugins/stack_connectors/server/connector_types/{open_ai => openai}/lib/azure_openai_utils.ts (97%) rename x-pack/plugins/stack_connectors/server/connector_types/{open_ai => openai}/lib/openai_utils.test.ts (99%) rename x-pack/plugins/stack_connectors/server/connector_types/{open_ai => openai}/lib/openai_utils.ts (93%) rename x-pack/plugins/stack_connectors/server/connector_types/{open_ai => openai}/lib/utils.test.ts (99%) rename x-pack/plugins/stack_connectors/server/connector_types/{open_ai => openai}/lib/utils.ts (97%) rename x-pack/plugins/stack_connectors/server/connector_types/{open_ai/open_ai.test.ts => openai/openai.test.ts} (98%) rename x-pack/plugins/stack_connectors/server/connector_types/{open_ai/open_ai.ts => openai/openai.ts} (97%) rename x-pack/plugins/stack_connectors/server/connector_types/{open_ai => openai}/render.test.ts (100%) rename x-pack/plugins/stack_connectors/server/connector_types/{open_ai => openai}/render.ts (93%) rename x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/{open_ai_simulation.ts => openai_simulation.ts} (100%) rename x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/{open_ai.ts => openai.ts} (99%) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index ff2196aa3adb6..ff0f4817135f4 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1208,9 +1208,9 @@ x-pack/plugins/cloud_integrations/cloud_full_story/server/config.ts @elastic/kib /x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users @elastic/security-threat-hunting-explore ## Explore owner connectors -/x-pack/plugins/stack_connectors/public/connector_types/open_ai @elastic/security-threat-hunting-explore -/x-pack/plugins/stack_connectors/server/connector_types/open_ai @elastic/security-threat-hunting-explore -/x-pack/plugins/stack_connectors/common/open_ai @elastic/security-threat-hunting-explore +/x-pack/plugins/stack_connectors/public/connector_types/openai @elastic/security-threat-hunting-explore +/x-pack/plugins/stack_connectors/server/connector_types/openai @elastic/security-threat-hunting-explore +/x-pack/plugins/stack_connectors/common/openai @elastic/security-threat-hunting-explore ## Defend Workflows owner connectors /x-pack/plugins/stack_connectors/public/connector_types/sentinelone @elastic/security-defend-workflows diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_header/index.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_header/index.tsx index fb7d8e20778a9..e4c4454859d34 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_header/index.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_header/index.tsx @@ -17,7 +17,7 @@ import { } from '@elastic/eui'; import { css } from '@emotion/react'; import { DocLinksStart } from '@kbn/core-doc-links-browser'; -import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/open_ai/constants'; +import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/openai/constants'; import { Conversation } from '../../..'; import { AssistantTitle } from '../assistant_title'; import { ConversationSelector } from '../conversations/conversation_selector'; diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector/index.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector/index.tsx index f823e6bb49eb0..b68cff6713e91 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector/index.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector/index.tsx @@ -19,7 +19,7 @@ import React, { useCallback, useEffect, useMemo, useState } from 'react'; import useEvent from 'react-use/lib/useEvent'; import { css } from '@emotion/react'; -import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/open_ai/constants'; +import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/openai/constants'; import { Conversation } from '../../../..'; import { useAssistantContext } from '../../../assistant_context'; import * as i18n from './translations'; diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector_settings/index.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector_settings/index.tsx index 8c18a01a2b3d0..3f26c97f5ad0b 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector_settings/index.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector_settings/index.tsx @@ -18,7 +18,7 @@ import { import React, { useCallback, useMemo, useState } from 'react'; import { css } from '@emotion/react'; -import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/open_ai/constants'; +import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/openai/constants'; import { Conversation, Prompt } from '../../../..'; import { UseAssistantContext } from '../../../assistant_context'; import * as i18n from './translations'; diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/index.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/index.tsx index d838f45bb9e47..cdfd8187e7a2f 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/index.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/index.tsx @@ -29,7 +29,7 @@ import { import { createPortal } from 'react-dom'; import { css } from '@emotion/react'; -import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/open_ai/constants'; +import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/openai/constants'; import { ActionConnectorProps } from '@kbn/triggers-actions-ui-plugin/public/types'; import { ChatSend } from './chat_send'; import { BlockBotCallToAction } from './block_bot/cta'; diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings.tsx index 87aebe74cdec0..38a9527ca923f 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings.tsx @@ -23,7 +23,7 @@ import { // eslint-disable-next-line @kbn/eslint/module_migration import styled from 'styled-components'; import { css } from '@emotion/react'; -import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/open_ai/constants'; +import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/openai/constants'; import { Conversation, Prompt, QuickPrompt } from '../../..'; import * as i18n from './translations'; import { useAssistantContext } from '../../assistant_context'; diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings_button.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings_button.tsx index 9a65e5b101d44..f559ae8aa76dd 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings_button.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings_button.tsx @@ -8,7 +8,7 @@ import React, { useCallback } from 'react'; import { EuiButtonIcon, EuiToolTip } from '@elastic/eui'; -import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/open_ai/constants'; +import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/openai/constants'; import { Conversation } from '../../..'; import { AssistantSettings, CONVERSATIONS_TAB } from './assistant_settings'; import * as i18n from './translations'; diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant_context/types.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant_context/types.tsx index 706454f47e375..bf0a20e2b6ea5 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant_context/types.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant_context/types.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/open_ai/constants'; +import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/openai/constants'; export type ConversationRole = 'system' | 'user' | 'assistant'; diff --git a/x-pack/packages/kbn-elastic-assistant/impl/connectorland/helpers.tsx b/x-pack/packages/kbn-elastic-assistant/impl/connectorland/helpers.tsx index 231bf32c8af93..9147a6ca83dba 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/connectorland/helpers.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/connectorland/helpers.tsx @@ -7,7 +7,7 @@ import type { ActionConnector } from '@kbn/triggers-actions-ui-plugin/public'; import { ActionConnectorProps } from '@kbn/triggers-actions-ui-plugin/public/types'; -import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/open_ai/constants'; +import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/openai/constants'; import { ActionTypeModel } from '@kbn/triggers-actions-ui-plugin/public'; interface GenAiConfig { @@ -20,7 +20,7 @@ interface GenAiConfig { * Returns the GenAiConfig for a given ActionConnector. Note that if the connector is preconfigured, * the config will be undefined as the connector is neither available nor editable. * - * TODO: Extract and use separate types from GenAiConfig from '@kbn/stack-connectors-plugin/common/open_ai/types' + * TODO: Extract and use separate types from GenAiConfig from '@kbn/stack-connectors-plugin/common/openai/types' * * @param connector */ diff --git a/x-pack/packages/kbn-elastic-assistant/impl/mock/conversation.ts b/x-pack/packages/kbn-elastic-assistant/impl/mock/conversation.ts index 0296ca6fb7706..8e8a099766812 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/mock/conversation.ts +++ b/x-pack/packages/kbn-elastic-assistant/impl/mock/conversation.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/open_ai/constants'; +import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/openai/constants'; import { Conversation } from '../..'; export const alertConvo: Conversation = { diff --git a/x-pack/plugins/actions/server/lib/action_executor.ts b/x-pack/plugins/actions/server/lib/action_executor.ts index d0c512aea7d88..d3d57de4cda4e 100644 --- a/x-pack/plugins/actions/server/lib/action_executor.ts +++ b/x-pack/plugins/actions/server/lib/action_executor.ts @@ -286,8 +286,8 @@ export class ActionExecutor { event.event = event.event || {}; - // start open_ai extension - // add event.kibana.action.execution.open_ai to event log when OpenAI Connector is executed + // start openai extension + // add event.kibana.action.execution.openai to event log when OpenAI Connector is executed if (result.status === 'ok' && actionTypeId === '.gen-ai') { const data = result.data as unknown as { usage: { prompt_tokens?: number; completion_tokens?: number; total_tokens?: number }; @@ -311,7 +311,7 @@ export class ActionExecutor { }, }; } - // end open_ai extension + // end openai extension const currentUser = security?.authc.getCurrentUser(request); diff --git a/x-pack/plugins/stack_connectors/common/open_ai/constants.ts b/x-pack/plugins/stack_connectors/common/openai/constants.ts similarity index 93% rename from x-pack/plugins/stack_connectors/common/open_ai/constants.ts rename to x-pack/plugins/stack_connectors/common/openai/constants.ts index 850c07f422347..db01f52d762cf 100644 --- a/x-pack/plugins/stack_connectors/common/open_ai/constants.ts +++ b/x-pack/plugins/stack_connectors/common/openai/constants.ts @@ -7,13 +7,13 @@ import { i18n } from '@kbn/i18n'; -export const OPEN_AI_TITLE = i18n.translate( +export const OPENAI_TITLE = i18n.translate( 'xpack.stackConnectors.components.genAi.connectorTypeTitle', { defaultMessage: 'OpenAI', } ); -export const OPEN_AI_CONNECTOR_ID = '.gen-ai'; +export const OPENAI_CONNECTOR_ID = '.gen-ai'; export enum SUB_ACTION { RUN = 'run', INVOKE_AI = 'invokeAI', diff --git a/x-pack/plugins/stack_connectors/common/open_ai/schema.ts b/x-pack/plugins/stack_connectors/common/openai/schema.ts similarity index 100% rename from x-pack/plugins/stack_connectors/common/open_ai/schema.ts rename to x-pack/plugins/stack_connectors/common/openai/schema.ts diff --git a/x-pack/plugins/stack_connectors/common/open_ai/types.ts b/x-pack/plugins/stack_connectors/common/openai/types.ts similarity index 100% rename from x-pack/plugins/stack_connectors/common/open_ai/types.ts rename to x-pack/plugins/stack_connectors/common/openai/types.ts diff --git a/x-pack/plugins/stack_connectors/public/common/index.ts b/x-pack/plugins/stack_connectors/public/common/index.ts index 38199afb17e3d..ec5dd5e69e242 100644 --- a/x-pack/plugins/stack_connectors/public/common/index.ts +++ b/x-pack/plugins/stack_connectors/public/common/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import OpenAILogo from '../connector_types/open_ai/logo'; +import OpenAILogo from '../connector_types/openai/logo'; -export { OPEN_AI_CONNECTOR_ID, OpenAiProviderType } from '../../common/open_ai/constants'; +export { OPENAI_CONNECTOR_ID, OpenAiProviderType } from '../../common/openai/constants'; export { OpenAILogo }; diff --git a/x-pack/plugins/stack_connectors/public/connector_types/index.ts b/x-pack/plugins/stack_connectors/public/connector_types/index.ts index 8df13f9623767..0c024870133dc 100644 --- a/x-pack/plugins/stack_connectors/public/connector_types/index.ts +++ b/x-pack/plugins/stack_connectors/public/connector_types/index.ts @@ -11,7 +11,7 @@ import { getCasesWebhookConnectorType } from './cases_webhook'; import { getEmailConnectorType } from './email'; import { getIndexConnectorType } from './es_index'; import { getJiraConnectorType } from './jira'; -import { getOpenAIConnectorType } from './open_ai'; +import { getOpenAIConnectorType } from './openai'; import { getBedrockConnectorType } from './bedrock'; import { getOpsgenieConnectorType } from './opsgenie'; import { getPagerDutyConnectorType } from './pagerduty'; diff --git a/x-pack/plugins/stack_connectors/public/connector_types/open_ai/api.test.ts b/x-pack/plugins/stack_connectors/public/connector_types/openai/api.test.ts similarity index 94% rename from x-pack/plugins/stack_connectors/public/connector_types/open_ai/api.test.ts rename to x-pack/plugins/stack_connectors/public/connector_types/openai/api.test.ts index 4841f73e74b51..5ab342a22828b 100644 --- a/x-pack/plugins/stack_connectors/public/connector_types/open_ai/api.test.ts +++ b/x-pack/plugins/stack_connectors/public/connector_types/openai/api.test.ts @@ -7,7 +7,7 @@ import { httpServiceMock } from '@kbn/core-http-browser-mocks'; import { getDashboard } from './api'; -import { SUB_ACTION } from '../../../common/open_ai/constants'; +import { SUB_ACTION } from '../../../common/openai/constants'; const response = { available: true, }; diff --git a/x-pack/plugins/stack_connectors/public/connector_types/open_ai/api.ts b/x-pack/plugins/stack_connectors/public/connector_types/openai/api.ts similarity index 94% rename from x-pack/plugins/stack_connectors/public/connector_types/open_ai/api.ts rename to x-pack/plugins/stack_connectors/public/connector_types/openai/api.ts index 21f3dd435c506..97b0608bb725d 100644 --- a/x-pack/plugins/stack_connectors/public/connector_types/open_ai/api.ts +++ b/x-pack/plugins/stack_connectors/public/connector_types/openai/api.ts @@ -7,7 +7,7 @@ import { HttpSetup } from '@kbn/core-http-browser'; import { ActionTypeExecutorResult, BASE_ACTION_API_PATH } from '@kbn/actions-plugin/common'; -import { SUB_ACTION } from '../../../common/open_ai/constants'; +import { SUB_ACTION } from '../../../common/openai/constants'; import { ConnectorExecutorResult, rewriteResponseToCamelCase } from '../lib/rewrite_response_body'; export async function getDashboard({ diff --git a/x-pack/plugins/stack_connectors/public/connector_types/open_ai/connector.test.tsx b/x-pack/plugins/stack_connectors/public/connector_types/openai/connector.test.tsx similarity index 99% rename from x-pack/plugins/stack_connectors/public/connector_types/open_ai/connector.test.tsx rename to x-pack/plugins/stack_connectors/public/connector_types/openai/connector.test.tsx index ed7db46085402..e88c3fa116153 100644 --- a/x-pack/plugins/stack_connectors/public/connector_types/open_ai/connector.test.tsx +++ b/x-pack/plugins/stack_connectors/public/connector_types/openai/connector.test.tsx @@ -10,7 +10,7 @@ import ConnectorFields from './connector'; import { ConnectorFormTestProvider } from '../lib/test_utils'; import { act, fireEvent, render, waitFor } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; -import { DEFAULT_OPENAI_MODEL, OpenAiProviderType } from '../../../common/open_ai/constants'; +import { DEFAULT_OPENAI_MODEL, OpenAiProviderType } from '../../../common/openai/constants'; import { useKibana } from '@kbn/triggers-actions-ui-plugin/public'; import { useGetDashboard } from './use_get_dashboard'; diff --git a/x-pack/plugins/stack_connectors/public/connector_types/open_ai/connector.tsx b/x-pack/plugins/stack_connectors/public/connector_types/openai/connector.tsx similarity index 97% rename from x-pack/plugins/stack_connectors/public/connector_types/open_ai/connector.tsx rename to x-pack/plugins/stack_connectors/public/connector_types/openai/connector.tsx index 681842893a0eb..516ff9c3e9264 100644 --- a/x-pack/plugins/stack_connectors/public/connector_types/open_ai/connector.tsx +++ b/x-pack/plugins/stack_connectors/public/connector_types/openai/connector.tsx @@ -19,7 +19,7 @@ import { } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; import { useKibana } from '@kbn/triggers-actions-ui-plugin/public'; import { fieldValidators } from '@kbn/es-ui-shared-plugin/static/forms/helpers'; -import { OpenAiProviderType } from '../../../common/open_ai/constants'; +import { OpenAiProviderType } from '../../../common/openai/constants'; import { useGetDashboard } from './use_get_dashboard'; import * as i18n from './translations'; import { diff --git a/x-pack/plugins/stack_connectors/public/connector_types/open_ai/constants.tsx b/x-pack/plugins/stack_connectors/public/connector_types/openai/constants.tsx similarity index 96% rename from x-pack/plugins/stack_connectors/public/connector_types/open_ai/constants.tsx rename to x-pack/plugins/stack_connectors/public/connector_types/openai/constants.tsx index 31284d6bc273e..4df722ecfae04 100644 --- a/x-pack/plugins/stack_connectors/public/connector_types/open_ai/constants.tsx +++ b/x-pack/plugins/stack_connectors/public/connector_types/openai/constants.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { ConfigFieldSchema, SecretsFieldSchema } from '@kbn/triggers-actions-ui-plugin/public'; import { FormattedMessage } from '@kbn/i18n-react'; import { EuiLink } from '@elastic/eui'; -import { DEFAULT_OPENAI_MODEL, OpenAiProviderType } from '../../../common/open_ai/constants'; +import { DEFAULT_OPENAI_MODEL, OpenAiProviderType } from '../../../common/openai/constants'; import * as i18n from './translations'; export const DEFAULT_URL = 'https://api.openai.com/v1/chat/completions' as const; @@ -46,7 +46,7 @@ export const openAiConfig: ConfigFieldSchema[] = [ href="https://platform.openai.com/docs/api-reference" target="_blank" > - {`${i18n.OPEN_AI} ${i18n.DOCUMENTATION}`} + {`${i18n.OPENAI} ${i18n.DOCUMENTATION}`} ), }} @@ -108,7 +108,7 @@ export const openAiSecrets: SecretsFieldSchema[] = [ href="https://platform.openai.com/account/api-keys" target="_blank" > - {`${i18n.OPEN_AI} ${i18n.DOCUMENTATION}`} + {`${i18n.OPENAI} ${i18n.DOCUMENTATION}`} ), }} @@ -145,8 +145,8 @@ export const azureAiSecrets: SecretsFieldSchema[] = [ export const providerOptions = [ { value: OpenAiProviderType.OpenAi, - text: i18n.OPEN_AI, - label: i18n.OPEN_AI, + text: i18n.OPENAI, + label: i18n.OPENAI, }, { value: OpenAiProviderType.AzureAi, diff --git a/x-pack/plugins/stack_connectors/public/connector_types/open_ai/index.ts b/x-pack/plugins/stack_connectors/public/connector_types/openai/index.ts similarity index 97% rename from x-pack/plugins/stack_connectors/public/connector_types/open_ai/index.ts rename to x-pack/plugins/stack_connectors/public/connector_types/openai/index.ts index 57b71ca882084..8c51a45c58f9f 100644 --- a/x-pack/plugins/stack_connectors/public/connector_types/open_ai/index.ts +++ b/x-pack/plugins/stack_connectors/public/connector_types/openai/index.ts @@ -5,4 +5,4 @@ * 2.0. */ -export { getConnectorType as getOpenAIConnectorType } from './open_ai'; +export { getConnectorType as getOpenAIConnectorType } from './openai'; diff --git a/x-pack/plugins/stack_connectors/public/connector_types/open_ai/logo.tsx b/x-pack/plugins/stack_connectors/public/connector_types/openai/logo.tsx similarity index 100% rename from x-pack/plugins/stack_connectors/public/connector_types/open_ai/logo.tsx rename to x-pack/plugins/stack_connectors/public/connector_types/openai/logo.tsx diff --git a/x-pack/plugins/stack_connectors/public/connector_types/open_ai/open_ai.test.tsx b/x-pack/plugins/stack_connectors/public/connector_types/openai/openai.test.tsx similarity index 97% rename from x-pack/plugins/stack_connectors/public/connector_types/open_ai/open_ai.test.tsx rename to x-pack/plugins/stack_connectors/public/connector_types/openai/openai.test.tsx index edb7e2a319b1a..49a4d87524f7a 100644 --- a/x-pack/plugins/stack_connectors/public/connector_types/open_ai/open_ai.test.tsx +++ b/x-pack/plugins/stack_connectors/public/connector_types/openai/openai.test.tsx @@ -9,7 +9,7 @@ import { TypeRegistry } from '@kbn/triggers-actions-ui-plugin/public/application import { registerConnectorTypes } from '..'; import type { ActionTypeModel } from '@kbn/triggers-actions-ui-plugin/public/types'; import { registrationServicesMock } from '../../mocks'; -import { SUB_ACTION } from '../../../common/open_ai/constants'; +import { SUB_ACTION } from '../../../common/openai/constants'; const ACTION_TYPE_ID = '.gen-ai'; let actionTypeModel: ActionTypeModel; diff --git a/x-pack/plugins/stack_connectors/public/connector_types/open_ai/open_ai.tsx b/x-pack/plugins/stack_connectors/public/connector_types/openai/openai.tsx similarity index 90% rename from x-pack/plugins/stack_connectors/public/connector_types/open_ai/open_ai.tsx rename to x-pack/plugins/stack_connectors/public/connector_types/openai/openai.tsx index f0164645c1b2d..83340c90be804 100644 --- a/x-pack/plugins/stack_connectors/public/connector_types/open_ai/open_ai.tsx +++ b/x-pack/plugins/stack_connectors/public/connector_types/openai/openai.tsx @@ -8,8 +8,8 @@ import { lazy } from 'react'; import { i18n } from '@kbn/i18n'; import type { GenericValidationResult } from '@kbn/triggers-actions-ui-plugin/public/types'; -import { SUB_ACTION } from '../../../common/open_ai/constants'; -import { OPEN_AI_CONNECTOR_ID, OPEN_AI_TITLE } from '../../../common/open_ai/constants'; +import { SUB_ACTION } from '../../../common/openai/constants'; +import { OPENAI_CONNECTOR_ID, OPENAI_TITLE } from '../../../common/openai/constants'; import { ActionParams, OpenAIConnector } from './types'; interface ValidationErrors { @@ -18,12 +18,12 @@ interface ValidationErrors { } export function getConnectorType(): OpenAIConnector { return { - id: OPEN_AI_CONNECTOR_ID, + id: OPENAI_CONNECTOR_ID, iconClass: lazy(() => import('./logo')), selectMessage: i18n.translate('xpack.stackConnectors.components.genAi.selectMessageText', { defaultMessage: 'Send a request to OpenAI systems.', }), - actionTypeTitle: OPEN_AI_TITLE, + actionTypeTitle: OPENAI_TITLE, validateParams: async ( actionParams: ActionParams ): Promise> => { diff --git a/x-pack/plugins/stack_connectors/public/connector_types/open_ai/params.test.tsx b/x-pack/plugins/stack_connectors/public/connector_types/openai/params.test.tsx similarity index 99% rename from x-pack/plugins/stack_connectors/public/connector_types/open_ai/params.test.tsx rename to x-pack/plugins/stack_connectors/public/connector_types/openai/params.test.tsx index 97ed648e0bbd2..cefabe4d3b1aa 100644 --- a/x-pack/plugins/stack_connectors/public/connector_types/open_ai/params.test.tsx +++ b/x-pack/plugins/stack_connectors/public/connector_types/openai/params.test.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { fireEvent, render } from '@testing-library/react'; import ParamsFields from './params'; import { MockCodeEditor } from '@kbn/triggers-actions-ui-plugin/public/application/code_editor.mock'; -import { OpenAiProviderType, SUB_ACTION } from '../../../common/open_ai/constants'; +import { OpenAiProviderType, SUB_ACTION } from '../../../common/openai/constants'; import { DEFAULT_BODY, DEFAULT_BODY_AZURE, DEFAULT_URL } from './constants'; const kibanaReactPath = '../../../../../../src/plugins/kibana_react/public'; diff --git a/x-pack/plugins/stack_connectors/public/connector_types/open_ai/params.tsx b/x-pack/plugins/stack_connectors/public/connector_types/openai/params.tsx similarity index 99% rename from x-pack/plugins/stack_connectors/public/connector_types/open_ai/params.tsx rename to x-pack/plugins/stack_connectors/public/connector_types/openai/params.tsx index 14384d2d86412..0f129f05975f7 100644 --- a/x-pack/plugins/stack_connectors/public/connector_types/open_ai/params.tsx +++ b/x-pack/plugins/stack_connectors/public/connector_types/openai/params.tsx @@ -12,7 +12,7 @@ import { ActionConnectorMode, JsonEditorWithMessageVariables, } from '@kbn/triggers-actions-ui-plugin/public'; -import { OpenAiProviderType, SUB_ACTION } from '../../../common/open_ai/constants'; +import { OpenAiProviderType, SUB_ACTION } from '../../../common/openai/constants'; import { DEFAULT_BODY, DEFAULT_BODY_AZURE } from './constants'; import { OpenAIActionConnector, ActionParams } from './types'; diff --git a/x-pack/plugins/stack_connectors/public/connector_types/open_ai/translations.ts b/x-pack/plugins/stack_connectors/public/connector_types/openai/translations.ts similarity index 97% rename from x-pack/plugins/stack_connectors/public/connector_types/open_ai/translations.ts rename to x-pack/plugins/stack_connectors/public/connector_types/openai/translations.ts index 6d439d95a1183..f6cfa4a91cf61 100644 --- a/x-pack/plugins/stack_connectors/public/connector_types/open_ai/translations.ts +++ b/x-pack/plugins/stack_connectors/public/connector_types/openai/translations.ts @@ -39,7 +39,7 @@ export const API_PROVIDER_LABEL = i18n.translate( } ); -export const OPEN_AI = i18n.translate('xpack.stackConnectors.components.genAi.openAi', { +export const OPENAI = i18n.translate('xpack.stackConnectors.components.genAi.openAi', { defaultMessage: 'OpenAI', }); diff --git a/x-pack/plugins/stack_connectors/public/connector_types/open_ai/types.ts b/x-pack/plugins/stack_connectors/public/connector_types/openai/types.ts similarity index 91% rename from x-pack/plugins/stack_connectors/public/connector_types/open_ai/types.ts rename to x-pack/plugins/stack_connectors/public/connector_types/openai/types.ts index 354c40845c4fa..3ba19c04d13a7 100644 --- a/x-pack/plugins/stack_connectors/public/connector_types/open_ai/types.ts +++ b/x-pack/plugins/stack_connectors/public/connector_types/openai/types.ts @@ -7,8 +7,8 @@ import { ActionTypeModel as ConnectorTypeModel } from '@kbn/triggers-actions-ui-plugin/public'; import { UserConfiguredActionConnector } from '@kbn/triggers-actions-ui-plugin/public/types'; -import { OpenAiProviderType, SUB_ACTION } from '../../../common/open_ai/constants'; -import { RunActionParams } from '../../../common/open_ai/types'; +import { OpenAiProviderType, SUB_ACTION } from '../../../common/openai/constants'; +import { RunActionParams } from '../../../common/openai/types'; export interface ActionParams { subAction: SUB_ACTION.RUN | SUB_ACTION.TEST; diff --git a/x-pack/plugins/stack_connectors/public/connector_types/open_ai/use_get_dashboard.test.ts b/x-pack/plugins/stack_connectors/public/connector_types/openai/use_get_dashboard.test.ts similarity index 100% rename from x-pack/plugins/stack_connectors/public/connector_types/open_ai/use_get_dashboard.test.ts rename to x-pack/plugins/stack_connectors/public/connector_types/openai/use_get_dashboard.test.ts diff --git a/x-pack/plugins/stack_connectors/public/connector_types/open_ai/use_get_dashboard.ts b/x-pack/plugins/stack_connectors/public/connector_types/openai/use_get_dashboard.ts similarity index 100% rename from x-pack/plugins/stack_connectors/public/connector_types/open_ai/use_get_dashboard.ts rename to x-pack/plugins/stack_connectors/public/connector_types/openai/use_get_dashboard.ts diff --git a/x-pack/plugins/stack_connectors/server/connector_types/index.ts b/x-pack/plugins/stack_connectors/server/connector_types/index.ts index ba95be41cdd2c..0117a9d1a7a2a 100644 --- a/x-pack/plugins/stack_connectors/server/connector_types/index.ts +++ b/x-pack/plugins/stack_connectors/server/connector_types/index.ts @@ -17,7 +17,7 @@ import { getTinesConnectorType } from './tines'; import { getActionType as getTorqConnectorType } from './torq'; import { getConnectorType as getEmailConnectorType } from './email'; import { getConnectorType as getIndexConnectorType } from './es_index'; -import { getConnectorType as getOpenAIConnectorType } from './open_ai'; +import { getConnectorType as getOpenAIConnectorType } from './openai'; import { getConnectorType as getBedrockConnectorType } from './bedrock'; import { getConnectorType as getPagerDutyConnectorType } from './pagerduty'; import { getConnectorType as getSwimlaneConnectorType } from './swimlane'; diff --git a/x-pack/plugins/stack_connectors/server/connector_types/open_ai/create_dashboard.test.ts b/x-pack/plugins/stack_connectors/server/connector_types/openai/create_dashboard.test.ts similarity index 100% rename from x-pack/plugins/stack_connectors/server/connector_types/open_ai/create_dashboard.test.ts rename to x-pack/plugins/stack_connectors/server/connector_types/openai/create_dashboard.test.ts diff --git a/x-pack/plugins/stack_connectors/server/connector_types/open_ai/create_dashboard.ts b/x-pack/plugins/stack_connectors/server/connector_types/openai/create_dashboard.ts similarity index 100% rename from x-pack/plugins/stack_connectors/server/connector_types/open_ai/create_dashboard.ts rename to x-pack/plugins/stack_connectors/server/connector_types/openai/create_dashboard.ts diff --git a/x-pack/plugins/stack_connectors/server/connector_types/open_ai/dashboard.ts b/x-pack/plugins/stack_connectors/server/connector_types/openai/dashboard.ts similarity index 99% rename from x-pack/plugins/stack_connectors/server/connector_types/open_ai/dashboard.ts rename to x-pack/plugins/stack_connectors/server/connector_types/openai/dashboard.ts index c430f369be57b..8503ef9bf59fc 100644 --- a/x-pack/plugins/stack_connectors/server/connector_types/open_ai/dashboard.ts +++ b/x-pack/plugins/stack_connectors/server/connector_types/openai/dashboard.ts @@ -177,7 +177,7 @@ export const getDashboard = (dashboardId: string): SavedObject { diff --git a/x-pack/plugins/stack_connectors/server/connector_types/open_ai/index.ts b/x-pack/plugins/stack_connectors/server/connector_types/openai/index.ts similarity index 88% rename from x-pack/plugins/stack_connectors/server/connector_types/open_ai/index.ts rename to x-pack/plugins/stack_connectors/server/connector_types/openai/index.ts index 75dace0da60ec..fb6a27b17bad5 100644 --- a/x-pack/plugins/stack_connectors/server/connector_types/open_ai/index.ts +++ b/x-pack/plugins/stack_connectors/server/connector_types/openai/index.ts @@ -15,18 +15,18 @@ import { urlAllowListValidator } from '@kbn/actions-plugin/server'; import { ValidatorServices } from '@kbn/actions-plugin/server/types'; import { assertURL } from '@kbn/actions-plugin/server/sub_action_framework/helpers/validators'; import { - OPEN_AI_CONNECTOR_ID, - OPEN_AI_TITLE, + OPENAI_CONNECTOR_ID, + OPENAI_TITLE, OpenAiProviderType, -} from '../../../common/open_ai/constants'; -import { ConfigSchema, SecretsSchema } from '../../../common/open_ai/schema'; -import { Config, Secrets } from '../../../common/open_ai/types'; -import { OpenAIConnector } from './open_ai'; +} from '../../../common/openai/constants'; +import { ConfigSchema, SecretsSchema } from '../../../common/openai/schema'; +import { Config, Secrets } from '../../../common/openai/types'; +import { OpenAIConnector } from './openai'; import { renderParameterTemplates } from './render'; export const getConnectorType = (): SubActionConnectorType => ({ - id: OPEN_AI_CONNECTOR_ID, - name: OPEN_AI_TITLE, + id: OPENAI_CONNECTOR_ID, + name: OPENAI_TITLE, Service: OpenAIConnector, schema: { config: ConfigSchema, diff --git a/x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/azure_openai_utils.test.ts b/x-pack/plugins/stack_connectors/server/connector_types/openai/lib/azure_openai_utils.test.ts similarity index 99% rename from x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/azure_openai_utils.test.ts rename to x-pack/plugins/stack_connectors/server/connector_types/openai/lib/azure_openai_utils.test.ts index 1d2d24e3bc3a4..43a9aa83a3f02 100644 --- a/x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/azure_openai_utils.test.ts +++ b/x-pack/plugins/stack_connectors/server/connector_types/openai/lib/azure_openai_utils.test.ts @@ -14,7 +14,7 @@ import { AZURE_OPENAI_CHAT_URL, AZURE_OPENAI_COMPLETIONS_URL, AZURE_OPENAI_COMPLETIONS_EXTENSIONS_URL, -} from '../../../../common/open_ai/constants'; +} from '../../../../common/openai/constants'; describe('Azure Open AI Utils', () => { const chatUrl = diff --git a/x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/azure_openai_utils.ts b/x-pack/plugins/stack_connectors/server/connector_types/openai/lib/azure_openai_utils.ts similarity index 97% rename from x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/azure_openai_utils.ts rename to x-pack/plugins/stack_connectors/server/connector_types/openai/lib/azure_openai_utils.ts index 7c15a57e48a4f..f39a574554a57 100644 --- a/x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/azure_openai_utils.ts +++ b/x-pack/plugins/stack_connectors/server/connector_types/openai/lib/azure_openai_utils.ts @@ -9,7 +9,7 @@ import { AZURE_OPENAI_CHAT_URL, AZURE_OPENAI_COMPLETIONS_URL, AZURE_OPENAI_COMPLETIONS_EXTENSIONS_URL, -} from '../../../../common/open_ai/constants'; +} from '../../../../common/openai/constants'; const APIS_ALLOWING_STREAMING = new Set([ AZURE_OPENAI_CHAT_URL, diff --git a/x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/openai_utils.test.ts b/x-pack/plugins/stack_connectors/server/connector_types/openai/lib/openai_utils.test.ts similarity index 99% rename from x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/openai_utils.test.ts rename to x-pack/plugins/stack_connectors/server/connector_types/openai/lib/openai_utils.test.ts index 4e85ddaff6dbd..656982525cd0e 100644 --- a/x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/openai_utils.test.ts +++ b/x-pack/plugins/stack_connectors/server/connector_types/openai/lib/openai_utils.test.ts @@ -10,7 +10,7 @@ import { DEFAULT_OPENAI_MODEL, OPENAI_CHAT_URL, OPENAI_LEGACY_COMPLETION_URL, -} from '../../../../common/open_ai/constants'; +} from '../../../../common/openai/constants'; describe('Open AI Utils', () => { describe('sanitizeRequest', () => { diff --git a/x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/openai_utils.ts b/x-pack/plugins/stack_connectors/server/connector_types/openai/lib/openai_utils.ts similarity index 93% rename from x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/openai_utils.ts rename to x-pack/plugins/stack_connectors/server/connector_types/openai/lib/openai_utils.ts index 427424a31b590..8bbe8997c7e50 100644 --- a/x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/openai_utils.ts +++ b/x-pack/plugins/stack_connectors/server/connector_types/openai/lib/openai_utils.ts @@ -5,10 +5,7 @@ * 2.0. */ -import { - OPENAI_CHAT_URL, - OPENAI_LEGACY_COMPLETION_URL, -} from '../../../../common/open_ai/constants'; +import { OPENAI_CHAT_URL, OPENAI_LEGACY_COMPLETION_URL } from '../../../../common/openai/constants'; const APIS_ALLOWING_STREAMING = new Set([OPENAI_CHAT_URL, OPENAI_LEGACY_COMPLETION_URL]); diff --git a/x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/utils.test.ts b/x-pack/plugins/stack_connectors/server/connector_types/openai/lib/utils.test.ts similarity index 99% rename from x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/utils.test.ts rename to x-pack/plugins/stack_connectors/server/connector_types/openai/lib/utils.test.ts index 643ef57a3ae1f..9dffaab3e5e00 100644 --- a/x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/utils.test.ts +++ b/x-pack/plugins/stack_connectors/server/connector_types/openai/lib/utils.test.ts @@ -10,7 +10,7 @@ import { DEFAULT_OPENAI_MODEL, OpenAiProviderType, OPENAI_CHAT_URL, -} from '../../../../common/open_ai/constants'; +} from '../../../../common/openai/constants'; import { sanitizeRequest as openAiSanitizeRequest, getRequestWithStreamOption as openAiGetRequestWithStreamOption, diff --git a/x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/utils.ts b/x-pack/plugins/stack_connectors/server/connector_types/openai/lib/utils.ts similarity index 97% rename from x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/utils.ts rename to x-pack/plugins/stack_connectors/server/connector_types/openai/lib/utils.ts index 41baedc4559c9..74cf97e95ac06 100644 --- a/x-pack/plugins/stack_connectors/server/connector_types/open_ai/lib/utils.ts +++ b/x-pack/plugins/stack_connectors/server/connector_types/openai/lib/utils.ts @@ -7,7 +7,7 @@ import { AxiosResponse, ResponseType } from 'axios'; import { IncomingMessage } from 'http'; -import { OpenAiProviderType } from '../../../../common/open_ai/constants'; +import { OpenAiProviderType } from '../../../../common/openai/constants'; import { sanitizeRequest as openAiSanitizeRequest, getRequestWithStreamOption as openAiGetRequestWithStreamOption, diff --git a/x-pack/plugins/stack_connectors/server/connector_types/open_ai/open_ai.test.ts b/x-pack/plugins/stack_connectors/server/connector_types/openai/openai.test.ts similarity index 98% rename from x-pack/plugins/stack_connectors/server/connector_types/open_ai/open_ai.test.ts rename to x-pack/plugins/stack_connectors/server/connector_types/openai/openai.test.ts index 980423fd7c194..091421435162b 100644 --- a/x-pack/plugins/stack_connectors/server/connector_types/open_ai/open_ai.test.ts +++ b/x-pack/plugins/stack_connectors/server/connector_types/openai/openai.test.ts @@ -5,16 +5,16 @@ * 2.0. */ -import { OpenAIConnector } from './open_ai'; +import { OpenAIConnector } from './openai'; import { actionsConfigMock } from '@kbn/actions-plugin/server/actions_config.mock'; import { DEFAULT_OPENAI_MODEL, - OPEN_AI_CONNECTOR_ID, + OPENAI_CONNECTOR_ID, OpenAiProviderType, -} from '../../../common/open_ai/constants'; +} from '../../../common/openai/constants'; import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; import { actionsMock } from '@kbn/actions-plugin/server/mocks'; -import { RunActionResponseSchema, StreamingResponseSchema } from '../../../common/open_ai/schema'; +import { RunActionResponseSchema, StreamingResponseSchema } from '../../../common/openai/schema'; import { initDashboard } from './create_dashboard'; jest.mock('./create_dashboard'); @@ -48,7 +48,7 @@ describe('OpenAIConnector', () => { describe('OpenAI', () => { const connector = new OpenAIConnector({ configurationUtilities: actionsConfigMock.create(), - connector: { id: '1', type: OPEN_AI_CONNECTOR_ID }, + connector: { id: '1', type: OPENAI_CONNECTOR_ID }, config: { apiUrl: 'https://api.openai.com/v1/chat/completions', apiProvider: OpenAiProviderType.OpenAi, @@ -287,7 +287,7 @@ describe('OpenAIConnector', () => { describe('AzureAI', () => { const connector = new OpenAIConnector({ configurationUtilities: actionsConfigMock.create(), - connector: { id: '1', type: OPEN_AI_CONNECTOR_ID }, + connector: { id: '1', type: OPENAI_CONNECTOR_ID }, config: { apiUrl: 'https://My-test-resource-123.openai.azure.com/openai/deployments/NEW-DEPLOYMENT-321/chat/completions?api-version=2023-05-15', @@ -457,7 +457,7 @@ describe('OpenAIConnector', () => { describe('Token dashboard', () => { const connector = new OpenAIConnector({ configurationUtilities: actionsConfigMock.create(), - connector: { id: '1', type: OPEN_AI_CONNECTOR_ID }, + connector: { id: '1', type: OPENAI_CONNECTOR_ID }, config: { apiUrl: 'https://example.com/api', apiProvider: OpenAiProviderType.AzureAi }, secrets: { apiKey: '123' }, logger: loggingSystemMock.createLogger(), diff --git a/x-pack/plugins/stack_connectors/server/connector_types/open_ai/open_ai.ts b/x-pack/plugins/stack_connectors/server/connector_types/openai/openai.ts similarity index 97% rename from x-pack/plugins/stack_connectors/server/connector_types/open_ai/open_ai.ts rename to x-pack/plugins/stack_connectors/server/connector_types/openai/openai.ts index 102c3d4543a63..dec34ac2bb388 100644 --- a/x-pack/plugins/stack_connectors/server/connector_types/open_ai/open_ai.ts +++ b/x-pack/plugins/stack_connectors/server/connector_types/openai/openai.ts @@ -14,21 +14,21 @@ import { StreamActionParamsSchema, StreamingResponseSchema, InvokeAIActionParamsSchema, -} from '../../../common/open_ai/schema'; +} from '../../../common/openai/schema'; import type { Config, Secrets, RunActionParams, RunActionResponse, StreamActionParams, -} from '../../../common/open_ai/types'; -import { SUB_ACTION } from '../../../common/open_ai/constants'; +} from '../../../common/openai/types'; +import { SUB_ACTION } from '../../../common/openai/constants'; import { DashboardActionParams, DashboardActionResponse, InvokeAIActionParams, InvokeAIActionResponse, -} from '../../../common/open_ai/types'; +} from '../../../common/openai/types'; import { initDashboard } from './create_dashboard'; import { getAxiosOptions, diff --git a/x-pack/plugins/stack_connectors/server/connector_types/open_ai/render.test.ts b/x-pack/plugins/stack_connectors/server/connector_types/openai/render.test.ts similarity index 100% rename from x-pack/plugins/stack_connectors/server/connector_types/open_ai/render.test.ts rename to x-pack/plugins/stack_connectors/server/connector_types/openai/render.test.ts diff --git a/x-pack/plugins/stack_connectors/server/connector_types/open_ai/render.ts b/x-pack/plugins/stack_connectors/server/connector_types/openai/render.ts similarity index 93% rename from x-pack/plugins/stack_connectors/server/connector_types/open_ai/render.ts rename to x-pack/plugins/stack_connectors/server/connector_types/openai/render.ts index 883e731a65729..bb2f97d7ca0db 100644 --- a/x-pack/plugins/stack_connectors/server/connector_types/open_ai/render.ts +++ b/x-pack/plugins/stack_connectors/server/connector_types/openai/render.ts @@ -8,7 +8,7 @@ import { ExecutorParams } from '@kbn/actions-plugin/server/sub_action_framework/types'; import { renderMustacheString } from '@kbn/actions-plugin/server/lib/mustache_renderer'; import { RenderParameterTemplates } from '@kbn/actions-plugin/server/types'; -import { SUB_ACTION } from '../../../common/open_ai/constants'; +import { SUB_ACTION } from '../../../common/openai/constants'; export const renderParameterTemplates: RenderParameterTemplates = ( params, diff --git a/x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/open_ai_simulation.ts b/x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/openai_simulation.ts similarity index 100% rename from x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/open_ai_simulation.ts rename to x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/openai_simulation.ts diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/open_ai.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/openai.ts similarity index 99% rename from x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/open_ai.ts rename to x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/openai.ts index 2166ac5627cd2..c4f8d1078002c 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/open_ai.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/openai.ts @@ -10,7 +10,7 @@ import expect from '@kbn/expect'; import { OpenAISimulator, genAiSuccessResponse, -} from '@kbn/actions-simulators-plugin/server/open_ai_simulation'; +} from '@kbn/actions-simulators-plugin/server/openai_simulation'; import { FtrProviderContext } from '../../../../../common/ftr_provider_context'; import { getUrlPrefix, ObjectRemover } from '../../../../../common/lib'; diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/index.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/index.ts index d7bd25dfbd528..e9fc2cbeb7c00 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/index.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/index.ts @@ -39,7 +39,7 @@ export default function connectorsTests({ loadTestFile, getService }: FtrProvide loadTestFile(require.resolve('./connector_types/xmatters')); loadTestFile(require.resolve('./connector_types/tines')); loadTestFile(require.resolve('./connector_types/torq')); - loadTestFile(require.resolve('./connector_types/open_ai')); + loadTestFile(require.resolve('./connector_types/openai')); loadTestFile(require.resolve('./connector_types/d3security')); loadTestFile(require.resolve('./connector_types/bedrock')); loadTestFile(require.resolve('./create'));