Class: SoilSidekick::LeafEnginesApi
- Inherits:
-
Object
- Object
- SoilSidekick::LeafEnginesApi
- Defined in:
- lib/soilsidekick/api/leaf_engines_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#initialize(api_client = ApiClient.default) ⇒ LeafEnginesApi
constructor
A new instance of LeafEnginesApi.
-
#leafengines_query(leafengines_query_request, opts = {}) ⇒ LeafEnginesCompatibility
Query plant-environment compatibility LeafEngines API for plant compatibility scoring with environmental factors.
-
#leafengines_query_with_http_info(leafengines_query_request, opts = {}) ⇒ Array<(LeafEnginesCompatibility, Integer, Hash)>
Query plant-environment compatibility LeafEngines API for plant compatibility scoring with environmental factors.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ LeafEnginesApi
Returns a new instance of LeafEnginesApi.
19 20 21 |
# File 'lib/soilsidekick/api/leaf_engines_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/soilsidekick/api/leaf_engines_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#leafengines_query(leafengines_query_request, opts = {}) ⇒ LeafEnginesCompatibility
Query plant-environment compatibility LeafEngines API for plant compatibility scoring with environmental factors
30 31 32 33 |
# File 'lib/soilsidekick/api/leaf_engines_api.rb', line 30 def leafengines_query(leafengines_query_request, opts = {}) data, _status_code, _headers = leafengines_query_with_http_info(leafengines_query_request, opts) data end |
#leafengines_query_with_http_info(leafengines_query_request, opts = {}) ⇒ Array<(LeafEnginesCompatibility, Integer, Hash)>
Query plant-environment compatibility LeafEngines API for plant compatibility scoring with environmental factors
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
# File 'lib/soilsidekick/api/leaf_engines_api.rb', line 43 def leafengines_query_with_http_info(leafengines_query_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: LeafEnginesApi.leafengines_query ...' end # verify the required parameter 'leafengines_query_request' is set if @api_client.config.client_side_validation && leafengines_query_request.nil? fail ArgumentError, "Missing the required parameter 'leafengines_query_request' when calling LeafEnginesApi.leafengines_query" end allowable_values = [4096, 8192, 16384, 24576] if @api_client.config.client_side_validation && opts[:'x_tq_context_mode'] && !allowable_values.include?(opts[:'x_tq_context_mode']) fail ArgumentError, "invalid value for \"x_tq_context_mode\", must be one of #{allowable_values}" end allowable_values = ["none", "reuse", "persist"] if @api_client.config.client_side_validation && opts[:'x_tq_kv_cache_hint'] && !allowable_values.include?(opts[:'x_tq_kv_cache_hint']) fail ArgumentError, "invalid value for \"x_tq_kv_cache_hint\", must be one of #{allowable_values}" end allowable_values = ["auto", "gemma-2b", "gemma-7b", "gemma-7b-tq"] if @api_client.config.client_side_validation && opts[:'x_tq_model_tier'] && !allowable_values.include?(opts[:'x_tq_model_tier']) fail ArgumentError, "invalid value for \"x_tq_model_tier\", must be one of #{allowable_values}" end # resource path local_var_path = '/leafengines-query' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end header_params[:'x-tq-context-mode'] = opts[:'x_tq_context_mode'] if !opts[:'x_tq_context_mode'].nil? header_params[:'x-tq-kv-cache-hint'] = opts[:'x_tq_kv_cache_hint'] if !opts[:'x_tq_kv_cache_hint'].nil? header_params[:'x-tq-model-tier'] = opts[:'x_tq_model_tier'] if !opts[:'x_tq_model_tier'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(leafengines_query_request) # return_type return_type = opts[:debug_return_type] || 'LeafEnginesCompatibility' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKeyAuth'] = opts.merge( :operation => :"LeafEnginesApi.leafengines_query", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: LeafEnginesApi#leafengines_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |