You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/reference.asciidoc
+64-4Lines changed: 64 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2479,7 +2479,6 @@ A partial reduction is performed every time the coordinating node has received a
2479
2479
** *`ignore_unavailable` (Optional, boolean)*: Whether specified concrete indices should be ignored when unavailable (missing or closed)
2480
2480
** *`lenient` (Optional, boolean)*: Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
2481
2481
** *`max_concurrent_shard_requests` (Optional, number)*: The number of concurrent shard requests per node this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests
** *`preference` (Optional, string)*: Specify the node or shard the operation should be performed on (default: random)
2484
2483
** *`request_cache` (Optional, boolean)*: Specify if request cache should be used for this request or not, defaults to true
2485
2484
** *`routing` (Optional, string)*: A list of specific routing values
@@ -2622,9 +2621,6 @@ It supports a list of values, such as `open,hidden`.
2622
2621
local cluster state. If `false` the list of selected nodes are computed
2623
2622
from the cluster state of the master node. In both cases the coordinating
2624
2623
node will send requests for further information to each selected node.
2625
-
** *`master_timeout` (Optional, string | -1 | 0)*: The period to wait for a connection to the master node.
2626
-
If the master node is not available before the timeout expires, the request fails and returns an error.
2627
-
To indicated that the request should never timeout, you can set it to `-1`.
2628
2624
2629
2625
[discrete]
2630
2626
==== allocation
@@ -8402,6 +8398,70 @@ These settings are specific to the `cohere` service.
8402
8398
These settings are specific to the task type you specified.
8403
8399
** *`timeout` (Optional, string | -1 | 0)*: Specifies the amount of time to wait for the inference endpoint to be created.
8404
8400
8401
+
[discrete]
8402
+
==== put_custom
8403
+
Create a custom inference endpoint.
8404
+
8405
+
The custom service gives more control over how to interact with external inference services that aren't explicitly supported through dedicated integrations.
8406
+
The custom service gives you the ability to define the headers, url, query parameters, request body, and secrets.
8407
+
The custom service supports the template replacement functionality, which enables you to define a template that can be replaced with the value associated with that key.
8408
+
Templates are portions of a string that start with `${` and end with `}`.
8409
+
The parameters `secret_parameters` and `task_settings` are checked for keys for template replacement. Template replacement is supported in the `request`, `headers`, `url`, and `query_parameters`.
8410
+
If the definition (key) is not found for a template, an error message is returned.
8411
+
In case of an endpoint definition like the following:
Copy file name to clipboardExpand all lines: src/api/api/inference.ts
+45Lines changed: 45 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -609,6 +609,51 @@ export default class Inference {
609
609
returnawaitthis.transport.request({ path, method, querystring, body, meta },options)
610
610
}
611
611
612
+
/**
613
+
* Create a custom inference endpoint. The custom service gives more control over how to interact with external inference services that aren't explicitly supported through dedicated integrations. The custom service gives you the ability to define the headers, url, query parameters, request body, and secrets. The custom service supports the template replacement functionality, which enables you to define a template that can be replaced with the value associated with that key. Templates are portions of a string that start with `${` and end with `}`. The parameters `secret_parameters` and `task_settings` are checked for keys for template replacement. Template replacement is supported in the `request`, `headers`, `url`, and `query_parameters`. If the definition (key) is not found for a template, an error message is returned. In case of an endpoint definition like the following: ``` PUT _inference/text_embedding/test-text-embedding { "service": "custom", "service_settings": { "secret_parameters": { "api_key": "<some api key>" }, "url": "...endpoints.huggingface.cloud/v1/embeddings", "headers": { "Authorization": "Bearer ${api_key}", "Content-Type": "application/json" }, "request": "{\"input\": ${input}}", "response": { "json_parser": { "text_embeddings":"$.data[*].embedding[*]" } } }} ``` To replace `${api_key}` the `secret_parameters` and `task_settings` are checked for a key named `api_key`. > info > Templates should not be surrounded by quotes. Pre-defined templates: * `${input}` refers to the array of input strings that comes from the `input` field of the subsequent inference requests. * `${input_type}` refers to the input type translation values. * `${query}` refers to the query field used specifically for reranking tasks. * `${top_n}` refers to the `top_n` field available when performing rerank requests. * `${return_documents}` refers to the `return_documents` field available when performing rerank requests.
614
+
* @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-custom | Elasticsearch API documentation}
0 commit comments