diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/bulk.rb b/elasticsearch-api/lib/elasticsearch/api/actions/bulk.rb index 820ab1844d..1ec0d57a68 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/bulk.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/bulk.rb @@ -78,6 +78,7 @@ module Actions # * JavaScript: Check out `client.helpers.*` # * .NET: Check out `BulkAllObservable` # * PHP: Check out bulk indexing. + # * Ruby: Check out `Elasticsearch::Helpers::BulkHelper` # **Submitting bulk requests with cURL** # If you're providing text file input to `curl`, you must use the `--data-binary` flag instead of plain `-d`. # The latter doesn't preserve newlines. For example: diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cat/aliases.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cat/aliases.rb index 37549558fa..952f8190d7 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cat/aliases.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cat/aliases.rb @@ -28,7 +28,7 @@ module Actions # IMPORTANT: CAT APIs are only intended for human consumption using the command line or the Kibana console. They are not intended for use by applications. For application consumption, use the aliases API. # # @option arguments [String, Array] :name A comma-separated list of aliases to retrieve. Supports wildcards (`*`). To retrieve all aliases, omit this parameter or use `*` or `_all`. - # @option arguments [String, Array] :h List of columns to appear in the response. Supports simple wildcards. + # @option arguments [String, Array] :h A comma-separated list of columns names to display. It supports simple wildcards. # @option arguments [String, Array] :s List of columns that determine how the table should be sorted. # Sorting defaults to ascending and can be changed by setting `:asc` # or `:desc` as a suffix to the column name. diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cat/allocation.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cat/allocation.rb index 8daa241f68..3094858f1e 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cat/allocation.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cat/allocation.rb @@ -28,7 +28,7 @@ module Actions # # @option arguments [String, Array] :node_id A comma-separated list of node identifiers or names used to limit the returned information. # @option arguments [String] :bytes The unit used to display byte values. - # @option arguments [String, Array] :h List of columns to appear in the response. Supports simple wildcards. + # @option arguments [String, Array] :h A comma-separated list of columns names to display. It supports simple wildcards. # @option arguments [String, Array] :s List of columns that determine how the table should be sorted. # Sorting defaults to ascending and can be changed by setting `:asc` # or `:desc` as a suffix to the column name. diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cat/component_templates.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cat/component_templates.rb index 81460d34e8..e9386e2dc1 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cat/component_templates.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cat/component_templates.rb @@ -31,7 +31,7 @@ module Actions # @option arguments [String] :name The name of the component template. # It accepts wildcard expressions. # If it is omitted, all component templates are returned. - # @option arguments [String, Array] :h List of columns to appear in the response. Supports simple wildcards. + # @option arguments [String, Array] :h A comma-separated list of columns names to display. It supports simple wildcards. # @option arguments [String, Array] :s List of columns that determine how the table should be sorted. # Sorting defaults to ascending and can be changed by setting `:asc` # or `:desc` as a suffix to the column name. diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cat/count.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cat/count.rb index 785d772ea6..bd5ab98e08 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cat/count.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cat/count.rb @@ -31,7 +31,7 @@ module Actions # @option arguments [String, Array] :index A comma-separated list of data streams, indices, and aliases used to limit the request. # It supports wildcards (`*`). # To target all data streams and indices, omit this parameter or use `*` or `_all`. - # @option arguments [String, Array] :h List of columns to appear in the response. Supports simple wildcards. + # @option arguments [String, Array] :h A comma-separated list of columns names to display. It supports simple wildcards. # @option arguments [String, Array] :s List of columns that determine how the table should be sorted. # Sorting defaults to ascending and can be changed by setting `:asc` # or `:desc` as a suffix to the column name. diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cat/fielddata.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cat/fielddata.rb index 973b0cf643..85d743dd7d 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cat/fielddata.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cat/fielddata.rb @@ -30,7 +30,7 @@ module Actions # @option arguments [String, Array] :fields Comma-separated list of fields used to limit returned information. # To retrieve all fields, omit this parameter. # @option arguments [String] :bytes The unit used to display byte values. - # @option arguments [String, Array] :h List of columns to appear in the response. Supports simple wildcards. + # @option arguments [String, Array] :h A comma-separated list of columns names to display. It supports simple wildcards. # @option arguments [String, Array] :s List of columns that determine how the table should be sorted. # Sorting defaults to ascending and can be changed by setting `:asc` # or `:desc` as a suffix to the column name. diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cluster/get_settings.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cluster/get_settings.rb index 079aac89e9..cceded3515 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cluster/get_settings.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cluster/get_settings.rb @@ -26,7 +26,12 @@ module Actions # By default, it returns only settings that have been explicitly defined. # # @option arguments [Boolean] :flat_settings If `true`, returns settings in flat format. - # @option arguments [Boolean] :include_defaults If `true`, returns default cluster settings from the local node. + # @option arguments [Boolean] :include_defaults If `true`, also returns default values for all other cluster settings, reflecting the values + # in the `elasticsearch.yml` file of one of the nodes in the cluster. If the nodes in your + # cluster do not all have the same values in their `elasticsearch.yml` config files then the + # values returned by this API may vary from invocation to invocation and may not reflect the + # values that Elasticsearch uses in all situations. Use the `GET _nodes/settings` API to + # fetch the settings for each individual node in your cluster. # @option arguments [Time] :master_timeout Period to wait for a connection to the master node. # If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. # @option arguments [Time] :timeout Period to wait for a response. diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/esql/async_query.rb b/elasticsearch-api/lib/elasticsearch/api/actions/esql/async_query.rb index 950b956e0a..d285551186 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/esql/async_query.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/esql/async_query.rb @@ -32,7 +32,8 @@ module Actions # It is valid only for the CSV format. # @option arguments [Boolean] :drop_null_columns 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. - # @option arguments [String] :format A short version of the Accept header, for example `json` or `yaml`. + # @option arguments [String] :format 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. # @option arguments [Boolean] :error_trace When set to `true` Elasticsearch will include the full stack trace of errors # when they occur. # @option arguments [String, Array] :filter_path Comma-separated list of filters in dot notation which reduce the response diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/esql/query.rb b/elasticsearch-api/lib/elasticsearch/api/actions/esql/query.rb index 9e34919f38..48e87913e7 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/esql/query.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/esql/query.rb @@ -28,7 +28,7 @@ module Actions # minor version, meaning that your referencing code may break when this # library is upgraded. # - # @option arguments [String] :format A short version of the Accept header, e.g. json, yaml. + # @option arguments [String] :format 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. # @option arguments [String] :delimiter The character to use between values within a CSV row. Only valid for the CSV format. # @option arguments [Boolean] :drop_null_columns 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. diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/put_mapping.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/put_mapping.rb index 7642a06665..5bf1317179 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/put_mapping.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/put_mapping.rb @@ -32,7 +32,7 @@ module Actions # - Update supported mapping parameters # - Change a field's mapping using reindexing # - Rename a field using a field alias - # Learn how to use the update mapping API with practical examples in the {https://www.elastic.co/docs//manage-data/data-store/mapping/update-mappings-examples Update mapping API examples} guide. + # Learn how to use the update mapping API with practical examples in the {https://www.elastic.co/docs/manage-data/data-store/mapping/update-mappings-examples Update mapping API examples} guide. # # @option arguments [String, Array] :index A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices. (*Required*) # @option arguments [Boolean] :allow_no_indices If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices. diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/inference/put.rb b/elasticsearch-api/lib/elasticsearch/api/actions/inference/put.rb index f3cbd8d401..2dedb92962 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/inference/put.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/inference/put.rb @@ -27,6 +27,7 @@ module Actions # 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: + # * AI21 (`chat_completion`, `completion`) # * AlibabaCloud AI Search (`completion`, `rerank`, `sparse_embedding`, `text_embedding`) # * Amazon Bedrock (`completion`, `text_embedding`) # * Amazon SageMaker (`chat_completion`, `completion`, `rerank`, `sparse_embedding`, `text_embedding`) @@ -34,17 +35,18 @@ module Actions # * Azure AI Studio (`completion`, 'rerank', `text_embedding`) # * Azure OpenAI (`completion`, `text_embedding`) # * Cohere (`completion`, `rerank`, `text_embedding`) - # * DeepSeek (`completion`, `chat_completion`) + # * DeepSeek (`chat_completion`, `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`) + # * Google Vertex AI (`chat_completion`, `completion`, `rerank`, `text_embedding`) # * Hugging Face (`chat_completion`, `completion`, `rerank`, `text_embedding`) + # * JinaAI (`rerank`, `text_embedding`) + # * Llama (`chat_completion`, `completion`, `text_embedding`) # * Mistral (`chat_completion`, `completion`, `text_embedding`) # * OpenAI (`chat_completion`, `completion`, `text_embedding`) - # * VoyageAI (`text_embedding`, `rerank`) + # * VoyageAI (`rerank`, `text_embedding`) # * Watsonx inference integration (`text_embedding`) - # * JinaAI (`text_embedding`, `rerank`) # # @option arguments [String] :task_type The task type. Refer to the integration list in the API description for the available task types. # @option arguments [String] :inference_id The inference Id (*Required*) diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/inference/put_ai21.rb b/elasticsearch-api/lib/elasticsearch/api/actions/inference/put_ai21.rb new file mode 100644 index 0000000000..df7f3a439c --- /dev/null +++ b/elasticsearch-api/lib/elasticsearch/api/actions/inference/put_ai21.rb @@ -0,0 +1,78 @@ +# Licensed to Elasticsearch B.V. under one or more contributor +# license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright +# ownership. Elasticsearch B.V. licenses this file to you under +# the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# This code was automatically generated from the Elasticsearch Specification +# See https://github.com/elastic/elasticsearch-specification +# See Elasticsearch::ES_SPECIFICATION_COMMIT for commit hash. +module Elasticsearch + module API + module Inference + module Actions + # Create a AI21 inference endpoint. + # Create an inference endpoint to perform an inference task with the `ai21` service. + # + # @option arguments [String] :task_type The type of the inference task that the model will perform. (*Required*) + # @option arguments [String] :ai21_inference_id The unique identifier of the inference endpoint. (*Required*) + # @option arguments [Time] :timeout Specifies the amount of time to wait for the inference endpoint to be created. Server default: 30s. + # @option arguments [Boolean] :error_trace When set to `true` Elasticsearch will include the full stack trace of errors + # when they occur. + # @option arguments [String, Array] :filter_path Comma-separated list of filters in dot notation which reduce the response + # returned by Elasticsearch. + # @option arguments [Boolean] :human When set to `true` will return statistics in a format suitable for humans. + # For example `"exists_time": "1h"` for humans and + # `"exists_time_in_millis": 3600000` for computers. When disabled the human + # readable values will be omitted. This makes sense for responses being consumed + # only by machines. + # @option arguments [Boolean] :pretty If set to `true` the returned JSON will be "pretty-formatted". Only use + # this option for debugging only. + # @option arguments [Hash] :headers Custom HTTP headers + # @option arguments [Hash] :body request body + # + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-ai21 + # + def put_ai21(arguments = {}) + request_opts = { endpoint: arguments[:endpoint] || 'inference.put_ai21' } + + defined_params = [:task_type, :ai21_inference_id].each_with_object({}) do |variable, set_variables| + set_variables[variable] = arguments[variable] if arguments.key?(variable) + end + request_opts[:defined_params] = defined_params unless defined_params.empty? + + raise ArgumentError, "Required argument 'task_type' missing" unless arguments[:task_type] + raise ArgumentError, "Required argument 'ai21_inference_id' missing" unless arguments[:ai21_inference_id] + + arguments = arguments.clone + headers = arguments.delete(:headers) || {} + + body = arguments.delete(:body) + + _task_type = arguments.delete(:task_type) + + _ai21_inference_id = arguments.delete(:ai21_inference_id) + + method = Elasticsearch::API::HTTP_PUT + path = "_inference/#{Utils.listify(_task_type)}/#{Utils.listify(_ai21_inference_id)}" + params = Utils.process_params(arguments) + + Elasticsearch::API::Response.new( + perform_request(method, path, params, body, headers, request_opts) + ) + end + end + end + end +end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/inference/put_llama.rb b/elasticsearch-api/lib/elasticsearch/api/actions/inference/put_llama.rb new file mode 100644 index 0000000000..a4abbf2664 --- /dev/null +++ b/elasticsearch-api/lib/elasticsearch/api/actions/inference/put_llama.rb @@ -0,0 +1,78 @@ +# Licensed to Elasticsearch B.V. under one or more contributor +# license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright +# ownership. Elasticsearch B.V. licenses this file to you under +# the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# This code was automatically generated from the Elasticsearch Specification +# See https://github.com/elastic/elasticsearch-specification +# See Elasticsearch::ES_SPECIFICATION_COMMIT for commit hash. +module Elasticsearch + module API + module Inference + module Actions + # Create a Llama inference endpoint. + # Create an inference endpoint to perform an inference task with the `llama` service. + # + # @option arguments [String] :task_type The type of the inference task that the model will perform. (*Required*) + # @option arguments [String] :llama_inference_id The unique identifier of the inference endpoint. (*Required*) + # @option arguments [Time] :timeout Specifies the amount of time to wait for the inference endpoint to be created. Server default: 30s. + # @option arguments [Boolean] :error_trace When set to `true` Elasticsearch will include the full stack trace of errors + # when they occur. + # @option arguments [String, Array] :filter_path Comma-separated list of filters in dot notation which reduce the response + # returned by Elasticsearch. + # @option arguments [Boolean] :human When set to `true` will return statistics in a format suitable for humans. + # For example `"exists_time": "1h"` for humans and + # `"exists_time_in_millis": 3600000` for computers. When disabled the human + # readable values will be omitted. This makes sense for responses being consumed + # only by machines. + # @option arguments [Boolean] :pretty If set to `true` the returned JSON will be "pretty-formatted". Only use + # this option for debugging only. + # @option arguments [Hash] :headers Custom HTTP headers + # @option arguments [Hash] :body request body + # + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-llama + # + def put_llama(arguments = {}) + request_opts = { endpoint: arguments[:endpoint] || 'inference.put_llama' } + + defined_params = [:task_type, :llama_inference_id].each_with_object({}) do |variable, set_variables| + set_variables[variable] = arguments[variable] if arguments.key?(variable) + end + request_opts[:defined_params] = defined_params unless defined_params.empty? + + raise ArgumentError, "Required argument 'task_type' missing" unless arguments[:task_type] + raise ArgumentError, "Required argument 'llama_inference_id' missing" unless arguments[:llama_inference_id] + + arguments = arguments.clone + headers = arguments.delete(:headers) || {} + + body = arguments.delete(:body) + + _task_type = arguments.delete(:task_type) + + _llama_inference_id = arguments.delete(:llama_inference_id) + + method = Elasticsearch::API::HTTP_PUT + path = "_inference/#{Utils.listify(_task_type)}/#{Utils.listify(_llama_inference_id)}" + params = Utils.process_params(arguments) + + Elasticsearch::API::Response.new( + perform_request(method, path, params, body, headers, request_opts) + ) + end + end + end + end +end diff --git a/elasticsearch-api/lib/elasticsearch/api/version.rb b/elasticsearch-api/lib/elasticsearch/api/version.rb index 7e2e114f7e..4f6f82548c 100644 --- a/elasticsearch-api/lib/elasticsearch/api/version.rb +++ b/elasticsearch-api/lib/elasticsearch/api/version.rb @@ -18,6 +18,6 @@ module Elasticsearch module API VERSION = '9.1.0'.freeze - ES_SPECIFICATION_COMMIT = 'e585438d116b00ff34643179e6286e402c0bcaaf'.freeze + ES_SPECIFICATION_COMMIT = 'c26dfd2c787bc7b187f3ccac15b9c5993d45f801'.freeze end end diff --git a/elasticsearch-api/spec/unit/actions/inference/put_ai21_spec.rb b/elasticsearch-api/spec/unit/actions/inference/put_ai21_spec.rb new file mode 100644 index 0000000000..ee902011c9 --- /dev/null +++ b/elasticsearch-api/spec/unit/actions/inference/put_ai21_spec.rb @@ -0,0 +1,36 @@ +# Licensed to Elasticsearch B.V. under one or more contributor +# license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright +# ownership. Elasticsearch B.V. licenses this file to you under +# the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +require 'spec_helper' + +describe 'client#inference.put_ai21' do + let(:expected_args) do + [ + 'PUT', + '_inference/foo/bar', + {}, + nil, + {}, + { defined_params: { ai21_inference_id: 'bar', task_type: 'foo' }, + endpoint: 'inference.put_ai21' } + ] + end + + it 'performs the request' do + expect(client_double.inference.put_ai21(task_type: 'foo', ai21_inference_id: 'bar')).to be_a Elasticsearch::API::Response + end +end diff --git a/elasticsearch-api/spec/unit/actions/inference/put_llama_spec.rb b/elasticsearch-api/spec/unit/actions/inference/put_llama_spec.rb new file mode 100644 index 0000000000..dc5623d513 --- /dev/null +++ b/elasticsearch-api/spec/unit/actions/inference/put_llama_spec.rb @@ -0,0 +1,36 @@ +# Licensed to Elasticsearch B.V. under one or more contributor +# license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright +# ownership. Elasticsearch B.V. licenses this file to you under +# the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +require 'spec_helper' + +describe 'client#inference.put_llama' do + let(:expected_args) do + [ + 'PUT', + '_inference/foo/bar', + {}, + nil, + {}, + { defined_params: { llama_inference_id: 'bar', task_type: 'foo' }, + endpoint: 'inference.put_llama' } + ] + end + + it 'performs the request' do + expect(client_double.inference.put_llama(task_type: 'foo', llama_inference_id: 'bar')).to be_a Elasticsearch::API::Response + end +end