|
| 1 | +[[infer-service-elastic]] |
| 2 | +=== Elastic {infer-cap} Service (EIS) |
| 3 | + |
| 4 | +.New API reference |
| 5 | +[sidebar] |
| 6 | +-- |
| 7 | +For the most up-to-date API details, refer to {api-es}/group/endpoint-inference[{infer-cap} APIs]. |
| 8 | +-- |
| 9 | + |
| 10 | +Creates an {infer} endpoint to perform an {infer} task with the `elastic` service. |
| 11 | + |
| 12 | + |
| 13 | +[discrete] |
| 14 | +[[infer-service-elastic-api-request]] |
| 15 | +==== {api-request-title} |
| 16 | + |
| 17 | +`PUT /_inference/<task_type>/<inference_id>` |
| 18 | + |
| 19 | +[discrete] |
| 20 | +[[infer-service-elastic-api-path-params]] |
| 21 | +==== {api-path-parms-title} |
| 22 | + |
| 23 | +`<inference_id>`:: |
| 24 | +(Required, string) |
| 25 | +include::inference-shared.asciidoc[tag=inference-id] |
| 26 | + |
| 27 | +`<task_type>`:: |
| 28 | +(Required, string) |
| 29 | +include::inference-shared.asciidoc[tag=task-type] |
| 30 | ++ |
| 31 | +-- |
| 32 | +Available task types: |
| 33 | + |
| 34 | +* `chat_completion`, |
| 35 | +* `sparse_embedding`. |
| 36 | +-- |
| 37 | + |
| 38 | +[NOTE] |
| 39 | +==== |
| 40 | +The `chat_completion` task type only supports streaming and only through the `_unified` API. |
| 41 | +
|
| 42 | +include::inference-shared.asciidoc[tag=chat-completion-docs] |
| 43 | +==== |
| 44 | + |
| 45 | +[discrete] |
| 46 | +[[infer-service-elastic-api-request-body]] |
| 47 | +==== {api-request-body-title} |
| 48 | + |
| 49 | +`chunking_settings`:: |
| 50 | +(Optional, object) |
| 51 | +include::inference-shared.asciidoc[tag=chunking-settings] |
| 52 | + |
| 53 | +`max_chunking_size`::: |
| 54 | +(Optional, integer) |
| 55 | +include::inference-shared.asciidoc[tag=chunking-settings-max-chunking-size] |
| 56 | + |
| 57 | +`overlap`::: |
| 58 | +(Optional, integer) |
| 59 | +include::inference-shared.asciidoc[tag=chunking-settings-overlap] |
| 60 | + |
| 61 | +`sentence_overlap`::: |
| 62 | +(Optional, integer) |
| 63 | +include::inference-shared.asciidoc[tag=chunking-settings-sentence-overlap] |
| 64 | + |
| 65 | +`strategy`::: |
| 66 | +(Optional, string) |
| 67 | +include::inference-shared.asciidoc[tag=chunking-settings-strategy] |
| 68 | + |
| 69 | +`service`:: |
| 70 | +(Required, string) |
| 71 | +The type of service supported for the specified task type. In this case, |
| 72 | +`openai`. |
| 73 | + |
| 74 | +`service_settings`:: |
| 75 | +(Required, object) |
| 76 | +include::inference-shared.asciidoc[tag=service-settings] |
| 77 | ++ |
| 78 | +-- |
| 79 | +These settings are specific to the `elser` service. |
| 80 | +-- |
| 81 | + |
| 82 | + |
| 83 | +`model_id`::: |
| 84 | +(Required, string) |
| 85 | +The name of the model to use for the {infer} task. |
| 86 | + |
| 87 | + |
| 88 | +`task_settings`:: |
| 89 | +(Optional, object) |
| 90 | +include::inference-shared.asciidoc[tag=task-settings] |
| 91 | ++ |
| 92 | +.`task_settings` for the `chat_completion` task type |
| 93 | +[%collapsible%closed] |
| 94 | +===== |
| 95 | +`user`::: |
| 96 | +(Optional, string) |
| 97 | +Specifies the user issuing the request, which can be used for abuse detection. |
| 98 | +===== |
| 99 | ++ |
| 100 | +.`task_settings` for the `sparse_embedding` task type |
| 101 | +[%collapsible%closed] |
| 102 | +===== |
| 103 | +`user`::: |
| 104 | +(optional, string) |
| 105 | +Specifies the user issuing the request, which can be used for abuse detection. |
| 106 | +===== |
| 107 | + |
| 108 | + |
| 109 | +[discrete] |
| 110 | +[[inference-example-elastic]] |
| 111 | +==== Elastic {infer-cap} Service example |
| 112 | + |
| 113 | +The following example shows how to create an {infer} endpoint called `elser-model-eis` to perform a `text_embedding` task type. |
| 114 | + |
| 115 | +[source,console] |
| 116 | +------------------------------------------------------------ |
| 117 | +PUT _inference/sparse_embedding/elser-model-eis |
| 118 | +{ |
| 119 | + "service": "elastic", |
| 120 | + "service_settings": { |
| 121 | + "model_name": "elser" |
| 122 | + } |
| 123 | +} |
| 124 | +
|
| 125 | +------------------------------------------------------------ |
| 126 | +// TEST[skip:TBD] |
0 commit comments