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 API] Add API to get configuration of inference services #114862

Merged
merged 13 commits into from
Oct 30, 2024

Conversation

ymao1
Copy link
Contributor

@ymao1 ymao1 commented Oct 15, 2024

Resolves https://github.com/elastic/ml-team/issues/1308, https://github.com/elastic/ml-team/issues/1309

Summary

Adds API to return a list of configurations by inference service. As recommended in the issue, the response format follows the search connectors protocol

  • GET _inference/_services - returns configurations for all available services
  • Get _inference/_services/{taskType} - returns configuration for all services that support the given task type

Example response

GET _inference/_services
[
    {
        "provider": "cohere",
        "task_types": [
            {
                "task_type": "text_embedding",
                "configuration": {
                    "truncate": {
                        "default_value": null,
                        "depends_on": [],
                        "display": "dropdown",
                        "label": "Truncate",
                        "options": [
                            {
                                "label": "NONE",
                                "value": "NONE"
                            },
                            {
                                "label": "START",
                                "value": "START"
                            },
                            {
                                "label": "END",
                                "value": "END"
                            }
                        ],
                        "order": 2,
                        "required": false,
                        "sensitive": false,
                        "tooltip": "Specifies how the API handles inputs longer than the maximum token length.",
                        "type": "str",
                        "ui_restrictions": [],
                        "validations": [],
                        "value": ""
                    },
                    "input_type": {
                        "default_value": null,
                        "depends_on": [],
                        "display": "dropdown",
                        "label": "Input Type",
                        "options": [
                            {
                                "label": "classification",
                                "value": "classification"
                            },
                            {
                                "label": "clusterning",
                                "value": "clusterning"
                            },
                            {
                                "label": "ingest",
                                "value": "ingest"
                            },
                            {
                                "label": "search",
                                "value": "search"
                            }
                        ],
                        "order": 1,
                        "required": false,
                        "sensitive": false,
                        "tooltip": "Specifies the type of input passed to the model.",
                        "type": "str",
                        "ui_restrictions": [],
                        "validations": [],
                        "value": ""
                    }
                }
            },
            {
                "task_type": "rerank",
                "configuration": {
                    "top_n": {
                        "default_value": null,
                        "depends_on": [],
                        "display": "numeric",
                        "label": "Top N",
                        "order": 2,
                        "required": false,
                        "sensitive": false,
                        "tooltip": "The number of most relevant documents to return, defaults to the number of the documents.",
                        "type": "int",
                        "ui_restrictions": [],
                        "validations": [],
                        "value": null
                    },
                    "return_documents": {
                        "default_value": null,
                        "depends_on": [],
                        "display": "toggle",
                        "label": "Return Documents",
                        "order": 1,
                        "required": false,
                        "sensitive": false,
                        "tooltip": "Specify whether to return doc text within the results.",
                        "type": "bool",
                        "ui_restrictions": [],
                        "validations": [],
                        "value": false
                    }
                }
            },
            {
                "task_type": "completion",
                "configuration": {}
            }
        ],
        "configuration": {
            "api_key": {
                "default_value": null,
                "depends_on": [],
                "display": "textbox",
                "label": "API Key",
                "order": 1,
                "required": true,
                "sensitive": true,
                "tooltip": "API Key for the provider you're connecting to.",
                "type": "str",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            },
            "rate_limit.requests_per_minute": {
                "default_value": null,
                "depends_on": [],
                "display": "numeric",
                "label": "Rate Limit",
                "order": 6,
                "required": false,
                "sensitive": false,
                "tooltip": "Minimize the number of rate limit errors.",
                "type": "int",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            }
        }
    },
    {
        "provider": "googlevertexai",
        "task_types": [
            {
                "task_type": "text_embedding",
                "configuration": {
                    "auto_truncate": {
                        "default_value": null,
                        "depends_on": [],
                        "display": "toggle",
                        "label": "Auto Truncate",
                        "order": 1,
                        "required": false,
                        "sensitive": false,
                        "tooltip": "Specifies if the API truncates inputs longer than the maximum token length automatically.",
                        "type": "bool",
                        "ui_restrictions": [],
                        "validations": [],
                        "value": false
                    }
                }
            },
            {
                "task_type": "rerank",
                "configuration": {
                    "top_n": {
                        "default_value": null,
                        "depends_on": [],
                        "display": "toggle",
                        "label": "Top N",
                        "order": 1,
                        "required": false,
                        "sensitive": false,
                        "tooltip": "Specifies the number of the top n documents, which should be returned.",
                        "type": "bool",
                        "ui_restrictions": [],
                        "validations": [],
                        "value": false
                    }
                }
            }
        ],
        "configuration": {
            "service_account_json": {
                "default_value": null,
                "depends_on": [],
                "display": "textbox",
                "label": "Credentials JSON",
                "order": 1,
                "required": true,
                "sensitive": true,
                "tooltip": "API Key for the provider you're connecting to.",
                "type": "str",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            },
            "project_id": {
                "default_value": null,
                "depends_on": [],
                "display": "textbox",
                "label": "GCP Project",
                "order": 4,
                "required": true,
                "sensitive": false,
                "tooltip": "The GCP Project ID which has Vertex AI API(s) enabled. For more information on the URL, refer to the {geminiVertexAIDocs}.",
                "type": "str",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            },
            "location": {
                "default_value": null,
                "depends_on": [],
                "display": "textbox",
                "label": "GCP Region",
                "order": 3,
                "required": true,
                "sensitive": false,
                "tooltip": "Please provide the GCP region where the Vertex AI API(s) is enabled. For more information, refer to the {geminiVertexAIDocs}.",
                "type": "str",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            },
            "rate_limit.requests_per_minute": {
                "default_value": null,
                "depends_on": [],
                "display": "numeric",
                "label": "Rate Limit",
                "order": 6,
                "required": false,
                "sensitive": false,
                "tooltip": "Minimize the number of rate limit errors.",
                "type": "int",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            },
            "model_id": {
                "default_value": null,
                "depends_on": [],
                "display": "textbox",
                "label": "Model ID",
                "order": 2,
                "required": true,
                "sensitive": false,
                "tooltip": "ID of the LLM you're using.",
                "type": "str",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            }
        }
    },
    {
        "provider": "azureopenai",
        "task_types": [
            {
                "task_type": "text_embedding",
                "configuration": {
                    "user": {
                        "default_value": null,
                        "depends_on": [],
                        "display": "textbox",
                        "label": "User",
                        "order": 1,
                        "required": false,
                        "sensitive": false,
                        "tooltip": "Specifies the user issuing the request.",
                        "type": "str",
                        "ui_restrictions": [],
                        "validations": [],
                        "value": ""
                    }
                }
            },
            {
                "task_type": "completion",
                "configuration": {
                    "user": {
                        "default_value": null,
                        "depends_on": [],
                        "display": "textbox",
                        "label": "User",
                        "order": 1,
                        "required": false,
                        "sensitive": false,
                        "tooltip": "Specifies the user issuing the request.",
                        "type": "str",
                        "ui_restrictions": [],
                        "validations": [],
                        "value": ""
                    }
                }
            }
        ],
        "configuration": {
            "api_key": {
                "default_value": null,
                "depends_on": [],
                "display": "textbox",
                "label": "API Key",
                "order": 1,
                "required": false,
                "sensitive": true,
                "tooltip": "You must provide either an API key or an Entra ID.",
                "type": "str",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            },
            "entra_id": {
                "default_value": null,
                "depends_on": [],
                "display": "textbox",
                "label": "Entra ID",
                "order": 2,
                "required": false,
                "sensitive": true,
                "tooltip": "You must provide either an API key or an Entra ID.",
                "type": "str",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            },
            "rate_limit.requests_per_minute": {
                "default_value": null,
                "depends_on": [],
                "display": "numeric",
                "label": "Rate Limit",
                "order": 6,
                "required": false,
                "sensitive": false,
                "tooltip": "The azureopenai service sets a default number of requests allowed per minute depending on the task type.",
                "type": "int",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            },
            "deployment_id": {
                "default_value": null,
                "depends_on": [],
                "display": "textbox",
                "label": "Deployment ID",
                "order": 5,
                "required": true,
                "sensitive": false,
                "tooltip": "The deployment name of your deployed models.",
                "type": "str",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            },
            "resource_name": {
                "default_value": null,
                "depends_on": [],
                "display": "textbox",
                "label": "Resource Name",
                "order": 3,
                "required": true,
                "sensitive": false,
                "tooltip": "The name of your Azure OpenAI resource.",
                "type": "str",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            },
            "api_version": {
                "default_value": null,
                "depends_on": [],
                "display": "textbox",
                "label": "API Version",
                "order": 4,
                "required": true,
                "sensitive": false,
                "tooltip": "The Azure API version ID to use.",
                "type": "str",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            }
        }
    },
    {
        "provider": "openai",
        "task_types": [
            {
                "task_type": "text_embedding",
                "configuration": {
                    "user": {
                        "default_value": null,
                        "depends_on": [],
                        "display": "textbox",
                        "label": "User",
                        "order": 1,
                        "required": false,
                        "sensitive": false,
                        "tooltip": "Specifies the user issuing the request.",
                        "type": "str",
                        "ui_restrictions": [],
                        "validations": [],
                        "value": ""
                    }
                }
            },
            {
                "task_type": "completion",
                "configuration": {
                    "user": {
                        "default_value": null,
                        "depends_on": [],
                        "display": "textbox",
                        "label": "User",
                        "order": 1,
                        "required": false,
                        "sensitive": false,
                        "tooltip": "Specifies the user issuing the request.",
                        "type": "str",
                        "ui_restrictions": [],
                        "validations": [],
                        "value": ""
                    }
                }
            }
        ],
        "configuration": {
            "api_key": {
                "default_value": null,
                "depends_on": [],
                "display": "textbox",
                "label": "API Key",
                "order": 1,
                "required": true,
                "sensitive": true,
                "tooltip": "The OpenAI API authentication key. For more details about generating OpenAI API keys, refer to the https://platform.openai.com/account/api-keys.",
                "type": "str",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            },
            "organization_id": {
                "default_value": null,
                "depends_on": [],
                "display": "textbox",
                "label": "Organization ID",
                "order": 3,
                "required": false,
                "sensitive": false,
                "tooltip": "The unique identifier of your organization.",
                "type": "str",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            },
            "rate_limit.requests_per_minute": {
                "default_value": null,
                "depends_on": [],
                "display": "numeric",
                "label": "Rate Limit",
                "order": 6,
                "required": false,
                "sensitive": false,
                "tooltip": "Default number of requests allowed per minute. For text_embedding is 3000. For completion is 500.",
                "type": "int",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            },
            "model_id": {
                "default_value": null,
                "depends_on": [],
                "display": "textbox",
                "label": "Model ID",
                "order": 2,
                "required": true,
                "sensitive": false,
                "tooltip": "The name of the model to use for the inference task.",
                "type": "str",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            },
            "url": {
                "default_value": "https://api.openai.com/v1/chat/completions",
                "depends_on": [],
                "display": "textbox",
                "label": "URL",
                "order": 4,
                "required": true,
                "sensitive": false,
                "tooltip": "The OpenAI API endpoint URL. For more information on the URL, refer to the https://platform.openai.com/docs/api-reference.",
                "type": "str",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            }
        }
    },
    {
        "provider": "azureaistudio",
        "task_types": [
            {
                "task_type": "text_embedding",
                "configuration": {
                    "top_p": {
                        "default_value": null,
                        "depends_on": [],
                        "display": "numeric",
                        "label": "Top P",
                        "order": 4,
                        "required": false,
                        "sensitive": false,
                        "tooltip": "A number in the range of 0.0 to 2.0 that is an alternative value to temperature. Should not be used if temperature is specified.",
                        "type": "int",
                        "ui_restrictions": [],
                        "validations": [],
                        "value": null
                    },
                    "max_new_tokens": {
                        "default_value": null,
                        "depends_on": [],
                        "display": "numeric",
                        "label": "Max New Tokens",
                        "order": 2,
                        "required": false,
                        "sensitive": false,
                        "tooltip": "Provides a hint for the maximum number of output tokens to be generated.",
                        "type": "int",
                        "ui_restrictions": [],
                        "validations": [],
                        "value": null
                    },
                    "temperature": {
                        "default_value": null,
                        "depends_on": [],
                        "display": "numeric",
                        "label": "Temperature",
                        "order": 3,
                        "required": false,
                        "sensitive": false,
                        "tooltip": "A number in the range of 0.0 to 2.0 that specifies the sampling temperature.",
                        "type": "int",
                        "ui_restrictions": [],
                        "validations": [],
                        "value": null
                    },
                    "do_sample": {
                        "default_value": null,
                        "depends_on": [],
                        "display": "numeric",
                        "label": "Do Sample",
                        "order": 1,
                        "required": false,
                        "sensitive": false,
                        "tooltip": "Instructs the inference process to perform sampling or not.",
                        "type": "int",
                        "ui_restrictions": [],
                        "validations": [],
                        "value": null
                    }
                }
            },
            {
                "task_type": "completion",
                "configuration": {
                    "user": {
                        "default_value": null,
                        "depends_on": [],
                        "display": "textbox",
                        "label": "User",
                        "order": 1,
                        "required": false,
                        "sensitive": false,
                        "tooltip": "Specifies the user issuing the request.",
                        "type": "str",
                        "ui_restrictions": [],
                        "validations": [],
                        "value": ""
                    }
                }
            }
        ],
        "configuration": {
            "endpoint_type": {
                "default_value": null,
                "depends_on": [],
                "display": "dropdown",
                "label": "Endpoint Type",
                "options": [
                    {
                        "label": "token",
                        "value": "token"
                    },
                    {
                        "label": "realtime",
                        "value": "realtime"
                    }
                ],
                "order": 3,
                "required": true,
                "sensitive": false,
                "tooltip": "Specifies the type of endpoint that is used in your model deployment.",
                "type": "str",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            },
            "provider": {
                "default_value": null,
                "depends_on": [],
                "display": "dropdown",
                "label": "Provider",
                "options": [
                    {
                        "label": "cohere",
                        "value": "cohere"
                    },
                    {
                        "label": "meta",
                        "value": "meta"
                    },
                    {
                        "label": "microsoft_phi",
                        "value": "microsoft_phi"
                    },
                    {
                        "label": "mistral",
                        "value": "mistral"
                    },
                    {
                        "label": "openai",
                        "value": "openai"
                    },
                    {
                        "label": "databricks",
                        "value": "databricks"
                    }
                ],
                "order": 3,
                "required": true,
                "sensitive": false,
                "tooltip": "The model provider for your deployment.",
                "type": "str",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            },
            "api_key": {
                "default_value": null,
                "depends_on": [],
                "display": "textbox",
                "label": "API Key",
                "order": 1,
                "required": true,
                "sensitive": true,
                "tooltip": "API Key for the provider you're connecting to.",
                "type": "str",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            },
            "rate_limit.requests_per_minute": {
                "default_value": null,
                "depends_on": [],
                "display": "numeric",
                "label": "Rate Limit",
                "order": 6,
                "required": false,
                "sensitive": false,
                "tooltip": "Minimize the number of rate limit errors.",
                "type": "int",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            },
            "target": {
                "default_value": null,
                "depends_on": [],
                "display": "textbox",
                "label": "Target",
                "order": 2,
                "required": true,
                "sensitive": false,
                "tooltip": "The target URL of your Azure AI Studio model deployment.",
                "type": "str",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            }
        }
    },
    {
        "provider": "amazonbedrock",
        "task_types": [
            {
                "task_type": "text_embedding",
                "configuration": {}
            },
            {
                "task_type": "completion",
                "configuration": {
                    "top_p": {
                        "default_value": null,
                        "depends_on": [],
                        "display": "numeric",
                        "label": "Top P",
                        "order": 3,
                        "required": false,
                        "sensitive": false,
                        "tooltip": "Alternative to temperature. A number in the range of 0.0 to 1.0, to eliminate low-probability tokens.",
                        "type": "int",
                        "ui_restrictions": [],
                        "validations": [],
                        "value": null
                    },
                    "max_new_tokens": {
                        "default_value": null,
                        "depends_on": [],
                        "display": "numeric",
                        "label": "Max New Tokens",
                        "order": 1,
                        "required": false,
                        "sensitive": false,
                        "tooltip": "Sets the maximum number for the output tokens to be generated.",
                        "type": "int",
                        "ui_restrictions": [],
                        "validations": [],
                        "value": null
                    },
                    "top_k": {
                        "default_value": null,
                        "depends_on": [],
                        "display": "numeric",
                        "label": "Top K",
                        "order": 4,
                        "required": false,
                        "sensitive": false,
                        "tooltip": "Only available for anthropic, cohere, and mistral providers. Alternative to temperature.",
                        "type": "int",
                        "ui_restrictions": [],
                        "validations": [],
                        "value": null
                    },
                    "temperature": {
                        "default_value": null,
                        "depends_on": [],
                        "display": "numeric",
                        "label": "Temperature",
                        "order": 2,
                        "required": false,
                        "sensitive": false,
                        "tooltip": "A number between 0.0 and 1.0 that controls the apparent creativity of the results.",
                        "type": "int",
                        "ui_restrictions": [],
                        "validations": [],
                        "value": null
                    }
                }
            }
        ],
        "configuration": {
            "secret_key": {
                "default_value": null,
                "depends_on": [],
                "display": "textbox",
                "label": "Secret Key",
                "order": 2,
                "required": true,
                "sensitive": true,
                "tooltip": "A valid AWS secret key that is paired with the access_key.",
                "type": "str",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            },
            "provider": {
                "default_value": null,
                "depends_on": [],
                "display": "dropdown",
                "label": "Provider",
                "options": [
                    {
                        "label": "amazontitan",
                        "value": "amazontitan"
                    },
                    {
                        "label": "anthropic",
                        "value": "anthropic"
                    },
                    {
                        "label": "ai21labs",
                        "value": "ai21labs"
                    },
                    {
                        "label": "cohere",
                        "value": "cohere"
                    },
                    {
                        "label": "meta",
                        "value": "meta"
                    },
                    {
                        "label": "mistral",
                        "value": "mistral"
                    }
                ],
                "order": 3,
                "required": true,
                "sensitive": false,
                "tooltip": "The model provider for your deployment.",
                "type": "str",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            },
            "access_key": {
                "default_value": null,
                "depends_on": [],
                "display": "textbox",
                "label": "Access Key",
                "order": 1,
                "required": true,
                "sensitive": true,
                "tooltip": "A valid AWS access key that has permissions to use Amazon Bedrock.",
                "type": "str",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            },
            "model": {
                "default_value": null,
                "depends_on": [],
                "display": "textbox",
                "label": "Model",
                "order": 4,
                "required": true,
                "sensitive": false,
                "tooltip": "The base model ID or an ARN to a custom model based on a foundational model.",
                "type": "str",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            },
            "rate_limit.requests_per_minute": {
                "default_value": null,
                "depends_on": [],
                "display": "numeric",
                "label": "Rate Limit",
                "order": 6,
                "required": false,
                "sensitive": false,
                "tooltip": "By default, the amazonbedrock service sets the number of requests allowed per minute to 240.",
                "type": "int",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            },
            "region": {
                "default_value": null,
                "depends_on": [],
                "display": "textbox",
                "label": "Region",
                "order": 5,
                "required": true,
                "sensitive": false,
                "tooltip": "The region that your model or ARN is deployed in.",
                "type": "str",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            }
        }
    },
    {
        "provider": "elasticsearch",
        "task_types": [
            {
                "task_type": "text_embedding",
                "configuration": {}
            },
            {
                "task_type": "sparse_embedding",
                "configuration": {}
            },
            {
                "task_type": "rerank",
                "configuration": {
                    "return_documents": {
                        "default_value": null,
                        "depends_on": [],
                        "display": "toggle",
                        "label": "Return Documents",
                        "order": 1,
                        "required": false,
                        "sensitive": false,
                        "tooltip": "Returns the document instead of only the index.",
                        "type": "bool",
                        "ui_restrictions": [],
                        "validations": [],
                        "value": true
                    }
                }
            }
        ],
        "configuration": {
            "num_allocations": {
                "default_value": 1,
                "depends_on": [],
                "display": "numeric",
                "label": "Number Allocations",
                "order": 2,
                "required": true,
                "sensitive": false,
                "tooltip": "The total number of allocations this model is assigned across machine learning nodes.",
                "type": "int",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            },
            "num_threads": {
                "default_value": 2,
                "depends_on": [],
                "display": "numeric",
                "label": "Number Threads",
                "order": 3,
                "required": true,
                "sensitive": false,
                "tooltip": "Sets the number of threads used by each model allocation during inference.",
                "type": "int",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            },
            "model_id": {
                "default_value": ".multilingual-e5-small",
                "depends_on": [],
                "display": "dropdown",
                "label": "Model ID",
                "options": [
                    {
                        "label": ".elser_model_1",
                        "value": ".elser_model_1"
                    },
                    {
                        "label": ".elser_model_2",
                        "value": ".elser_model_2"
                    },
                    {
                        "label": ".elser_model_2_linux-x86_64",
                        "value": ".elser_model_2_linux-x86_64"
                    },
                    {
                        "label": ".multilingual-e5-small",
                        "value": ".multilingual-e5-small"
                    },
                    {
                        "label": ".multilingual-e5-small_linux-x86_64",
                        "value": ".multilingual-e5-small_linux-x86_64"
                    }
                ],
                "order": 1,
                "required": true,
                "sensitive": false,
                "tooltip": "The name of the model to use for the inference task.",
                "type": "str",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            }
        }
    },
    {
        "provider": "hugging_face_elser",
        "task_types": [
            {
                "task_type": "sparse_embedding",
                "configuration": {}
            }
        ],
        "configuration": {
            "api_key": {
                "default_value": null,
                "depends_on": [],
                "display": "textbox",
                "label": "API Key",
                "order": 1,
                "required": true,
                "sensitive": true,
                "tooltip": "API Key for the provider you're connecting to.",
                "type": "str",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            },
            "rate_limit.requests_per_minute": {
                "default_value": null,
                "depends_on": [],
                "display": "numeric",
                "label": "Rate Limit",
                "order": 6,
                "required": false,
                "sensitive": false,
                "tooltip": "Minimize the number of rate limit errors.",
                "type": "int",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            },
            "url": {
                "default_value": null,
                "depends_on": [],
                "display": "textbox",
                "label": "URL",
                "order": 1,
                "required": true,
                "sensitive": false,
                "tooltip": "The URL endpoint to use for the requests.",
                "type": "str",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            }
        }
    },
    {
        "provider": "anthropic",
        "task_types": [
            {
                "task_type": "completion",
                "configuration": {
                    "top_p": {
                        "default_value": null,
                        "depends_on": [],
                        "display": "numeric",
                        "label": "Top P",
                        "order": 4,
                        "required": false,
                        "sensitive": false,
                        "tooltip": "Specifies to use Anthropic’s nucleus sampling.",
                        "type": "int",
                        "ui_restrictions": [],
                        "validations": [],
                        "value": null
                    },
                    "max_tokens": {
                        "default_value": null,
                        "depends_on": [],
                        "display": "numeric",
                        "label": "Max Tokens",
                        "order": 1,
                        "required": true,
                        "sensitive": false,
                        "tooltip": "The maximum number of tokens to generate before stopping.",
                        "type": "int",
                        "ui_restrictions": [],
                        "validations": [],
                        "value": null
                    },
                    "top_k": {
                        "default_value": null,
                        "depends_on": [],
                        "display": "numeric",
                        "label": "Top K",
                        "order": 3,
                        "required": false,
                        "sensitive": false,
                        "tooltip": "Specifies to only sample from the top K options for each subsequent token.",
                        "type": "int",
                        "ui_restrictions": [],
                        "validations": [],
                        "value": null
                    },
                    "temperature": {
                        "default_value": null,
                        "depends_on": [],
                        "display": "textbox",
                        "label": "Temperature",
                        "order": 2,
                        "required": false,
                        "sensitive": false,
                        "tooltip": "The amount of randomness injected into the response.",
                        "type": "str",
                        "ui_restrictions": [],
                        "validations": [],
                        "value": null
                    }
                }
            }
        ],
        "configuration": {
            "api_key": {
                "default_value": null,
                "depends_on": [],
                "display": "textbox",
                "label": "API Key",
                "order": 1,
                "required": true,
                "sensitive": true,
                "tooltip": "API Key for the provider you're connecting to.",
                "type": "str",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            },
            "rate_limit.requests_per_minute": {
                "default_value": null,
                "depends_on": [],
                "display": "numeric",
                "label": "Rate Limit",
                "order": 6,
                "required": false,
                "sensitive": false,
                "tooltip": "By default, the anthropic service sets the number of requests allowed per minute to 50.",
                "type": "int",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            },
            "model_id": {
                "default_value": null,
                "depends_on": [],
                "display": "textbox",
                "label": "Model ID",
                "order": 2,
                "required": true,
                "sensitive": false,
                "tooltip": "The name of the model to use for the inference task.",
                "type": "str",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            }
        }
    },
    {
        "provider": "elastic",
        "task_types": [
            {
                "task_type": "sparse_embedding",
                "configuration": {}
            }
        ],
        "configuration": {
            "rate_limit.requests_per_minute": {
                "default_value": null,
                "depends_on": [],
                "display": "numeric",
                "label": "Rate Limit",
                "order": 6,
                "required": false,
                "sensitive": false,
                "tooltip": "Minimize the number of rate limit errors.",
                "type": "int",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            },
            "model_id": {
                "default_value": null,
                "depends_on": [],
                "display": "textbox",
                "label": "Model ID",
                "order": 2,
                "required": true,
                "sensitive": false,
                "tooltip": "The name of the model to use for the inference task.",
                "type": "str",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            },
            "max_input_tokens": {
                "default_value": null,
                "depends_on": [],
                "display": "numeric",
                "label": "Maximum Input Tokens",
                "order": 3,
                "required": false,
                "sensitive": false,
                "tooltip": "Allows you to specify the maximum number of tokens per input.",
                "type": "int",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            }
        }
    },
    {
        "provider": "watsonxai",
        "task_types": [
            {
                "task_type": "text_embedding",
                "configuration": {}
            }
        ],
        "configuration": {
            "project_id": {
                "default_value": null,
                "depends_on": [],
                "display": "textbox",
                "label": "Project ID",
                "order": 2,
                "required": true,
                "sensitive": false,
                "tooltip": "",
                "type": "str",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            },
            "model_id": {
                "default_value": null,
                "depends_on": [],
                "display": "textbox",
                "label": "Model ID",
                "order": 3,
                "required": true,
                "sensitive": false,
                "tooltip": "The name of the model to use for the inference task.",
                "type": "str",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            },
            "api_version": {
                "default_value": null,
                "depends_on": [],
                "display": "textbox",
                "label": "API Version",
                "order": 1,
                "required": true,
                "sensitive": false,
                "tooltip": "The IBM Watsonx API version ID to use.",
                "type": "str",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            },
            "max_input_tokens": {
                "default_value": null,
                "depends_on": [],
                "display": "numeric",
                "label": "Maximum Input Tokens",
                "order": 5,
                "required": false,
                "sensitive": false,
                "tooltip": "Allows you to specify the maximum number of tokens per input.",
                "type": "int",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            },
            "url": {
                "default_value": null,
                "depends_on": [],
                "display": "textbox",
                "label": "URL",
                "order": 4,
                "required": true,
                "sensitive": false,
                "tooltip": "",
                "type": "str",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            }
        }
    },
    {
        "provider": "hugging_face",
        "task_types": [
            {
                "task_type": "text_embedding",
                "configuration": {}
            },
            {
                "task_type": "sparse_embedding",
                "configuration": {}
            }
        ],
        "configuration": {
            "api_key": {
                "default_value": null,
                "depends_on": [],
                "display": "textbox",
                "label": "API Key",
                "order": 1,
                "required": true,
                "sensitive": true,
                "tooltip": "API Key for the provider you're connecting to.",
                "type": "str",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            },
            "rate_limit.requests_per_minute": {
                "default_value": null,
                "depends_on": [],
                "display": "numeric",
                "label": "Rate Limit",
                "order": 6,
                "required": false,
                "sensitive": false,
                "tooltip": "Minimize the number of rate limit errors.",
                "type": "int",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            },
            "url": {
                "default_value": "https://api.openai.com/v1/embeddings",
                "depends_on": [],
                "display": "textbox",
                "label": "URL",
                "order": 1,
                "required": true,
                "sensitive": false,
                "tooltip": "The URL endpoint to use for the requests.",
                "type": "str",
                "ui_restrictions": [],
                "validations": [],
                "value": "https://api.openai.com/v1/embeddings"
            }
        }
    },
    {
        "provider": "googleaistudio",
        "task_types": [
            {
                "task_type": "text_embedding",
                "configuration": {}
            },
            {
                "task_type": "completion",
                "configuration": {}
            }
        ],
        "configuration": {
            "api_key": {
                "default_value": null,
                "depends_on": [],
                "display": "textbox",
                "label": "API Key",
                "order": 1,
                "required": true,
                "sensitive": true,
                "tooltip": "API Key for the provider you're connecting to.",
                "type": "str",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            },
            "rate_limit.requests_per_minute": {
                "default_value": null,
                "depends_on": [],
                "display": "numeric",
                "label": "Rate Limit",
                "order": 6,
                "required": false,
                "sensitive": false,
                "tooltip": "Minimize the number of rate limit errors.",
                "type": "int",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            },
            "model_id": {
                "default_value": null,
                "depends_on": [],
                "display": "textbox",
                "label": "Model ID",
                "order": 2,
                "required": true,
                "sensitive": false,
                "tooltip": "ID of the LLM you're using.",
                "type": "str",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            }
        }
    },
    {
        "provider": "mistral",
        "task_types": [
            {
                "task_type": "text_embedding",
                "configuration": {}
            }
        ],
        "configuration": {
            "api_key": {
                "default_value": null,
                "depends_on": [],
                "display": "textbox",
                "label": "API Key",
                "order": 1,
                "required": true,
                "sensitive": true,
                "tooltip": "API Key for the provider you're connecting to.",
                "type": "str",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            },
            "model": {
                "default_value": null,
                "depends_on": [],
                "display": "textbox",
                "label": "Model",
                "order": 2,
                "required": true,
                "sensitive": false,
                "tooltip": "Refer to the Mistral models documentation for the list of available text embedding models.",
                "type": "str",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            },
            "rate_limit.requests_per_minute": {
                "default_value": null,
                "depends_on": [],
                "display": "numeric",
                "label": "Rate Limit",
                "order": 6,
                "required": false,
                "sensitive": false,
                "tooltip": "Minimize the number of rate limit errors.",
                "type": "int",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            },
            "max_input_tokens": {
                "default_value": null,
                "depends_on": [],
                "display": "numeric",
                "label": "Maximum Input Tokens",
                "order": 3,
                "required": false,
                "sensitive": false,
                "tooltip": "Allows you to specify the maximum number of tokens per input.",
                "type": "int",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            }
        }
    },
    {
        "provider": "alibabacloud-ai-search",
        "task_types": [
            {
                "task_type": "text_embedding",
                "configuration": {
                    "input_type": {
                        "default_value": null,
                        "depends_on": [],
                        "display": "dropdown",
                        "label": "Input Type",
                        "options": [
                            {
                                "label": "ingest",
                                "value": "ingest"
                            },
                            {
                                "label": "search",
                                "value": "search"
                            }
                        ],
                        "order": 1,
                        "required": false,
                        "sensitive": false,
                        "tooltip": "Specifies the type of input passed to the model.",
                        "type": "str",
                        "ui_restrictions": [],
                        "validations": [],
                        "value": ""
                    }
                }
            },
            {
                "task_type": "sparse_embedding",
                "configuration": {
                    "return_token": {
                        "default_value": null,
                        "depends_on": [],
                        "display": "toggle",
                        "label": "Return Token",
                        "order": 2,
                        "required": false,
                        "sensitive": false,
                        "tooltip": "If `true`, the token name will be returned in the response. Defaults to `false` which means only the token ID will be returned in the response.",
                        "type": "bool",
                        "ui_restrictions": [],
                        "validations": [],
                        "value": true
                    },
                    "input_type": {
                        "default_value": null,
                        "depends_on": [],
                        "display": "dropdown",
                        "label": "Input Type",
                        "options": [
                            {
                                "label": "ingest",
                                "value": "ingest"
                            },
                            {
                                "label": "search",
                                "value": "search"
                            }
                        ],
                        "order": 1,
                        "required": false,
                        "sensitive": false,
                        "tooltip": "Specifies the type of input passed to the model.",
                        "type": "str",
                        "ui_restrictions": [],
                        "validations": [],
                        "value": ""
                    }
                }
            },
            {
                "task_type": "rerank",
                "configuration": {}
            },
            {
                "task_type": "completion",
                "configuration": {}
            }
        ],
        "configuration": {
            "workspace": {
                "default_value": null,
                "depends_on": [],
                "display": "textbox",
                "label": "Workspace",
                "order": 5,
                "required": true,
                "sensitive": false,
                "tooltip": "The name of the workspace used for the {infer} task.",
                "type": "str",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            },
            "api_key": {
                "default_value": null,
                "depends_on": [],
                "display": "textbox",
                "label": "API Key",
                "order": 1,
                "required": true,
                "sensitive": true,
                "tooltip": "A valid API key for the AlibabaCloud AI Search API.",
                "type": "str",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            },
            "service_id": {
                "default_value": null,
                "depends_on": [],
                "display": "dropdown",
                "label": "Project ID",
                "options": [
                    {
                        "label": "ops-text-embedding-001",
                        "value": "ops-text-embedding-001"
                    },
                    {
                        "label": "ops-text-embedding-zh-001",
                        "value": "ops-text-embedding-zh-001"
                    },
                    {
                        "label": "ops-text-embedding-en-001",
                        "value": "ops-text-embedding-en-001"
                    },
                    {
                        "label": "ops-text-embedding-002",
                        "value": "ops-text-embedding-002"
                    },
                    {
                        "label": "ops-text-sparse-embedding-001",
                        "value": "ops-text-sparse-embedding-001"
                    },
                    {
                        "label": "ops-bge-reranker-larger",
                        "value": "ops-bge-reranker-larger"
                    }
                ],
                "order": 2,
                "required": true,
                "sensitive": false,
                "tooltip": "The name of the model service to use for the {infer} task.",
                "type": "str",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            },
            "host": {
                "default_value": null,
                "depends_on": [],
                "display": "textbox",
                "label": "Host",
                "order": 3,
                "required": true,
                "sensitive": false,
                "tooltip": "The name of the host address used for the {infer} task. You can find the host address at https://opensearch.console.aliyun.com/cn-shanghai/rag/api-key[ the API keys section] of the documentation.",
                "type": "str",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            },
            "rate_limit.requests_per_minute": {
                "default_value": null,
                "depends_on": [],
                "display": "numeric",
                "label": "Rate Limit",
                "order": 6,
                "required": false,
                "sensitive": false,
                "tooltip": "Minimize the number of rate limit errors.",
                "type": "int",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            },
            "http_schema": {
                "default_value": null,
                "depends_on": [],
                "display": "dropdown",
                "label": "HTTP Schema",
                "options": [
                    {
                        "label": "https",
                        "value": "https"
                    },
                    {
                        "label": "http",
                        "value": "http"
                    }
                ],
                "order": 4,
                "required": true,
                "sensitive": false,
                "tooltip": "",
                "type": "str",
                "ui_restrictions": [],
                "validations": [],
                "value": null
            }
        }
    }
]

@ymao1 ymao1 force-pushed the ml-api-get-services branch 4 times, most recently from c6b0074 to 774709a Compare October 22, 2024 19:18
@ymao1 ymao1 changed the title Ml api get services [Inference API] Add API to get configuration of inference services Oct 23, 2024
@ymao1 ymao1 self-assigned this Oct 23, 2024
import static org.elasticsearch.xpack.inference.rest.Paths.TASK_TYPE;
import static org.elasticsearch.xpack.inference.rest.Paths.TASK_TYPE_INFERENCE_SERVICES_PATH;

@ServerlessScope(Scope.INTERNAL)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I set this to internal but I'm not sure whether it should be public or not.

Choose a reason for hiding this comment

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

As long in will be possible to call it on Kibana side with esClient.transport.request. I don't see any reasons why it should be public for now. Also public APIs usually requires an extensive documentation and maintenance complexity.

@ymao1 ymao1 force-pushed the ml-api-get-services branch from 774709a to a0a37ad Compare October 23, 2024 12:30
@ymao1 ymao1 force-pushed the ml-api-get-services branch from a0a37ad to 82fd150 Compare October 23, 2024 13:07
@ymao1 ymao1 added >enhancement :ml Machine learning Team:ML Meta label for the ML team v8.17.0 auto-backport Automatically create backport pull requests when merged labels Oct 23, 2024
@elasticsearchmachine
Copy link
Collaborator

Hi @ymao1, I've created a changelog YAML for you.

@ymao1 ymao1 marked this pull request as ready for review October 23, 2024 14:38
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/ml-core (Team:ML)

@ymao1 ymao1 requested a review from YulNaumenko October 23, 2024 14:39
"text_embedding",
"completion"
],
"configuration": {
Copy link
Member

Choose a reason for hiding this comment

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

I think we may need to split up configuration into service_settings and task_settings? @YulNaumenko does that sound right?

For example, https://www.elastic.co/guide/en/elasticsearch/reference/current/infer-service-amazon-bedrock.html
Could be:

PUT _inference/completion/amazon_bedrock_completion
{
    "service": "amazonbedrock",
    "service_settings": {
        "access_key": "<aws_access_key>",
        "secret_key": "<aws_secret_key>",
        "region": "us-east-1",
        "provider": "amazontitan",
        "model": "amazon.titan-text-premier-v1:0"
    },
    "task_settings": {
        "temperature": 0.5,
        "top_p": 0.5
    }
}

Do we need to communicate back to the kibana connector? Or am I misunderstanding the configuration object?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe this is a separate issue: https://github.com/elastic/ml-team/issues/1308. Is that correct @YulNaumenko?

Copy link

@YulNaumenko YulNaumenko Oct 25, 2024

Choose a reason for hiding this comment

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

I think we can make it within the single request as @prwhelan suggested and that will help to avoid calling two separate APIs. I will need to change the Connector code to consume the new schema.
For example we can extend it by adding to each provider the taskTypes prop similar to what I requested as a separate API:

taskTypes: [
    {
          "task_type": string,
          "configuration": {
              category?: string;
              default_value: string | number | boolean | null;
              depends_on: Dependency[];
              display: DisplayType;
              label: string;
              options?: SelectOption[];
              order?: number | null;
              placeholder?: string;
              required: boolean;
              sensitive: boolean;
              tooltip: string | null;
              type: FieldType;
              ui_restrictions: string[];
              validations: Validation[];
              value: string | number | boolean | null;
       }
    }
  ]

@serenachou
Copy link
Contributor

dropping in to say that ya'll are the coolest, thanks @prwhelan and @YulNaumenko

@prwhelan
Copy link
Member

dropping in to say that ya'll are the coolest, thanks @prwhelan and @YulNaumenko

all credit goes to @ymao1

Copy link

@YulNaumenko YulNaumenko left a comment

Choose a reason for hiding this comment

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

LGTM! Tested locally, works as expected!

@ymao1 ymao1 merged commit 4ecdfbb into elastic:main Oct 30, 2024
16 checks passed
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

Status Branch Result
8.x Commit could not be cherrypicked due to conflicts

You can use sqren/backport to manually backport by running backport --upstream elastic/elasticsearch --pr 114862

@ymao1
Copy link
Contributor Author

ymao1 commented Oct 30, 2024

💚 All backports created successfully

Status Branch Result
8.x

Questions ?

Please refer to the Backport tool documentation

ymao1 added a commit to ymao1/elasticsearch that referenced this pull request Oct 30, 2024
…lastic#114862)

* Adding API to get list of service configurations

* Update docs/changelog/114862.yaml

* Fixing some configurations

* PR feedback -> Stream.of

* PR feedback -> singleton

* Renaming ServiceConfiguration to SettingsConfiguration. Adding TaskSettingsConfiguration

* Adding task type settings configuration to response

* PR feedback

(cherry picked from commit 4ecdfbb)

# Conflicts:
#	x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/alibabacloudsearch/AlibabaCloudSearchService.java
#	x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elastic/ElasticInferenceService.java
#	x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/services/alibabacloudsearch/AlibabaCloudSearchServiceTests.java
#	x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/services/amazonbedrock/AmazonBedrockServiceTests.java
#	x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/services/googlevertexai/GoogleVertexAiServiceTests.java
ymao1 added a commit that referenced this pull request Oct 30, 2024
…114862) (#115979)

* Adding API to get list of service configurations

* Update docs/changelog/114862.yaml

* Fixing some configurations

* PR feedback -> Stream.of

* PR feedback -> singleton

* Renaming ServiceConfiguration to SettingsConfiguration. Adding TaskSettingsConfiguration

* Adding task type settings configuration to response

* PR feedback

(cherry picked from commit 4ecdfbb)

# Conflicts:
#	x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/alibabacloudsearch/AlibabaCloudSearchService.java
#	x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elastic/ElasticInferenceService.java
#	x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/services/alibabacloudsearch/AlibabaCloudSearchServiceTests.java
#	x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/services/amazonbedrock/AmazonBedrockServiceTests.java
#	x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/services/googlevertexai/GoogleVertexAiServiceTests.java
@ymao1 ymao1 deleted the ml-api-get-services branch October 30, 2024 19:26
jfreden pushed a commit to jfreden/elasticsearch that referenced this pull request Nov 4, 2024
…lastic#114862)

* Adding API to get list of service configurations

* Update docs/changelog/114862.yaml

* Fixing some configurations

* PR feedback -> Stream.of

* PR feedback -> singleton

* Renaming ServiceConfiguration to SettingsConfiguration. Adding TaskSettingsConfiguration

* Adding task type settings configuration to response

* PR feedback
YulNaumenko added a commit to elastic/kibana that referenced this pull request Nov 12, 2024
…s ES API instead of hardcoded values. (#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.
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 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 added a commit to elastic/kibana 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
auto-backport Automatically create backport pull requests when merged backport pending >enhancement :ml Machine learning Team:ML Meta label for the ML team v8.17.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants