Skip to content

[ML] Exposing OpenAI URL field in services API #126638

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

Merged

Conversation

jonathan-buttner
Copy link
Contributor

This PR adds the url field to the services API for the openai service.

Fixes #126350

Testing

GET _inference/_services

Response

    {
        "service": "openai",
        "name": "OpenAI",
        "task_types": [
            "text_embedding",
            "completion",
            "chat_completion"
        ],
        "configurations": {
            "api_key": {
                "description": "The OpenAI API authentication key. For more details about generating OpenAI API keys, refer to the https://platform.openai.com/account/api-keys.",
                "label": "API Key",
                "required": true,
                "sensitive": true,
                "updatable": true,
                "type": "str",
                "supported_task_types": [
                    "text_embedding",
                    "completion",
                    "chat_completion"
                ]
            },
            "organization_id": {
                "description": "The unique identifier of your organization.",
                "label": "Organization ID",
                "required": false,
                "sensitive": false,
                "updatable": false,
                "type": "str",
                "supported_task_types": [
                    "text_embedding",
                    "completion",
                    "chat_completion"
                ]
            },
            "rate_limit.requests_per_minute": {
                "description": "Default number of requests allowed per minute. For text_embedding is 3000. For completion is 500.",
                "label": "Rate Limit",
                "required": false,
                "sensitive": false,
                "updatable": false,
                "type": "int",
                "supported_task_types": [
                    "text_embedding",
                    "completion",
                    "chat_completion"
                ]
            },
            "model_id": {
                "description": "The name of the model to use for the inference task.",
                "label": "Model ID",
                "required": true,
                "sensitive": false,
                "updatable": false,
                "type": "str",
                "supported_task_types": [
                    "text_embedding",
                    "completion",
                    "chat_completion"
                ]
            },
            "url": {
                "description": "The absolute URL of the external service to send requests to.",
                "label": "URL",
                "required": false,
                "sensitive": false,
                "updatable": false,
                "type": "str",
                "supported_task_types": [
                    "text_embedding",
                    "completion",
                    "chat_completion"
                ]
            },
            "dimensions": {
                "description": "The number of dimensions the resulting embeddings should have. For more information refer to https://platform.openai.com/docs/api-reference/embeddings/create#embeddings-create-dimensions.",
                "label": "Dimensions",
                "required": false,
                "sensitive": false,
                "updatable": false,
                "type": "int",
                "supported_task_types": [
                    "text_embedding"
                ]
            }
        }
    },

@jonathan-buttner jonathan-buttner added >non-issue :ml Machine learning Team:ML Meta label for the ML team auto-backport Automatically create backport pull requests when merged v8.19.0 v9.1.0 labels Apr 10, 2025
@jonathan-buttner jonathan-buttner marked this pull request as ready for review April 10, 2025 19:46
@elasticsearchmachine
Copy link
Collaborator

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

Copy link
Member

@davidkyle davidkyle left a comment

Choose a reason for hiding this comment

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

LGTM

@jonathan-buttner jonathan-buttner merged commit 39e594f into elastic:main Apr 11, 2025
17 checks passed
@jonathan-buttner jonathan-buttner deleted the ml-openai-expose-url-config branch April 11, 2025 12:26
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.x

jonathan-buttner added a commit to jonathan-buttner/elasticsearch that referenced this pull request Apr 11, 2025
* Adding url configuration field

* Fixing test
elasticsearchmachine pushed a commit that referenced this pull request Apr 11, 2025
* Adding url configuration field

* Fixing test
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 :ml Machine learning >non-issue Team:ML Meta label for the ML team v8.19.0 v9.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ML] OpenAI Inference Endpoint is missing URL parameter
3 participants