diff --git a/docs/reference/api-reference.md b/docs/reference/api-reference.md index 6c1f8c1d9..31b389a6f 100644 --- a/docs/reference/api-reference.md +++ b/docs/reference/api-reference.md @@ -1015,6 +1015,7 @@ client.index({ index }) ## client.info [_info] Get cluster info. Get basic build, version, and cluster information. +::: In Serverless, this API is retained for backward compatibility only. Some response fields, such as the version number, should be ignored. [Endpoint documentation](https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-info) @@ -4624,7 +4625,12 @@ To override the default behavior, you can set the `esql.query.allow_partial_resu It is valid only for the CSV format. - **`drop_null_columns` (Optional, boolean)**: Indicates whether columns that are entirely `null` will be removed from the `columns` and `values` portion of the results. If `true`, the response will include an extra section under the name `all_columns` which has the name of all the columns. -- **`format` (Optional, Enum("csv" \| "json" \| "tsv" \| "txt" \| "yaml" \| "cbor" \| "smile" \| "arrow"))**: A short version of the Accept header, for example `json` or `yaml`. +- **`format` (Optional, Enum("csv" \| "json" \| "tsv" \| "txt" \| "yaml" \| "cbor" \| "smile" \| "arrow"))**: A short version of the Accept header, e.g. json, yaml. + +`csv`, `tsv`, and `txt` formats will return results in a tabular format, excluding other metadata fields from the response. + +For async requests, nothing will be returned if the async query doesn't finish within the timeout. +The query ID and running status are available in the `X-Elasticsearch-Async-Id` and `X-Elasticsearch-Async-Is-Running` HTTP headers of the response, respectively. ## client.esql.asyncQueryDelete [_esql.async_query_delete] Delete an async ES|QL query. @@ -4745,6 +4751,8 @@ name and the next level key is the column name. object with information about the clusters that participated in the search along with info such as shards count. - **`format` (Optional, Enum("csv" \| "json" \| "tsv" \| "txt" \| "yaml" \| "cbor" \| "smile" \| "arrow"))**: A short version of the Accept header, e.g. json, yaml. + +`csv`, `tsv`, and `txt` formats will return results in a tabular format, excluding other metadata fields from the response. - **`delimiter` (Optional, string)**: The character to use between values within a CSV row. Only valid for the CSV format. - **`drop_null_columns` (Optional, boolean)**: Should columns that are entirely `null` be removed from the `columns` and `values` portion of the results? Defaults to `false`. If `true` then the response will include an extra section under the name `all_columns` which has the name of all columns. @@ -7612,6 +7620,7 @@ However, if you do not plan to use the inference APIs to use these models or if The following integrations are available through the inference API. You can find the available task types next to the integration name: * AlibabaCloud AI Search (`completion`, `rerank`, `sparse_embedding`, `text_embedding`) * Amazon Bedrock (`completion`, `text_embedding`) +* Amazon SageMaker (`chat_completion`, `completion`, `rerank`, `sparse_embedding`, `text_embedding`) * Anthropic (`completion`) * Azure AI Studio (`completion`, `text_embedding`) * Azure OpenAI (`completion`, `text_embedding`) @@ -7692,14 +7701,28 @@ These settings are specific to the task type you specified. - **`timeout` (Optional, string \| -1 \| 0)**: Specifies the amount of time to wait for the inference endpoint to be created. ## client.inference.putAmazonsagemaker [_inference.put_amazonsagemaker] -Configure a Amazon SageMaker inference endpoint +Create an Amazon SageMaker inference endpoint. -[Endpoint documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/infer-service-amazon-sagemaker.html) +Create an inference endpoint to perform an inference task with the `amazon_sagemaker` service. + +[Endpoint documentation](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-amazonsagemaker) ```ts -client.inference.putAmazonsagemaker() +client.inference.putAmazonsagemaker({ task_type, amazonsagemaker_inference_id, service, service_settings }) ``` +### Arguments [_arguments_inference.put_amazonsagemaker] + +#### Request (object) [_request_inference.put_amazonsagemaker] +- **`task_type` (Enum("text_embedding" \| "completion" \| "chat_completion" \| "sparse_embedding" \| "rerank"))**: The type of the inference task that the model will perform. +- **`amazonsagemaker_inference_id` (string)**: The unique identifier of the inference endpoint. +- **`service` (Enum("amazon_sagemaker"))**: The type of service supported for the specified task type. In this case, `amazon_sagemaker`. +- **`service_settings` ({ access_key, endpoint_name, api, region, secret_key, target_model, target_container_hostname, inference_component_name, batch_size, dimensions })**: Settings used to install the inference model. +These settings are specific to the `amazon_sagemaker` service and `service_settings.api` you specified. +- **`chunking_settings` (Optional, { max_chunk_size, overlap, sentence_overlap, strategy })**: The chunking configuration object. +- **`task_settings` (Optional, { custom_attributes, enable_explanations, inference_id, session_id, target_variant })**: Settings to configure the inference task. +These settings are specific to the task type and `service_settings.api` you specified. +- **`timeout` (Optional, string \| -1 \| 0)**: Specifies the amount of time to wait for the inference endpoint to be created. ## client.inference.putAnthropic [_inference.put_anthropic] Create an Anthropic inference endpoint. diff --git a/src/api/api/inference.ts b/src/api/api/inference.ts index 8cf8cdcad..0755edda7 100644 --- a/src/api/api/inference.ts +++ b/src/api/api/inference.ts @@ -139,8 +139,15 @@ export default class Inference { 'task_type', 'amazonsagemaker_inference_id' ], - body: [], - query: [] + body: [ + 'chunking_settings', + 'service', + 'service_settings', + 'task_settings' + ], + query: [ + 'timeout' + ] }, 'inference.put_anthropic': { path: [ @@ -716,7 +723,7 @@ export default class Inference { } /** - * Create an inference endpoint. 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. The following integrations are available through the inference API. You can find the available task types next to the integration name: * AlibabaCloud AI Search (`completion`, `rerank`, `sparse_embedding`, `text_embedding`) * Amazon Bedrock (`completion`, `text_embedding`) * Anthropic (`completion`) * Azure AI Studio (`completion`, `text_embedding`) * Azure OpenAI (`completion`, `text_embedding`) * Cohere (`completion`, `rerank`, `text_embedding`) * DeepSeek (`completion`, `chat_completion`) * Elasticsearch (`rerank`, `sparse_embedding`, `text_embedding` - this service is for built-in models and models uploaded through Eland) * ELSER (`sparse_embedding`) * Google AI Studio (`completion`, `text_embedding`) * Google Vertex AI (`rerank`, `text_embedding`) * Hugging Face (`chat_completion`, `completion`, `rerank`, `text_embedding`) * Mistral (`chat_completion`, `completion`, `text_embedding`) * OpenAI (`chat_completion`, `completion`, `text_embedding`) * VoyageAI (`text_embedding`, `rerank`) * Watsonx inference integration (`text_embedding`) * JinaAI (`text_embedding`, `rerank`) + * Create an inference endpoint. 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. The following integrations are available through the inference API. You can find the available task types next to the integration name: * AlibabaCloud AI Search (`completion`, `rerank`, `sparse_embedding`, `text_embedding`) * Amazon Bedrock (`completion`, `text_embedding`) * Amazon SageMaker (`chat_completion`, `completion`, `rerank`, `sparse_embedding`, `text_embedding`) * Anthropic (`completion`) * Azure AI Studio (`completion`, `text_embedding`) * Azure OpenAI (`completion`, `text_embedding`) * Cohere (`completion`, `rerank`, `text_embedding`) * DeepSeek (`completion`, `chat_completion`) * Elasticsearch (`rerank`, `sparse_embedding`, `text_embedding` - this service is for built-in models and models uploaded through Eland) * ELSER (`sparse_embedding`) * Google AI Studio (`completion`, `text_embedding`) * Google Vertex AI (`rerank`, `text_embedding`) * Hugging Face (`chat_completion`, `completion`, `rerank`, `text_embedding`) * Mistral (`chat_completion`, `completion`, `text_embedding`) * OpenAI (`chat_completion`, `completion`, `text_embedding`) * VoyageAI (`text_embedding`, `rerank`) * Watsonx inference integration (`text_embedding`) * JinaAI (`text_embedding`, `rerank`) * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put | Elasticsearch API documentation} */ async put (this: That, params: T.InferencePutRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -887,15 +894,17 @@ export default class Inference { } /** - * Configure a Amazon SageMaker inference endpoint - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/9.1/infer-service-amazon-sagemaker.html | Elasticsearch API documentation} + * Create an Amazon SageMaker inference endpoint. Create an inference endpoint to perform an inference task with the `amazon_sagemaker` service. + * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-amazonsagemaker | Elasticsearch API documentation} */ - async putAmazonsagemaker (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async putAmazonsagemaker (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async putAmazonsagemaker (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise - async putAmazonsagemaker (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { + async putAmazonsagemaker (this: That, params: T.InferencePutAmazonsagemakerRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async putAmazonsagemaker (this: That, params: T.InferencePutAmazonsagemakerRequest, options?: TransportRequestOptionsWithMeta): Promise> + async putAmazonsagemaker (this: That, params: T.InferencePutAmazonsagemakerRequest, options?: TransportRequestOptions): Promise + async putAmazonsagemaker (this: That, params: T.InferencePutAmazonsagemakerRequest, options?: TransportRequestOptions): Promise { const { - path: acceptedPath + path: acceptedPath, + body: acceptedBody, + query: acceptedQuery } = this.acceptedParams['inference.put_amazonsagemaker'] const userQuery = params?.querystring @@ -911,12 +920,22 @@ export default class Inference { } } - params = params ?? {} for (const key in params) { - if (acceptedPath.includes(key)) { + if (acceptedBody.includes(key)) { + body = body ?? {} + // @ts-expect-error + body[key] = params[key] + } else if (acceptedPath.includes(key)) { continue } else if (key !== 'body' && key !== 'querystring') { - querystring[key] = params[key] + if (acceptedQuery.includes(key) || commonQueryParams.includes(key)) { + // @ts-expect-error + querystring[key] = params[key] + } else { + body = body ?? {} + // @ts-expect-error + body[key] = params[key] + } } } diff --git a/src/api/api/info.ts b/src/api/api/info.ts index 536fabb6c..d490a4fac 100644 --- a/src/api/api/info.ts +++ b/src/api/api/info.ts @@ -35,7 +35,7 @@ const acceptedParams: Record diff --git a/src/api/types.ts b/src/api/types.ts index 61265d6de..0f48a5279 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -3848,7 +3848,10 @@ export interface ElasticsearchVersionInfo { /** The minimum node version with which the responding node can communicate. * Also the minimum version from which you can perform a rolling upgrade. */ minimum_wire_compatibility_version: VersionString - /** The Elasticsearch version number. */ + /** The Elasticsearch version number. + * + * ::: IMPORTANT: For Serverless deployments, this static value is always `8.11.0` and is used solely for backward compatibility with legacy clients. + * Serverless environments are versionless and automatically upgraded, so this value can be safely ignored. */ number: string } @@ -17916,7 +17919,13 @@ export type EqlSearchResponse = EqlEqlSearchResponseBase