elasticsearch-api 8.17.2 → 8.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/lib/elasticsearch/api/actions/bulk.rb +1 -0
  3. data/lib/elasticsearch/api/actions/cat/help.rb +1 -3
  4. data/lib/elasticsearch/api/actions/cat/segments.rb +2 -0
  5. data/lib/elasticsearch/api/actions/cat/tasks.rb +2 -0
  6. data/lib/elasticsearch/api/actions/create.rb +1 -0
  7. data/lib/elasticsearch/api/actions/eql/search.rb +2 -0
  8. data/lib/elasticsearch/api/actions/esql/async_query_stop.rb +60 -0
  9. data/lib/elasticsearch/api/actions/index.rb +1 -0
  10. data/lib/elasticsearch/api/actions/index_lifecycle_management/delete_lifecycle.rb +1 -3
  11. data/lib/elasticsearch/api/actions/index_lifecycle_management/explain_lifecycle.rb +0 -1
  12. data/lib/elasticsearch/api/actions/index_lifecycle_management/get_lifecycle.rb +1 -3
  13. data/lib/elasticsearch/api/actions/index_lifecycle_management/put_lifecycle.rb +1 -3
  14. data/lib/elasticsearch/api/actions/index_lifecycle_management/start.rb +1 -3
  15. data/lib/elasticsearch/api/actions/index_lifecycle_management/stop.rb +1 -3
  16. data/lib/elasticsearch/api/actions/indices/resolve_cluster.rb +11 -8
  17. data/lib/elasticsearch/api/actions/indices/rollover.rb +0 -1
  18. data/lib/elasticsearch/api/actions/inference/chat_completion_unified.rb +61 -0
  19. data/lib/elasticsearch/api/actions/inference/completion.rb +61 -0
  20. data/lib/elasticsearch/api/actions/inference/put_alibabacloud.rb +69 -0
  21. data/lib/elasticsearch/api/actions/inference/put_amazonbedrock.rb +69 -0
  22. data/lib/elasticsearch/api/actions/inference/put_anthropic.rb +69 -0
  23. data/lib/elasticsearch/api/actions/inference/put_azureaistudio.rb +69 -0
  24. data/lib/elasticsearch/api/actions/inference/put_azureopenai.rb +69 -0
  25. data/lib/elasticsearch/api/actions/inference/put_cohere.rb +65 -0
  26. data/lib/elasticsearch/api/actions/inference/put_elasticsearch.rb +69 -0
  27. data/lib/elasticsearch/api/actions/inference/put_elser.rb +65 -0
  28. data/lib/elasticsearch/api/actions/inference/put_googleaistudio.rb +69 -0
  29. data/lib/elasticsearch/api/actions/inference/put_googlevertexai.rb +69 -0
  30. data/lib/elasticsearch/api/actions/inference/put_hugging_face.rb +69 -0
  31. data/lib/elasticsearch/api/actions/inference/put_jinaai.rb +65 -0
  32. data/lib/elasticsearch/api/actions/inference/put_mistral.rb +69 -0
  33. data/lib/elasticsearch/api/actions/inference/put_openai.rb +65 -0
  34. data/lib/elasticsearch/api/actions/inference/put_voyageai.rb +69 -0
  35. data/lib/elasticsearch/api/actions/inference/put_watsonx.rb +69 -0
  36. data/lib/elasticsearch/api/actions/inference/rerank.rb +61 -0
  37. data/lib/elasticsearch/api/actions/inference/sparse_embedding.rb +61 -0
  38. data/lib/elasticsearch/api/actions/inference/{stream_inference.rb → stream_completion.rb} +5 -12
  39. data/lib/elasticsearch/api/actions/inference/text_embedding.rb +61 -0
  40. data/lib/elasticsearch/api/actions/inference/update.rb +1 -1
  41. data/lib/elasticsearch/api/actions/ingest/delete_geoip_database.rb +1 -3
  42. data/lib/elasticsearch/api/actions/ingest/delete_ip_location_database.rb +1 -3
  43. data/lib/elasticsearch/api/actions/ingest/put_geoip_database.rb +1 -3
  44. data/lib/elasticsearch/api/actions/ingest/put_ip_location_database.rb +1 -3
  45. data/lib/elasticsearch/api/actions/machine_learning/start_trained_model_deployment.rb +2 -1
  46. data/lib/elasticsearch/api/actions/update.rb +1 -0
  47. data/lib/elasticsearch/api/version.rb +1 -1
  48. data/spec/elasticsearch/api/actions/esql/async_query_stop_spec.rb +35 -0
  49. data/spec/elasticsearch/api/actions/indices/resolve_cluster_spec.rb +14 -9
  50. data/spec/elasticsearch/api/actions/inference/chat_completion_unified_spec.rb +36 -0
  51. data/spec/elasticsearch/api/actions/inference/completion_spec.rb +36 -0
  52. data/spec/elasticsearch/api/actions/inference/put_alibabacloud_spec.rb +36 -0
  53. data/spec/elasticsearch/api/actions/inference/put_amazonbedrock_spec.rb +36 -0
  54. data/spec/elasticsearch/api/actions/inference/put_anthropic_spec.rb +36 -0
  55. data/spec/elasticsearch/api/actions/inference/put_azureaistudio_spec.rb +36 -0
  56. data/spec/elasticsearch/api/actions/inference/put_azureopenai_spec.rb +36 -0
  57. data/spec/elasticsearch/api/actions/inference/put_cohere_spec.rb +36 -0
  58. data/spec/elasticsearch/api/actions/inference/put_elasticsearch_spec.rb +36 -0
  59. data/spec/elasticsearch/api/actions/inference/put_elser_spec.rb +36 -0
  60. data/spec/elasticsearch/api/actions/inference/put_googleaistudio_spec.rb +36 -0
  61. data/spec/elasticsearch/api/actions/inference/put_googlevertexai_spec.rb +36 -0
  62. data/spec/elasticsearch/api/actions/inference/put_huggingface_spec.rb +36 -0
  63. data/spec/elasticsearch/api/actions/inference/put_jinaai_spec.rb +36 -0
  64. data/spec/elasticsearch/api/actions/inference/put_mistral_spec.rb +36 -0
  65. data/spec/elasticsearch/api/actions/inference/put_openai_spec.rb +36 -0
  66. data/spec/elasticsearch/api/actions/inference/put_voyageai_spec.rb +36 -0
  67. data/spec/elasticsearch/api/actions/inference/put_watsonx_spec.rb +36 -0
  68. data/spec/elasticsearch/api/actions/inference/rerank_spec.rb +35 -0
  69. data/spec/elasticsearch/api/actions/inference/{stream_inference_spec.rb → sparse_embedding_spec.rb} +4 -4
  70. data/spec/elasticsearch/api/actions/inference/stream_completion_spec.rb +35 -0
  71. data/spec/elasticsearch/api/actions/inference/text_embedding_spec.rb +35 -0
  72. data/spec/elasticsearch/api/actions/inference/update_spec.rb +1 -1
  73. data/spec/elasticsearch/api/actions/ingest/delete_geoip_database_spec.rb +1 -1
  74. data/spec/elasticsearch/api/actions/ingest/delete_ip_location_database_spec.rb +1 -1
  75. data/spec/rest_api/skipped_tests_free.yml +15 -0
  76. data/spec/rest_api/skipped_tests_platinum.yml +13 -0
  77. data/spec/unit/actions/async_search/delete_spec.rb +35 -0
  78. data/spec/unit/actions/async_search/get_spec.rb +35 -0
  79. data/spec/unit/actions/async_search/status_spec.rb +34 -0
  80. data/spec/unit/actions/async_search/submit_spec.rb +87 -0
  81. data/spec/yaml-test-runner/run.rb +4 -1
  82. metadata +79 -5
@@ -0,0 +1,69 @@
1
+ # Licensed to Elasticsearch B.V. under one or more contributor
2
+ # license agreements. See the NOTICE file distributed with
3
+ # this work for additional information regarding copyright
4
+ # ownership. Elasticsearch B.V. licenses this file to you under
5
+ # the Apache License, Version 2.0 (the "License"); you may
6
+ # not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+ #
18
+ # Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80
19
+ # @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec
20
+ #
21
+ module Elasticsearch
22
+ module API
23
+ module Inference
24
+ module Actions
25
+ # Configure a Mistral inference endpoint
26
+ #
27
+ # @option arguments [String] :task_type The task type
28
+ # @option arguments [String] :mistral_inference_id The inference Id
29
+ # @option arguments [Hash] :headers Custom HTTP headers
30
+ # @option arguments [Hash] :body The inference endpoint's task and service settings
31
+ #
32
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.17/infer-service-mistral.html
33
+ #
34
+ def put_mistral(arguments = {})
35
+ request_opts = { endpoint: arguments[:endpoint] || 'inference.put_mistral' }
36
+
37
+ defined_params = %i[task_type mistral_inference_id].each_with_object({}) do |variable, set_variables|
38
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
39
+ end
40
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
41
+
42
+ raise ArgumentError, "Required argument 'task_type' missing" unless arguments[:task_type]
43
+
44
+ unless arguments[:mistral_inference_id]
45
+ raise ArgumentError,
46
+ "Required argument 'mistral_inference_id' missing"
47
+ end
48
+
49
+ arguments = arguments.clone
50
+ headers = arguments.delete(:headers) || {}
51
+
52
+ body = arguments.delete(:body)
53
+
54
+ _task_type = arguments.delete(:task_type)
55
+
56
+ _mistral_inference_id = arguments.delete(:mistral_inference_id)
57
+
58
+ method = Elasticsearch::API::HTTP_PUT
59
+ path = "_inference/#{Utils.__listify(_task_type)}/#{Utils.__listify(_mistral_inference_id)}"
60
+ params = {}
61
+
62
+ Elasticsearch::API::Response.new(
63
+ perform_request(method, path, params, body, headers, request_opts)
64
+ )
65
+ end
66
+ end
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,65 @@
1
+ # Licensed to Elasticsearch B.V. under one or more contributor
2
+ # license agreements. See the NOTICE file distributed with
3
+ # this work for additional information regarding copyright
4
+ # ownership. Elasticsearch B.V. licenses this file to you under
5
+ # the Apache License, Version 2.0 (the "License"); you may
6
+ # not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+ #
18
+ # Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80
19
+ # @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec
20
+ #
21
+ module Elasticsearch
22
+ module API
23
+ module Inference
24
+ module Actions
25
+ # Configure an OpenAI inference endpoint
26
+ #
27
+ # @option arguments [String] :task_type The task type
28
+ # @option arguments [String] :openai_inference_id The inference ID
29
+ # @option arguments [Hash] :headers Custom HTTP headers
30
+ # @option arguments [Hash] :body The inference endpoint's task and service settings
31
+ #
32
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.17/infer-service-openai.html
33
+ #
34
+ def put_openai(arguments = {})
35
+ request_opts = { endpoint: arguments[:endpoint] || 'inference.put_openai' }
36
+
37
+ defined_params = %i[task_type openai_inference_id].each_with_object({}) do |variable, set_variables|
38
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
39
+ end
40
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
41
+
42
+ raise ArgumentError, "Required argument 'task_type' missing" unless arguments[:task_type]
43
+ raise ArgumentError, "Required argument 'openai_inference_id' missing" unless arguments[:openai_inference_id]
44
+
45
+ arguments = arguments.clone
46
+ headers = arguments.delete(:headers) || {}
47
+
48
+ body = arguments.delete(:body)
49
+
50
+ _task_type = arguments.delete(:task_type)
51
+
52
+ _openai_inference_id = arguments.delete(:openai_inference_id)
53
+
54
+ method = Elasticsearch::API::HTTP_PUT
55
+ path = "_inference/#{Utils.__listify(_task_type)}/#{Utils.__listify(_openai_inference_id)}"
56
+ params = {}
57
+
58
+ Elasticsearch::API::Response.new(
59
+ perform_request(method, path, params, body, headers, request_opts)
60
+ )
61
+ end
62
+ end
63
+ end
64
+ end
65
+ end
@@ -0,0 +1,69 @@
1
+ # Licensed to Elasticsearch B.V. under one or more contributor
2
+ # license agreements. See the NOTICE file distributed with
3
+ # this work for additional information regarding copyright
4
+ # ownership. Elasticsearch B.V. licenses this file to you under
5
+ # the Apache License, Version 2.0 (the "License"); you may
6
+ # not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+ #
18
+ # Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80
19
+ # @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec
20
+ #
21
+ module Elasticsearch
22
+ module API
23
+ module Inference
24
+ module Actions
25
+ # Configure a VoyageAI inference endpoint
26
+ #
27
+ # @option arguments [String] :task_type The task type
28
+ # @option arguments [String] :voyageai_inference_id The inference ID
29
+ # @option arguments [Hash] :headers Custom HTTP headers
30
+ # @option arguments [Hash] :body The inference endpoint's task and service settings
31
+ #
32
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.17/inference-apis.html
33
+ #
34
+ def put_voyageai(arguments = {})
35
+ request_opts = { endpoint: arguments[:endpoint] || 'inference.put_voyageai' }
36
+
37
+ defined_params = %i[task_type voyageai_inference_id].each_with_object({}) do |variable, set_variables|
38
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
39
+ end
40
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
41
+
42
+ raise ArgumentError, "Required argument 'task_type' missing" unless arguments[:task_type]
43
+
44
+ unless arguments[:voyageai_inference_id]
45
+ raise ArgumentError,
46
+ "Required argument 'voyageai_inference_id' missing"
47
+ end
48
+
49
+ arguments = arguments.clone
50
+ headers = arguments.delete(:headers) || {}
51
+
52
+ body = arguments.delete(:body)
53
+
54
+ _task_type = arguments.delete(:task_type)
55
+
56
+ _voyageai_inference_id = arguments.delete(:voyageai_inference_id)
57
+
58
+ method = Elasticsearch::API::HTTP_PUT
59
+ path = "_inference/#{Utils.__listify(_task_type)}/#{Utils.__listify(_voyageai_inference_id)}"
60
+ params = {}
61
+
62
+ Elasticsearch::API::Response.new(
63
+ perform_request(method, path, params, body, headers, request_opts)
64
+ )
65
+ end
66
+ end
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,69 @@
1
+ # Licensed to Elasticsearch B.V. under one or more contributor
2
+ # license agreements. See the NOTICE file distributed with
3
+ # this work for additional information regarding copyright
4
+ # ownership. Elasticsearch B.V. licenses this file to you under
5
+ # the Apache License, Version 2.0 (the "License"); you may
6
+ # not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+ #
18
+ # Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80
19
+ # @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec
20
+ #
21
+ module Elasticsearch
22
+ module API
23
+ module Inference
24
+ module Actions
25
+ # Configure a Watsonx inference endpoint
26
+ #
27
+ # @option arguments [String] :task_type The task type
28
+ # @option arguments [String] :watsonx_inference_id The inference Id
29
+ # @option arguments [Hash] :headers Custom HTTP headers
30
+ # @option arguments [Hash] :body The inference endpoint's task and service settings
31
+ #
32
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.17/infer-service-watsonx-ai.html
33
+ #
34
+ def put_watsonx(arguments = {})
35
+ request_opts = { endpoint: arguments[:endpoint] || 'inference.put_watsonx' }
36
+
37
+ defined_params = %i[task_type watsonx_inference_id].each_with_object({}) do |variable, set_variables|
38
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
39
+ end
40
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
41
+
42
+ raise ArgumentError, "Required argument 'task_type' missing" unless arguments[:task_type]
43
+
44
+ unless arguments[:watsonx_inference_id]
45
+ raise ArgumentError,
46
+ "Required argument 'watsonx_inference_id' missing"
47
+ end
48
+
49
+ arguments = arguments.clone
50
+ headers = arguments.delete(:headers) || {}
51
+
52
+ body = arguments.delete(:body)
53
+
54
+ _task_type = arguments.delete(:task_type)
55
+
56
+ _watsonx_inference_id = arguments.delete(:watsonx_inference_id)
57
+
58
+ method = Elasticsearch::API::HTTP_PUT
59
+ path = "_inference/#{Utils.__listify(_task_type)}/#{Utils.__listify(_watsonx_inference_id)}"
60
+ params = {}
61
+
62
+ Elasticsearch::API::Response.new(
63
+ perform_request(method, path, params, body, headers, request_opts)
64
+ )
65
+ end
66
+ end
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,61 @@
1
+ # Licensed to Elasticsearch B.V. under one or more contributor
2
+ # license agreements. See the NOTICE file distributed with
3
+ # this work for additional information regarding copyright
4
+ # ownership. Elasticsearch B.V. licenses this file to you under
5
+ # the Apache License, Version 2.0 (the "License"); you may
6
+ # not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+ #
18
+ # Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80
19
+ # @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec
20
+ #
21
+ module Elasticsearch
22
+ module API
23
+ module Inference
24
+ module Actions
25
+ # Perform reranking inference
26
+ #
27
+ # @option arguments [String] :inference_id The inference Id
28
+ # @option arguments [Hash] :headers Custom HTTP headers
29
+ # @option arguments [Hash] :body The inference payload
30
+ #
31
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.17/post-inference-api.html
32
+ #
33
+ def rerank(arguments = {})
34
+ request_opts = { endpoint: arguments[:endpoint] || 'inference.rerank' }
35
+
36
+ defined_params = [:inference_id].each_with_object({}) do |variable, set_variables|
37
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
38
+ end
39
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
40
+
41
+ raise ArgumentError, "Required argument 'inference_id' missing" unless arguments[:inference_id]
42
+
43
+ arguments = arguments.clone
44
+ headers = arguments.delete(:headers) || {}
45
+
46
+ body = arguments.delete(:body)
47
+
48
+ _inference_id = arguments.delete(:inference_id)
49
+
50
+ method = Elasticsearch::API::HTTP_POST
51
+ path = "_inference/rerank/#{Utils.__listify(_inference_id)}"
52
+ params = {}
53
+
54
+ Elasticsearch::API::Response.new(
55
+ perform_request(method, path, params, body, headers, request_opts)
56
+ )
57
+ end
58
+ end
59
+ end
60
+ end
61
+ end
@@ -0,0 +1,61 @@
1
+ # Licensed to Elasticsearch B.V. under one or more contributor
2
+ # license agreements. See the NOTICE file distributed with
3
+ # this work for additional information regarding copyright
4
+ # ownership. Elasticsearch B.V. licenses this file to you under
5
+ # the Apache License, Version 2.0 (the "License"); you may
6
+ # not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+ #
18
+ # Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80
19
+ # @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec
20
+ #
21
+ module Elasticsearch
22
+ module API
23
+ module Inference
24
+ module Actions
25
+ # Perform sparse embedding inference
26
+ #
27
+ # @option arguments [String] :inference_id The inference Id
28
+ # @option arguments [Hash] :headers Custom HTTP headers
29
+ # @option arguments [Hash] :body The inference payload
30
+ #
31
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.17/post-inference-api.html
32
+ #
33
+ def sparse_embedding(arguments = {})
34
+ request_opts = { endpoint: arguments[:endpoint] || 'inference.sparse_embedding' }
35
+
36
+ defined_params = [:inference_id].each_with_object({}) do |variable, set_variables|
37
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
38
+ end
39
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
40
+
41
+ raise ArgumentError, "Required argument 'inference_id' missing" unless arguments[:inference_id]
42
+
43
+ arguments = arguments.clone
44
+ headers = arguments.delete(:headers) || {}
45
+
46
+ body = arguments.delete(:body)
47
+
48
+ _inference_id = arguments.delete(:inference_id)
49
+
50
+ method = Elasticsearch::API::HTTP_POST
51
+ path = "_inference/sparse_embedding/#{Utils.__listify(_inference_id)}"
52
+ params = {}
53
+
54
+ Elasticsearch::API::Response.new(
55
+ perform_request(method, path, params, body, headers, request_opts)
56
+ )
57
+ end
58
+ end
59
+ end
60
+ end
61
+ end
@@ -22,19 +22,18 @@ module Elasticsearch
22
22
  module API
23
23
  module Inference
24
24
  module Actions
25
- # Perform streaming inference
25
+ # Perform streaming completion inference
26
26
  #
27
27
  # @option arguments [String] :inference_id The inference Id
28
- # @option arguments [String] :task_type The task type
29
28
  # @option arguments [Hash] :headers Custom HTTP headers
30
29
  # @option arguments [Hash] :body The inference payload
31
30
  #
32
31
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.17/post-stream-inference-api.html
33
32
  #
34
- def stream_inference(arguments = {})
35
- request_opts = { endpoint: arguments[:endpoint] || 'inference.stream_inference' }
33
+ def stream_completion(arguments = {})
34
+ request_opts = { endpoint: arguments[:endpoint] || 'inference.stream_completion' }
36
35
 
37
- defined_params = %i[inference_id task_type].each_with_object({}) do |variable, set_variables|
36
+ defined_params = [:inference_id].each_with_object({}) do |variable, set_variables|
38
37
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
39
38
  end
40
39
  request_opts[:defined_params] = defined_params unless defined_params.empty?
@@ -48,14 +47,8 @@ module Elasticsearch
48
47
 
49
48
  _inference_id = arguments.delete(:inference_id)
50
49
 
51
- _task_type = arguments.delete(:task_type)
52
-
53
50
  method = Elasticsearch::API::HTTP_POST
54
- path = if _task_type && _inference_id
55
- "_inference/#{Utils.__listify(_task_type)}/#{Utils.__listify(_inference_id)}/_stream"
56
- else
57
- "_inference/#{Utils.__listify(_inference_id)}/_stream"
58
- end
51
+ path = "_inference/completion/#{Utils.__listify(_inference_id)}/_stream"
59
52
  params = {}
60
53
 
61
54
  Elasticsearch::API::Response.new(
@@ -0,0 +1,61 @@
1
+ # Licensed to Elasticsearch B.V. under one or more contributor
2
+ # license agreements. See the NOTICE file distributed with
3
+ # this work for additional information regarding copyright
4
+ # ownership. Elasticsearch B.V. licenses this file to you under
5
+ # the Apache License, Version 2.0 (the "License"); you may
6
+ # not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+ #
18
+ # Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80
19
+ # @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec
20
+ #
21
+ module Elasticsearch
22
+ module API
23
+ module Inference
24
+ module Actions
25
+ # Perform text embedding inference
26
+ #
27
+ # @option arguments [String] :inference_id The inference Id
28
+ # @option arguments [Hash] :headers Custom HTTP headers
29
+ # @option arguments [Hash] :body The inference payload
30
+ #
31
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.17/post-inference-api.html
32
+ #
33
+ def text_embedding(arguments = {})
34
+ request_opts = { endpoint: arguments[:endpoint] || 'inference.text_embedding' }
35
+
36
+ defined_params = [:inference_id].each_with_object({}) do |variable, set_variables|
37
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
38
+ end
39
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
40
+
41
+ raise ArgumentError, "Required argument 'inference_id' missing" unless arguments[:inference_id]
42
+
43
+ arguments = arguments.clone
44
+ headers = arguments.delete(:headers) || {}
45
+
46
+ body = arguments.delete(:body)
47
+
48
+ _inference_id = arguments.delete(:inference_id)
49
+
50
+ method = Elasticsearch::API::HTTP_POST
51
+ path = "_inference/text_embedding/#{Utils.__listify(_inference_id)}"
52
+ params = {}
53
+
54
+ Elasticsearch::API::Response.new(
55
+ perform_request(method, path, params, body, headers, request_opts)
56
+ )
57
+ end
58
+ end
59
+ end
60
+ end
61
+ end
@@ -50,7 +50,7 @@ module Elasticsearch
50
50
 
51
51
  _task_type = arguments.delete(:task_type)
52
52
 
53
- method = Elasticsearch::API::HTTP_POST
53
+ method = Elasticsearch::API::HTTP_PUT
54
54
  path = if _task_type && _inference_id
55
55
  "_inference/#{Utils.__listify(_task_type)}/#{Utils.__listify(_inference_id)}/_update"
56
56
  else
@@ -25,8 +25,6 @@ module Elasticsearch
25
25
  # Deletes a geoip database configuration
26
26
  #
27
27
  # @option arguments [List] :id A comma-separated list of geoip database configurations to delete
28
- # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
29
- # @option arguments [Time] :timeout Explicit operation timeout
30
28
  # @option arguments [Hash] :headers Custom HTTP headers
31
29
  #
32
30
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.17/delete-geoip-database-api.html
@@ -50,7 +48,7 @@ module Elasticsearch
50
48
 
51
49
  method = Elasticsearch::API::HTTP_DELETE
52
50
  path = "_ingest/geoip/database/#{Utils.__listify(_id)}"
53
- params = Utils.process_params(arguments)
51
+ params = {}
54
52
 
55
53
  Elasticsearch::API::Response.new(
56
54
  perform_request(method, path, params, body, headers, request_opts)
@@ -25,8 +25,6 @@ module Elasticsearch
25
25
  # Deletes an ip location database configuration
26
26
  #
27
27
  # @option arguments [List] :id A comma-separated list of ip location database configurations to delete
28
- # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
29
- # @option arguments [Time] :timeout Explicit operation timeout
30
28
  # @option arguments [Hash] :headers Custom HTTP headers
31
29
  #
32
30
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.17/delete-ip-location-database-api.html
@@ -50,7 +48,7 @@ module Elasticsearch
50
48
 
51
49
  method = Elasticsearch::API::HTTP_DELETE
52
50
  path = "_ingest/ip_location/database/#{Utils.__listify(_id)}"
53
- params = Utils.process_params(arguments)
51
+ params = {}
54
52
 
55
53
  Elasticsearch::API::Response.new(
56
54
  perform_request(method, path, params, body, headers, request_opts)
@@ -25,8 +25,6 @@ module Elasticsearch
25
25
  # Puts the configuration for a geoip database to be downloaded
26
26
  #
27
27
  # @option arguments [String] :id The id of the database configuration
28
- # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
29
- # @option arguments [Time] :timeout Explicit operation timeout
30
28
  # @option arguments [Hash] :headers Custom HTTP headers
31
29
  # @option arguments [Hash] :body The database configuration definition (*Required*)
32
30
  #
@@ -52,7 +50,7 @@ module Elasticsearch
52
50
 
53
51
  method = Elasticsearch::API::HTTP_PUT
54
52
  path = "_ingest/geoip/database/#{Utils.__listify(_id)}"
55
- params = Utils.process_params(arguments)
53
+ params = {}
56
54
 
57
55
  Elasticsearch::API::Response.new(
58
56
  perform_request(method, path, params, body, headers, request_opts)
@@ -25,8 +25,6 @@ module Elasticsearch
25
25
  # Puts the configuration for a ip location database to be downloaded
26
26
  #
27
27
  # @option arguments [String] :id The id of the database configuration
28
- # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
29
- # @option arguments [Time] :timeout Explicit operation timeout
30
28
  # @option arguments [Hash] :headers Custom HTTP headers
31
29
  # @option arguments [Hash] :body The database configuration definition (*Required*)
32
30
  #
@@ -52,7 +50,7 @@ module Elasticsearch
52
50
 
53
51
  method = Elasticsearch::API::HTTP_PUT
54
52
  path = "_ingest/ip_location/database/#{Utils.__listify(_id)}"
55
- params = Utils.process_params(arguments)
53
+ params = {}
56
54
 
57
55
  Elasticsearch::API::Response.new(
58
56
  perform_request(method, path, params, body, headers, request_opts)
@@ -34,6 +34,7 @@ module Elasticsearch
34
34
  # @option arguments [Time] :timeout Controls the amount of time to wait for the model to deploy.
35
35
  # @option arguments [String] :wait_for The allocation status for which to wait (options: starting, started, fully_allocated)
36
36
  # @option arguments [Hash] :headers Custom HTTP headers
37
+ # @option arguments [Hash] :body The settings for the trained model deployment
37
38
  #
38
39
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.17/start-trained-model-deployment.html
39
40
  #
@@ -50,7 +51,7 @@ module Elasticsearch
50
51
  arguments = arguments.clone
51
52
  headers = arguments.delete(:headers) || {}
52
53
 
53
- body = nil
54
+ body = arguments.delete(:body)
54
55
 
55
56
  _model_id = arguments.delete(:model_id)
56
57
 
@@ -37,6 +37,7 @@ module Elasticsearch
37
37
  # @option arguments [Number] :if_seq_no only perform the update operation if the last operation that has changed the document has the specified sequence number
38
38
  # @option arguments [Number] :if_primary_term only perform the update operation if the last operation that has changed the document has the specified primary term
39
39
  # @option arguments [Boolean] :require_alias When true, requires destination is an alias. Default is false
40
+ # @option arguments [Boolean] :include_source_on_error True or false if to include the document source in the error message in case of parsing errors. Defaults to true.
40
41
  # @option arguments [Hash] :headers Custom HTTP headers
41
42
  # @option arguments [Hash] :body The request definition requires either `script` or partial `doc` (*Required*)
42
43
  #
@@ -17,6 +17,6 @@
17
17
 
18
18
  module Elasticsearch
19
19
  module API
20
- VERSION = '8.17.2'.freeze
20
+ VERSION = '8.18.0'.freeze
21
21
  end
22
22
  end
@@ -0,0 +1,35 @@
1
+ # Licensed to Elasticsearch B.V. under one or more contributor
2
+ # license agreements. See the NOTICE file distributed with
3
+ # this work for additional information regarding copyright
4
+ # ownership. Elasticsearch B.V. licenses this file to you under
5
+ # the Apache License, Version 2.0 (the "License"); you may
6
+ # not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+
18
+ require 'spec_helper'
19
+
20
+ describe 'client.esql#async_query_stop' do
21
+ let(:expected_args) do
22
+ [
23
+ 'POST',
24
+ '_query/async/foo/stop',
25
+ {},
26
+ nil,
27
+ {},
28
+ { endpoint: 'esql.async_query_stop', defined_params: { id: 'foo' } }
29
+ ]
30
+ end
31
+
32
+ it 'performs the request' do
33
+ expect(client_double.esql.async_query_stop(id: 'foo')).to be_a Elasticsearch::API::Response
34
+ end
35
+ end