Skip to content

Commit

Permalink
[API] Parameter is now optional in inference.get_model
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored and picandocodigo committed Apr 18, 2024
1 parent e13ea0b commit 040a68a
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ def get_model(arguments = {})
end
request_opts[:defined_params] = defined_params unless defined_params.empty?

raise ArgumentError, "Required argument 'inference_id' missing" unless arguments[:inference_id]

arguments = arguments.clone
headers = arguments.delete(:headers) || {}

Expand All @@ -56,8 +54,10 @@ def get_model(arguments = {})
method = Elasticsearch::API::HTTP_GET
path = if _task_type && _inference_id
"_inference/#{Utils.__listify(_task_type)}/#{Utils.__listify(_inference_id)}"
else
elsif _inference_id
"_inference/#{Utils.__listify(_inference_id)}"
else
'_inference'
end
params = {}

Expand Down

0 comments on commit 040a68a

Please sign in to comment.