Class: Asimov::ApiV1::Completions
- Defined in:
- lib/asimov/api_v1/completions.rb
Overview
Class interface for API methods in the “/completions” URI subspace.
Instance Method Summary collapse
-
#create(model:, parameters: {}) ⇒ Object
Creates a completion request with the specified parameters.
Methods inherited from Base
#initialize, #rest_create_w_json_params, #rest_create_w_multipart_params, #rest_delete, #rest_get, #rest_get_streamed_download, #rest_index
Constructor Details
This class inherits a constructor from Asimov::ApiV1::Base
Instance Method Details
#create(model:, parameters: {}) ⇒ Object
Creates a completion request with the specified parameters.
13 14 15 16 17 18 19 |
# File 'lib/asimov/api_v1/completions.rb', line 13 def create(model:, parameters: {}) raise MissingRequiredParameterError.new(:model) unless model raise StreamingResponseNotSupportedError if parameters[:stream] rest_create_w_json_params(resource: "completions", parameters: parameters.merge({ model: model })) end |