Skip to content

Commit

Permalink
[8.10] [OAS] Add defaultModel to generative AI connector (#166394) (#…
Browse files Browse the repository at this point in the history
…166879)

# Backport

This will backport the following commits from `main` to `8.10`:
- [[OAS] Add defaultModel to generative AI connector
(#166394)](#166394)

<!--- Backport version: 8.9.8 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Lisa
Cawley","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-09-20T18:39:08Z","message":"[OAS]
Add defaultModel to generative AI connector
(#166394)","sha":"82024c240a89ab8f63c27d3f42ac2a80b6c2cd2c","branchLabelMapping":{"^v8.11.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:ResponseOps","docs","Team:
SecuritySolution","Feature:Actions/ConnectorTypes","v8.11.0","v8.10.1"],"number":166394,"url":"https://github.com/elastic/kibana/pull/166394","mergeCommit":{"message":"[OAS]
Add defaultModel to generative AI connector
(#166394)","sha":"82024c240a89ab8f63c27d3f42ac2a80b6c2cd2c"}},"sourceBranch":"main","suggestedTargetBranches":["8.10"],"targetPullRequestStates":[{"branch":"main","label":"v8.11.0","labelRegex":"^v8.11.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/166394","number":166394,"mergeCommit":{"message":"[OAS]
Add defaultModel to generative AI connector
(#166394)","sha":"82024c240a89ab8f63c27d3f42ac2a80b6c2cd2c"}},{"branch":"8.10","label":"v8.10.1","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
  • Loading branch information
lcawl authored Sep 28, 2023
1 parent ae8abdd commit e4b126c
Show file tree
Hide file tree
Showing 6 changed files with 198 additions and 48 deletions.
101 changes: 75 additions & 26 deletions docs/api-generated/connectors/connector-apis-passthru.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ Any modifications made to this file will be overwritten.
<div class="openapi">
<h2>Access</h2>
<ol>
<li>APIKey KeyParamName:ApiKey KeyInQuery:false KeyInHeader:true</li>
<li>HTTP Basic Authentication</li>
<li>APIKey KeyParamName:ApiKey KeyInQuery:false KeyInHeader:true</li>
</ol>
<h2><a name="__Methods">Methods</a></h2>
Expand Down Expand Up @@ -308,15 +308,23 @@ Any modifications made to this file will be overwritten.
<h3 class="field-label">Example data</h3>
<div class="example-data-content-type">Content-Type: application/json</div>
<pre class="example"><code>{
<pre class="example"><code>[ {
"supported_feature_ids" : [ "alerting", "uptime", "siem" ],
"name" : "Index",
"enabled_in_license" : true,
"id" : ".server-log",
"enabled_in_config" : true,
"minimum_license_required" : "basic",
"enabled" : true
}</code></pre>
}, {
"supported_feature_ids" : [ "alerting", "uptime", "siem" ],
"name" : "Index",
"enabled_in_license" : true,
"id" : ".server-log",
"enabled_in_config" : true,
"minimum_license_required" : "basic",
"enabled" : true
} ]</code></pre>
<h3 class="field-label">Produces</h3>
This API call produces the following media types according to the <span class="header">Accept</span> request header;
Expand Down Expand Up @@ -363,7 +371,7 @@ Any modifications made to this file will be overwritten.
<h3 class="field-label">Example data</h3>
<div class="example-data-content-type">Content-Type: application/json</div>
<pre class="example"><code>{
<pre class="example"><code>[ {
"is_missing_secrets" : false,
"is_deprecated" : false,
"is_preconfigured" : false,
Expand All @@ -375,7 +383,19 @@ Any modifications made to this file will be overwritten.
"key" : ""
},
"connector_type_id" : ".server-log"
}</code></pre>
}, {
"is_missing_secrets" : false,
"is_deprecated" : false,
"is_preconfigured" : false,
"name" : "my-connector",
"is_system_action" : false,
"referenced_by_count" : 2,
"id" : "b0766e10-d190-11ec-b04c-776c77d14fca",
"config" : {
"key" : ""
},
"connector_type_id" : ".server-log"
} ]</code></pre>
<h3 class="field-label">Produces</h3>
This API call produces the following media types according to the <span class="header">Accept</span> request header;
Expand Down Expand Up @@ -601,14 +621,21 @@ Any modifications made to this file will be overwritten.
<h3 class="field-label">Example data</h3>
<div class="example-data-content-type">Content-Type: application/json</div>
<pre class="example"><code>{
<pre class="example"><code>[ {
"enabledInConfig" : true,
"name" : "name",
"enabledInLicense" : true,
"id" : "id",
"minimumLicenseRequired" : "minimumLicenseRequired",
"enabled" : true
}</code></pre>
}, {
"enabledInConfig" : true,
"name" : "name",
"enabledInLicense" : true,
"id" : "id",
"minimumLicenseRequired" : "minimumLicenseRequired",
"enabled" : true
} ]</code></pre>
<h3 class="field-label">Produces</h3>
This API call produces the following media types according to the <span class="header">Accept</span> request header;
Expand Down Expand Up @@ -655,15 +682,23 @@ Any modifications made to this file will be overwritten.
<h3 class="field-label">Example data</h3>
<div class="example-data-content-type">Content-Type: application/json</div>
<pre class="example"><code>{
<pre class="example"><code>[ {
"isPreconfigured" : true,
"isDeprecated" : true,
"actionTypeId" : "actionTypeId",
"name" : "name",
"id" : "id",
"config" : "{}",
"isMissingSecrets" : true
}</code></pre>
}, {
"isPreconfigured" : true,
"isDeprecated" : true,
"actionTypeId" : "actionTypeId",
"name" : "name",
"id" : "id",
"config" : "{}",
"isMissingSecrets" : true
} ]</code></pre>
<h3 class="field-label">Produces</h3>
This API call produces the following media types according to the <span class="header">Accept</span> request header;
Expand Down Expand Up @@ -997,12 +1032,13 @@ Any modifications made to this file will be overwritten.
<li><a href="#Run_connector_request_body_properties"><code>Run_connector_request_body_properties</code> - Run connector request body properties</a></li>
<li><a href="#Run_connector_request_body_properties_params"><code>Run_connector_request_body_properties_params</code> - </a></li>
<li><a href="#Severity_mapping"><code>Severity_mapping</code> - Severity mapping</a></li>
<li><a href="#Subaction_parameters"><code>Subaction_parameters</code> - Subaction parameters</a></li>
<li><a href="#Unauthorized_response"><code>Unauthorized_response</code> - Unauthorized response</a></li>
<li><a href="#Update_connector_request_body_properties"><code>Update_connector_request_body_properties</code> - Update connector request body properties</a></li>
<li><a href="#action_response_properties"><code>action_response_properties</code> - Action response properties</a></li>
<li><a href="#config_properties_cases_webhook"><code>config_properties_cases_webhook</code> - Connector request properties for Webhook - Case Management connector</a></li>
<li><a href="#config_properties_genai"><code>config_properties_genai</code> - Connector request properties for a generative AI connector</a></li>
<li><a href="#config_properties_genai_oneOf"><code>config_properties_genai_oneOf</code> - </a></li>
<li><a href="#config_properties_genai_oneOf_1"><code>config_properties_genai_oneOf_1</code> - </a></li>
<li><a href="#config_properties_index"><code>config_properties_index</code> - Connector request properties for an index connector</a></li>
<li><a href="#config_properties_jira"><code>config_properties_jira</code> - Connector request properties for a Jira connector</a></li>
<li><a href="#config_properties_opsgenie"><code>config_properties_opsgenie</code> - Connector request properties for an Opsgenie connector</a></li>
Expand Down Expand Up @@ -1289,10 +1325,6 @@ Any modifications made to this file will be overwritten.
<div class="param-enum-header">Enum:</div>
<div class="param-enum">debug</div><div class="param-enum">error</div><div class="param-enum">fatal</div><div class="param-enum">info</div><div class="param-enum">trace</div><div class="param-enum">warn</div>
<div class="param">message </div><div class="param-desc"><span class="param-type"><a href="#string">String</a></span> The message for server log connectors. </div>
<div class="param">subAction </div><div class="param-desc"><span class="param-type"><a href="#string">String</a></span> The action to test. </div>
<div class="param-enum-header">Enum:</div>
<div class="param-enum">pushToService</div>
<div class="param">subActionParams </div><div class="param-desc"><span class="param-type"><a href="#run_connector_subaction_pushtoservice_subActionParams">run_connector_subaction_pushtoservice_subActionParams</a></span> </div>
</div> <!-- field-items -->
</div>
<div class="model">
Expand All @@ -1305,16 +1337,6 @@ Any modifications made to this file will be overwritten.
<div class="param">name </div><div class="param-desc"><span class="param-type"><a href="#string">String</a></span> The name of the field in Swimlane. </div>
</div> <!-- field-items -->
</div>
<div class="model">
<h3><a name="Subaction_parameters"><code>Subaction_parameters</code> - Subaction parameters</a> <a class="up" href="#__Models">Up</a></h3>
<div class='model-description'>Test an action that involves a subaction.</div>
<div class="field-items">
<div class="param">subAction </div><div class="param-desc"><span class="param-type"><a href="#string">String</a></span> The action to test. </div>
<div class="param-enum-header">Enum:</div>
<div class="param-enum">pushToService</div>
<div class="param">subActionParams </div><div class="param-desc"><span class="param-type"><a href="#run_connector_subaction_pushtoservice_subActionParams">run_connector_subaction_pushtoservice_subActionParams</a></span> </div>
</div> <!-- field-items -->
</div>
<div class="model">
<h3><a name="Unauthorized_response"><code>Unauthorized_response</code> - Unauthorized response</a> <a class="up" href="#__Models">Up</a></h3>
<div class='model-description'></div>
Expand All @@ -1335,6 +1357,9 @@ Any modifications made to this file will be overwritten.
<div class="param">config </div><div class="param-desc"><span class="param-type"><a href="#config_properties_swimlane">config_properties_swimlane</a></span> </div>
<div class="param">name </div><div class="param-desc"><span class="param-type"><a href="#string">String</a></span> The display name for the connector. </div>
<div class="param">secrets </div><div class="param-desc"><span class="param-type"><a href="#secrets_properties_swimlane">secrets_properties_swimlane</a></span> </div>
<div class="param">connector_type_id </div><div class="param-desc"><span class="param-type"><a href="#string">String</a></span> The type of connector. </div>
<div class="param-enum-header">Enum:</div>
<div class="param-enum">.gen-ai</div>
</div> <!-- field-items -->
</div>
<div class="model">
Expand Down Expand Up @@ -1381,8 +1406,32 @@ Any modifications made to this file will be overwritten.
<h3><a name="config_properties_genai"><code>config_properties_genai</code> - Connector request properties for a generative AI connector</a> <a class="up" href="#__Models">Up</a></h3>
<div class='model-description'>Defines properties for connectors when type is <code>.gen-ai</code>.</div>
<div class="field-items">
<div class="param">apiProvider (optional)</div><div class="param-desc"><span class="param-type"><a href="#string">String</a></span> The OpenAI API provider. </div>
<div class="param">apiUrl (optional)</div><div class="param-desc"><span class="param-type"><a href="#string">String</a></span> The OpenAI API endpoint. </div>
<div class="param">apiProvider </div><div class="param-desc"><span class="param-type"><a href="#string">String</a></span> The OpenAI API provider. </div>
<div class="param-enum-header">Enum:</div>
<div class="param-enum">OpenAI</div>
<div class="param">apiUrl </div><div class="param-desc"><span class="param-type"><a href="#string">String</a></span> The OpenAI API endpoint. </div>
<div class="param">defaultModel (optional)</div><div class="param-desc"><span class="param-type"><a href="#string">String</a></span> The default model to use for requests. </div>
</div> <!-- field-items -->
</div>
<div class="model">
<h3><a name="config_properties_genai_oneOf"><code>config_properties_genai_oneOf</code> - </a> <a class="up" href="#__Models">Up</a></h3>
<div class='model-description'></div>
<div class="field-items">
<div class="param">apiProvider </div><div class="param-desc"><span class="param-type"><a href="#string">String</a></span> The OpenAI API provider. </div>
<div class="param-enum-header">Enum:</div>
<div class="param-enum">Azure OpenAI</div>
<div class="param">apiUrl </div><div class="param-desc"><span class="param-type"><a href="#string">String</a></span> The OpenAI API endpoint. </div>
</div> <!-- field-items -->
</div>
<div class="model">
<h3><a name="config_properties_genai_oneOf_1"><code>config_properties_genai_oneOf_1</code> - </a> <a class="up" href="#__Models">Up</a></h3>
<div class='model-description'></div>
<div class="field-items">
<div class="param">apiProvider </div><div class="param-desc"><span class="param-type"><a href="#string">String</a></span> The OpenAI API provider. </div>
<div class="param-enum-header">Enum:</div>
<div class="param-enum">OpenAI</div>
<div class="param">apiUrl </div><div class="param-desc"><span class="param-type"><a href="#string">String</a></span> The OpenAI API endpoint. </div>
<div class="param">defaultModel (optional)</div><div class="param-desc"><span class="param-type"><a href="#string">String</a></span> The default model to use for requests. </div>
</div> <!-- field-items -->
</div>
<div class="model">
Expand Down
57 changes: 49 additions & 8 deletions x-pack/plugins/actions/docs/openapi/bundled.json
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,9 @@
{
"$ref": "#/components/schemas/update_connector_request_cases_webhook"
},
{
"$ref": "#/components/schemas/create_connector_request_genai"
},
{
"$ref": "#/components/schemas/update_connector_request_index"
},
Expand Down Expand Up @@ -1595,16 +1598,54 @@
"config_properties_genai": {
"title": "Connector request properties for a generative AI connector",
"description": "Defines properties for connectors when type is `.gen-ai`.",
"type": "object",
"properties": {
"apiProvider": {
"type": "string",
"description": "The OpenAI API provider."
"oneOf": [
{
"type": "object",
"required": [
"apiProvider",
"apiUrl"
],
"properties": {
"apiProvider": {
"type": "string",
"description": "The OpenAI API provider.",
"enum": [
"Azure OpenAI"
]
},
"apiUrl": {
"type": "string",
"description": "The OpenAI API endpoint."
}
}
},
"apiUrl": {
"type": "string",
"description": "The OpenAI API endpoint."
{
"type": "object",
"required": [
"apiProvider",
"apiUrl"
],
"properties": {
"apiProvider": {
"type": "string",
"description": "The OpenAI API provider.",
"enum": [
"OpenAI"
]
},
"apiUrl": {
"type": "string",
"description": "The OpenAI API endpoint."
},
"defaultModel": {
"type": "string",
"description": "The default model to use for requests."
}
}
}
],
"discriminator": {
"propertyName": "apiProvider"
}
},
"secrets_properties_genai": {
Expand Down
41 changes: 33 additions & 8 deletions x-pack/plugins/actions/docs/openapi/bundled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ paths:
description: The properties vary depending on the connector type.
oneOf:
- $ref: '#/components/schemas/update_connector_request_cases_webhook'
- $ref: '#/components/schemas/create_connector_request_genai'
- $ref: '#/components/schemas/update_connector_request_index'
- $ref: '#/components/schemas/update_connector_request_jira'
- $ref: '#/components/schemas/update_connector_request_opsgenie'
Expand Down Expand Up @@ -979,14 +980,38 @@ components:
config_properties_genai:
title: Connector request properties for a generative AI connector
description: Defines properties for connectors when type is `.gen-ai`.
type: object
properties:
apiProvider:
type: string
description: The OpenAI API provider.
apiUrl:
type: string
description: The OpenAI API endpoint.
oneOf:
- type: object
required:
- apiProvider
- apiUrl
properties:
apiProvider:
type: string
description: The OpenAI API provider.
enum:
- Azure OpenAI
apiUrl:
type: string
description: The OpenAI API endpoint.
- type: object
required:
- apiProvider
- apiUrl
properties:
apiProvider:
type: string
description: The OpenAI API provider.
enum:
- OpenAI
apiUrl:
type: string
description: The OpenAI API endpoint.
defaultModel:
type: string
description: The default model to use for requests.
discriminator:
propertyName: apiProvider
secrets_properties_genai:
title: Connector secrets properties for a generative AI connector
description: Defines secrets for connectors when type is `.gen-ai`.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,32 @@
title: Connector request properties for a generative AI connector
description: Defines properties for connectors when type is `.gen-ai`.
type: object
properties:
apiProvider:
oneOf:
- type: object
required:
- apiProvider
- apiUrl
properties:
apiProvider:
type: string
description: The OpenAI API provider.
apiUrl:
enum: ['Azure OpenAI']
apiUrl:
type: string
description: The OpenAI API endpoint.
description: The OpenAI API endpoint.
- type: object
required:
- apiProvider
- apiUrl
properties:
apiProvider:
type: string
description: The OpenAI API provider.
enum: ['OpenAI']
apiUrl:
type: string
description: The OpenAI API endpoint.
defaultModel:
type: string
description: The default model to use for requests.
discriminator:
propertyName: apiProvider
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
title: Update generative AI connector request
type: object
required:
- config
- name
properties:
config:
$ref: 'config_properties_genai.yaml'
name:
type: string
description: The display name for the connector.
secrets:
$ref: 'secrets_properties_genai.yaml'
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ put:
oneOf:
- $ref: '../components/schemas/update_connector_request_cases_webhook.yaml'
# - $ref: '../components/schemas/update_connector_request_email.yaml'
# - $ref: '../components/schemas/create_connector_request_genai.yaml'
- $ref: '../components/schemas/create_connector_request_genai.yaml'
- $ref: '../components/schemas/update_connector_request_index.yaml'
- $ref: '../components/schemas/update_connector_request_jira.yaml'
- $ref: '../components/schemas/update_connector_request_opsgenie.yaml'
Expand Down

0 comments on commit e4b126c

Please sign in to comment.