Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[8.x] [ML] Switching from _unified to _stream for the chat_completion…
… task type (elastic#210104) (elastic#210111) # Backport This will backport the following commits from `main` to `8.x`: - [[ML] Switching from _unified to _stream for the chat_completion task type (elastic#210104)](elastic#210104) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Jonathan Buttner","email":"56361221+jonathan-buttner@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-02-06T21:40:47Z","message":"[ML] Switching from _unified to _stream for the chat_completion task type (elastic#210104)\n\nThis PR switch the endpoint used for the `chat_completion` task type to\r\n`_stream`. Only the URL changes, the request and response format stay\r\nthe same. The `_stream` URL was introduced a couple verisons ago and is\r\nthe preferred route for interacting with `chat_completion`.\r\n\r\n### Testing\r\n\r\nSetup a pre-configured connector for security. Add this to your\r\n`config/kibana.dev.yml`\r\n\r\n```\r\nxpack.actions.preconfigured:\r\n my-inference-open-ai:\r\n name: Inference Preconfig Jon\r\n actionTypeId: .inference\r\n exposeConfig: true\r\n config:\r\n provider: 'openai'\r\n taskType: 'chat_completion'\r\n inferenceId: 'openai-chat_completion-123'\r\n providerConfig:\r\n rate_limit:\r\n requests_per_minute: 80000\r\n model_id: 'gpt-4o'\r\n url: https://api.openai.com/v1/chat/completions\r\n secrets:\r\n providerSecrets:\r\n api_key: '<api key>'\r\n```\r\n\r\nThen via the Connectors page, create an AI connector with the inference\r\nendpoint id set to `openai-chat_completion-123`\r\n\r\n\r\nhttps://github.com/user-attachments/assets/29d56d58-cd96-432f-9d13-460446d204a1","sha":"3a14752dad189a9702be1f108b14680e7d1fe9bc","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:ML","Feature:GenAI","backport:version","v8.18.0","v9.1.0","v8.19.0"],"title":"[ML] Switching from _unified to _stream for the chat_completion task type","number":210104,"url":"https://github.com/elastic/kibana/pull/210104","mergeCommit":{"message":"[ML] Switching from _unified to _stream for the chat_completion task type (elastic#210104)\n\nThis PR switch the endpoint used for the `chat_completion` task type to\r\n`_stream`. Only the URL changes, the request and response format stay\r\nthe same. The `_stream` URL was introduced a couple verisons ago and is\r\nthe preferred route for interacting with `chat_completion`.\r\n\r\n### Testing\r\n\r\nSetup a pre-configured connector for security. Add this to your\r\n`config/kibana.dev.yml`\r\n\r\n```\r\nxpack.actions.preconfigured:\r\n my-inference-open-ai:\r\n name: Inference Preconfig Jon\r\n actionTypeId: .inference\r\n exposeConfig: true\r\n config:\r\n provider: 'openai'\r\n taskType: 'chat_completion'\r\n inferenceId: 'openai-chat_completion-123'\r\n providerConfig:\r\n rate_limit:\r\n requests_per_minute: 80000\r\n model_id: 'gpt-4o'\r\n url: https://api.openai.com/v1/chat/completions\r\n secrets:\r\n providerSecrets:\r\n api_key: '<api key>'\r\n```\r\n\r\nThen via the Connectors page, create an AI connector with the inference\r\nendpoint id set to `openai-chat_completion-123`\r\n\r\n\r\nhttps://github.com/user-attachments/assets/29d56d58-cd96-432f-9d13-460446d204a1","sha":"3a14752dad189a9702be1f108b14680e7d1fe9bc"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.18","8.x"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/210104","number":210104,"mergeCommit":{"message":"[ML] Switching from _unified to _stream for the chat_completion task type (elastic#210104)\n\nThis PR switch the endpoint used for the `chat_completion` task type to\r\n`_stream`. Only the URL changes, the request and response format stay\r\nthe same. The `_stream` URL was introduced a couple verisons ago and is\r\nthe preferred route for interacting with `chat_completion`.\r\n\r\n### Testing\r\n\r\nSetup a pre-configured connector for security. Add this to your\r\n`config/kibana.dev.yml`\r\n\r\n```\r\nxpack.actions.preconfigured:\r\n my-inference-open-ai:\r\n name: Inference Preconfig Jon\r\n actionTypeId: .inference\r\n exposeConfig: true\r\n config:\r\n provider: 'openai'\r\n taskType: 'chat_completion'\r\n inferenceId: 'openai-chat_completion-123'\r\n providerConfig:\r\n rate_limit:\r\n requests_per_minute: 80000\r\n model_id: 'gpt-4o'\r\n url: https://api.openai.com/v1/chat/completions\r\n secrets:\r\n providerSecrets:\r\n api_key: '<api key>'\r\n```\r\n\r\nThen via the Connectors page, create an AI connector with the inference\r\nendpoint id set to `openai-chat_completion-123`\r\n\r\n\r\nhttps://github.com/user-attachments/assets/29d56d58-cd96-432f-9d13-460446d204a1","sha":"3a14752dad189a9702be1f108b14680e7d1fe9bc"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Jonathan Buttner <56361221+jonathan-buttner@users.noreply.github.com>
- Loading branch information