From f26c1b78fba7b88efe9f13c938daf875d8512498 Mon Sep 17 00:00:00 2001 From: Steph Milovic Date: Tue, 26 Sep 2023 11:13:43 -0600 Subject: [PATCH] rename gen ai to OpenAI --- .github/CODEOWNERS | 6 +++--- .../connectors/connector-apis-passthru.asciidoc | 14 +++++++------- .../connectors/action-types/gen-ai.asciidoc | 16 ++++++++-------- .../pre-configured-connectors.asciidoc | 4 ++-- docs/settings/alert-action-settings.asciidoc | 8 ++++---- .../gen_ai_streaming_response_example/README.md | 4 ++-- .../public/components/list_connector.tsx | 2 +- .../public/components/setup_connector.tsx | 2 +- .../public/gen_ai_streaming_response_example.tsx | 2 +- .../public/plugin.tsx | 7 +++---- .../server/plugin.ts | 2 +- x-pack/packages/kbn-elastic-assistant/README.md | 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 +- .../impl/connectorland/helpers.tsx | 4 ++-- .../impl/connectorland/translations.ts | 6 +++--- .../impl/content/prompts/welcome/translations.ts | 2 +- .../impl/mock/conversation.ts | 2 +- x-pack/plugins/actions/docs/openapi/bundled.json | 10 +++++----- x-pack/plugins/actions/docs/openapi/bundled.yaml | 12 ++++++------ .../schemas/config_properties_genai.yaml | 4 ++-- .../connector_response_properties_genai.yaml | 2 +- .../schemas/create_connector_request_genai.yaml | 6 +++--- .../schemas/secrets_properties_genai.yaml | 4 ++-- .../schemas/update_connector_request_genai.yaml | 4 ++-- .../actions/server/lib/action_executor.test.ts | 2 +- .../actions/server/lib/action_executor.ts | 6 +++--- .../plugins/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 | 2 +- .../{gen_ai => open_ai}/api.test.ts | 2 +- .../connector_types/{gen_ai => open_ai}/api.ts | 2 +- .../{gen_ai => open_ai}/connector.test.tsx | 4 ++-- .../{gen_ai => open_ai}/connector.tsx | 2 +- .../{gen_ai => open_ai}/constants.tsx | 2 +- .../connector_types/{gen_ai => open_ai}/index.ts | 2 +- .../connector_types/{gen_ai => open_ai}/logo.tsx | 0 .../gen_ai.test.tsx => open_ai/open_ai.test.tsx} | 6 +++--- .../{gen_ai/gen_ai.tsx => open_ai/open_ai.tsx} | 8 ++++---- .../{gen_ai => open_ai}/params.test.tsx | 4 ++-- .../{gen_ai => open_ai}/params.tsx | 2 +- .../{gen_ai => open_ai}/translations.ts | 2 +- .../connector_types/{gen_ai => open_ai}/types.ts | 4 ++-- .../use_get_dashboard.test.ts | 2 +- .../{gen_ai => open_ai}/use_get_dashboard.ts | 0 .../server/connector_types/index.ts | 2 +- .../{gen_ai => open_ai}/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 ++++++++-------- .../connector_types/{gen_ai => open_ai}/index.ts | 14 +++++++------- .../lib/azure_openai_utils.test.ts | 2 +- .../lib/azure_openai_utils.ts | 2 +- .../{gen_ai => open_ai}/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 +- .../gen_ai.test.ts => open_ai/open_ai.test.ts} | 14 +++++++------- .../{gen_ai/gen_ai.ts => open_ai/open_ai.ts} | 10 +++++----- .../{gen_ai => open_ai}/render.test.ts | 2 +- .../{gen_ai => open_ai}/render.ts | 2 +- .../tests/actions/connector_types/gen_ai.ts | 4 ++-- .../group2/tests/actions/index.ts | 2 +- .../tests/connectors/connectors.spec.ts | 2 +- .../stack_connectors/generative_ai_connector.ts | 4 ++-- .../stack_connectors/xmatters_connector.ts | 2 +- 76 files changed, 156 insertions(+), 154 deletions(-) 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 (99%) rename x-pack/plugins/stack_connectors/public/connector_types/{gen_ai => open_ai}/connector.tsx (98%) rename x-pack/plugins/stack_connectors/public/connector_types/{gen_ai => open_ai}/constants.tsx (99%) rename x-pack/plugins/stack_connectors/public/connector_types/{gen_ai => open_ai}/index.ts (95%) 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} (89%) rename x-pack/plugins/stack_connectors/public/connector_types/{gen_ai => open_ai}/params.test.tsx (98%) rename x-pack/plugins/stack_connectors/public/connector_types/{gen_ai => open_ai}/params.tsx (99%) 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 (92%) 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 (84%) 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} (98%) rename x-pack/plugins/stack_connectors/server/connector_types/{gen_ai/gen_ai.ts => open_ai/open_ai.ts} (97%) 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%) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 647de24ad4920..bea4d67f08c1c 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1202,9 +1202,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/docs/api-generated/connectors/connector-apis-passthru.asciidoc b/docs/api-generated/connectors/connector-apis-passthru.asciidoc index b68b4e4ca648f..4e81b0998f27d 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
  • @@ -1043,7 +1043,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
  • @@ -1099,7 +1099,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
  • @@ -1429,7 +1429,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.
    @@ -1948,8 +1948,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.
    @@ -2525,7 +2525,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/connectors/action-types/gen-ai.asciidoc b/docs/management/connectors/action-types/gen-ai.asciidoc index 5e1b3553309ac..c856a4de878cf 100644 --- a/docs/management/connectors/action-types/gen-ai.asciidoc +++ b/docs/management/connectors/action-types/gen-ai.asciidoc @@ -1,7 +1,7 @@ [[gen-ai-action-type]] -== Generative AI connector and action +== 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]] ==== 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 @@ 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: + @@ -69,6 +69,6 @@ Use the <> to customize connecto [[gen-ai-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/pre-configured-connectors.asciidoc b/docs/management/connectors/pre-configured-connectors.asciidoc index 1fc679facf423..ed2116dbef530 100644 --- a/docs/management/connectors/pre-configured-connectors.asciidoc +++ b/docs/management/connectors/pre-configured-connectors.asciidoc @@ -281,9 +281,9 @@ secrets: [float] [[preconfigured-gen-ai-configuration]] -==== Generative AI connectors +==== OpenAI connectors -The following example creates a <>: +The following example creates a <>: [source,text] -- diff --git a/docs/settings/alert-action-settings.asciidoc b/docs/settings/alert-action-settings.asciidoc index 3748cf325f86c..11f0e0e87ef40 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. @@ -447,7 +447,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/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..aaa57f6710d0c 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 @@ -24,7 +24,7 @@ export const SetupConnector = ({ setIsConnectorModalVisible }: SetupConnectorPro 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/README.md b/x-pack/packages/kbn-elastic-assistant/README.md index 0d0a848e536c7..667e5dec0db7c 100644 --- a/x-pack/packages/kbn-elastic-assistant/README.md +++ b/x-pack/packages/kbn-elastic-assistant/README.md @@ -1,6 +1,6 @@ # @kbn/elastic-assistant -The `Elastic Assistant` is a user interface for interacting with generative AIs, like `ChatGPT`. +The `Elastic Assistant` is a user interface for interacting with OpenAIs, like `ChatGPT`. This package provides: 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/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/translations.ts b/x-pack/packages/kbn-elastic-assistant/impl/connectorland/translations.ts index ae84527b21c7d..f231395e940e0 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/connectorland/translations.ts +++ b/x-pack/packages/kbn-elastic-assistant/impl/connectorland/translations.ts @@ -69,7 +69,7 @@ export const INLINE_CONNECTOR_PLACEHOLDER = i18n.translate( export const ADD_CONNECTOR_TITLE = i18n.translate( 'xpack.elasticAssistant.assistant.connectors.addConnectorButton.title', { - defaultMessage: 'Add Generative AI Connector', + defaultMessage: 'Add OpenAI Connector', } ); @@ -83,14 +83,14 @@ export const ADD_CONNECTOR_DESCRIPTION = i18n.translate( export const ADD_CONNECTOR_MISSING_PRIVILEGES_TITLE = i18n.translate( 'xpack.elasticAssistant.assistant.connectors.addConnectorButton.missingPrivilegesTitle', { - defaultMessage: 'Generative AI Connector Required', + defaultMessage: 'OpenAI Connector Required', } ); export const ADD_CONNECTOR_MISSING_PRIVILEGES_DESCRIPTION = i18n.translate( 'xpack.elasticAssistant.assistant.connectors.addConnectorButton.missingPrivilegesDescription', { - defaultMessage: 'Please contact your administrator to enable a Generative AI Connector.', + defaultMessage: 'Please contact your administrator to enable an OpenAI Connector.', } ); 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..572fc0f3bacd0 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 an OpenAI Connector to get this chat experience going! With the OpenAI 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... 😉", } ); 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/docs/openapi/bundled.json b/x-pack/plugins/actions/docs/openapi/bundled.json index 4039ab6b5a0de..82f373cb4fa08 100644 --- a/x-pack/plugins/actions/docs/openapi/bundled.json +++ b/x-pack/plugins/actions/docs/openapi/bundled.json @@ -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 +} diff --git a/x-pack/plugins/actions/docs/openapi/bundled.yaml b/x-pack/plugins/actions/docs/openapi/bundled.yaml index 9d1842c4dace9..82f5b08e42b2f 100644 --- a/x-pack/plugins/actions/docs/openapi/bundled.yaml +++ b/x-pack/plugins/actions/docs/openapi/bundled.yaml @@ -1030,14 +1030,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: | @@ -1102,7 +1102,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 @@ -1137,7 +1137,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: @@ -1145,9 +1145,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..2aafeb5967a65 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 GenerativeAi 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/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..bb4c36008adff 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 { getGenerativeAiConnectorType } from './open_ai'; import { getBedrockConnectorType } from './bedrock'; import { getOpsgenieConnectorType } from './opsgenie'; import { getPagerDutyConnectorType } from './pagerduty'; 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 99% 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..5cacd1ae9ea70 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 @@ -10,7 +10,7 @@ import GenerativeAiConnectorFields 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', 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 98% 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..4d4cb8b9848d5 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, 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 fc06a88fc91fb..42bf57975099f 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/gen_ai/index.ts b/x-pack/plugins/stack_connectors/public/connector_types/open_ai/index.ts similarity index 95% 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 index dea9dbeaef3d7..7b6fa6bb9dae4 100644 --- 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 @@ -5,4 +5,4 @@ * 2.0. */ -export { getConnectorType as getGenerativeAiConnectorType } from './gen_ai'; +export { getConnectorType as getGenerativeAiConnectorType } 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 89% 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..90dfaff587548 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,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/gen_ai/constants'; -import { GEN_AI_CONNECTOR_ID, OPEN_AI_TITLE } from '../../../common/gen_ai/constants'; +import { SUB_ACTION } from '../../../common/open_ai/constants'; +import { OPEN_AI_CONNECTOR_ID, OPEN_AI_TITLE } from '../../../common/open_ai/constants'; import { GenerativeAiActionParams, GenerativeAiConnector } from './types'; interface ValidationErrors { @@ -18,10 +18,10 @@ interface ValidationErrors { } export function getConnectorType(): GenerativeAiConnector { 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 ( 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 98% 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..327313f3f0400 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 @@ -9,7 +9,7 @@ import React from 'react'; import { fireEvent, render } from '@testing-library/react'; import GenerativeAiParamsFields 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'; @@ -67,7 +67,7 @@ describe('Gen AI Params Fields renders', () => { isPreconfigured: false, isSystemAction: false as const, isDeprecated: false, - name: 'My GenAI Connector', + name: 'My OpenAI Connector', config: { apiProvider, apiUrl: DEFAULT_URL, 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 similarity index 99% 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 index 3ad883d1a248f..5c9b59ec06536 100644 --- 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 @@ -12,8 +12,8 @@ import { 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'; const GenerativeAiParamsFields: React.FunctionComponent< 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 a407413faa791..e6abbf9ef2024 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 @@ -105,6 +105,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 92% 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..dbcb36f04cd39 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,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/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 { subAction: SUB_ACTION.RUN | SUB_ACTION.TEST; 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/index.ts b/x-pack/plugins/stack_connectors/server/connector_types/index.ts index 743f2664ed0b5..f38cc50fb87e0 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 getGenerativeAiConnectorType } from './open_ai'; 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/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 84% 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..799c08f4c5959 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 @@ -15,17 +15,17 @@ 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 { GenAiConnector } 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, schema: { @@ -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 98% 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..5a5f459d50da7 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,16 +5,16 @@ * 2.0. */ -import { GenAiConnector } from './gen_ai'; +import { GenAiConnector } 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'); @@ -48,7 +48,7 @@ describe('GenAiConnector', () => { describe('OpenAI', () => { const connector = new GenAiConnector({ 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, @@ -287,7 +287,7 @@ describe('GenAiConnector', () => { describe('AzureAI', () => { const connector = new GenAiConnector({ 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', @@ -457,7 +457,7 @@ describe('GenAiConnector', () => { describe('Token dashboard', () => { const connector = new GenAiConnector({ 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 97% 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..bfdc60f21b468 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, 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/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/gen_ai.ts index 5cfe992171dac..8733155aacbb0 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/gen_ai.ts @@ -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', }); }); }); @@ -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 () => { 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/observability_ai_assistant_api_integration/tests/connectors/connectors.spec.ts b/x-pack/test/observability_ai_assistant_api_integration/tests/connectors/connectors.spec.ts index c7e790099a5ed..6fdc0bcd2094b 100644 --- a/x-pack/test/observability_ai_assistant_api_integration/tests/connectors/connectors.spec.ts +++ b/x-pack/test/observability_ai_assistant_api_integration/tests/connectors/connectors.spec.ts @@ -29,7 +29,7 @@ export default function ApiTest({ getService }: FtrProviderContext) { expect(res.body.length).to.be(0); }); - it("returns the gen ai connector if it's been created", async () => { + it("returns the OpenAI connector if it's been created", async () => { const connectorCreateResponse = await supertest .post('/api/actions/connector') .set('kbn-xsrf', 'foo') 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');