Class: SoilSidekick::ConsumerPlantCareApi

Inherits:
Object
  • Object
show all
Defined in:
lib/soilsidekick/api/consumer_plant_care_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ConsumerPlantCareApi

Returns a new instance of ConsumerPlantCareApi.



19
20
21
# File 'lib/soilsidekick/api/consumer_plant_care_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/soilsidekick/api/consumer_plant_care_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#beginner_guidance(beginner_guidance_request, opts = {}) ⇒ BeginnerGuidance

Beginner-friendly plant guidance without jargon Judgment-free, accessible plant guidance that solves community gatekeeping issues. This endpoint: - Translates scientific jargon into plain language - Never makes users feel stupid for asking about common plants - Uses progressive disclosure (simple answer first, details on request) - Provides encouraging, supportive tone - Offers practical "what do I do right now" guidance

Parameters:

Options Hash (opts):

  • :x_tq_context_mode (Integer)

    TurboQuant extended context window size (tokens). With 3-bit KV cache, context windows up to 24K tokens are feasible within the same memory budget as standard 4K. (default to 4096)

  • :x_tq_kv_cache_hint (String)

    KV cache management hint. - `none`: No caching (default) - `reuse`: Reuse KV cache from previous request in same session (40-60% compute savings) - `persist`: Persist cache to disk for cross-session reuse (default to ‘none’)

  • :x_tq_model_tier (String)

    Preferred model tier for inference. - `auto`: Server selects optimal model based on device capabilities - `gemma-2b`: Lightweight model (~0.5GB KV with TQ) - `gemma-7b`: Full model, standard KV cache - `gemma-7b-tq`: Full model with TurboQuant 3-bit KV cache (~1.3GB) (default to ‘auto’)

Returns:



30
31
32
33
# File 'lib/soilsidekick/api/consumer_plant_care_api.rb', line 30

def beginner_guidance(beginner_guidance_request, opts = {})
  data, _status_code, _headers = beginner_guidance_with_http_info(beginner_guidance_request, opts)
  data
end

#beginner_guidance_with_http_info(beginner_guidance_request, opts = {}) ⇒ Array<(BeginnerGuidance, Integer, Hash)>

Beginner-friendly plant guidance without jargon Judgment-free, accessible plant guidance that solves community gatekeeping issues. This endpoint: - Translates scientific jargon into plain language - Never makes users feel stupid for asking about common plants - Uses progressive disclosure (simple answer first, details on request) - Provides encouraging, supportive tone - Offers practical &quot;what do I do right now&quot; guidance

Parameters:

Options Hash (opts):

  • :x_tq_context_mode (Integer)

    TurboQuant extended context window size (tokens). With 3-bit KV cache, context windows up to 24K tokens are feasible within the same memory budget as standard 4K. (default to 4096)

  • :x_tq_kv_cache_hint (String)

    KV cache management hint. - &#x60;none&#x60;: No caching (default) - &#x60;reuse&#x60;: Reuse KV cache from previous request in same session (40-60% compute savings) - &#x60;persist&#x60;: Persist cache to disk for cross-session reuse (default to ‘none’)

  • :x_tq_model_tier (String)

    Preferred model tier for inference. - &#x60;auto&#x60;: Server selects optimal model based on device capabilities - &#x60;gemma-2b&#x60;: Lightweight model (~0.5GB KV with TQ) - &#x60;gemma-7b&#x60;: Full model, standard KV cache - &#x60;gemma-7b-tq&#x60;: Full model with TurboQuant 3-bit KV cache (~1.3GB) (default to ‘auto’)

Returns:

  • (Array<(BeginnerGuidance, Integer, Hash)>)

    BeginnerGuidance data, response status code and response headers



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/consumer_plant_care_api.rb', line 43

def beginner_guidance_with_http_info(beginner_guidance_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConsumerPlantCareApi.beginner_guidance ...'
  end
  # verify the required parameter 'beginner_guidance_request' is set
  if @api_client.config.client_side_validation && beginner_guidance_request.nil?
    fail ArgumentError, "Missing the required parameter 'beginner_guidance_request' when calling ConsumerPlantCareApi.beginner_guidance"
  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 = '/beginner-guidance'

  # 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(beginner_guidance_request)

  # return_type
  return_type = opts[:debug_return_type] || 'BeginnerGuidance'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']

  new_options = opts.merge(
    :operation => :"ConsumerPlantCareApi.beginner_guidance",
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ConsumerPlantCareApi#beginner_guidance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#dynamic_care(dynamic_care_request, opts = {}) ⇒ DynamicCare

Hyper-localized dynamic plant care recommendations Real-time, environment-aware care recommendations that solve the "generic advice" problem. Unlike static "water every 7 days" recommendations, this endpoint: - Adjusts watering based on current humidity, temperature, and recent rainfall - Considers container type, soil composition, and drainage - Factors in seasonal changes and indoor environment conditions - Accounts for plant maturity and growth phase - Provides actionable guidance, not rigid schedules

Parameters:

  • dynamic_care_request (DynamicCareRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_tq_context_mode (Integer)

    TurboQuant extended context window size (tokens). With 3-bit KV cache, context windows up to 24K tokens are feasible within the same memory budget as standard 4K. (default to 4096)

  • :x_tq_kv_cache_hint (String)

    KV cache management hint. - &#x60;none&#x60;: No caching (default) - &#x60;reuse&#x60;: Reuse KV cache from previous request in same session (40-60% compute savings) - &#x60;persist&#x60;: Persist cache to disk for cross-session reuse (default to ‘none’)

  • :x_tq_model_tier (String)

    Preferred model tier for inference. - &#x60;auto&#x60;: Server selects optimal model based on device capabilities - &#x60;gemma-2b&#x60;: Lightweight model (~0.5GB KV with TQ) - &#x60;gemma-7b&#x60;: Full model, standard KV cache - &#x60;gemma-7b-tq&#x60;: Full model with TurboQuant 3-bit KV cache (~1.3GB) (default to ‘auto’)

Returns:



119
120
121
122
# File 'lib/soilsidekick/api/consumer_plant_care_api.rb', line 119

def dynamic_care(dynamic_care_request, opts = {})
  data, _status_code, _headers = dynamic_care_with_http_info(dynamic_care_request, opts)
  data
end

#dynamic_care_with_http_info(dynamic_care_request, opts = {}) ⇒ Array<(DynamicCare, Integer, Hash)>

Hyper-localized dynamic plant care recommendations Real-time, environment-aware care recommendations that solve the &quot;generic advice&quot; problem. Unlike static &quot;water every 7 days&quot; recommendations, this endpoint: - Adjusts watering based on current humidity, temperature, and recent rainfall - Considers container type, soil composition, and drainage - Factors in seasonal changes and indoor environment conditions - Accounts for plant maturity and growth phase - Provides actionable guidance, not rigid schedules

Parameters:

  • dynamic_care_request (DynamicCareRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_tq_context_mode (Integer)

    TurboQuant extended context window size (tokens). With 3-bit KV cache, context windows up to 24K tokens are feasible within the same memory budget as standard 4K. (default to 4096)

  • :x_tq_kv_cache_hint (String)

    KV cache management hint. - &#x60;none&#x60;: No caching (default) - &#x60;reuse&#x60;: Reuse KV cache from previous request in same session (40-60% compute savings) - &#x60;persist&#x60;: Persist cache to disk for cross-session reuse (default to ‘none’)

  • :x_tq_model_tier (String)

    Preferred model tier for inference. - &#x60;auto&#x60;: Server selects optimal model based on device capabilities - &#x60;gemma-2b&#x60;: Lightweight model (~0.5GB KV with TQ) - &#x60;gemma-7b&#x60;: Full model, standard KV cache - &#x60;gemma-7b-tq&#x60;: Full model with TurboQuant 3-bit KV cache (~1.3GB) (default to ‘auto’)

Returns:

  • (Array<(DynamicCare, Integer, Hash)>)

    DynamicCare data, response status code and response headers



132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
# File 'lib/soilsidekick/api/consumer_plant_care_api.rb', line 132

def dynamic_care_with_http_info(dynamic_care_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConsumerPlantCareApi.dynamic_care ...'
  end
  # verify the required parameter 'dynamic_care_request' is set
  if @api_client.config.client_side_validation && dynamic_care_request.nil?
    fail ArgumentError, "Missing the required parameter 'dynamic_care_request' when calling ConsumerPlantCareApi.dynamic_care"
  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 = '/dynamic-care'

  # 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(dynamic_care_request)

  # return_type
  return_type = opts[:debug_return_type] || 'DynamicCare'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']

  new_options = opts.merge(
    :operation => :"ConsumerPlantCareApi.dynamic_care",
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ConsumerPlantCareApi#dynamic_care\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#safe_identification(safe_identification_request, opts = {}) ⇒ SafeIdentification

Safe plant identification with toxic lookalike warnings Environmentally-contextualized plant identification that addresses misidentification concerns. Unlike generic plant ID, this endpoint: - Checks against a toxic lookalike database with visual similarity scores - Uses environmental context (soil, climate, regional flora) to weight identification probability - Provides confidence breakdowns showing why alternatives were considered - Issues explicit warnings for dangerous lookalikes (Poison Hemlock vs Wild Carrot) - Accounts for plant growth stage (seedling identification challenges)

Parameters:

Options Hash (opts):

  • :x_tq_context_mode (Integer)

    TurboQuant extended context window size (tokens). With 3-bit KV cache, context windows up to 24K tokens are feasible within the same memory budget as standard 4K. (default to 4096)

  • :x_tq_kv_cache_hint (String)

    KV cache management hint. - &#x60;none&#x60;: No caching (default) - &#x60;reuse&#x60;: Reuse KV cache from previous request in same session (40-60% compute savings) - &#x60;persist&#x60;: Persist cache to disk for cross-session reuse (default to ‘none’)

  • :x_tq_model_tier (String)

    Preferred model tier for inference. - &#x60;auto&#x60;: Server selects optimal model based on device capabilities - &#x60;gemma-2b&#x60;: Lightweight model (~0.5GB KV with TQ) - &#x60;gemma-7b&#x60;: Full model, standard KV cache - &#x60;gemma-7b-tq&#x60;: Full model with TurboQuant 3-bit KV cache (~1.3GB) (default to ‘auto’)

Returns:



208
209
210
211
# File 'lib/soilsidekick/api/consumer_plant_care_api.rb', line 208

def safe_identification(safe_identification_request, opts = {})
  data, _status_code, _headers = safe_identification_with_http_info(safe_identification_request, opts)
  data
end

#safe_identification_with_http_info(safe_identification_request, opts = {}) ⇒ Array<(SafeIdentification, Integer, Hash)>

Safe plant identification with toxic lookalike warnings Environmentally-contextualized plant identification that addresses misidentification concerns. Unlike generic plant ID, this endpoint: - Checks against a toxic lookalike database with visual similarity scores - Uses environmental context (soil, climate, regional flora) to weight identification probability - Provides confidence breakdowns showing why alternatives were considered - Issues explicit warnings for dangerous lookalikes (Poison Hemlock vs Wild Carrot) - Accounts for plant growth stage (seedling identification challenges)

Parameters:

Options Hash (opts):

  • :x_tq_context_mode (Integer)

    TurboQuant extended context window size (tokens). With 3-bit KV cache, context windows up to 24K tokens are feasible within the same memory budget as standard 4K. (default to 4096)

  • :x_tq_kv_cache_hint (String)

    KV cache management hint. - &#x60;none&#x60;: No caching (default) - &#x60;reuse&#x60;: Reuse KV cache from previous request in same session (40-60% compute savings) - &#x60;persist&#x60;: Persist cache to disk for cross-session reuse (default to ‘none’)

  • :x_tq_model_tier (String)

    Preferred model tier for inference. - &#x60;auto&#x60;: Server selects optimal model based on device capabilities - &#x60;gemma-2b&#x60;: Lightweight model (~0.5GB KV with TQ) - &#x60;gemma-7b&#x60;: Full model, standard KV cache - &#x60;gemma-7b-tq&#x60;: Full model with TurboQuant 3-bit KV cache (~1.3GB) (default to ‘auto’)

Returns:

  • (Array<(SafeIdentification, Integer, Hash)>)

    SafeIdentification data, response status code and response headers



221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
# File 'lib/soilsidekick/api/consumer_plant_care_api.rb', line 221

def safe_identification_with_http_info(safe_identification_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConsumerPlantCareApi.safe_identification ...'
  end
  # verify the required parameter 'safe_identification_request' is set
  if @api_client.config.client_side_validation && safe_identification_request.nil?
    fail ArgumentError, "Missing the required parameter 'safe_identification_request' when calling ConsumerPlantCareApi.safe_identification"
  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 = '/safe-identification'

  # 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(safe_identification_request)

  # return_type
  return_type = opts[:debug_return_type] || 'SafeIdentification'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']

  new_options = opts.merge(
    :operation => :"ConsumerPlantCareApi.safe_identification",
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ConsumerPlantCareApi#safe_identification\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end