Skip to content

Commit

Permalink
[DOCS] Move preconfigured generative AI connector details (#165418)
Browse files Browse the repository at this point in the history
  • Loading branch information
lcawl authored Sep 20, 2023
1 parent 010f585 commit 3f3a27b
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 31 deletions.
35 changes: 5 additions & 30 deletions docs/management/connectors/action-types/gen-ai.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
++++
<titleabbrev>Generative AI</titleabbrev>
++++
:frontmatter-description: Add a connector that can send requests to an OpenAI provider.
:frontmatter-tags-products: [kibana]
:frontmatter-tags-content-type: [how-to]
: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 <<execute-connector-api,run connector API>> to send the request.

Expand All @@ -27,36 +32,6 @@ API Provider:: The OpenAI API provider, either OpenAI or Azure OpenAI.
API URL:: The OpenAI request URL.
API Key:: The OpenAI or Azure OpenAI API key for authentication.

[float]
[[preconfigured-gen-ai-configuration]]
=== Create preconfigured connectors

If you are running {kib} on-prem, you can define connectors by
adding `xpack.actions.preconfigured` settings to your `kibana.yml` file.
For example:

[source,text]
--
xpack.actions.preconfigured:
my-gen-ai:
name: preconfigured-gen-ai-connector-type
actionTypeId: .gen-ai
config:
apiUrl: https://api.openai.com/v1/chat/completions
apiProvider: 'Azure OpenAI'
secrets:
apiKey: superlongapikey
--

Config defines information for the connector type.

`apiProvider`:: A string that corresponds to *OpenAI API Provider*.
`apiUrl`:: A URL string that corresponds to the *OpenAI API URL*.

Secrets defines sensitive information for the connector type.

`apiKey`:: A string that corresponds to *OpenAI API Key*.

[float]
[[gen-ai-action-configuration]]
=== Test connectors
Expand Down
27 changes: 26 additions & 1 deletion docs/management/connectors/pre-configured-connectors.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,9 @@ Index names must start with `kibana-alert-history-` to take advantage of the pre
=== Examples

* <<preconfigured-d3security-configuration>>
* <<preconfigured-resilient-configuration>>
* <<preconfigured-email-configuration>>
* <<preconfigured-gen-ai-configuration>>
* <<preconfigured-resilient-configuration>>
* <<preconfigured-index-configuration>>
* <<preconfigured-jira-configuration>>
* <<preconfigured-opsgenie-configuration>>
Expand Down Expand Up @@ -276,6 +277,30 @@ secrets:
password: <password>
--------------------------------------------------

[float]
[[preconfigured-gen-ai-configuration]]
==== Generative AI connectors

The following example creates a <<gen-ai-action-type,generative AI connector>>:

[source,text]
--
xpack.actions.preconfigured:
my-gen-ai:
name: preconfigured-gen-ai-connector-type
actionTypeId: .gen-ai
config:
apiUrl: https://api.openai.com/v1/chat/completions <1>
apiProvider: 'OpenAI' <2>
defaultModel: gpt-4 <3>
secrets:
apiKey: superlongapikey <4>
--
<1> The OpenAI request URL
<2> The OpenAI API provider, either `OpenAI` or `Azure OpenAI`.
<3> The default model to use for requests. This setting is optional and applicable only when `apiProvider` is `OpenAI`.
<4> The OpenAI or Azure OpenAI API key for authentication.

[float]
[[preconfigured-resilient-configuration]]
==== {ibm-r} connectors
Expand Down
8 changes: 8 additions & 0 deletions docs/settings/alert-action-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,14 @@ For example: `.email`, `.index`, `.opsgenie`, `.server-log`, `.resilient`, `.sla
`xpack.actions.preconfigured.<connector-id>.config`::
The configuration details, which are specific to the type of preconfigured connector.

`xpack.actions.preconfigured.<connector-id>.config.apiProvider`::
For a <<gen-ai-action-type,generative AI connector>>, specifies the OpenAI API provider, either `OpenAI` or `Azure OpenAI`.

`xpack.actions.preconfigured.<connector-id>.config.apiUrl`::
A configuration URL that varies by connector:
+
--
* For a <<gen-ai-action-type,generative AI connector>>, specifies the OpenAI request URL.
* For a <<resilient-action-type,{ibm-r} connector>>, specifies the {ibm-r} instance URL.
* For a <<jira-action-type,Jira connector>>, specifies the Jira instance URL.
* For an <<opsgenie-action-type,{opsgenie} connector>>, specifies the {opsgenie} URL. For example, `https://api.opsgenie.com` or `https://api.eu.opsgenie.com`.
Expand Down Expand Up @@ -316,6 +320,9 @@ NOTE: If you are using the `xpack.actions.allowedHosts` setting, make sure the h
`xpack.actions.preconfigured.<connector-id>.config.createIncidentResponseKey`::
For a <<cases-webhook-action-type,{webhook-cm} connector>>, specifies a string from the response body of the create case method that corresponds to the external service identifier.

`xpack.actions.preconfigured.<connector-id>.config.defaultModel`::
For a <<gen-ai-action-type,generative AI connector>>, specifies the default model to use for requests. It is optional and applicable only when `xpack.actions.preconfigured.<connector-id>.config.apiProvider` is `OpenAI`.

`xpack.actions.preconfigured.<connector-id>.config.executionTimeField`::
For an <<index-action-type,index connector>>, a field that indicates when the document was indexed.

Expand Down Expand Up @@ -437,6 +444,7 @@ TIP: Sensitive properties, such as passwords, should be stored in the <<creating
An API key secret that varies by connector:
+
--
* For a <<gen-ai-action-type,generative AI connector>>, specifies the OpenAI or Azure OpenAI API key for authentication.
* For an <<opsgenie-action-type,{opsgenie} connector>>, specifies the {opsgenie} API authentication key for HTTP basic authentication.
--

Expand Down

0 comments on commit 3f3a27b

Please sign in to comment.