diff --git a/compiler/package-lock.json b/compiler/package-lock.json index 0b9414aa3a..75900ff11d 100644 --- a/compiler/package-lock.json +++ b/compiler/package-lock.json @@ -553,6 +553,7 @@ "integrity": "sha512-r0bBaXu5Swb05doFYO2kTWHMovJnNVbCsII0fhesM8bNRlLhXIuckley4a2DaD+vOdmm5G+zGkQZAPZsF80+YQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "undici-types": "~7.16.0" } @@ -631,6 +632,7 @@ "integrity": "sha512-ZohdsbXadjGBSK0/r+d87X0SBmKzOq4/S5nzK6SBgJspFo9/CUDJ7hjayuze+JK7CZQLDMroqytp7pOcFKTxZA==", "dev": true, "license": "BSD-2-Clause", + "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "4.33.0", "@typescript-eslint/types": "4.33.0", @@ -815,6 +817,7 @@ "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", "dev": true, "license": "MIT", + "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -2370,6 +2373,7 @@ "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@babel/code-frame": "7.12.11", "@eslint/eslintrc": "^0.4.3", @@ -2576,6 +2580,7 @@ "integrity": "sha512-ixmkI62Rbc2/w8Vfxyh1jQRTdRTF52VxwRVHl/ykPAmqG+Nb7/kNn+byLP0LxPgI7zWA16Jt82SybJInmMia3A==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@rtsao/scc": "^1.1.0", "array-includes": "^3.1.8", @@ -2667,6 +2672,7 @@ "integrity": "sha512-oUwtPJ1W0SKD0Tr+wqu92c5xuCeQqB3hSCHasn/ZgjFdA9iDGNkNf2Zi9ztY7X+hNuMib23LNGRm6+uN+KLE3g==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "eslint-plugin-es": "^3.0.0", "eslint-utils": "^2.0.0", @@ -2758,6 +2764,7 @@ "integrity": "sha512-SftLb1pUG01QYq2A/hGAWfDRXqYD82zE7j7TopDOyNdU+7SvvoXREls/+PRTY17vUXzXnZA/zfnyKgRH6x4JJw==", "dev": true, "license": "ISC", + "peer": true, "engines": { "node": "^10.12.0 || >=12.0.0" }, @@ -2771,6 +2778,7 @@ "integrity": "sha512-Qteup0SqU15kdocexFNAJMvCJEfa2xUKNV4CC1xsVMrIIqEy3SQ/rqyxCWNzfrd3/ldy6HMlD2e0JDVpDg2qIA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "array-includes": "^3.1.8", "array.prototype.findlast": "^1.2.5", @@ -5464,6 +5472,7 @@ "integrity": "sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg==", "dev": true, "license": "MIT", + "peer": true, "bin": { "prettier": "bin-prettier.js" }, @@ -6954,6 +6963,7 @@ "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", "dev": true, "license": "Apache-2.0", + "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" diff --git a/docs/examples/languageExamples.json b/docs/examples/languageExamples.json index 490cac4fb1..c70b2830ae 100644 --- a/docs/examples/languageExamples.json +++ b/docs/examples/languageExamples.json @@ -19192,5 +19192,49 @@ "language": "curl", "code": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"service\":\"fireworksai\",\"service_settings\":{\"api_key\":\"your-api-key\",\"model_id\":\"accounts/fireworks/models/deepseek-v3p1\"}}' \"$ELASTICSEARCH_URL/_inference/completion/my-fireworks-completion\"" } + ], + "specification/inference/chat_completion_unified/examples/request/PostChatCompletionRequestExample5.yaml": [ + { + "language": "Python", + "code": "resp = client.inference.chat_completion_unified(\n inference_id=\"reasoning-chat-completion\",\n chat_completion_request={\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Barber shaves all those, who do not shave themselves. Who shaves the barber?\"\n }\n ]\n },\n {\n \"role\": \"assistant\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"This is the barber paradox. Such a barber cannot logically exist.\"\n }\n ],\n \"reasoning\": \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"reasoning_details\": [\n {\n \"type\": \"reasoning.encrypted\",\n \"data\": \"[REDACTED]\"\n },\n {\n \"type\": \"reasoning.summary\",\n \"summary\": \"Barber shaving himself creates contradiction\"\n },\n {\n \"type\": \"reasoning.text\",\n \"text\": \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"signature\": \"sig_123\"\n }\n ]\n },\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"What if there are 2 barbers?\"\n }\n ]\n }\n ],\n \"reasoning\": {\n \"enabled\": True,\n \"summary\": \"detailed\",\n \"exclude\": False\n }\n },\n)" + }, + { + "language": "JavaScript", + "code": "const response = await client.inference.chatCompletionUnified({\n inference_id: \"reasoning-chat-completion\",\n chat_completion_request: {\n messages: [\n {\n role: \"user\",\n content: [\n {\n type: \"text\",\n text: \"Barber shaves all those, who do not shave themselves. Who shaves the barber?\",\n },\n ],\n },\n {\n role: \"assistant\",\n content: [\n {\n type: \"text\",\n text: \"This is the barber paradox. Such a barber cannot logically exist.\",\n },\n ],\n reasoning:\n \"If the barber shaves himself, he should not; if he does not, he should.\",\n reasoning_details: [\n {\n type: \"reasoning.encrypted\",\n data: \"[REDACTED]\",\n },\n {\n type: \"reasoning.summary\",\n summary: \"Barber shaving himself creates contradiction\",\n },\n {\n type: \"reasoning.text\",\n text: \"If the barber shaves himself, he should not; if he does not, he should.\",\n signature: \"sig_123\",\n },\n ],\n },\n {\n role: \"user\",\n content: [\n {\n type: \"text\",\n text: \"What if there are 2 barbers?\",\n },\n ],\n },\n ],\n reasoning: {\n enabled: true,\n summary: \"detailed\",\n exclude: false,\n },\n },\n});" + }, + { + "language": "Ruby", + "code": "response = client.inference.chat_completion_unified(\n inference_id: \"reasoning-chat-completion\",\n body: {\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Barber shaves all those, who do not shave themselves. Who shaves the barber?\"\n }\n ]\n },\n {\n \"role\": \"assistant\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"This is the barber paradox. Such a barber cannot logically exist.\"\n }\n ],\n \"reasoning\": \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"reasoning_details\": [\n {\n \"type\": \"reasoning.encrypted\",\n \"data\": \"[REDACTED]\"\n },\n {\n \"type\": \"reasoning.summary\",\n \"summary\": \"Barber shaving himself creates contradiction\"\n },\n {\n \"type\": \"reasoning.text\",\n \"text\": \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"signature\": \"sig_123\"\n }\n ]\n },\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"What if there are 2 barbers?\"\n }\n ]\n }\n ],\n \"reasoning\": {\n \"enabled\": true,\n \"summary\": \"detailed\",\n \"exclude\": false\n }\n }\n)" + }, + { + "language": "PHP", + "code": "$resp = $client->inference()->chatCompletionUnified([\n \"inference_id\" => \"reasoning-chat-completion\",\n \"body\" => [\n \"messages\" => array(\n [\n \"role\" => \"user\",\n \"content\" => array(\n [\n \"type\" => \"text\",\n \"text\" => \"Barber shaves all those, who do not shave themselves. Who shaves the barber?\",\n ],\n ),\n ],\n [\n \"role\" => \"assistant\",\n \"content\" => array(\n [\n \"type\" => \"text\",\n \"text\" => \"This is the barber paradox. Such a barber cannot logically exist.\",\n ],\n ),\n \"reasoning\" => \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"reasoning_details\" => array(\n [\n \"type\" => \"reasoning.encrypted\",\n \"data\" => \"[REDACTED]\",\n ],\n [\n \"type\" => \"reasoning.summary\",\n \"summary\" => \"Barber shaving himself creates contradiction\",\n ],\n [\n \"type\" => \"reasoning.text\",\n \"text\" => \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"signature\" => \"sig_123\",\n ],\n ),\n ],\n [\n \"role\" => \"user\",\n \"content\" => array(\n [\n \"type\" => \"text\",\n \"text\" => \"What if there are 2 barbers?\",\n ],\n ),\n ],\n ),\n \"reasoning\" => [\n \"enabled\" => true,\n \"summary\" => \"detailed\",\n \"exclude\" => false,\n ],\n ],\n]);" + }, + { + "language": "curl", + "code": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Barber shaves all those, who do not shave themselves. Who shaves the barber?\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"This is the barber paradox. Such a barber cannot logically exist.\"}],\"reasoning\":\"If the barber shaves himself, he should not; if he does not, he should.\",\"reasoning_details\":[{\"type\":\"reasoning.encrypted\",\"data\":\"[REDACTED]\"},{\"type\":\"reasoning.summary\",\"summary\":\"Barber shaving himself creates contradiction\"},{\"type\":\"reasoning.text\",\"text\":\"If the barber shaves himself, he should not; if he does not, he should.\",\"signature\":\"sig_123\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"What if there are 2 barbers?\"}]}],\"reasoning\":{\"enabled\":true,\"summary\":\"detailed\",\"exclude\":false}}' \"$ELASTICSEARCH_URL/_inference/chat_completion/reasoning-chat-completion/_stream\"" + } + ], + "specification/inference/chat_completion_unified/examples/request/PostChatCompletionRequestExample4.yaml": [ + { + "language": "Python", + "code": "resp = client.inference.chat_completion_unified(\n inference_id=\"reasoning-chat-completion\",\n chat_completion_request={\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Barber shaves all those, who do not shave themselves. Who shaves the barber?\"\n }\n ]\n },\n {\n \"role\": \"assistant\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"This is the barber paradox. Such a barber cannot logically exist.\"\n }\n ],\n \"reasoning\": \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"reasoning_details\": [\n {\n \"type\": \"reasoning.encrypted\",\n \"data\": \"[REDACTED]\"\n },\n {\n \"type\": \"reasoning.summary\",\n \"summary\": \"Barber shaving himself creates contradiction\"\n },\n {\n \"type\": \"reasoning.text\",\n \"text\": \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"signature\": \"sig_123\"\n }\n ]\n },\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"What if there are 2 barbers?\"\n }\n ]\n }\n ],\n \"reasoning\": {\n \"effort\": \"high\",\n \"summary\": \"detailed\",\n \"exclude\": False\n }\n },\n)" + }, + { + "language": "JavaScript", + "code": "const response = await client.inference.chatCompletionUnified({\n inference_id: \"reasoning-chat-completion\",\n chat_completion_request: {\n messages: [\n {\n role: \"user\",\n content: [\n {\n type: \"text\",\n text: \"Barber shaves all those, who do not shave themselves. Who shaves the barber?\",\n },\n ],\n },\n {\n role: \"assistant\",\n content: [\n {\n type: \"text\",\n text: \"This is the barber paradox. Such a barber cannot logically exist.\",\n },\n ],\n reasoning:\n \"If the barber shaves himself, he should not; if he does not, he should.\",\n reasoning_details: [\n {\n type: \"reasoning.encrypted\",\n data: \"[REDACTED]\",\n },\n {\n type: \"reasoning.summary\",\n summary: \"Barber shaving himself creates contradiction\",\n },\n {\n type: \"reasoning.text\",\n text: \"If the barber shaves himself, he should not; if he does not, he should.\",\n signature: \"sig_123\",\n },\n ],\n },\n {\n role: \"user\",\n content: [\n {\n type: \"text\",\n text: \"What if there are 2 barbers?\",\n },\n ],\n },\n ],\n reasoning: {\n effort: \"high\",\n summary: \"detailed\",\n exclude: false,\n },\n },\n});" + }, + { + "language": "Ruby", + "code": "response = client.inference.chat_completion_unified(\n inference_id: \"reasoning-chat-completion\",\n body: {\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Barber shaves all those, who do not shave themselves. Who shaves the barber?\"\n }\n ]\n },\n {\n \"role\": \"assistant\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"This is the barber paradox. Such a barber cannot logically exist.\"\n }\n ],\n \"reasoning\": \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"reasoning_details\": [\n {\n \"type\": \"reasoning.encrypted\",\n \"data\": \"[REDACTED]\"\n },\n {\n \"type\": \"reasoning.summary\",\n \"summary\": \"Barber shaving himself creates contradiction\"\n },\n {\n \"type\": \"reasoning.text\",\n \"text\": \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"signature\": \"sig_123\"\n }\n ]\n },\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"What if there are 2 barbers?\"\n }\n ]\n }\n ],\n \"reasoning\": {\n \"effort\": \"high\",\n \"summary\": \"detailed\",\n \"exclude\": false\n }\n }\n)" + }, + { + "language": "PHP", + "code": "$resp = $client->inference()->chatCompletionUnified([\n \"inference_id\" => \"reasoning-chat-completion\",\n \"body\" => [\n \"messages\" => array(\n [\n \"role\" => \"user\",\n \"content\" => array(\n [\n \"type\" => \"text\",\n \"text\" => \"Barber shaves all those, who do not shave themselves. Who shaves the barber?\",\n ],\n ),\n ],\n [\n \"role\" => \"assistant\",\n \"content\" => array(\n [\n \"type\" => \"text\",\n \"text\" => \"This is the barber paradox. Such a barber cannot logically exist.\",\n ],\n ),\n \"reasoning\" => \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"reasoning_details\" => array(\n [\n \"type\" => \"reasoning.encrypted\",\n \"data\" => \"[REDACTED]\",\n ],\n [\n \"type\" => \"reasoning.summary\",\n \"summary\" => \"Barber shaving himself creates contradiction\",\n ],\n [\n \"type\" => \"reasoning.text\",\n \"text\" => \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"signature\" => \"sig_123\",\n ],\n ),\n ],\n [\n \"role\" => \"user\",\n \"content\" => array(\n [\n \"type\" => \"text\",\n \"text\" => \"What if there are 2 barbers?\",\n ],\n ),\n ],\n ),\n \"reasoning\" => [\n \"effort\" => \"high\",\n \"summary\" => \"detailed\",\n \"exclude\" => false,\n ],\n ],\n]);" + }, + { + "language": "curl", + "code": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Barber shaves all those, who do not shave themselves. Who shaves the barber?\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"This is the barber paradox. Such a barber cannot logically exist.\"}],\"reasoning\":\"If the barber shaves himself, he should not; if he does not, he should.\",\"reasoning_details\":[{\"type\":\"reasoning.encrypted\",\"data\":\"[REDACTED]\"},{\"type\":\"reasoning.summary\",\"summary\":\"Barber shaving himself creates contradiction\"},{\"type\":\"reasoning.text\",\"text\":\"If the barber shaves himself, he should not; if he does not, he should.\",\"signature\":\"sig_123\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"What if there are 2 barbers?\"}]}],\"reasoning\":{\"effort\":\"high\",\"summary\":\"detailed\",\"exclude\":false}}' \"$ELASTICSEARCH_URL/_inference/chat_completion/reasoning-chat-completion/_stream\"" + } ] } \ No newline at end of file diff --git a/docs/examples/package-lock.json b/docs/examples/package-lock.json index c994302164..35e64b8589 100644 --- a/docs/examples/package-lock.json +++ b/docs/examples/package-lock.json @@ -157,6 +157,7 @@ "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.9.0.tgz", "integrity": "sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg==", "license": "Apache-2.0", + "peer": true, "engines": { "node": ">=8.0.0" } @@ -1009,6 +1010,7 @@ "integrity": "sha512-c3Q2VVkGAUyupsjRnaNX6u8Dq2vAdzm9iuPj5FW0fRxzlxgq9Q39MDq10IvmQSpLgHQNyQzQmOo6bgGHmH3NNg==", "hasInstallScript": true, "license": "MIT", + "peer": true, "funding": { "type": "opencollective", "url": "https://opencollective.com/core-js" @@ -1778,6 +1780,7 @@ "resolved": "https://registry.npmjs.org/jsep/-/jsep-1.4.0.tgz", "integrity": "sha512-B7qPcEVE3NVkmSJbaYxvv4cHkVW7DQsZz13pUMrfS8z8Q/BuShN+gcTXrUlPiGqM2/t/EEaI030bpxMqY8gMlw==", "license": "MIT", + "peer": true, "engines": { "node": ">= 10.16.0" } @@ -1963,6 +1966,7 @@ "resolved": "https://registry.npmjs.org/mobx/-/mobx-6.15.0.tgz", "integrity": "sha512-UczzB+0nnwGotYSgllfARAqWCJ5e/skuV2K/l+Zyck/H6pJIhLXuBnz+6vn2i211o7DtbE78HQtsYEKICHGI+g==", "license": "MIT", + "peer": true, "funding": { "type": "opencollective", "url": "https://opencollective.com/mobx" @@ -2487,6 +2491,7 @@ "resolved": "https://registry.npmjs.org/react/-/react-19.2.0.tgz", "integrity": "sha512-tmbWg6W31tQLeB5cdIBOicJDJRR2KzXsV7uSK9iNfLWQ5bIZfxuPEHp7M8wiHyHnn0DD1i7w3Zmin0FtkrwoCQ==", "license": "MIT", + "peer": true, "engines": { "node": ">=0.10.0" } @@ -2496,6 +2501,7 @@ "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.0.tgz", "integrity": "sha512-UlbRu4cAiGaIewkPyiRGJk0imDN2T3JjieT6spoL2UeSf5od4n5LB/mQ4ejmxhCFT1tYe8IvaFulzynWovsEFQ==", "license": "MIT", + "peer": true, "dependencies": { "scheduler": "^0.27.0" }, @@ -2842,6 +2848,7 @@ "resolved": "https://registry.npmjs.org/styled-components/-/styled-components-6.1.19.tgz", "integrity": "sha512-1v/e3Dl1BknC37cXMhwGomhO8AkYmN41CqyX9xhUDxry1ns3BFQy2lLDRQXJRdVVWB9OHemv/53xaStimvWyuA==", "license": "MIT", + "peer": true, "dependencies": { "@emotion/is-prop-valid": "1.2.2", "@emotion/unitless": "0.8.1", diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index 07e318a077..e4b4fad08f 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -105172,8 +105172,15 @@ "type": "object", "properties": { "user": { - "description": "For a `completion`, `chat_completion` or `text_embedding` task, specify the user issuing the request.\nThis information can be used for abuse detection.", + "description": "Specifies the user issuing the request.\nThis information can be used for abuse detection.", "type": "string" + }, + "headers": { + "description": "Specifies custom HTTP header parameters.\nFor example:\n```\n\"headers\": {\n \"Custom-Header\": \"Some-Value\",\n \"Another-Custom-Header\": \"Another-Value\"\n}\n```", + "type": "object", + "additionalProperties": { + "type": "string" + } } } }, @@ -105484,16 +105491,25 @@ "type": "number" }, "headers": { - "description": "Specifies the HTTP header parameters – such as `Authentication` or `Content-Type` – that are required to access the custom service.\nFor example:\n```\n\"headers\":{\n \"Authorization\": \"Bearer ${api_key}\",\n \"Content-Type\": \"application/json;charset=utf-8\"\n}\n```", - "type": "object" + "description": "Specifies the HTTP header parameters – such as `Authentication` or `Content-Type` – that are required to access the custom service.\nFor example:\n```\n\"headers\": {\n \"Authorization\": \"Bearer ${api_key}\",\n \"Content-Type\": \"application/json;charset=utf-8\"\n}\n```", + "type": "object", + "additionalProperties": { + "type": "string" + } }, "input_type": { "description": "Specifies the input type translation values that are used to replace the `${input_type}` template in the request body.\nFor example:\n```\n\"input_type\": {\n \"translation\": {\n \"ingest\": \"do_ingest\",\n \"search\": \"do_search\"\n },\n \"default\": \"a_default\"\n},\n```\nIf the subsequent inference requests come from a search context, the `search` key will be used and the template will be replaced with `do_search`.\nIf it comes from the ingest context `do_ingest` is used. If it's a different context that is not specified, the default value will be used. If no default is specified an empty string is used.\n`translation` can be:\n* `classification`\n* `clustering`\n* `ingest`\n* `search`", - "type": "object" + "type": "object", + "additionalProperties": { + "type": "string" + } }, "query_parameters": { "description": "Specifies the query parameters as a list of tuples. The arrays inside the `query_parameters` must have two items, a key and a value.\nFor example:\n```\n\"query_parameters\":[\n [\"param_key\", \"some_value\"],\n [\"param_key\", \"another_value\"],\n [\"other_key\", \"other_value\"]\n]\n```\nIf the base url is `https://www.elastic.co` it results in: `https://www.elastic.co?param_key=some_value¶m_key=another_value&other_key=other_value`.", - "type": "object" + "type": "array", + "items": { + "$ref": "#/components/schemas/inference._types.CustomServiceQueryParameter" + } }, "request": { "description": "The request configuration object.", @@ -105513,7 +105529,10 @@ }, "secret_parameters": { "description": "Specifies secret parameters, like `api_key` or `api_token`, that are required to access the custom service.\nFor example:\n```\n\"secret_parameters\":{\n \"api_key\":\"\"\n}\n```", - "type": "object" + "type": "object", + "additionalProperties": { + "type": "string" + } }, "url": { "description": "The URL endpoint to use for the requests.", @@ -105526,6 +105545,12 @@ "secret_parameters" ] }, + "inference._types.CustomServiceQueryParameter": { + "type": "array", + "items": { + "type": "string" + } + }, "inference._types.CustomRequestParams": { "type": "object", "properties": { @@ -105543,7 +105568,10 @@ "properties": { "json_parser": { "description": "Specifies the JSON parser that is used to parse the response from the custom service.\nDifferent task types require different json_parser parameters.\nFor example:\n```\n# text_embedding\n# For a response like this:\n\n{\n \"object\": \"list\",\n \"data\": [\n {\n \"object\": \"embedding\",\n \"index\": 0,\n \"embedding\": [\n 0.014539449,\n -0.015288644\n ]\n }\n ],\n \"model\": \"text-embedding-ada-002-v2\",\n \"usage\": {\n \"prompt_tokens\": 8,\n \"total_tokens\": 8\n }\n}\n\n# the json_parser definition should look like this:\n\n\"response\":{\n \"json_parser\":{\n \"text_embeddings\":\"$.data[*].embedding[*]\"\n }\n}\n\n# Elasticsearch supports the following embedding types:\n* float\n* byte\n* bit (or binary)\n\nTo specify the embedding type for the response, the `embedding_type`\nfield should be added in the `json_parser` object. Here's an example:\n\"response\":{\n \"json_parser\":{\n \"text_embeddings\":\"$.data[*].embedding[*]\",\n \"embedding_type\":\"bit\"\n }\n}\n\nIf `embedding_type` is not specified, it defaults to `float`.\n\n# sparse_embedding\n# For a response like this:\n\n{\n \"request_id\": \"75C50B5B-E79E-4930-****-F48DBB392231\",\n \"latency\": 22,\n \"usage\": {\n \"token_count\": 11\n },\n \"result\": {\n \"sparse_embeddings\": [\n {\n \"index\": 0,\n \"embedding\": [\n {\n \"token_id\": 6,\n \"weight\": 0.101\n },\n {\n \"token_id\": 163040,\n \"weight\": 0.28417\n }\n ]\n }\n ]\n }\n}\n\n# the json_parser definition should look like this:\n\n\"response\":{\n \"json_parser\":{\n \"token_path\":\"$.result.sparse_embeddings[*].embedding[*].token_id\",\n \"weight_path\":\"$.result.sparse_embeddings[*].embedding[*].weight\"\n }\n}\n\n# rerank\n# For a response like this:\n\n{\n \"results\": [\n {\n \"index\": 3,\n \"relevance_score\": 0.999071,\n \"document\": \"abc\"\n },\n {\n \"index\": 4,\n \"relevance_score\": 0.7867867,\n \"document\": \"123\"\n },\n {\n \"index\": 0,\n \"relevance_score\": 0.32713068,\n \"document\": \"super\"\n }\n ],\n}\n\n# the json_parser definition should look like this:\n\n\"response\":{\n \"json_parser\":{\n \"reranked_index\":\"$.result.scores[*].index\", // optional\n \"relevance_score\":\"$.result.scores[*].score\",\n \"document_text\":\"xxx\" // optional\n }\n}\n\n# completion\n# For a response like this:\n\n{\n \"id\": \"chatcmpl-B9MBs8CjcvOU2jLn4n570S5qMJKcT\",\n \"object\": \"chat.completion\",\n \"created\": 1741569952,\n \"model\": \"gpt-4.1-2025-04-14\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"Hello! How can I assist you today?\",\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ]\n}\n\n# the json_parser definition should look like this:\n\n\"response\":{\n \"json_parser\":{\n \"completion_result\":\"$.choices[*].message.content\"\n }\n}", - "type": "object" + "type": "object", + "additionalProperties": { + "type": "string" + } } }, "required": [ @@ -105555,10 +105583,32 @@ "properties": { "parameters": { "description": "Specifies parameters that are required to run the custom service. The parameters depend on the model your custom service uses.\nFor example:\n```\n\"task_settings\":{\n \"parameters\":{\n \"input_type\":\"query\",\n \"return_token\":true\n }\n}\n```", - "type": "object" + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/inference._types.CustomTaskParameter" + } } } }, + "inference._types.CustomTaskParameter": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "number" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, "inference._types.InferenceEndpointInfoCustom": { "allOf": [ { @@ -105940,8 +105990,11 @@ "type": "string" }, "headers": { - "description": "For a `completion` or`chat_completion` task. Specifies custom HTTP header parameters.\nFor example:\n```\n\"headers\":{\n \"Custom-Header\": \"Some-Value\",\n \"Another-Custom-Header\": \"Another-Value\"\n}\n```", - "type": "object" + "description": "For a `completion` or`chat_completion` task. Specifies custom HTTP header parameters.\nFor example:\n```\n\"headers\": {\n \"Custom-Header\": \"Some-Value\",\n \"Another-Custom-Header\": \"Another-Value\"\n}\n```", + "type": "object", + "additionalProperties": { + "type": "string" + } } } }, @@ -106952,12 +107005,15 @@ "type": "object", "properties": { "user": { - "description": "For a `completion`, `chat_completion`, or `text_embedding` task, specify the user issuing the request.\nThis information can be used for abuse detection.", + "description": "Specifies the user issuing the request.\nThis information can be used for abuse detection.", "type": "string" }, "headers": { - "description": "Specifies custom HTTP header parameters.\nFor example:\n```\n\"headers\":{\n \"Custom-Header\": \"Some-Value\",\n \"Another-Custom-Header\": \"Another-Value\"\n}\n```", - "type": "object" + "description": "Specifies custom HTTP header parameters.\nFor example:\n```\n\"headers\": {\n \"Custom-Header\": \"Some-Value\",\n \"Another-Custom-Header\": \"Another-Value\"\n}\n```", + "type": "object", + "additionalProperties": { + "type": "string" + } } } }, diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index af4bb8b0ca..05039cd708 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -69017,8 +69017,15 @@ "type": "object", "properties": { "user": { - "description": "For a `completion`, `chat_completion` or `text_embedding` task, specify the user issuing the request.\nThis information can be used for abuse detection.", + "description": "Specifies the user issuing the request.\nThis information can be used for abuse detection.", "type": "string" + }, + "headers": { + "description": "Specifies custom HTTP header parameters.\nFor example:\n```\n\"headers\": {\n \"Custom-Header\": \"Some-Value\",\n \"Another-Custom-Header\": \"Another-Value\"\n}\n```", + "type": "object", + "additionalProperties": { + "type": "string" + } } } }, @@ -69329,16 +69336,25 @@ "type": "number" }, "headers": { - "description": "Specifies the HTTP header parameters – such as `Authentication` or `Content-Type` – that are required to access the custom service.\nFor example:\n```\n\"headers\":{\n \"Authorization\": \"Bearer ${api_key}\",\n \"Content-Type\": \"application/json;charset=utf-8\"\n}\n```", - "type": "object" + "description": "Specifies the HTTP header parameters – such as `Authentication` or `Content-Type` – that are required to access the custom service.\nFor example:\n```\n\"headers\": {\n \"Authorization\": \"Bearer ${api_key}\",\n \"Content-Type\": \"application/json;charset=utf-8\"\n}\n```", + "type": "object", + "additionalProperties": { + "type": "string" + } }, "input_type": { "description": "Specifies the input type translation values that are used to replace the `${input_type}` template in the request body.\nFor example:\n```\n\"input_type\": {\n \"translation\": {\n \"ingest\": \"do_ingest\",\n \"search\": \"do_search\"\n },\n \"default\": \"a_default\"\n},\n```\nIf the subsequent inference requests come from a search context, the `search` key will be used and the template will be replaced with `do_search`.\nIf it comes from the ingest context `do_ingest` is used. If it's a different context that is not specified, the default value will be used. If no default is specified an empty string is used.\n`translation` can be:\n* `classification`\n* `clustering`\n* `ingest`\n* `search`", - "type": "object" + "type": "object", + "additionalProperties": { + "type": "string" + } }, "query_parameters": { "description": "Specifies the query parameters as a list of tuples. The arrays inside the `query_parameters` must have two items, a key and a value.\nFor example:\n```\n\"query_parameters\":[\n [\"param_key\", \"some_value\"],\n [\"param_key\", \"another_value\"],\n [\"other_key\", \"other_value\"]\n]\n```\nIf the base url is `https://www.elastic.co` it results in: `https://www.elastic.co?param_key=some_value¶m_key=another_value&other_key=other_value`.", - "type": "object" + "type": "array", + "items": { + "$ref": "#/components/schemas/inference._types.CustomServiceQueryParameter" + } }, "request": { "description": "The request configuration object.", @@ -69358,7 +69374,10 @@ }, "secret_parameters": { "description": "Specifies secret parameters, like `api_key` or `api_token`, that are required to access the custom service.\nFor example:\n```\n\"secret_parameters\":{\n \"api_key\":\"\"\n}\n```", - "type": "object" + "type": "object", + "additionalProperties": { + "type": "string" + } }, "url": { "description": "The URL endpoint to use for the requests.", @@ -69371,6 +69390,12 @@ "secret_parameters" ] }, + "inference._types.CustomServiceQueryParameter": { + "type": "array", + "items": { + "type": "string" + } + }, "inference._types.CustomRequestParams": { "type": "object", "properties": { @@ -69388,7 +69413,10 @@ "properties": { "json_parser": { "description": "Specifies the JSON parser that is used to parse the response from the custom service.\nDifferent task types require different json_parser parameters.\nFor example:\n```\n# text_embedding\n# For a response like this:\n\n{\n \"object\": \"list\",\n \"data\": [\n {\n \"object\": \"embedding\",\n \"index\": 0,\n \"embedding\": [\n 0.014539449,\n -0.015288644\n ]\n }\n ],\n \"model\": \"text-embedding-ada-002-v2\",\n \"usage\": {\n \"prompt_tokens\": 8,\n \"total_tokens\": 8\n }\n}\n\n# the json_parser definition should look like this:\n\n\"response\":{\n \"json_parser\":{\n \"text_embeddings\":\"$.data[*].embedding[*]\"\n }\n}\n\n# Elasticsearch supports the following embedding types:\n* float\n* byte\n* bit (or binary)\n\nTo specify the embedding type for the response, the `embedding_type`\nfield should be added in the `json_parser` object. Here's an example:\n\"response\":{\n \"json_parser\":{\n \"text_embeddings\":\"$.data[*].embedding[*]\",\n \"embedding_type\":\"bit\"\n }\n}\n\nIf `embedding_type` is not specified, it defaults to `float`.\n\n# sparse_embedding\n# For a response like this:\n\n{\n \"request_id\": \"75C50B5B-E79E-4930-****-F48DBB392231\",\n \"latency\": 22,\n \"usage\": {\n \"token_count\": 11\n },\n \"result\": {\n \"sparse_embeddings\": [\n {\n \"index\": 0,\n \"embedding\": [\n {\n \"token_id\": 6,\n \"weight\": 0.101\n },\n {\n \"token_id\": 163040,\n \"weight\": 0.28417\n }\n ]\n }\n ]\n }\n}\n\n# the json_parser definition should look like this:\n\n\"response\":{\n \"json_parser\":{\n \"token_path\":\"$.result.sparse_embeddings[*].embedding[*].token_id\",\n \"weight_path\":\"$.result.sparse_embeddings[*].embedding[*].weight\"\n }\n}\n\n# rerank\n# For a response like this:\n\n{\n \"results\": [\n {\n \"index\": 3,\n \"relevance_score\": 0.999071,\n \"document\": \"abc\"\n },\n {\n \"index\": 4,\n \"relevance_score\": 0.7867867,\n \"document\": \"123\"\n },\n {\n \"index\": 0,\n \"relevance_score\": 0.32713068,\n \"document\": \"super\"\n }\n ],\n}\n\n# the json_parser definition should look like this:\n\n\"response\":{\n \"json_parser\":{\n \"reranked_index\":\"$.result.scores[*].index\", // optional\n \"relevance_score\":\"$.result.scores[*].score\",\n \"document_text\":\"xxx\" // optional\n }\n}\n\n# completion\n# For a response like this:\n\n{\n \"id\": \"chatcmpl-B9MBs8CjcvOU2jLn4n570S5qMJKcT\",\n \"object\": \"chat.completion\",\n \"created\": 1741569952,\n \"model\": \"gpt-4.1-2025-04-14\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"Hello! How can I assist you today?\",\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ]\n}\n\n# the json_parser definition should look like this:\n\n\"response\":{\n \"json_parser\":{\n \"completion_result\":\"$.choices[*].message.content\"\n }\n}", - "type": "object" + "type": "object", + "additionalProperties": { + "type": "string" + } } }, "required": [ @@ -69400,10 +69428,32 @@ "properties": { "parameters": { "description": "Specifies parameters that are required to run the custom service. The parameters depend on the model your custom service uses.\nFor example:\n```\n\"task_settings\":{\n \"parameters\":{\n \"input_type\":\"query\",\n \"return_token\":true\n }\n}\n```", - "type": "object" + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/inference._types.CustomTaskParameter" + } } } }, + "inference._types.CustomTaskParameter": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "number" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, "inference._types.InferenceEndpointInfoCustom": { "allOf": [ { @@ -69785,8 +69835,11 @@ "type": "string" }, "headers": { - "description": "For a `completion` or`chat_completion` task. Specifies custom HTTP header parameters.\nFor example:\n```\n\"headers\":{\n \"Custom-Header\": \"Some-Value\",\n \"Another-Custom-Header\": \"Another-Value\"\n}\n```", - "type": "object" + "description": "For a `completion` or`chat_completion` task. Specifies custom HTTP header parameters.\nFor example:\n```\n\"headers\": {\n \"Custom-Header\": \"Some-Value\",\n \"Another-Custom-Header\": \"Another-Value\"\n}\n```", + "type": "object", + "additionalProperties": { + "type": "string" + } } } }, @@ -70797,12 +70850,15 @@ "type": "object", "properties": { "user": { - "description": "For a `completion`, `chat_completion`, or `text_embedding` task, specify the user issuing the request.\nThis information can be used for abuse detection.", + "description": "Specifies the user issuing the request.\nThis information can be used for abuse detection.", "type": "string" }, "headers": { - "description": "Specifies custom HTTP header parameters.\nFor example:\n```\n\"headers\":{\n \"Custom-Header\": \"Some-Value\",\n \"Another-Custom-Header\": \"Another-Value\"\n}\n```", - "type": "object" + "description": "Specifies custom HTTP header parameters.\nFor example:\n```\n\"headers\": {\n \"Custom-Header\": \"Some-Value\",\n \"Another-Custom-Header\": \"Another-Value\"\n}\n```", + "type": "object", + "additionalProperties": { + "type": "string" + } } } }, diff --git a/output/schema/schema.json b/output/schema/schema.json index 7414f05495..e8f347720a 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -177371,7 +177371,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L134-L151" + "specLocation": "inference/_types/CommonTypes.ts#L135-L152" }, { "kind": "interface", @@ -177421,7 +177421,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L647-L670" + "specLocation": "inference/_types/CommonTypes.ts#L648-L671" }, { "kind": "enum", @@ -177434,7 +177434,7 @@ "name": "Ai21ServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L677-L679" + "specLocation": "inference/_types/CommonTypes.ts#L678-L680" }, { "kind": "enum", @@ -177450,7 +177450,7 @@ "name": "Ai21TaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L672-L675" + "specLocation": "inference/_types/CommonTypes.ts#L673-L676" }, { "kind": "interface", @@ -177522,7 +177522,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L681-L726" + "specLocation": "inference/_types/CommonTypes.ts#L682-L727" }, { "kind": "enum", @@ -177535,7 +177535,7 @@ "name": "AlibabaCloudServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L751-L753" + "specLocation": "inference/_types/CommonTypes.ts#L752-L754" }, { "kind": "interface", @@ -177569,7 +177569,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L728-L742" + "specLocation": "inference/_types/CommonTypes.ts#L729-L743" }, { "kind": "enum", @@ -177591,7 +177591,7 @@ "name": "AlibabaCloudTaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L744-L749" + "specLocation": "inference/_types/CommonTypes.ts#L745-L750" }, { "kind": "interface", @@ -177679,7 +177679,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L755-L797" + "specLocation": "inference/_types/CommonTypes.ts#L756-L798" }, { "kind": "enum", @@ -177692,7 +177692,7 @@ "name": "AmazonBedrockServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L831-L833" + "specLocation": "inference/_types/CommonTypes.ts#L832-L834" }, { "kind": "interface", @@ -177751,7 +177751,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L799-L823" + "specLocation": "inference/_types/CommonTypes.ts#L800-L824" }, { "kind": "enum", @@ -177770,7 +177770,7 @@ "name": "AmazonBedrockTaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L825-L829" + "specLocation": "inference/_types/CommonTypes.ts#L826-L830" }, { "kind": "enum", @@ -177786,7 +177786,7 @@ "name": "AmazonSageMakerApi", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L891-L894" + "specLocation": "inference/_types/CommonTypes.ts#L892-L895" }, { "kind": "interface", @@ -177929,7 +177929,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L835-L889" + "specLocation": "inference/_types/CommonTypes.ts#L836-L890" }, { "kind": "enum", @@ -177942,7 +177942,7 @@ "name": "AmazonSageMakerServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L974-L976" + "specLocation": "inference/_types/CommonTypes.ts#L975-L977" }, { "kind": "interface", @@ -178022,7 +178022,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L925-L954" + "specLocation": "inference/_types/CommonTypes.ts#L926-L955" }, { "kind": "interface", @@ -178069,7 +178069,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L978-L994" + "specLocation": "inference/_types/CommonTypes.ts#L979-L995" }, { "kind": "enum", @@ -178082,7 +178082,7 @@ "name": "AnthropicServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1027-L1029" + "specLocation": "inference/_types/CommonTypes.ts#L1028-L1030" }, { "kind": "interface", @@ -178142,7 +178142,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L996-L1021" + "specLocation": "inference/_types/CommonTypes.ts#L997-L1022" }, { "kind": "enum", @@ -178155,7 +178155,7 @@ "name": "AnthropicTaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1023-L1025" + "specLocation": "inference/_types/CommonTypes.ts#L1024-L1026" }, { "kind": "interface", @@ -178229,7 +178229,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L1031-L1071" + "specLocation": "inference/_types/CommonTypes.ts#L1032-L1072" }, { "kind": "enum", @@ -178242,7 +178242,7 @@ "name": "AzureAiStudioServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1118-L1120" + "specLocation": "inference/_types/CommonTypes.ts#L1119-L1121" }, { "kind": "interface", @@ -178337,7 +178337,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L1073-L1110" + "specLocation": "inference/_types/CommonTypes.ts#L1074-L1111" }, { "kind": "enum", @@ -178356,7 +178356,7 @@ "name": "AzureAiStudioTaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1112-L1116" + "specLocation": "inference/_types/CommonTypes.ts#L1113-L1117" }, { "kind": "interface", @@ -178448,7 +178448,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L1122-L1165" + "specLocation": "inference/_types/CommonTypes.ts#L1123-L1166" }, { "kind": "enum", @@ -178461,7 +178461,7 @@ "name": "AzureOpenAIServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1181-L1183" + "specLocation": "inference/_types/CommonTypes.ts#L1193-L1195" }, { "kind": "interface", @@ -178471,7 +178471,7 @@ }, "properties": [ { - "description": "For a `completion`, `chat_completion` or `text_embedding` task, specify the user issuing the request.\nThis information can be used for abuse detection.", + "description": "Specifies the user issuing the request.\nThis information can be used for abuse detection.", "name": "user", "required": false, "type": { @@ -178481,9 +178481,32 @@ "namespace": "_builtins" } } + }, + { + "description": "Specifies custom HTTP header parameters.\nFor example:\n```\n\"headers\": {\n \"Custom-Header\": \"Some-Value\",\n \"Another-Custom-Header\": \"Another-Value\"\n}\n```", + "name": "headers", + "required": false, + "type": { + "kind": "dictionary_of", + "key": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + }, + "singleKey": false, + "value": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } } ], - "specLocation": "inference/_types/CommonTypes.ts#L1167-L1173" + "specLocation": "inference/_types/CommonTypes.ts#L1168-L1185" }, { "kind": "enum", @@ -178502,7 +178525,7 @@ "name": "AzureOpenAITaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1175-L1179" + "specLocation": "inference/_types/CommonTypes.ts#L1187-L1191" }, { "kind": "interface", @@ -178549,7 +178572,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L404-L421" + "specLocation": "inference/_types/CommonTypes.ts#L405-L422" }, { "kind": "enum", @@ -178574,7 +178597,7 @@ "name": "CohereEmbeddingType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1236-L1242" + "specLocation": "inference/_types/CommonTypes.ts#L1248-L1254" }, { "kind": "enum", @@ -178596,7 +178619,7 @@ "name": "CohereInputType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1244-L1249" + "specLocation": "inference/_types/CommonTypes.ts#L1256-L1261" }, { "kind": "interface", @@ -178669,7 +178692,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L1185-L1224" + "specLocation": "inference/_types/CommonTypes.ts#L1197-L1236" }, { "kind": "enum", @@ -178682,7 +178705,7 @@ "name": "CohereServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1232-L1234" + "specLocation": "inference/_types/CommonTypes.ts#L1244-L1246" }, { "kind": "enum", @@ -178701,7 +178724,7 @@ "name": "CohereSimilarityType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1251-L1255" + "specLocation": "inference/_types/CommonTypes.ts#L1263-L1267" }, { "kind": "interface", @@ -178759,7 +178782,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L1263-L1295" + "specLocation": "inference/_types/CommonTypes.ts#L1275-L1307" }, { "kind": "enum", @@ -178778,7 +178801,7 @@ "name": "CohereTaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1226-L1230" + "specLocation": "inference/_types/CommonTypes.ts#L1238-L1242" }, { "kind": "enum", @@ -178797,7 +178820,7 @@ "name": "CohereTruncateType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1257-L1261" + "specLocation": "inference/_types/CommonTypes.ts#L1269-L1273" }, { "kind": "interface", @@ -178879,7 +178902,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L512-L524" + "specLocation": "inference/_types/CommonTypes.ts#L513-L525" }, { "kind": "interface", @@ -178914,7 +178937,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L475-L487" + "specLocation": "inference/_types/CommonTypes.ts#L476-L488" }, { "kind": "interface", @@ -178937,7 +178960,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L464-L473" + "specLocation": "inference/_types/CommonTypes.ts#L465-L474" }, { "kind": "interface", @@ -178992,7 +179015,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L489-L510" + "specLocation": "inference/_types/CommonTypes.ts#L490-L511" }, { "kind": "type_alias", @@ -179004,7 +179027,7 @@ "name": "CompletionToolType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L153-L156", + "specLocation": "inference/_types/CommonTypes.ts#L154-L157", "type": { "kind": "union_of", "items": [ @@ -179082,7 +179105,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L158-L179" + "specLocation": "inference/_types/CommonTypes.ts#L159-L180" }, { "kind": "enum", @@ -179101,7 +179124,7 @@ "name": "ContentType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L181-L185" + "specLocation": "inference/_types/CommonTypes.ts#L182-L186" }, { "kind": "interface", @@ -179149,7 +179172,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L1574-L1595" + "specLocation": "inference/_types/CommonTypes.ts#L1597-L1618" }, { "kind": "enum", @@ -179162,7 +179185,7 @@ "name": "ContextualAIServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1570-L1572" + "specLocation": "inference/_types/CommonTypes.ts#L1593-L1595" }, { "kind": "interface", @@ -179209,7 +179232,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L1597-L1615" + "specLocation": "inference/_types/CommonTypes.ts#L1620-L1638" }, { "kind": "interface", @@ -179231,7 +179254,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L1374-L1385" + "specLocation": "inference/_types/CommonTypes.ts#L1395-L1406" }, { "kind": "interface", @@ -179245,11 +179268,66 @@ "name": "json_parser", "required": true, "type": { - "kind": "user_defined_value" + "kind": "dictionary_of", + "key": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + }, + "singleKey": false, + "value": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } } } ], - "specLocation": "inference/_types/CommonTypes.ts#L1387-L1541" + "specLocation": "inference/_types/CommonTypes.ts#L1408-L1562" + }, + { + "kind": "enum", + "members": [ + { + "name": "classification" + }, + { + "name": "clustering" + }, + { + "name": "ingest" + }, + { + "name": "search" + } + ], + "name": { + "name": "CustomServiceInputType", + "namespace": "inference._types" + }, + "specLocation": "inference/_types/CommonTypes.ts#L1309-L1314" + }, + { + "kind": "type_alias", + "name": { + "name": "CustomServiceQueryParameter", + "namespace": "inference._types" + }, + "specLocation": "inference/_types/CommonTypes.ts#L1316-L1316", + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } }, { "kind": "interface", @@ -179273,11 +179351,26 @@ } }, { - "description": "Specifies the HTTP header parameters – such as `Authentication` or `Content-Type` – that are required to access the custom service.\nFor example:\n```\n\"headers\":{\n \"Authorization\": \"Bearer ${api_key}\",\n \"Content-Type\": \"application/json;charset=utf-8\"\n}\n```", + "description": "Specifies the HTTP header parameters – such as `Authentication` or `Content-Type` – that are required to access the custom service.\nFor example:\n```\n\"headers\": {\n \"Authorization\": \"Bearer ${api_key}\",\n \"Content-Type\": \"application/json;charset=utf-8\"\n}\n```", "name": "headers", "required": false, "type": { - "kind": "user_defined_value" + "kind": "dictionary_of", + "key": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + }, + "singleKey": false, + "value": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } } }, { @@ -179285,7 +179378,22 @@ "name": "input_type", "required": false, "type": { - "kind": "user_defined_value" + "kind": "dictionary_of", + "key": { + "kind": "instance_of", + "type": { + "name": "CustomServiceInputType", + "namespace": "inference._types" + } + }, + "singleKey": false, + "value": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } } }, { @@ -179293,7 +179401,14 @@ "name": "query_parameters", "required": false, "type": { - "kind": "user_defined_value" + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "CustomServiceQueryParameter", + "namespace": "inference._types" + } + } } }, { @@ -179325,7 +179440,22 @@ "name": "secret_parameters", "required": true, "type": { - "kind": "user_defined_value" + "kind": "dictionary_of", + "key": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + }, + "singleKey": false, + "value": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } } }, { @@ -179341,7 +179471,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L1297-L1372" + "specLocation": "inference/_types/CommonTypes.ts#L1318-L1393" }, { "kind": "enum", @@ -179354,7 +179484,55 @@ "name": "CustomServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1550-L1552" + "specLocation": "inference/_types/CommonTypes.ts#L1571-L1573" + }, + { + "kind": "type_alias", + "name": { + "name": "CustomTaskParameter", + "namespace": "inference._types" + }, + "specLocation": "inference/_types/CommonTypes.ts#L1575-L1575", + "type": { + "kind": "union_of", + "items": [ + { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + }, + { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + }, + { + "kind": "instance_of", + "type": { + "name": "double", + "namespace": "_types" + } + }, + { + "kind": "instance_of", + "type": { + "name": "float", + "namespace": "_types" + } + }, + { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + ] + } }, { "kind": "interface", @@ -179368,11 +179546,26 @@ "name": "parameters", "required": false, "type": { - "kind": "user_defined_value" + "kind": "dictionary_of", + "key": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + }, + "singleKey": false, + "value": { + "kind": "instance_of", + "type": { + "name": "CustomTaskParameter", + "namespace": "inference._types" + } + } } } ], - "specLocation": "inference/_types/CommonTypes.ts#L1554-L1568" + "specLocation": "inference/_types/CommonTypes.ts#L1577-L1591" }, { "kind": "enum", @@ -179394,7 +179587,7 @@ "name": "CustomTaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1543-L1548" + "specLocation": "inference/_types/CommonTypes.ts#L1564-L1569" }, { "kind": "interface", @@ -179442,7 +179635,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L1617-L1637" + "specLocation": "inference/_types/CommonTypes.ts#L1640-L1660" }, { "kind": "enum", @@ -179455,7 +179648,7 @@ "name": "DeepSeekServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1639-L1641" + "specLocation": "inference/_types/CommonTypes.ts#L1662-L1664" }, { "kind": "interface", @@ -179684,7 +179877,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L1643-L1699" + "specLocation": "inference/_types/CommonTypes.ts#L1666-L1722" }, { "kind": "enum", @@ -179697,7 +179890,7 @@ "name": "ElasticsearchServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1715-L1717" + "specLocation": "inference/_types/CommonTypes.ts#L1738-L1740" }, { "kind": "interface", @@ -179720,7 +179913,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L1701-L1707" + "specLocation": "inference/_types/CommonTypes.ts#L1724-L1730" }, { "kind": "enum", @@ -179739,7 +179932,7 @@ "name": "ElasticsearchTaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1709-L1713" + "specLocation": "inference/_types/CommonTypes.ts#L1732-L1736" }, { "kind": "interface", @@ -179785,7 +179978,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L1719-L1745" + "specLocation": "inference/_types/CommonTypes.ts#L1742-L1768" }, { "kind": "enum", @@ -179798,7 +179991,7 @@ "name": "ElserServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1751-L1753" + "specLocation": "inference/_types/CommonTypes.ts#L1774-L1776" }, { "kind": "enum", @@ -179811,7 +180004,7 @@ "name": "ElserTaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1747-L1749" + "specLocation": "inference/_types/CommonTypes.ts#L1770-L1772" }, { "kind": "enum", @@ -179827,7 +180020,7 @@ "name": "EmbeddingContentFormat", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L642-L645" + "specLocation": "inference/_types/CommonTypes.ts#L643-L646" }, { "kind": "type_alias", @@ -179836,7 +180029,7 @@ "name": "EmbeddingContentInput", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L602-L607", + "specLocation": "inference/_types/CommonTypes.ts#L603-L608", "type": { "kind": "union_of", "items": [ @@ -179881,7 +180074,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L609-L617" + "specLocation": "inference/_types/CommonTypes.ts#L610-L618" }, { "kind": "interface", @@ -179928,7 +180121,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L619-L635" + "specLocation": "inference/_types/CommonTypes.ts#L620-L636" }, { "kind": "enum", @@ -179944,7 +180137,7 @@ "name": "EmbeddingContentType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L637-L640" + "specLocation": "inference/_types/CommonTypes.ts#L638-L641" }, { "kind": "interface", @@ -180013,7 +180206,7 @@ "name": "EmbeddingInput", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L590-L595", + "specLocation": "inference/_types/CommonTypes.ts#L591-L596", "type": { "kind": "union_of", "items": [ @@ -180041,7 +180234,7 @@ "name": "EmbeddingStringInput", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L597-L600", + "specLocation": "inference/_types/CommonTypes.ts#L598-L601", "type": { "kind": "union_of", "items": [ @@ -180100,7 +180293,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L423-L433" + "specLocation": "inference/_types/CommonTypes.ts#L424-L434" }, { "kind": "interface", @@ -180134,7 +180327,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L204-L213" + "specLocation": "inference/_types/CommonTypes.ts#L205-L214" }, { "kind": "interface", @@ -180225,7 +180418,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L2288-L2328" + "specLocation": "inference/_types/CommonTypes.ts#L2311-L2351" }, { "kind": "enum", @@ -180238,7 +180431,7 @@ "name": "FireworksAIServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L2336-L2338" + "specLocation": "inference/_types/CommonTypes.ts#L2359-L2361" }, { "kind": "enum", @@ -180257,7 +180450,7 @@ "name": "FireworksAISimilarityType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L2340-L2344" + "specLocation": "inference/_types/CommonTypes.ts#L2363-L2367" }, { "kind": "interface", @@ -180279,15 +180472,30 @@ } }, { - "description": "For a `completion` or`chat_completion` task. Specifies custom HTTP header parameters.\nFor example:\n```\n\"headers\":{\n \"Custom-Header\": \"Some-Value\",\n \"Another-Custom-Header\": \"Another-Value\"\n}\n```", + "description": "For a `completion` or`chat_completion` task. Specifies custom HTTP header parameters.\nFor example:\n```\n\"headers\": {\n \"Custom-Header\": \"Some-Value\",\n \"Another-Custom-Header\": \"Another-Value\"\n}\n```", "name": "headers", "required": false, "type": { - "kind": "user_defined_value" + "kind": "dictionary_of", + "key": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + }, + "singleKey": false, + "value": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } } } ], - "specLocation": "inference/_types/CommonTypes.ts#L2346-L2363" + "specLocation": "inference/_types/CommonTypes.ts#L2369-L2386" }, { "kind": "enum", @@ -180306,7 +180514,7 @@ "name": "FireworksAITaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L2330-L2334" + "specLocation": "inference/_types/CommonTypes.ts#L2353-L2357" }, { "kind": "enum", @@ -180319,7 +180527,7 @@ "name": "GoogleAiServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1778-L1780" + "specLocation": "inference/_types/CommonTypes.ts#L1801-L1803" }, { "kind": "interface", @@ -180367,7 +180575,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L1755-L1771" + "specLocation": "inference/_types/CommonTypes.ts#L1778-L1794" }, { "kind": "enum", @@ -180383,7 +180591,7 @@ "name": "GoogleAiStudioTaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1773-L1776" + "specLocation": "inference/_types/CommonTypes.ts#L1796-L1799" }, { "kind": "enum", @@ -180411,7 +180619,7 @@ "name": "GoogleModelGardenProvider", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1869-L1876" + "specLocation": "inference/_types/CommonTypes.ts#L1892-L1899" }, { "kind": "interface", @@ -180548,7 +180756,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L1782-L1867" + "specLocation": "inference/_types/CommonTypes.ts#L1805-L1890" }, { "kind": "enum", @@ -180561,7 +180769,7 @@ "name": "GoogleVertexAIServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1917-L1919" + "specLocation": "inference/_types/CommonTypes.ts#L1940-L1942" }, { "kind": "interface", @@ -180623,7 +180831,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L1878-L1901" + "specLocation": "inference/_types/CommonTypes.ts#L1901-L1924" }, { "kind": "enum", @@ -180645,7 +180853,7 @@ "name": "GoogleVertexAITaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1910-L1915" + "specLocation": "inference/_types/CommonTypes.ts#L1933-L1938" }, { "kind": "interface", @@ -180695,7 +180903,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L1921-L1943" + "specLocation": "inference/_types/CommonTypes.ts#L1944-L1966" }, { "kind": "enum", @@ -180708,7 +180916,7 @@ "name": "GroqServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1949-L1951" + "specLocation": "inference/_types/CommonTypes.ts#L1972-L1974" }, { "kind": "enum", @@ -180721,7 +180929,7 @@ "name": "GroqTaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1945-L1947" + "specLocation": "inference/_types/CommonTypes.ts#L1968-L1970" }, { "kind": "interface", @@ -180783,7 +180991,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L1953-L1983" + "specLocation": "inference/_types/CommonTypes.ts#L1976-L2006" }, { "kind": "enum", @@ -180796,7 +181004,7 @@ "name": "HuggingFaceServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L2004-L2006" + "specLocation": "inference/_types/CommonTypes.ts#L2027-L2029" }, { "kind": "interface", @@ -180830,7 +181038,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L1985-L1995" + "specLocation": "inference/_types/CommonTypes.ts#L2008-L2018" }, { "kind": "enum", @@ -180852,7 +181060,7 @@ "name": "HuggingFaceTaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1997-L2002" + "specLocation": "inference/_types/CommonTypes.ts#L2020-L2025" }, { "kind": "interface", @@ -180886,7 +181094,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L187-L196" + "specLocation": "inference/_types/CommonTypes.ts#L188-L197" }, { "kind": "enum", @@ -180905,7 +181113,7 @@ "name": "ImageUrlDetail", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L198-L202" + "specLocation": "inference/_types/CommonTypes.ts#L199-L203" }, { "kind": "interface", @@ -182296,7 +182504,7 @@ "name": "JinaAIElementType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L2113-L2117" + "specLocation": "inference/_types/CommonTypes.ts#L2136-L2140" }, { "kind": "interface", @@ -182398,7 +182606,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L2008-L2056" + "specLocation": "inference/_types/CommonTypes.ts#L2031-L2079" }, { "kind": "enum", @@ -182411,7 +182619,7 @@ "name": "JinaAIServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L2096-L2098" + "specLocation": "inference/_types/CommonTypes.ts#L2119-L2121" }, { "kind": "enum", @@ -182430,7 +182638,7 @@ "name": "JinaAISimilarityType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L2100-L2104" + "specLocation": "inference/_types/CommonTypes.ts#L2123-L2127" }, { "kind": "interface", @@ -182488,7 +182696,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L2058-L2088" + "specLocation": "inference/_types/CommonTypes.ts#L2081-L2111" }, { "kind": "enum", @@ -182507,7 +182715,7 @@ "name": "JinaAITaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L2090-L2094" + "specLocation": "inference/_types/CommonTypes.ts#L2113-L2117" }, { "kind": "enum", @@ -182529,7 +182737,7 @@ "name": "JinaAITextEmbeddingTask", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L2106-L2111" + "specLocation": "inference/_types/CommonTypes.ts#L2129-L2134" }, { "kind": "interface", @@ -182601,7 +182809,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L2119-L2149" + "specLocation": "inference/_types/CommonTypes.ts#L2142-L2172" }, { "kind": "enum", @@ -182614,7 +182822,7 @@ "name": "LlamaServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L2157-L2159" + "specLocation": "inference/_types/CommonTypes.ts#L2180-L2182" }, { "kind": "enum", @@ -182633,7 +182841,7 @@ "name": "LlamaSimilarityType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L2161-L2165" + "specLocation": "inference/_types/CommonTypes.ts#L2184-L2188" }, { "kind": "enum", @@ -182652,7 +182860,7 @@ "name": "LlamaTaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L2151-L2155" + "specLocation": "inference/_types/CommonTypes.ts#L2174-L2178" }, { "kind": "interface", @@ -182741,7 +182949,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L299-L392" + "specLocation": "inference/_types/CommonTypes.ts#L300-L393" }, { "kind": "type_alias", @@ -182753,7 +182961,7 @@ "name": "MessageContent", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L294-L297", + "specLocation": "inference/_types/CommonTypes.ts#L295-L298", "type": { "kind": "union_of", "items": [ @@ -182837,7 +183045,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L2167-L2192" + "specLocation": "inference/_types/CommonTypes.ts#L2190-L2215" }, { "kind": "enum", @@ -182850,7 +183058,7 @@ "name": "MistralServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L2200-L2202" + "specLocation": "inference/_types/CommonTypes.ts#L2223-L2225" }, { "kind": "enum", @@ -182869,7 +183077,7 @@ "name": "MistralTaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L2194-L2198" + "specLocation": "inference/_types/CommonTypes.ts#L2217-L2221" }, { "kind": "enum", @@ -182885,7 +183093,7 @@ "name": "NvidiaInputType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L2283-L2286" + "specLocation": "inference/_types/CommonTypes.ts#L2306-L2309" }, { "kind": "interface", @@ -182967,7 +183175,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L2204-L2242" + "specLocation": "inference/_types/CommonTypes.ts#L2227-L2265" }, { "kind": "enum", @@ -182980,7 +183188,7 @@ "name": "NvidiaServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L2251-L2253" + "specLocation": "inference/_types/CommonTypes.ts#L2274-L2276" }, { "kind": "enum", @@ -182999,7 +183207,7 @@ "name": "NvidiaSimilarityType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L2255-L2259" + "specLocation": "inference/_types/CommonTypes.ts#L2278-L2282" }, { "kind": "interface", @@ -183033,7 +183241,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L2261-L2281" + "specLocation": "inference/_types/CommonTypes.ts#L2284-L2304" }, { "kind": "enum", @@ -183055,7 +183263,7 @@ "name": "NvidiaTaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L2244-L2249" + "specLocation": "inference/_types/CommonTypes.ts#L2267-L2272" }, { "kind": "interface", @@ -183154,7 +183362,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L2365-L2409" + "specLocation": "inference/_types/CommonTypes.ts#L2388-L2432" }, { "kind": "enum", @@ -183167,7 +183375,7 @@ "name": "OpenAIServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L2442-L2444" + "specLocation": "inference/_types/CommonTypes.ts#L2465-L2467" }, { "kind": "enum", @@ -183186,7 +183394,7 @@ "name": "OpenAISimilarityType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L2411-L2415" + "specLocation": "inference/_types/CommonTypes.ts#L2434-L2438" }, { "kind": "interface", @@ -183196,7 +183404,7 @@ }, "properties": [ { - "description": "For a `completion`, `chat_completion`, or `text_embedding` task, specify the user issuing the request.\nThis information can be used for abuse detection.", + "description": "Specifies the user issuing the request.\nThis information can be used for abuse detection.", "name": "user", "required": false, "type": { @@ -183208,15 +183416,30 @@ } }, { - "description": "Specifies custom HTTP header parameters.\nFor example:\n```\n\"headers\":{\n \"Custom-Header\": \"Some-Value\",\n \"Another-Custom-Header\": \"Another-Value\"\n}\n```", + "description": "Specifies custom HTTP header parameters.\nFor example:\n```\n\"headers\": {\n \"Custom-Header\": \"Some-Value\",\n \"Another-Custom-Header\": \"Another-Value\"\n}\n```", "name": "headers", "required": false, "type": { - "kind": "user_defined_value" + "kind": "dictionary_of", + "key": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + }, + "singleKey": false, + "value": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } } } ], - "specLocation": "inference/_types/CommonTypes.ts#L2417-L2434" + "specLocation": "inference/_types/CommonTypes.ts#L2440-L2457" }, { "kind": "enum", @@ -183235,7 +183458,7 @@ "name": "OpenAITaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L2436-L2440" + "specLocation": "inference/_types/CommonTypes.ts#L2459-L2463" }, { "kind": "interface", @@ -183317,7 +183540,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L2446-L2479" + "specLocation": "inference/_types/CommonTypes.ts#L2469-L2502" }, { "kind": "enum", @@ -183330,7 +183553,7 @@ "name": "OpenShiftAiServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L2488-L2490" + "specLocation": "inference/_types/CommonTypes.ts#L2511-L2513" }, { "kind": "enum", @@ -183349,7 +183572,7 @@ "name": "OpenShiftAiSimilarityType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L2492-L2496" + "specLocation": "inference/_types/CommonTypes.ts#L2515-L2519" }, { "kind": "interface", @@ -183383,7 +183606,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L2498-L2507" + "specLocation": "inference/_types/CommonTypes.ts#L2521-L2530" }, { "kind": "enum", @@ -183405,7 +183628,7 @@ "name": "OpenShiftAiTaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L2481-L2486" + "specLocation": "inference/_types/CommonTypes.ts#L2504-L2509" }, { "kind": "interface", @@ -183531,7 +183754,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L215-L245" + "specLocation": "inference/_types/CommonTypes.ts#L216-L246" }, { "kind": "type_alias", @@ -183540,7 +183763,7 @@ "name": "ReasoningDetail", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L394-L402", + "specLocation": "inference/_types/CommonTypes.ts#L395-L403", "type": { "kind": "union_of", "items": [ @@ -183598,7 +183821,7 @@ "name": "ReasoningEffort", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L247-L254" + "specLocation": "inference/_types/CommonTypes.ts#L248-L255" }, { "kind": "enum", @@ -183617,7 +183840,7 @@ "name": "ReasoningSummary", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L256-L260" + "specLocation": "inference/_types/CommonTypes.ts#L257-L261" }, { "kind": "interface", @@ -183744,7 +183967,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L25-L132" + "specLocation": "inference/_types/CommonTypes.ts#L26-L133" }, { "kind": "interface", @@ -183790,7 +184013,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L526-L588" + "specLocation": "inference/_types/CommonTypes.ts#L527-L589" }, { "kind": "interface", @@ -183948,7 +184171,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L435-L445" + "specLocation": "inference/_types/CommonTypes.ts#L436-L446" }, { "kind": "type_alias", @@ -184574,7 +184797,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L447-L462" + "specLocation": "inference/_types/CommonTypes.ts#L448-L463" }, { "kind": "interface", @@ -184596,7 +184819,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L1903-L1908" + "specLocation": "inference/_types/CommonTypes.ts#L1926-L1931" }, { "kind": "interface", @@ -184643,7 +184866,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L276-L292" + "specLocation": "inference/_types/CommonTypes.ts#L277-L293" }, { "kind": "interface", @@ -184678,7 +184901,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L262-L274" + "specLocation": "inference/_types/CommonTypes.ts#L263-L275" }, { "kind": "interface", @@ -184742,7 +184965,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L2509-L2540" + "specLocation": "inference/_types/CommonTypes.ts#L2532-L2563" }, { "kind": "enum", @@ -184755,7 +184978,7 @@ "name": "VoyageAIServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L2573-L2575" + "specLocation": "inference/_types/CommonTypes.ts#L2596-L2598" }, { "kind": "interface", @@ -184815,7 +185038,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L2542-L2566" + "specLocation": "inference/_types/CommonTypes.ts#L2565-L2589" }, { "kind": "enum", @@ -184831,7 +185054,7 @@ "name": "VoyageAITaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L2568-L2571" + "specLocation": "inference/_types/CommonTypes.ts#L2591-L2594" }, { "kind": "interface", @@ -184919,7 +185142,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L2577-L2613" + "specLocation": "inference/_types/CommonTypes.ts#L2600-L2636" }, { "kind": "enum", @@ -184932,7 +185155,7 @@ "name": "WatsonxServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L2622-L2624" + "specLocation": "inference/_types/CommonTypes.ts#L2645-L2647" }, { "kind": "enum", @@ -184954,7 +185177,7 @@ "name": "WatsonxTaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L2615-L2620" + "specLocation": "inference/_types/CommonTypes.ts#L2638-L2643" }, { "kind": "request", @@ -185071,12 +185294,56 @@ "value": "{\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"What's the price of a scarf?\"\n }\n ]\n }\n ],\n \"tools\": [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_current_price\",\n \"description\": \"Get the current price of a item\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"item\": {\n \"id\": \"123\"\n }\n }\n }\n }\n }\n ],\n \"tool_choice\": {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_current_price\"\n }\n }\n}" }, "PostChatCompletionRequestExample4": { + "alternatives": [ + { + "code": "resp = client.inference.chat_completion_unified(\n inference_id=\"reasoning-chat-completion\",\n chat_completion_request={\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Barber shaves all those, who do not shave themselves. Who shaves the barber?\"\n }\n ]\n },\n {\n \"role\": \"assistant\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"This is the barber paradox. Such a barber cannot logically exist.\"\n }\n ],\n \"reasoning\": \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"reasoning_details\": [\n {\n \"type\": \"reasoning.encrypted\",\n \"data\": \"[REDACTED]\"\n },\n {\n \"type\": \"reasoning.summary\",\n \"summary\": \"Barber shaving himself creates contradiction\"\n },\n {\n \"type\": \"reasoning.text\",\n \"text\": \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"signature\": \"sig_123\"\n }\n ]\n },\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"What if there are 2 barbers?\"\n }\n ]\n }\n ],\n \"reasoning\": {\n \"effort\": \"high\",\n \"summary\": \"detailed\",\n \"exclude\": False\n }\n },\n)", + "language": "Python" + }, + { + "code": "const response = await client.inference.chatCompletionUnified({\n inference_id: \"reasoning-chat-completion\",\n chat_completion_request: {\n messages: [\n {\n role: \"user\",\n content: [\n {\n type: \"text\",\n text: \"Barber shaves all those, who do not shave themselves. Who shaves the barber?\",\n },\n ],\n },\n {\n role: \"assistant\",\n content: [\n {\n type: \"text\",\n text: \"This is the barber paradox. Such a barber cannot logically exist.\",\n },\n ],\n reasoning:\n \"If the barber shaves himself, he should not; if he does not, he should.\",\n reasoning_details: [\n {\n type: \"reasoning.encrypted\",\n data: \"[REDACTED]\",\n },\n {\n type: \"reasoning.summary\",\n summary: \"Barber shaving himself creates contradiction\",\n },\n {\n type: \"reasoning.text\",\n text: \"If the barber shaves himself, he should not; if he does not, he should.\",\n signature: \"sig_123\",\n },\n ],\n },\n {\n role: \"user\",\n content: [\n {\n type: \"text\",\n text: \"What if there are 2 barbers?\",\n },\n ],\n },\n ],\n reasoning: {\n effort: \"high\",\n summary: \"detailed\",\n exclude: false,\n },\n },\n});", + "language": "JavaScript" + }, + { + "code": "response = client.inference.chat_completion_unified(\n inference_id: \"reasoning-chat-completion\",\n body: {\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Barber shaves all those, who do not shave themselves. Who shaves the barber?\"\n }\n ]\n },\n {\n \"role\": \"assistant\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"This is the barber paradox. Such a barber cannot logically exist.\"\n }\n ],\n \"reasoning\": \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"reasoning_details\": [\n {\n \"type\": \"reasoning.encrypted\",\n \"data\": \"[REDACTED]\"\n },\n {\n \"type\": \"reasoning.summary\",\n \"summary\": \"Barber shaving himself creates contradiction\"\n },\n {\n \"type\": \"reasoning.text\",\n \"text\": \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"signature\": \"sig_123\"\n }\n ]\n },\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"What if there are 2 barbers?\"\n }\n ]\n }\n ],\n \"reasoning\": {\n \"effort\": \"high\",\n \"summary\": \"detailed\",\n \"exclude\": false\n }\n }\n)", + "language": "Ruby" + }, + { + "code": "$resp = $client->inference()->chatCompletionUnified([\n \"inference_id\" => \"reasoning-chat-completion\",\n \"body\" => [\n \"messages\" => array(\n [\n \"role\" => \"user\",\n \"content\" => array(\n [\n \"type\" => \"text\",\n \"text\" => \"Barber shaves all those, who do not shave themselves. Who shaves the barber?\",\n ],\n ),\n ],\n [\n \"role\" => \"assistant\",\n \"content\" => array(\n [\n \"type\" => \"text\",\n \"text\" => \"This is the barber paradox. Such a barber cannot logically exist.\",\n ],\n ),\n \"reasoning\" => \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"reasoning_details\" => array(\n [\n \"type\" => \"reasoning.encrypted\",\n \"data\" => \"[REDACTED]\",\n ],\n [\n \"type\" => \"reasoning.summary\",\n \"summary\" => \"Barber shaving himself creates contradiction\",\n ],\n [\n \"type\" => \"reasoning.text\",\n \"text\" => \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"signature\" => \"sig_123\",\n ],\n ),\n ],\n [\n \"role\" => \"user\",\n \"content\" => array(\n [\n \"type\" => \"text\",\n \"text\" => \"What if there are 2 barbers?\",\n ],\n ),\n ],\n ),\n \"reasoning\" => [\n \"effort\" => \"high\",\n \"summary\" => \"detailed\",\n \"exclude\" => false,\n ],\n ],\n]);", + "language": "PHP" + }, + { + "code": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Barber shaves all those, who do not shave themselves. Who shaves the barber?\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"This is the barber paradox. Such a barber cannot logically exist.\"}],\"reasoning\":\"If the barber shaves himself, he should not; if he does not, he should.\",\"reasoning_details\":[{\"type\":\"reasoning.encrypted\",\"data\":\"[REDACTED]\"},{\"type\":\"reasoning.summary\",\"summary\":\"Barber shaving himself creates contradiction\"},{\"type\":\"reasoning.text\",\"text\":\"If the barber shaves himself, he should not; if he does not, he should.\",\"signature\":\"sig_123\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"What if there are 2 barbers?\"}]}],\"reasoning\":{\"effort\":\"high\",\"summary\":\"detailed\",\"exclude\":false}}' \"$ELASTICSEARCH_URL/_inference/chat_completion/reasoning-chat-completion/_stream\"", + "language": "curl" + } + ], "description": "Run `POST _inference/chat_completion/reasoning-chat-completion/_stream` to perform a chat completion task, using both `effort` parameter based reasoning configuration and including reasoning generated by the model on previous step.", "method_request": "POST _inference/chat_completion/reasoning-chat-completion/_stream", "summary": "A chat completion task with `effort` parameter defined reasoning", "value": "{\n \"messages\": [{\n \"role\": \"user\",\n \"content\": [{\n \"type\": \"text\",\n \"text\": \"Barber shaves all those, who do not shave themselves. Who shaves the barber?\"\n }\n ]\n }, {\n \"role\": \"assistant\",\n \"content\": [{\n \"type\": \"text\",\n \"text\": \"This is the barber paradox. Such a barber cannot logically exist.\"\n }\n ],\n \"reasoning\": \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"reasoning_details\": [{\n \"type\": \"reasoning.encrypted\",\n \"data\": \"[REDACTED]\"\n }, {\n \"type\": \"reasoning.summary\",\n \"summary\": \"Barber shaving himself creates contradiction\"\n }, {\n \"type\": \"reasoning.text\",\n \"text\": \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"signature\": \"sig_123\"\n }\n ]\n }, {\n \"role\": \"user\",\n \"content\": [{\n \"type\": \"text\",\n \"text\": \"What if there are 2 barbers?\"\n }\n ]\n }\n ],\n \"reasoning\": {\n \"effort\": \"high\",\n \"summary\": \"detailed\",\n \"exclude\": false\n }\n}" }, "PostChatCompletionRequestExample5": { + "alternatives": [ + { + "code": "resp = client.inference.chat_completion_unified(\n inference_id=\"reasoning-chat-completion\",\n chat_completion_request={\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Barber shaves all those, who do not shave themselves. Who shaves the barber?\"\n }\n ]\n },\n {\n \"role\": \"assistant\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"This is the barber paradox. Such a barber cannot logically exist.\"\n }\n ],\n \"reasoning\": \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"reasoning_details\": [\n {\n \"type\": \"reasoning.encrypted\",\n \"data\": \"[REDACTED]\"\n },\n {\n \"type\": \"reasoning.summary\",\n \"summary\": \"Barber shaving himself creates contradiction\"\n },\n {\n \"type\": \"reasoning.text\",\n \"text\": \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"signature\": \"sig_123\"\n }\n ]\n },\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"What if there are 2 barbers?\"\n }\n ]\n }\n ],\n \"reasoning\": {\n \"enabled\": True,\n \"summary\": \"detailed\",\n \"exclude\": False\n }\n },\n)", + "language": "Python" + }, + { + "code": "const response = await client.inference.chatCompletionUnified({\n inference_id: \"reasoning-chat-completion\",\n chat_completion_request: {\n messages: [\n {\n role: \"user\",\n content: [\n {\n type: \"text\",\n text: \"Barber shaves all those, who do not shave themselves. Who shaves the barber?\",\n },\n ],\n },\n {\n role: \"assistant\",\n content: [\n {\n type: \"text\",\n text: \"This is the barber paradox. Such a barber cannot logically exist.\",\n },\n ],\n reasoning:\n \"If the barber shaves himself, he should not; if he does not, he should.\",\n reasoning_details: [\n {\n type: \"reasoning.encrypted\",\n data: \"[REDACTED]\",\n },\n {\n type: \"reasoning.summary\",\n summary: \"Barber shaving himself creates contradiction\",\n },\n {\n type: \"reasoning.text\",\n text: \"If the barber shaves himself, he should not; if he does not, he should.\",\n signature: \"sig_123\",\n },\n ],\n },\n {\n role: \"user\",\n content: [\n {\n type: \"text\",\n text: \"What if there are 2 barbers?\",\n },\n ],\n },\n ],\n reasoning: {\n enabled: true,\n summary: \"detailed\",\n exclude: false,\n },\n },\n});", + "language": "JavaScript" + }, + { + "code": "response = client.inference.chat_completion_unified(\n inference_id: \"reasoning-chat-completion\",\n body: {\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Barber shaves all those, who do not shave themselves. Who shaves the barber?\"\n }\n ]\n },\n {\n \"role\": \"assistant\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"This is the barber paradox. Such a barber cannot logically exist.\"\n }\n ],\n \"reasoning\": \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"reasoning_details\": [\n {\n \"type\": \"reasoning.encrypted\",\n \"data\": \"[REDACTED]\"\n },\n {\n \"type\": \"reasoning.summary\",\n \"summary\": \"Barber shaving himself creates contradiction\"\n },\n {\n \"type\": \"reasoning.text\",\n \"text\": \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"signature\": \"sig_123\"\n }\n ]\n },\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"What if there are 2 barbers?\"\n }\n ]\n }\n ],\n \"reasoning\": {\n \"enabled\": true,\n \"summary\": \"detailed\",\n \"exclude\": false\n }\n }\n)", + "language": "Ruby" + }, + { + "code": "$resp = $client->inference()->chatCompletionUnified([\n \"inference_id\" => \"reasoning-chat-completion\",\n \"body\" => [\n \"messages\" => array(\n [\n \"role\" => \"user\",\n \"content\" => array(\n [\n \"type\" => \"text\",\n \"text\" => \"Barber shaves all those, who do not shave themselves. Who shaves the barber?\",\n ],\n ),\n ],\n [\n \"role\" => \"assistant\",\n \"content\" => array(\n [\n \"type\" => \"text\",\n \"text\" => \"This is the barber paradox. Such a barber cannot logically exist.\",\n ],\n ),\n \"reasoning\" => \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"reasoning_details\" => array(\n [\n \"type\" => \"reasoning.encrypted\",\n \"data\" => \"[REDACTED]\",\n ],\n [\n \"type\" => \"reasoning.summary\",\n \"summary\" => \"Barber shaving himself creates contradiction\",\n ],\n [\n \"type\" => \"reasoning.text\",\n \"text\" => \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"signature\" => \"sig_123\",\n ],\n ),\n ],\n [\n \"role\" => \"user\",\n \"content\" => array(\n [\n \"type\" => \"text\",\n \"text\" => \"What if there are 2 barbers?\",\n ],\n ),\n ],\n ),\n \"reasoning\" => [\n \"enabled\" => true,\n \"summary\" => \"detailed\",\n \"exclude\" => false,\n ],\n ],\n]);", + "language": "PHP" + }, + { + "code": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Barber shaves all those, who do not shave themselves. Who shaves the barber?\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"This is the barber paradox. Such a barber cannot logically exist.\"}],\"reasoning\":\"If the barber shaves himself, he should not; if he does not, he should.\",\"reasoning_details\":[{\"type\":\"reasoning.encrypted\",\"data\":\"[REDACTED]\"},{\"type\":\"reasoning.summary\",\"summary\":\"Barber shaving himself creates contradiction\"},{\"type\":\"reasoning.text\",\"text\":\"If the barber shaves himself, he should not; if he does not, he should.\",\"signature\":\"sig_123\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"What if there are 2 barbers?\"}]}],\"reasoning\":{\"enabled\":true,\"summary\":\"detailed\",\"exclude\":false}}' \"$ELASTICSEARCH_URL/_inference/chat_completion/reasoning-chat-completion/_stream\"", + "language": "curl" + } + ], "description": "Run `POST _inference/chat_completion/reasoning-chat-completion/_stream` to perform a chat completion task, using both `enabled` parameter based reasoning configuration and including reasoning generated by the model on previous step.", "method_request": "POST _inference/chat_completion/reasoning-chat-completion/_stream", "summary": "A chat completion task with `enabled` parameter defined reasoning", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 976460a483..f4f597fae3 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -14436,6 +14436,7 @@ export type InferenceAzureOpenAIServiceType = 'azureopenai' export interface InferenceAzureOpenAITaskSettings { user?: string + headers?: Record } export type InferenceAzureOpenAITaskType = 'completion' | 'chat_completion' | 'text_embedding' @@ -14532,24 +14533,30 @@ export interface InferenceCustomRequestParams { } export interface InferenceCustomResponseParams { - json_parser: any + json_parser: Record } +export type InferenceCustomServiceInputType = 'classification' | 'clustering' | 'ingest' | 'search' + +export type InferenceCustomServiceQueryParameter = string[] + export interface InferenceCustomServiceSettings { batch_size?: integer - headers?: any - input_type?: any - query_parameters?: any + headers?: Record + input_type?: Partial> + query_parameters?: InferenceCustomServiceQueryParameter[] request: InferenceCustomRequestParams response: InferenceCustomResponseParams - secret_parameters: any + secret_parameters: Record url?: string } export type InferenceCustomServiceType = 'custom' +export type InferenceCustomTaskParameter = string | integer | double | float | boolean + export interface InferenceCustomTaskSettings { - parameters?: any + parameters?: Record } export type InferenceCustomTaskType = 'text_embedding' | 'sparse_embedding' | 'rerank' | 'completion' @@ -14657,7 +14664,7 @@ export type InferenceFireworksAISimilarityType = 'cosine' | 'dot_product' | 'l2_ export interface InferenceFireworksAITaskSettings { user?: string - headers?: any + headers?: Record } export type InferenceFireworksAITaskType = 'chat_completion' | 'completion' | 'text_embedding' @@ -14995,7 +15002,7 @@ export type InferenceOpenAISimilarityType = 'cosine' | 'dot_product' | 'l2_norm' export interface InferenceOpenAITaskSettings { user?: string - headers?: any + headers?: Record } export type InferenceOpenAITaskType = 'chat_completion' | 'completion' | 'text_embedding' diff --git a/package-lock.json b/package-lock.json index d4f1b630a7..91a163639a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -319,6 +319,7 @@ "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.9.0.tgz", "integrity": "sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg==", "license": "Apache-2.0", + "peer": true, "engines": { "node": ">=8.0.0" } @@ -1685,8 +1686,7 @@ "url": "https://opencollective.com/fastify" } ], - "license": "BSD-3-Clause", - "peer": true + "license": "BSD-3-Clause" }, "node_modules/fast-xml-builder": { "version": "1.0.0", @@ -2296,6 +2296,7 @@ "resolved": "https://registry.npmjs.org/jsep/-/jsep-1.4.0.tgz", "integrity": "sha512-B7qPcEVE3NVkmSJbaYxvv4cHkVW7DQsZz13pUMrfS8z8Q/BuShN+gcTXrUlPiGqM2/t/EEaI030bpxMqY8gMlw==", "license": "MIT", + "peer": true, "engines": { "node": ">= 10.16.0" } @@ -2979,6 +2980,7 @@ "resolved": "https://registry.npmjs.org/react/-/react-19.2.3.tgz", "integrity": "sha512-Ku/hhYbVjOQnXDZFv2+RibmLFGwFdeeKHFcOTlrt7xplBnya5OGn/hIRDsqDiSUcfORsDC7MPxwork8jBwsIWA==", "license": "MIT", + "peer": true, "engines": { "node": ">=0.10.0" } @@ -2988,6 +2990,7 @@ "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.3.tgz", "integrity": "sha512-yELu4WmLPw5Mr/lmeEpox5rw3RETacE++JgHqQzd2dg+YbJuat3jH4ingc+WPZhxaoFzdv9y33G+F7Nl5O0GBg==", "license": "MIT", + "peer": true, "dependencies": { "scheduler": "^0.27.0" }, @@ -3352,6 +3355,7 @@ "resolved": "https://registry.npmjs.org/styled-components/-/styled-components-6.3.9.tgz", "integrity": "sha512-J72R4ltw0UBVUlEjTzI0gg2STOqlI9JBhQOL4Dxt7aJOnnSesy0qJDn4PYfMCafk9cWOaVg129Pesl5o+DIh0Q==", "license": "MIT", + "peer": true, "dependencies": { "@emotion/is-prop-valid": "1.4.0", "@emotion/unitless": "0.10.0", @@ -3463,6 +3467,7 @@ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "license": "MIT", + "peer": true, "engines": { "node": ">=12" }, diff --git a/specification/inference/_types/CommonTypes.ts b/specification/inference/_types/CommonTypes.ts index d5569b644c..60f07a83db 100644 --- a/specification/inference/_types/CommonTypes.ts +++ b/specification/inference/_types/CommonTypes.ts @@ -18,8 +18,9 @@ */ import { Id } from '@_types/common' -import { float, integer, long } from '@_types/Numeric' +import { double, float, integer, long } from '@_types/Numeric' import { RateLimitSetting, TaskSettings } from '@inference/_types/Services' +import { Dictionary } from '@spec_utils/Dictionary' import { UserDefinedValue } from '@spec_utils/UserDefinedValue' export class RequestChatCompletion { @@ -1166,10 +1167,21 @@ export class AzureOpenAIServiceSettings { export class AzureOpenAITaskSettings { /** - * For a `completion`, `chat_completion` or `text_embedding` task, specify the user issuing the request. + * Specifies the user issuing the request. * This information can be used for abuse detection. */ user?: string + /** + * Specifies custom HTTP header parameters. + * For example: + * ``` + * "headers": { + * "Custom-Header": "Some-Value", + * "Another-Custom-Header": "Another-Value" + * } + * ``` + */ + headers?: Dictionary } export enum AzureOpenAITaskType { @@ -1294,6 +1306,15 @@ export class CohereTaskSettings { truncate?: CohereTruncateType } +export enum CustomServiceInputType { + classification, + clustering, + ingest, + search +} + +export type CustomServiceQueryParameter = string[] + export class CustomServiceSettings { /** * Specifies the batch size used for the semantic_text field. If the field is not provided, the default is 10. @@ -1306,13 +1327,13 @@ export class CustomServiceSettings { * Specifies the HTTP header parameters – such as `Authentication` or `Content-Type` – that are required to access the custom service. * For example: * ``` - * "headers":{ + * "headers": { * "Authorization": "Bearer ${api_key}", * "Content-Type": "application/json;charset=utf-8" * } * ``` */ - headers?: UserDefinedValue + headers?: Dictionary /** * Specifies the input type translation values that are used to replace the `${input_type}` template in the request body. * For example: @@ -1333,7 +1354,7 @@ export class CustomServiceSettings { * * `ingest` * * `search` */ - input_type?: UserDefinedValue + input_type?: Dictionary /** * Specifies the query parameters as a list of tuples. The arrays inside the `query_parameters` must have two items, a key and a value. * For example: @@ -1346,7 +1367,7 @@ export class CustomServiceSettings { * ``` * If the base url is `https://www.elastic.co` it results in: `https://www.elastic.co?param_key=some_value¶m_key=another_value&other_key=other_value`. */ - query_parameters?: UserDefinedValue + query_parameters?: Array /** * The request configuration object. */ @@ -1364,7 +1385,7 @@ export class CustomServiceSettings { * } * ``` */ - secret_parameters: UserDefinedValue + secret_parameters: Dictionary /** * The URL endpoint to use for the requests. */ @@ -1537,7 +1558,7 @@ export class CustomResponseParams { * } * } */ - json_parser: UserDefinedValue + json_parser: Dictionary } export enum CustomTaskType { @@ -1551,6 +1572,8 @@ export enum CustomServiceType { custom } +export type CustomTaskParameter = string | integer | double | float | boolean + export class CustomTaskSettings { /** * Specifies parameters that are required to run the custom service. The parameters depend on the model your custom service uses. @@ -1564,7 +1587,7 @@ export class CustomTaskSettings { * } * ``` */ - parameters?: UserDefinedValue + parameters?: Dictionary } export enum ContextualAIServiceType { @@ -2353,13 +2376,13 @@ export class FireworksAITaskSettings { * For a `completion` or`chat_completion` task. Specifies custom HTTP header parameters. * For example: * ``` - * "headers":{ + * "headers": { * "Custom-Header": "Some-Value", * "Another-Custom-Header": "Another-Value" * } * ``` */ - headers?: UserDefinedValue + headers?: Dictionary } export class OpenAIServiceSettings { @@ -2416,7 +2439,7 @@ export enum OpenAISimilarityType { export class OpenAITaskSettings { /** - * For a `completion`, `chat_completion`, or `text_embedding` task, specify the user issuing the request. + * Specifies the user issuing the request. * This information can be used for abuse detection. */ user?: string @@ -2424,13 +2447,13 @@ export class OpenAITaskSettings { * Specifies custom HTTP header parameters. * For example: * ``` - * "headers":{ + * "headers": { * "Custom-Header": "Some-Value", * "Another-Custom-Header": "Another-Value" * } * ``` */ - headers?: UserDefinedValue + headers?: Dictionary } export enum OpenAITaskType { diff --git a/specification/inference/chat_completion_unified/examples/request/PostChatCompletionRequestExample4.yaml b/specification/inference/chat_completion_unified/examples/request/PostChatCompletionRequestExample4.yaml index d6a1cd0437..77e7028570 100644 --- a/specification/inference/chat_completion_unified/examples/request/PostChatCompletionRequestExample4.yaml +++ b/specification/inference/chat_completion_unified/examples/request/PostChatCompletionRequestExample4.yaml @@ -1,7 +1,7 @@ summary: A chat completion task with `effort` parameter defined reasoning description: - Run `POST _inference/chat_completion/reasoning-chat-completion/_stream` to perform a chat completion task, - using both `effort` parameter based reasoning configuration and including reasoning generated by the model on previous step. + Run `POST _inference/chat_completion/reasoning-chat-completion/_stream` to perform a chat completion task, using both + `effort` parameter based reasoning configuration and including reasoning generated by the model on previous step. method_request: 'POST _inference/chat_completion/reasoning-chat-completion/_stream' value: |- { diff --git a/specification/inference/chat_completion_unified/examples/request/PostChatCompletionRequestExample5.yaml b/specification/inference/chat_completion_unified/examples/request/PostChatCompletionRequestExample5.yaml index 1efb5f2ca8..32dfd4fd9a 100644 --- a/specification/inference/chat_completion_unified/examples/request/PostChatCompletionRequestExample5.yaml +++ b/specification/inference/chat_completion_unified/examples/request/PostChatCompletionRequestExample5.yaml @@ -1,7 +1,7 @@ summary: A chat completion task with `enabled` parameter defined reasoning description: - Run `POST _inference/chat_completion/reasoning-chat-completion/_stream` to perform a chat completion task, - using both `enabled` parameter based reasoning configuration and including reasoning generated by the model on previous step. + Run `POST _inference/chat_completion/reasoning-chat-completion/_stream` to perform a chat completion task, using both + `enabled` parameter based reasoning configuration and including reasoning generated by the model on previous step. method_request: 'POST _inference/chat_completion/reasoning-chat-completion/_stream' value: |- { diff --git a/specification/package-lock.json b/specification/package-lock.json index e7e1925faf..be0be5075e 100644 --- a/specification/package-lock.json +++ b/specification/package-lock.json @@ -516,6 +516,7 @@ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", "license": "MIT", + "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -717,6 +718,7 @@ "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.28.0.tgz", "integrity": "sha512-ocgh41VhRlf9+fVpe7QKzwLj9c92fDiqOj8Y3Sd4/ZmVA4Btx4PlUYPq4pp9JDyupkf1upbEXecxL2mwNV7jPQ==", "license": "MIT", + "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.12.1", diff --git a/typescript-generator/package-lock.json b/typescript-generator/package-lock.json index c2bf3056ed..ae222d855c 100644 --- a/typescript-generator/package-lock.json +++ b/typescript-generator/package-lock.json @@ -255,6 +255,7 @@ "integrity": "sha512-r0bBaXu5Swb05doFYO2kTWHMovJnNVbCsII0fhesM8bNRlLhXIuckley4a2DaD+vOdmm5G+zGkQZAPZsF80+YQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "undici-types": "~7.16.0" } @@ -272,6 +273,7 @@ "integrity": "sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@eslint-community/regexpp": "^4.4.0", "@typescript-eslint/scope-manager": "5.62.0", @@ -307,6 +309,7 @@ "integrity": "sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==", "dev": true, "license": "BSD-2-Clause", + "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "5.62.0", "@typescript-eslint/types": "5.62.0", @@ -475,6 +478,7 @@ "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", "dev": true, "license": "MIT", + "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -1298,6 +1302,7 @@ "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", @@ -1522,6 +1527,7 @@ "integrity": "sha512-ixmkI62Rbc2/w8Vfxyh1jQRTdRTF52VxwRVHl/ykPAmqG+Nb7/kNn+byLP0LxPgI7zWA16Jt82SybJInmMia3A==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@rtsao/scc": "^1.1.0", "array-includes": "^3.1.8", @@ -1589,6 +1595,7 @@ "integrity": "sha512-jDex9s7D/Qial8AGVIHq4W7NswpUD5DPDL2RH8Lzd9EloWUuvUkHfv4FRLMipH5q2UtyurorBkPeNi1wVWNh3Q==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "builtins": "^5.0.1", "eslint-plugin-es": "^4.1.0", @@ -1615,6 +1622,7 @@ "integrity": "sha512-57Zzfw8G6+Gq7axm2Pdo3gW/Rx3h9Yywgn61uE/3elTCOePEHVrn2i5CdfBwA1BLK0Q0WqctICIUSqXZW/VprQ==", "dev": true, "license": "ISC", + "peer": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, @@ -1631,6 +1639,7 @@ "integrity": "sha512-Qteup0SqU15kdocexFNAJMvCJEfa2xUKNV4CC1xsVMrIIqEy3SQ/rqyxCWNzfrd3/ldy6HMlD2e0JDVpDg2qIA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "array-includes": "^3.1.8", "array.prototype.findlast": "^1.2.5", @@ -4461,6 +4470,7 @@ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", "license": "Apache-2.0", + "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver"