Skip to content

Commit 986b756

Browse files
Auto-generated API code (#2706)
1 parent 429fdab commit 986b756

File tree

5 files changed

+34
-187
lines changed

5 files changed

+34
-187
lines changed

Diff for: docs/reference.asciidoc

+7-44
Original file line numberDiff line numberDiff line change
@@ -1729,7 +1729,7 @@ client.search({ ... })
17291729
** *`docvalue_fields` (Optional, { field, format, include_unmapped }[])*: An array of wildcard (`*`) field patterns. The request returns doc values for field names matching these patterns in the `hits.fields` property of the response.
17301730
** *`knn` (Optional, { field, query_vector, query_vector_builder, k, num_candidates, boost, filter, similarity, inner_hits, rescore_vector } | { field, query_vector, query_vector_builder, k, num_candidates, boost, filter, similarity, inner_hits, rescore_vector }[])*: The approximate kNN search to run.
17311731
** *`rank` (Optional, { rrf })*: The Reciprocal Rank Fusion (RRF) to use.
1732-
** *`min_score` (Optional, number)*: The minimum `_score` for matching documents. Documents with a lower `_score` are not included in the search results.
1732+
** *`min_score` (Optional, number)*: The minimum `_score` for matching documents. Documents with a lower `_score` are not included in search results and results collected by aggregations.
17331733
** *`post_filter` (Optional, { bool, boosting, common, combined_fields, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_grid, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, knn, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule, script, script_score, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, sparse_vector, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type })*: Use the `post_filter` parameter to filter search results. The search hits are filtered after the aggregations are calculated. A post filter has no impact on the aggregation results.
17341734
** *`profile` (Optional, boolean)*: Set to `true` to return detailed timing information about the execution of individual components in a search request. NOTE: This is a debugging tool and adds significant overhead to search execution.
17351735
** *`query` (Optional, { bool, boosting, common, combined_fields, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_grid, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, knn, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule, script, script_score, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, sparse_vector, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type })*: The search definition using the Query DSL.
@@ -2425,7 +2425,7 @@ Defaults to 10,000 hits.
24252425
names matching these patterns in the hits.fields property of the response.
24262426
** *`knn` (Optional, { field, query_vector, query_vector_builder, k, num_candidates, boost, filter, similarity, inner_hits, rescore_vector } | { field, query_vector, query_vector_builder, k, num_candidates, boost, filter, similarity, inner_hits, rescore_vector }[])*: Defines the approximate kNN search to run.
24272427
** *`min_score` (Optional, number)*: Minimum _score for matching documents. Documents with a lower _score are
2428-
not included in the search results.
2428+
not included in search results and results collected by aggregations.
24292429
** *`post_filter` (Optional, { bool, boosting, common, combined_fields, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_grid, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, knn, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule, script, script_score, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, sparse_vector, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type })*
24302430
** *`profile` (Optional, boolean)*
24312431
** *`query` (Optional, { bool, boosting, common, combined_fields, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_grid, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, knn, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule, script, script_score, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, sparse_vector, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type })*: Defines the search definition using the Query DSL.
@@ -5371,7 +5371,7 @@ Defaults to 10,000 hits.
53715371
** *`docvalue_fields` (Optional, { field, format, include_unmapped }[])*: Array of wildcard (*) patterns. The request returns doc values for field
53725372
names matching these patterns in the hits.fields property of the response.
53735373
** *`min_score` (Optional, number)*: Minimum _score for matching documents. Documents with a lower _score are
5374-
not included in the search results.
5374+
not included in search results and results collected by aggregations.
53755375
** *`post_filter` (Optional, { bool, boosting, common, combined_fields, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_grid, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, knn, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule, script, script_score, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, sparse_vector, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type })*
53765376
** *`profile` (Optional, boolean)*
53775377
** *`query` (Optional, { bool, boosting, common, combined_fields, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_grid, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, knn, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule, script, script_score, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, sparse_vector, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type })*: Defines the search definition using the Query DSL.
@@ -8042,25 +8042,6 @@ client.inference.get({ ... })
80428042
** *`task_type` (Optional, Enum("sparse_embedding" | "text_embedding" | "rerank" | "completion" | "chat_completion"))*: The task type
80438043
** *`inference_id` (Optional, string)*: The inference Id
80448044

8045-
[discrete]
8046-
==== post_eis_chat_completion
8047-
Perform a chat completion task through the Elastic Inference Service (EIS).
8048-
8049-
Perform a chat completion inference task with the `elastic` service.
8050-
8051-
{ref}/post-inference-api.html[Endpoint documentation]
8052-
[source,ts]
8053-
----
8054-
client.inference.postEisChatCompletion({ eis_inference_id })
8055-
----
8056-
8057-
[discrete]
8058-
==== Arguments
8059-
8060-
* *Request (object):*
8061-
** *`eis_inference_id` (string)*: The unique identifier of the inference endpoint.
8062-
** *`chat_completion_request` (Optional, { messages, model, max_completion_tokens, stop, temperature, tool_choice, tools, top_p })*
8063-
80648045
[discrete]
80658046
==== put
80668047
Create an inference endpoint.
@@ -8281,27 +8262,6 @@ These settings are specific to the `cohere` service.
82818262
** *`task_settings` (Optional, { input_type, return_documents, top_n, truncate })*: Settings to configure the inference task.
82828263
These settings are specific to the task type you specified.
82838264

8284-
[discrete]
8285-
==== put_eis
8286-
Create an Elastic Inference Service (EIS) inference endpoint.
8287-
8288-
Create an inference endpoint to perform an inference task through the Elastic Inference Service (EIS).
8289-
8290-
[source,ts]
8291-
----
8292-
client.inference.putEis({ task_type, eis_inference_id, service, service_settings })
8293-
----
8294-
8295-
[discrete]
8296-
==== Arguments
8297-
8298-
* *Request (object):*
8299-
** *`task_type` (Enum("chat_completion"))*: The type of the inference task that the model will perform.
8300-
NOTE: The `chat_completion` task type only supports streaming and only through the _stream API.
8301-
** *`eis_inference_id` (string)*: The unique identifier of the inference endpoint.
8302-
** *`service` (Enum("elastic"))*: The type of service supported for the specified task type. In this case, `elastic`.
8303-
** *`service_settings` ({ model_id, rate_limit })*: Settings used to install the inference model. These settings are specific to the `elastic` service.
8304-
83058265
[discrete]
83068266
==== put_elasticsearch
83078267
Create an Elasticsearch inference endpoint.
@@ -16420,7 +16380,10 @@ To indicate that the request should never timeout, set it to `-1`.
1642016380
Update Watcher index settings.
1642116381
Update settings for the Watcher internal index (`.watches`).
1642216382
Only a subset of settings can be modified.
16423-
This includes `index.auto_expand_replicas` and `index.number_of_replicas`.
16383+
This includes `index.auto_expand_replicas`, `index.number_of_replicas`, `index.routing.allocation.exclude.*`,
16384+
`index.routing.allocation.include.*` and `index.routing.allocation.require.*`.
16385+
Modification of `index.routing.allocation.include._tier_preference` is an exception and is not allowed as the
16386+
Watcher shards must always be in the `data_content` tier.
1642416387

1642516388
https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-update-settings[Endpoint documentation]
1642616389
[source,ts]

Diff for: src/api/api/inference.ts

-82
Original file line numberDiff line numberDiff line change
@@ -209,43 +209,6 @@ export default class Inference {
209209
return await this.transport.request({ path, method, querystring, body, meta }, options)
210210
}
211211

212-
/**
213-
* Perform a chat completion task through the Elastic Inference Service (EIS). Perform a chat completion inference task with the `elastic` service.
214-
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.x/post-inference-api.html | Elasticsearch API documentation}
215-
*/
216-
async postEisChatCompletion (this: That, params: T.InferencePostEisChatCompletionRequest | TB.InferencePostEisChatCompletionRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.InferencePostEisChatCompletionResponse>
217-
async postEisChatCompletion (this: That, params: T.InferencePostEisChatCompletionRequest | TB.InferencePostEisChatCompletionRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.InferencePostEisChatCompletionResponse, unknown>>
218-
async postEisChatCompletion (this: That, params: T.InferencePostEisChatCompletionRequest | TB.InferencePostEisChatCompletionRequest, options?: TransportRequestOptions): Promise<T.InferencePostEisChatCompletionResponse>
219-
async postEisChatCompletion (this: That, params: T.InferencePostEisChatCompletionRequest | TB.InferencePostEisChatCompletionRequest, options?: TransportRequestOptions): Promise<any> {
220-
const acceptedPath: string[] = ['eis_inference_id']
221-
const acceptedBody: string[] = ['chat_completion_request']
222-
const querystring: Record<string, any> = {}
223-
// @ts-expect-error
224-
let body: any = params.body ?? undefined
225-
226-
for (const key in params) {
227-
if (acceptedBody.includes(key)) {
228-
// @ts-expect-error
229-
body = params[key]
230-
} else if (acceptedPath.includes(key)) {
231-
continue
232-
} else if (key !== 'body') {
233-
// @ts-expect-error
234-
querystring[key] = params[key]
235-
}
236-
}
237-
238-
const method = 'POST'
239-
const path = `/_inference/chat_completion/${encodeURIComponent(params.eis_inference_id.toString())}/_stream`
240-
const meta: TransportRequestMetadata = {
241-
name: 'inference.post_eis_chat_completion',
242-
pathParts: {
243-
eis_inference_id: params.eis_inference_id
244-
}
245-
}
246-
return await this.transport.request({ path, method, querystring, body, meta }, options)
247-
}
248-
249212
/**
250213
* Create an inference endpoint. When you create an inference endpoint, the associated machine learning model is automatically deployed if it is not already running. After creating the endpoint, wait for the model deployment to complete before using it. To verify the deployment status, use the get trained model statistics API. Look for `"state": "fully_allocated"` in the response and ensure that the `"allocation_count"` matches the `"target_allocation_count"`. Avoid creating multiple endpoints for the same model unless required, as each endpoint consumes significant resources. IMPORTANT: The inference APIs enable you to use certain services, such as built-in machine learning models (ELSER, E5), models uploaded through Eland, Cohere, OpenAI, Mistral, Azure OpenAI, Google AI Studio, Google Vertex AI, Anthropic, Watsonx.ai, or Hugging Face. For built-in models and models uploaded through Eland, the inference APIs offer an alternative way to use and manage trained models. However, if you do not plan to use the inference APIs to use these models or if you want to use non-NLP models, use the machine learning trained model APIs.
251214
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.x/put-inference-api.html | Elasticsearch API documentation}
@@ -561,51 +524,6 @@ export default class Inference {
561524
return await this.transport.request({ path, method, querystring, body, meta }, options)
562525
}
563526

564-
/**
565-
* Create an Elastic Inference Service (EIS) inference endpoint. Create an inference endpoint to perform an inference task through the Elastic Inference Service (EIS).
566-
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.x/infer-service-elastic.html | Elasticsearch API documentation}
567-
*/
568-
async putEis (this: That, params: T.InferencePutEisRequest | TB.InferencePutEisRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.InferencePutEisResponse>
569-
async putEis (this: That, params: T.InferencePutEisRequest | TB.InferencePutEisRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.InferencePutEisResponse, unknown>>
570-
async putEis (this: That, params: T.InferencePutEisRequest | TB.InferencePutEisRequest, options?: TransportRequestOptions): Promise<T.InferencePutEisResponse>
571-
async putEis (this: That, params: T.InferencePutEisRequest | TB.InferencePutEisRequest, options?: TransportRequestOptions): Promise<any> {
572-
const acceptedPath: string[] = ['task_type', 'eis_inference_id']
573-
const acceptedBody: string[] = ['service', 'service_settings']
574-
const querystring: Record<string, any> = {}
575-
// @ts-expect-error
576-
const userBody: any = params?.body
577-
let body: Record<string, any> | string
578-
if (typeof userBody === 'string') {
579-
body = userBody
580-
} else {
581-
body = userBody != null ? { ...userBody } : undefined
582-
}
583-
584-
for (const key in params) {
585-
if (acceptedBody.includes(key)) {
586-
body = body ?? {}
587-
// @ts-expect-error
588-
body[key] = params[key]
589-
} else if (acceptedPath.includes(key)) {
590-
continue
591-
} else if (key !== 'body') {
592-
// @ts-expect-error
593-
querystring[key] = params[key]
594-
}
595-
}
596-
597-
const method = 'PUT'
598-
const path = `/_inference/${encodeURIComponent(params.task_type.toString())}/${encodeURIComponent(params.eis_inference_id.toString())}`
599-
const meta: TransportRequestMetadata = {
600-
name: 'inference.put_eis',
601-
pathParts: {
602-
task_type: params.task_type,
603-
eis_inference_id: params.eis_inference_id
604-
}
605-
}
606-
return await this.transport.request({ path, method, querystring, body, meta }, options)
607-
}
608-
609527
/**
610528
* Create an Elasticsearch inference endpoint. Create an inference endpoint to perform an inference task with the `elasticsearch` service. > info > Your Elasticsearch deployment contains preconfigured ELSER and E5 inference endpoints, you only need to create the enpoints using the API if you want to customize the settings. If you use the ELSER or the E5 model through the `elasticsearch` service, the API request will automatically download and deploy the model if it isn't downloaded yet. > info > You might see a 502 bad gateway error in the response when using the Kibana Console. This error usually just reflects a timeout, while the model downloads in the background. You can check the download progress in the Machine Learning UI. If using the Python client, you can set the timeout parameter to a higher value. After creating the endpoint, wait for the model deployment to complete before using it. To verify the deployment status, use the get trained model statistics API. Look for `"state": "fully_allocated"` in the response and ensure that the `"allocation_count"` matches the `"target_allocation_count"`. Avoid creating multiple endpoints for the same model unless required, as each endpoint consumes significant resources.
611529
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.x/infer-service-elasticsearch.html | Elasticsearch API documentation}

Diff for: src/api/api/watcher.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ export default class Watcher {
481481
}
482482

483483
/**
484-
* Update Watcher index settings. Update settings for the Watcher internal index (`.watches`). Only a subset of settings can be modified. This includes `index.auto_expand_replicas` and `index.number_of_replicas`.
484+
* Update Watcher index settings. Update settings for the Watcher internal index (`.watches`). Only a subset of settings can be modified. This includes `index.auto_expand_replicas`, `index.number_of_replicas`, `index.routing.allocation.exclude.*`, `index.routing.allocation.include.*` and `index.routing.allocation.require.*`. Modification of `index.routing.allocation.include._tier_preference` is an exception and is not allowed as the Watcher shards must always be in the `data_content` tier.
485485
* @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-update-settings | Elasticsearch API documentation}
486486
*/
487487
async updateSettings (this: That, params?: T.WatcherUpdateSettingsRequest | TB.WatcherUpdateSettingsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.WatcherUpdateSettingsResponse>

0 commit comments

Comments
 (0)