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

[Inference Connector] Modified getProvider to use _inference/_services ES API instead of hardcoded values. #199047

Merged

Conversation

YulNaumenko
Copy link
Contributor

@ymao1 introduced new ES API which allows to fetch available services providers list with the settings and task types:
GET _inference/_services
This PR is changing hardcoded providers list x-pack/plugins/stack_connectors/public/connector_types/inference/providers/get_providers.ts to use new ES API.

@YulNaumenko YulNaumenko added release_note:skip Skip the PR/issue when compiling release notes v9.0.0 v8.17.0 labels Nov 5, 2024
@YulNaumenko YulNaumenko self-assigned this Nov 5, 2024
@YulNaumenko YulNaumenko requested review from a team as code owners November 5, 2024 19:39
@YulNaumenko YulNaumenko added the backport:skip This commit does not require backporting label Nov 5, 2024
@pmuellr
Copy link
Member

pmuellr commented Nov 5, 2024

server-side ResponseOps changes LGTM, but I'd like to get one of the ResponseOps MX folks to review the UX bits. Especially with the file move. And perhaps CODEOWNERS can be adjusted to make this directory not owned by ResponseOps :-)

x-pack/plugins/stack_connectors/public/connector_types/inference/

Copy link
Contributor

@adcoelho adcoelho left a comment

Choose a reason for hiding this comment

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

Why the move of /dynamic_config/types.ts to common? We normally only have there things that are shared between public and server and these types are only used in public.

@ymao1
Copy link
Contributor

ymao1 commented Nov 7, 2024

I don't know if this should be done in this PR or another, but there should be better handling of unexpected providers. There are 2 provider configs returned from the ES API that the UI doesn't know about and selecting them will show this message:

Screenshot 2024-11-07 at 10 34 59 AM

I assume this will be continue to be a problem as ES adds new providers so we should have a fallback icon config.

@YulNaumenko
Copy link
Contributor Author

Why the move of /dynamic_config/types.ts to common? We normally only have there things that are shared between public and server and these types are only used in public.

I moved it to common because we are using this types on the server side. GET _inference/_services is using InferenceProvider, FieldsConfiguration -> ConfigProperties, InferenceTaskType as a schema.

@YulNaumenko YulNaumenko requested review from ymao1 and adcoelho November 8, 2024 03:57
Copy link
Contributor

@e40pud e40pud left a comment

Choose a reason for hiding this comment

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

LGTM

@YulNaumenko
Copy link
Contributor Author

Opened a ticket to handle icon and name on ES side.

Copy link
Contributor

@ymao1 ymao1 left a comment

Choose a reason for hiding this comment

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

LGTM

@YulNaumenko YulNaumenko enabled auto-merge (squash) November 11, 2024 22:56
@YulNaumenko YulNaumenko merged commit abf6a1d into elastic:main Nov 12, 2024
21 checks passed
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
stackConnectors 305 304 -1

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
stackConnectors 686.1KB 662.0KB -24.0KB

History

cc @YulNaumenko

tkajtoch pushed a commit to tkajtoch/kibana that referenced this pull request Nov 12, 2024
…s ES API instead of hardcoded values. (elastic#199047)

@ymao1
[introduced](elastic/elasticsearch#114862) new
ES API which allows to fetch available services providers list with the
settings and task types:
`GET _inference/_services` 
This PR is changing hardcoded providers list
`x-pack/plugins/stack_connectors/public/connector_types/inference/providers/get_providers.ts`
to use new ES API.
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Nov 18, 2024
…s ES API instead of hardcoded values. (elastic#199047)

@ymao1
[introduced](elastic/elasticsearch#114862) new
ES API which allows to fetch available services providers list with the
settings and task types:
`GET _inference/_services` 
This PR is changing hardcoded providers list
`x-pack/plugins/stack_connectors/public/connector_types/inference/providers/get_providers.ts`
to use new ES API.
@YulNaumenko
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
8.17

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

YulNaumenko added a commit to YulNaumenko/kibana that referenced this pull request Dec 18, 2024
…s ES API instead of hardcoded values. (elastic#199047)

@ymao1
[introduced](elastic/elasticsearch#114862) new
ES API which allows to fetch available services providers list with the
settings and task types:
`GET _inference/_services`
This PR is changing hardcoded providers list
`x-pack/plugins/stack_connectors/public/connector_types/inference/providers/get_providers.ts`
to use new ES API.

(cherry picked from commit abf6a1d)
YulNaumenko added a commit to YulNaumenko/kibana that referenced this pull request Dec 18, 2024
…s ES API instead of hardcoded values. (elastic#199047)

@ymao1
[introduced](elastic/elasticsearch#114862) new
ES API which allows to fetch available services providers list with the
settings and task types:
`GET _inference/_services`
This PR is changing hardcoded providers list
`x-pack/plugins/stack_connectors/public/connector_types/inference/providers/get_providers.ts`
to use new ES API.

(cherry picked from commit abf6a1d)
@YulNaumenko
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

YulNaumenko added a commit that referenced this pull request Dec 18, 2024
…ervices ES API instead of hardcoded values. (#199047) (#204680)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Inference Connector] Modified getProvider to use
_inference/_services ES API instead of hardcoded values.
(#199047)](#199047)

<!--- Backport version: 9.6.1 -->

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

<!--BACKPORT [{"author":{"name":"Yuliia
Naumenko","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-12T01:50:29Z","message":"[Inference
Connector] Modified getProvider to use _inference/_services ES API
instead of hardcoded values.
(#199047)\n\n@ymao1\r\n[introduced](elastic/elasticsearch#114862)
new\r\nES API which allows to fetch available services providers list
with the\r\nsettings and task types:\r\n`GET _inference/_services`
\r\nThis PR is changing hardcoded providers
list\r\n`x-pack/plugins/stack_connectors/public/connector_types/inference/providers/get_providers.ts`\r\nto
use new ES
API.","sha":"abf6a1d4f6e83f108ed11a3e6279d73db514b352","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:skip","v9.0.0","v8.17.0"],"title":"[Inference
Connector] Modified getProvider to use _inference/_services ES API
instead of hardcoded
values.","number":199047,"url":"https://github.com/elastic/kibana/pull/199047","mergeCommit":{"message":"[Inference
Connector] Modified getProvider to use _inference/_services ES API
instead of hardcoded values.
(#199047)\n\n@ymao1\r\n[introduced](elastic/elasticsearch#114862)
new\r\nES API which allows to fetch available services providers list
with the\r\nsettings and task types:\r\n`GET _inference/_services`
\r\nThis PR is changing hardcoded providers
list\r\n`x-pack/plugins/stack_connectors/public/connector_types/inference/providers/get_providers.ts`\r\nto
use new ES
API.","sha":"abf6a1d4f6e83f108ed11a3e6279d73db514b352"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/199047","number":199047,"mergeCommit":{"message":"[Inference
Connector] Modified getProvider to use _inference/_services ES API
instead of hardcoded values.
(#199047)\n\n@ymao1\r\n[introduced](elastic/elasticsearch#114862)
new\r\nES API which allows to fetch available services providers list
with the\r\nsettings and task types:\r\n`GET _inference/_services`
\r\nThis PR is changing hardcoded providers
list\r\n`x-pack/plugins/stack_connectors/public/connector_types/inference/providers/get_providers.ts`\r\nto
use new ES
API.","sha":"abf6a1d4f6e83f108ed11a3e6279d73db514b352"}},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"url":"https://github.com/elastic/kibana/pull/204679","number":204679,"branch":"8.17","state":"OPEN"}]}]
BACKPORT-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:skip Skip the PR/issue when compiling release notes v8.17.0 v8.18.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants