Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Connectors][GenAI] Inference Service Kibana connector #189027

Merged
Merged
Show file tree
Hide file tree
Changes from 64 commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
689b966
[Connectors][GenAI] Inference Service connector
YulNaumenko Jul 24, 2024
dda4ccc
Merge branch 'main' into kibana-generic-inference-connector
YulNaumenko Jul 24, 2024
7098133
Ui updates
YulNaumenko Aug 8, 2024
1ae31ea
added support for preSaveConnector and postDeleteConnector handlers t…
YulNaumenko Aug 8, 2024
d14f562
task types service
YulNaumenko Aug 13, 2024
b47e981
Merge remote-tracking branch 'upstream/main' into kibana-generic-infe…
YulNaumenko Aug 21, 2024
952784d
Merge remote-tracking branch 'upstream/main' into kibana-generic-infe…
YulNaumenko Aug 21, 2024
424b791
-
YulNaumenko Aug 21, 2024
6d0f7b4
reshuffle the ui
YulNaumenko Aug 28, 2024
556b8a1
Merge remote-tracking branch 'upstream/main' into kibana-generic-infe…
YulNaumenko Aug 30, 2024
62adb55
Added provider select control
YulNaumenko Sep 4, 2024
9d52a13
changes the form elements
YulNaumenko Sep 5, 2024
04fb36e
complete inference endpoint CRUD
YulNaumenko Sep 9, 2024
ab2d2b9
added typed schema
YulNaumenko Sep 10, 2024
080fc76
added subActions
YulNaumenko Sep 11, 2024
8a847ae
checkable control
YulNaumenko Sep 13, 2024
cfd86f7
added tests
YulNaumenko Sep 17, 2024
077fc92
-
YulNaumenko Sep 17, 2024
71b01f7
more tests
YulNaumenko Sep 18, 2024
5de8d82
more tests and validation
YulNaumenko Sep 24, 2024
8f5c40a
test fixes
YulNaumenko Sep 24, 2024
48167d6
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Sep 24, 2024
fadd693
Merge remote-tracking branch 'upstream/main' into kibana-generic-infe…
YulNaumenko Sep 25, 2024
0acf784
-
YulNaumenko Sep 25, 2024
6d12faa
integration tests
YulNaumenko Sep 25, 2024
cb60a3d
-
YulNaumenko Sep 25, 2024
26268c2
cleaned up docs
YulNaumenko Sep 25, 2024
3cb3556
translations fix
YulNaumenko Sep 25, 2024
4139ccc
styles fix
YulNaumenko Sep 25, 2024
68a33b8
fixed header linting
YulNaumenko Sep 25, 2024
c97afeb
tests
YulNaumenko Sep 25, 2024
1ddf304
-
YulNaumenko Sep 25, 2024
d0d77f5
fixed validation for dynamic fields
YulNaumenko Sep 26, 2024
ce4465e
Merge branch 'main' into kibana-generic-inference-connector
YulNaumenko Sep 26, 2024
7bfbe0b
added technical preview badge
YulNaumenko Sep 27, 2024
6341c2f
Merge branch 'kibana-generic-inference-connector' of github.com:YulNa…
YulNaumenko Sep 27, 2024
d5ea270
-
YulNaumenko Sep 28, 2024
1265bbf
use internal user for call inference
YulNaumenko Sep 30, 2024
14b0fc4
use inference api
YulNaumenko Oct 1, 2024
e8825ac
Merge branch 'main' into kibana-generic-inference-connector
YulNaumenko Oct 1, 2024
9987ca7
tests fix
YulNaumenko Oct 3, 2024
35e9442
removed persistence for schema
YulNaumenko Oct 4, 2024
6f9504f
uses post and pre save hooks
YulNaumenko Oct 4, 2024
a7eaae2
Merge branch 'main' into kibana-generic-inference-connector
YulNaumenko Oct 4, 2024
e9bfa27
fixed buttons group style, added alibabacloud
YulNaumenko Oct 7, 2024
b927fed
Merge branch 'kibana-generic-inference-connector' of github.com:YulNa…
YulNaumenko Oct 7, 2024
ce77db6
tests
YulNaumenko Oct 7, 2024
9bbfa90
Merge branch 'main' into kibana-generic-inference-connector
YulNaumenko Oct 7, 2024
299775d
-
YulNaumenko Oct 7, 2024
766c28b
Merge branch 'kibana-generic-inference-connector' of github.com:YulNa…
YulNaumenko Oct 7, 2024
47f71ae
Merge remote-tracking branch 'upstream/main' into kibana-generic-infe…
YulNaumenko Oct 8, 2024
3510dc2
Merge branch 'main' into kibana-generic-inference-connector
YulNaumenko Oct 8, 2024
dadf1cb
fixed due comments
YulNaumenko Oct 8, 2024
97bf027
tests
YulNaumenko Oct 8, 2024
4f450f4
fixed docs
YulNaumenko Oct 9, 2024
e222de3
Apply suggestions from code review
YulNaumenko Oct 9, 2024
2e5a503
Apply suggestions from code review
YulNaumenko Oct 9, 2024
e8cdbdd
fixed bundle size
YulNaumenko Oct 9, 2024
5da6285
Merge remote-tracking branch 'upstream/main' into kibana-generic-infe…
YulNaumenko Oct 9, 2024
3977655
fixed build
YulNaumenko Oct 10, 2024
653174a
-
YulNaumenko Oct 10, 2024
80beb6d
fix due to comments
YulNaumenko Oct 10, 2024
974cb28
fixed ui
YulNaumenko Oct 10, 2024
2f402ea
Merge branch 'main' into kibana-generic-inference-connector
YulNaumenko Oct 10, 2024
4c12619
no message
YulNaumenko Oct 10, 2024
356e827
Merge branch 'kibana-generic-inference-connector' of github.com:YulNa…
YulNaumenko Oct 10, 2024
b1da30c
removed from security assistant cards
YulNaumenko Oct 10, 2024
f2fe300
Apply suggestions from code review
YulNaumenko Oct 10, 2024
73432ee
build fix
YulNaumenko Oct 10, 2024
f75eb47
-
YulNaumenko Oct 11, 2024
3fef5b8
Apply suggestions from code review
YulNaumenko Oct 11, 2024
6553e80
tests
YulNaumenko Oct 11, 2024
d3a8933
Merge branch 'kibana-generic-inference-connector' of github.com:YulNa…
YulNaumenko Oct 11, 2024
331e0dd
-
YulNaumenko Oct 13, 2024
9c20a55
Merge branch 'main' into kibana-generic-inference-connector
YulNaumenko Oct 13, 2024
b870e1d
fixed update with numbers
YulNaumenko Oct 13, 2024
b829d6a
Merge branch 'main' into kibana-generic-inference-connector
YulNaumenko Oct 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -1671,6 +1671,11 @@ x-pack/test/security_solution_cypress/cypress/tasks/expandable_flyout @elastic/
/x-pack/plugins/stack_connectors/server/connector_types/gemini @elastic/security-generative-ai @elastic/obs-ai-assistant @elastic/appex-ai-infra
/x-pack/plugins/stack_connectors/common/gemini @elastic/security-generative-ai @elastic/obs-ai-assistant @elastic/appex-ai-infra

# Inference API
/x-pack/plugins/stack_connectors/public/connector_types/inference @elastic/appex-ai-infra @elastic/security-generative-ai @elastic/obs-ai-assistant
/x-pack/plugins/stack_connectors/server/connector_types/inference @elastic/appex-ai-infra @elastic/security-generative-ai @elastic/obs-ai-assistant
/x-pack/plugins/stack_connectors/common/inference @elastic/appex-ai-infra @elastic/security-generative-ai @elastic/obs-ai-assistant

## Defend Workflows owner connectors
/x-pack/plugins/stack_connectors/public/connector_types/sentinelone @elastic/security-defend-workflows
/x-pack/plugins/stack_connectors/server/connector_types/sentinelone @elastic/security-defend-workflows
Expand Down
4 changes: 4 additions & 0 deletions docs/management/action-types.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ a| <<gemini-action-type,{gemini}>>

| Send a request to {gemini}.

a| <<inference-action-type,{inference}>>

| Send a request to {inference}.

YulNaumenko marked this conversation as resolved.
Show resolved Hide resolved
a| <<email-action-type,Email>>

| Send email from your server.
Expand Down
123 changes: 123 additions & 0 deletions docs/management/connectors/action-types/inference.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
[[inference-action-type]]
== {infer-cap} connector and action
++++
<titleabbrev>{inference}</titleabbrev>
++++
:frontmatter-description: Add a connector that can send requests to {inference}.
:frontmatter-tags-products: [kibana]
:frontmatter-tags-content-type: [how-to]
:frontmatter-tags-user-goals: [configure]


The {infer} connector uses {es} client to send requests to {infer}. The connector uses the <<execute-connector-api,run connector API>> to send the request.
YulNaumenko marked this conversation as resolved.
Show resolved Hide resolved

[float]
[[define-inference-ui]]
=== Create connectors in {kib}

You can create connectors in *{stack-manage-app} > {connectors-ui}*. For example:
YulNaumenko marked this conversation as resolved.
Show resolved Hide resolved

[role="screenshot"]
image::management/connectors/images/inference-connector.png[{inference} connector]
// NOTE: This is an autogenerated screenshot. Do not edit it directly.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it really auto-generated or is this string a copy/paste error?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copy/paste


[float]
[[inference-connector-configuration]]
==== Connector configuration

{infer-cap} connectors have the following configuration properties:

Name:: The name of the connector.
Service:: The {infer} supported provider service.
YulNaumenko marked this conversation as resolved.
Show resolved Hide resolved
Task type:: The {infer} task type, it depends to the selected service.
YulNaumenko marked this conversation as resolved.
Show resolved Hide resolved
Inference ID:: The {infer} ID.
YulNaumenko marked this conversation as resolved.
Show resolved Hide resolved
Provider configuration:: Settings for service configuration.
Provider secrets:: Configuration for authentication.
Task type configuration:: Settings for task type configuration.

[float]
[[inference-action-configuration]]
=== Test connectors

You can test connectors with the <<execute-connector-api,run connector API>> or
as you're creating or editing the connector in {kib}. For example:
YulNaumenko marked this conversation as resolved.
Show resolved Hide resolved

[role="screenshot"]
image::management/connectors/images/inference-completion-params.png[{infer} params test]
// NOTE: This is an autogenerated screenshot. Do not edit it directly.

YulNaumenko marked this conversation as resolved.
Show resolved Hide resolved
The {infer} actions have the following configuration properties. Properties depend on the selected task type.

[float]
[[inference-connector-perform-completion]]
=== Connector perform completion task
YulNaumenko marked this conversation as resolved.
Show resolved Hide resolved

The following example performs a completion on the example question.
YulNaumenko marked this conversation as resolved.
Show resolved Hide resolved
Input::
The text on which you want to perform the {infer} task. For example:
+
[source,text]
--
{
input: 'What is Elastic?'
}
--

[float]
[[inference-connector-perform-text-embedding]]
=== Perform text embedding
YulNaumenko marked this conversation as resolved.
Show resolved Hide resolved

The following example performs text embedding.
YulNaumenko marked this conversation as resolved.
Show resolved Hide resolved
Input::
The text on which you want to perform the {infer} task. For example:
+
[source,text]
--
{
input: 'The sky above the port was the color of television tuned to a dead channel.',
task_settings: {
input_type: 'ingest
YulNaumenko marked this conversation as resolved.
Show resolved Hide resolved
}
}
--
Input type::
An optional string that overwrites the connector's default model.

[float]
[[inference-connector-perform-rerank]]
=== Connector perform rerank task
YulNaumenko marked this conversation as resolved.
Show resolved Hide resolved

The following example performs reranking on the example input.
YulNaumenko marked this conversation as resolved.
Show resolved Hide resolved
Input::
The text on which you want to perform the {infer} task. Should be a string array. For example:
+
[source,text]
--
{
input: ['luke', 'like', 'leia', 'chewy', 'r2d2', 'star', 'wars'],
query: 'star wars main character'
}
--
Query::
The search query text.

[float]
[[inference-connector-perform-sparse-embedding]]
=== Connector perform sparse embedding task
YulNaumenko marked this conversation as resolved.
Show resolved Hide resolved

The following example performs sparse embedding on the example sentence.
YulNaumenko marked this conversation as resolved.
Show resolved Hide resolved
Input::
The text on which you want to perform the {infer} task. For example:
+
[source,text]
--
{
input: 'The sky above the port was the color of television tuned to a dead channel.'
}
--

[float]
[[inference-connector-networking-configuration]]
=== Connector networking configuration

Use the <<action-settings, Action configuration settings>> to customize connector networking configurations, such as proxies, certificates, or TLS settings. You can set configurations that apply to all your connectors or use `xpack.actions.customHostSettings` to set per-host configurations.
YulNaumenko marked this conversation as resolved.
Show resolved Hide resolved
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/management/connectors/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ include::action-types/crowdstrike.asciidoc[leveloffset=+1]
include::action-types/d3security.asciidoc[leveloffset=+1]
include::action-types/email.asciidoc[leveloffset=+1]
include::action-types/gemini.asciidoc[leveloffset=+1]
include::action-types/inference.asciidoc[leveloffset=+1]
include::action-types/resilient.asciidoc[leveloffset=+1]
include::action-types/index.asciidoc[leveloffset=+1]
include::action-types/jira.asciidoc[leveloffset=+1]
Expand Down
1 change: 1 addition & 0 deletions docs/settings/alert-action-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ A configuration URL that varies by connector:
--
* For an <<bedrock-action-type,{bedrock} connector>>, specifies the {bedrock} request URL.
* For an <<gemini-action-type,{gemini} connector>>, specifies the {gemini} request URL.
* For an <<inference-action-type,{inference} connector>>, specifies the Elastic {inference} request.
* For a <<openai-action-type,OpenAI 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.
Expand Down
11 changes: 11 additions & 0 deletions oas_docs/examples/get_connector_types_generativeai_response.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,14 @@ value:
supported_feature_ids:
- generativeAIForSecurity
is_system_action_type: false
- id: .inference
name: Inference API
enabled: true
enabled_in_config: true
enabled_in_license: true
minimum_license_required: enterprise
supported_feature_ids:
- generativeAIForSecurity
- generativeAIForObservability
- generativeAIForSearchPlayground
is_system_action_type: false
10 changes: 10 additions & 0 deletions x-pack/packages/kbn-elastic-assistant/impl/mock/connectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,16 @@ export const mockActionTypes = [
isSystemActionType: true,
supportedFeatureIds: ['generativeAI'],
} as ActionType,
{
id: '.inference',
name: 'Inference API',
enabled: true,
enabledInConfig: true,
enabledInLicense: true,
minimumLicenseRequired: 'enterprise',
isSystemActionType: true,
supportedFeatureIds: ['generativeAI'],
} as ActionType,
];

export const mockConnectors: AIConnector[] = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const compatibilityGenerativeAIForObservability = i18n.translate(
const compatibilityGenerativeAIForSearchPlayground = i18n.translate(
'xpack.actions.availableConnectorFeatures.compatibility.generativeAIForSearchPlayground',
{
defaultMessage: 'Generative AI for Search Playground',
defaultMessage: 'Generative AI for Search',
}
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ description: The type of connector. For example, `.email`, `.index`, `.jira`, `.
enum:
- .bedrock
- .gemini
- .inference
- .cases-webhook
- .d3security
- .email
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
title: Connector request properties for an Inference API connector
description: Defines properties for connectors when type is `.inference`.
type: object
required:
- provider
- taskType
properties:
provider:
YulNaumenko marked this conversation as resolved.
Show resolved Hide resolved
type: string
description: The Inference API service provider.
taskType:
type: string
description: The Inference task type supported by provider.
providerConfig:
type: object
description: The provider settings.
taskTypeConfig:
type: object
description: The task type settings.
inferenceId:
type: string
YulNaumenko marked this conversation as resolved.
Show resolved Hide resolved
description: The task type settings.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
title: Connector secrets properties for an AI Connector
description: Defines secrets for connectors when type is `.inference`.
type: object
required:
- providerSecrets
properties:
providerSecrets:
type: object
description: The service account credentials. The service account could have different type of properties to encode.
Loading