Class: LaunchDarklyApi::AgentControlApi

Inherits:
Object
  • Object
show all
Defined in:
lib/launchdarkly_api/api/agent_control_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ AgentControlApi

Returns a new instance of AgentControlApi.



19
20
21
# File 'lib/launchdarkly_api/api/agent_control_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/launchdarkly_api/api/agent_control_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#delete_agent_graph(ld_api_version, project_key, graph_key, opts = {}) ⇒ nil

Delete agent graph Delete an existing agent graph and all of its edges.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • graph_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


29
30
31
32
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 29

def delete_agent_graph(ld_api_version, project_key, graph_key, opts = {})
  delete_agent_graph_with_http_info(ld_api_version, project_key, graph_key, opts)
  nil
end

#delete_agent_graph_with_http_info(ld_api_version, project_key, graph_key, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete agent graph Delete an existing agent graph and all of its edges.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • graph_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    nil, response status code and response headers



41
42
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
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 41

def delete_agent_graph_with_http_info(ld_api_version, project_key, graph_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentControlApi.delete_agent_graph ...'
  end
  # verify the required parameter 'ld_api_version' is set
  if @api_client.config.client_side_validation && ld_api_version.nil?
    fail ArgumentError, "Missing the required parameter 'ld_api_version' when calling AgentControlApi.delete_agent_graph"
  end
  # verify enum value
  allowable_values = ["beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(ld_api_version)
    fail ArgumentError, "invalid value for \"ld_api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AgentControlApi.delete_agent_graph"
  end
  # verify the required parameter 'graph_key' is set
  if @api_client.config.client_side_validation && graph_key.nil?
    fail ArgumentError, "Missing the required parameter 'graph_key' when calling AgentControlApi.delete_agent_graph"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/agent-graphs/{graphKey}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'graphKey' + '}', CGI.escape(graph_key.to_s))

  # 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']
  header_params[:'LD-API-Version'] = ld_api_version

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

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

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

#delete_agent_optimization(project_key, optimization_key, opts = {}) ⇒ nil

Delete an agent optimization Delete an existing agent optimization.

Parameters:

  • project_key (String)
  • optimization_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


109
110
111
112
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 109

def delete_agent_optimization(project_key, optimization_key, opts = {})
  delete_agent_optimization_with_http_info(project_key, optimization_key, opts)
  nil
end

#delete_agent_optimization_run(ld_api_version, project_key, optimization_key, run_id, opts = {}) ⇒ nil

Delete an agent optimization run Delete all results for a specific run of an agent optimization. Returns a 404 if the optimization does not exist or if the run has no results. A run whose results have already been deleted is indistinguishable from a run that never existed, so repeating this request also returns a 404.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • optimization_key (String)
  • run_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


180
181
182
183
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 180

def delete_agent_optimization_run(ld_api_version, project_key, optimization_key, run_id, opts = {})
  delete_agent_optimization_run_with_http_info(ld_api_version, project_key, optimization_key, run_id, opts)
  nil
end

#delete_agent_optimization_run_with_http_info(ld_api_version, project_key, optimization_key, run_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete an agent optimization run Delete all results for a specific run of an agent optimization. Returns a 404 if the optimization does not exist or if the run has no results. A run whose results have already been deleted is indistinguishable from a run that never existed, so repeating this request also returns a 404.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • optimization_key (String)
  • run_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    nil, response status code and response headers



193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
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
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 193

def delete_agent_optimization_run_with_http_info(ld_api_version, project_key, optimization_key, run_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentControlApi.delete_agent_optimization_run ...'
  end
  # verify the required parameter 'ld_api_version' is set
  if @api_client.config.client_side_validation && ld_api_version.nil?
    fail ArgumentError, "Missing the required parameter 'ld_api_version' when calling AgentControlApi.delete_agent_optimization_run"
  end
  # verify enum value
  allowable_values = ["beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(ld_api_version)
    fail ArgumentError, "invalid value for \"ld_api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AgentControlApi.delete_agent_optimization_run"
  end
  # verify the required parameter 'optimization_key' is set
  if @api_client.config.client_side_validation && optimization_key.nil?
    fail ArgumentError, "Missing the required parameter 'optimization_key' when calling AgentControlApi.delete_agent_optimization_run"
  end
  # verify the required parameter 'run_id' is set
  if @api_client.config.client_side_validation && run_id.nil?
    fail ArgumentError, "Missing the required parameter 'run_id' when calling AgentControlApi.delete_agent_optimization_run"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/agent-optimizations/{optimizationKey}/runs/{runId}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'optimizationKey' + '}', CGI.escape(optimization_key.to_s)).sub('{' + 'runId' + '}', CGI.escape(run_id.to_s))

  # 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']
  header_params[:'LD-API-Version'] = ld_api_version

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

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

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

#delete_agent_optimization_with_http_info(project_key, optimization_key, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete an agent optimization Delete an existing agent optimization.

Parameters:

  • project_key (String)
  • optimization_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    nil, response status code and response headers



120
121
122
123
124
125
126
127
128
129
130
131
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
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 120

def delete_agent_optimization_with_http_info(project_key, optimization_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentControlApi.delete_agent_optimization ...'
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AgentControlApi.delete_agent_optimization"
  end
  # verify the required parameter 'optimization_key' is set
  if @api_client.config.client_side_validation && optimization_key.nil?
    fail ArgumentError, "Missing the required parameter 'optimization_key' when calling AgentControlApi.delete_agent_optimization"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/agent-optimizations/{optimizationKey}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'optimizationKey' + '}', CGI.escape(optimization_key.to_s))

  # 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']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

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

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

#delete_ai_config(project_key, config_key, opts = {}) ⇒ nil

Delete AI Config Delete an existing AI Config.

Parameters:

  • project_key (String)
  • config_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


265
266
267
268
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 265

def delete_ai_config(project_key, config_key, opts = {})
  delete_ai_config_with_http_info(project_key, config_key, opts)
  nil
end

#delete_ai_config_variation(project_key, config_key, variation_key, opts = {}) ⇒ nil

Delete AI Config variation Delete a specific variation of an AI Config by config key and variation key.

Parameters:

  • project_key (String)
  • config_key (String)
  • variation_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


335
336
337
338
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 335

def delete_ai_config_variation(project_key, config_key, variation_key, opts = {})
  delete_ai_config_variation_with_http_info(project_key, config_key, variation_key, opts)
  nil
end

#delete_ai_config_variation_with_http_info(project_key, config_key, variation_key, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete AI Config variation Delete a specific variation of an AI Config by config key and variation key.

Parameters:

  • project_key (String)
  • config_key (String)
  • variation_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    nil, response status code and response headers



347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 347

def delete_ai_config_variation_with_http_info(project_key, config_key, variation_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentControlApi.delete_ai_config_variation ...'
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AgentControlApi.delete_ai_config_variation"
  end
  # verify the required parameter 'config_key' is set
  if @api_client.config.client_side_validation && config_key.nil?
    fail ArgumentError, "Missing the required parameter 'config_key' when calling AgentControlApi.delete_ai_config_variation"
  end
  # verify the required parameter 'variation_key' is set
  if @api_client.config.client_side_validation && variation_key.nil?
    fail ArgumentError, "Missing the required parameter 'variation_key' when calling AgentControlApi.delete_ai_config_variation"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/ai-configs/{configKey}/variations/{variationKey}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'configKey' + '}', CGI.escape(config_key.to_s)).sub('{' + 'variationKey' + '}', CGI.escape(variation_key.to_s))

  # 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']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

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

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

#delete_ai_config_with_http_info(project_key, config_key, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete AI Config Delete an existing AI Config.

Parameters:

  • project_key (String)
  • config_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    nil, response status code and response headers



276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 276

def delete_ai_config_with_http_info(project_key, config_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentControlApi.delete_ai_config ...'
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AgentControlApi.delete_ai_config"
  end
  # verify the required parameter 'config_key' is set
  if @api_client.config.client_side_validation && config_key.nil?
    fail ArgumentError, "Missing the required parameter 'config_key' when calling AgentControlApi.delete_ai_config"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/ai-configs/{configKey}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'configKey' + '}', CGI.escape(config_key.to_s))

  # 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']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

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

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

#delete_ai_tool(project_key, tool_key, opts = {}) ⇒ nil

Delete AI tool Delete an existing AI tool.

Parameters:

  • project_key (String)
  • tool_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


409
410
411
412
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 409

def delete_ai_tool(project_key, tool_key, opts = {})
  delete_ai_tool_with_http_info(project_key, tool_key, opts)
  nil
end

#delete_ai_tool_with_http_info(project_key, tool_key, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete AI tool Delete an existing AI tool.

Parameters:

  • project_key (String)
  • tool_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    nil, response status code and response headers



420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 420

def delete_ai_tool_with_http_info(project_key, tool_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentControlApi.delete_ai_tool ...'
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AgentControlApi.delete_ai_tool"
  end
  # verify the required parameter 'tool_key' is set
  if @api_client.config.client_side_validation && tool_key.nil?
    fail ArgumentError, "Missing the required parameter 'tool_key' when calling AgentControlApi.delete_ai_tool"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/ai-tools/{toolKey}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'toolKey' + '}', CGI.escape(tool_key.to_s))

  # 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']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

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

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

#delete_model_config(project_key, model_config_key, opts = {}) ⇒ nil

Delete an AI model config Delete an AI model config.

Parameters:

  • project_key (String)
  • model_config_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


478
479
480
481
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 478

def delete_model_config(project_key, model_config_key, opts = {})
  delete_model_config_with_http_info(project_key, model_config_key, opts)
  nil
end

#delete_model_config_with_http_info(project_key, model_config_key, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete an AI model config Delete an AI model config.

Parameters:

  • project_key (String)
  • model_config_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    nil, response status code and response headers



489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 489

def delete_model_config_with_http_info(project_key, model_config_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentControlApi.delete_model_config ...'
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AgentControlApi.delete_model_config"
  end
  # verify the required parameter 'model_config_key' is set
  if @api_client.config.client_side_validation && model_config_key.nil?
    fail ArgumentError, "Missing the required parameter 'model_config_key' when calling AgentControlApi.delete_model_config"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/ai-configs/model-configs/{modelConfigKey}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'modelConfigKey' + '}', CGI.escape(model_config_key.to_s))

  # 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']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

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

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

#delete_prompt_snippet(project_key, snippet_key, opts = {}) ⇒ nil

Delete a prompt snippet Delete an existing prompt snippet.

Parameters:

  • project_key (String)
  • snippet_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


547
548
549
550
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 547

def delete_prompt_snippet(project_key, snippet_key, opts = {})
  delete_prompt_snippet_with_http_info(project_key, snippet_key, opts)
  nil
end

#delete_prompt_snippet_with_http_info(project_key, snippet_key, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete a prompt snippet Delete an existing prompt snippet.

Parameters:

  • project_key (String)
  • snippet_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    nil, response status code and response headers



558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 558

def delete_prompt_snippet_with_http_info(project_key, snippet_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentControlApi.delete_prompt_snippet ...'
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AgentControlApi.delete_prompt_snippet"
  end
  # verify the required parameter 'snippet_key' is set
  if @api_client.config.client_side_validation && snippet_key.nil?
    fail ArgumentError, "Missing the required parameter 'snippet_key' when calling AgentControlApi.delete_prompt_snippet"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/ai-configs/prompt-snippets/{snippetKey}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'snippetKey' + '}', CGI.escape(snippet_key.to_s))

  # 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']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

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

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

#delete_restricted_models(project_key, restricted_models_request, opts = {}) ⇒ nil

Remove AI models from the restricted list Remove AI models, by key, from the restricted list.

Parameters:

  • project_key (String)
  • restricted_models_request (RestrictedModelsRequest)

    List of AI model keys to remove from the restricted list

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

    the optional parameters

Returns:

  • (nil)


616
617
618
619
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 616

def delete_restricted_models(project_key, restricted_models_request, opts = {})
  delete_restricted_models_with_http_info(project_key, restricted_models_request, opts)
  nil
end

#delete_restricted_models_with_http_info(project_key, restricted_models_request, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Remove AI models from the restricted list Remove AI models, by key, from the restricted list.

Parameters:

  • project_key (String)
  • restricted_models_request (RestrictedModelsRequest)

    List of AI model keys to remove from the restricted list

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 627

def delete_restricted_models_with_http_info(project_key, restricted_models_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentControlApi.delete_restricted_models ...'
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AgentControlApi.delete_restricted_models"
  end
  # verify the required parameter 'restricted_models_request' is set
  if @api_client.config.client_side_validation && restricted_models_request.nil?
    fail ArgumentError, "Missing the required parameter 'restricted_models_request' when calling AgentControlApi.delete_restricted_models"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/ai-configs/model-configs/restricted'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s))

  # 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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(restricted_models_request)

  # return_type
  return_type = opts[:debug_return_type]

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

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

#get_agent_graph(ld_api_version, project_key, graph_key, opts = {}) ⇒ AgentGraph

Get agent graph Retrieve a specific agent graph by its key, including its edges.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • graph_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



691
692
693
694
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 691

def get_agent_graph(ld_api_version, project_key, graph_key, opts = {})
  data, _status_code, _headers = get_agent_graph_with_http_info(ld_api_version, project_key, graph_key, opts)
  data
end

#get_agent_graph_with_http_info(ld_api_version, project_key, graph_key, opts = {}) ⇒ Array<(AgentGraph, Integer, Hash)>

Get agent graph Retrieve a specific agent graph by its key, including its edges.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • graph_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    AgentGraph data, response status code and response headers



703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 703

def get_agent_graph_with_http_info(ld_api_version, project_key, graph_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentControlApi.get_agent_graph ...'
  end
  # verify the required parameter 'ld_api_version' is set
  if @api_client.config.client_side_validation && ld_api_version.nil?
    fail ArgumentError, "Missing the required parameter 'ld_api_version' when calling AgentControlApi.get_agent_graph"
  end
  # verify enum value
  allowable_values = ["beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(ld_api_version)
    fail ArgumentError, "invalid value for \"ld_api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AgentControlApi.get_agent_graph"
  end
  # verify the required parameter 'graph_key' is set
  if @api_client.config.client_side_validation && graph_key.nil?
    fail ArgumentError, "Missing the required parameter 'graph_key' when calling AgentControlApi.get_agent_graph"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/agent-graphs/{graphKey}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'graphKey' + '}', CGI.escape(graph_key.to_s))

  # 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']
  header_params[:'LD-API-Version'] = ld_api_version

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

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

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

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

#get_agent_optimization(project_key, optimization_key, opts = {}) ⇒ AgentOptimization

Get an agent optimization Retrieve a specific agent optimization by its key.

Parameters:

  • project_key (String)
  • optimization_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



771
772
773
774
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 771

def get_agent_optimization(project_key, optimization_key, opts = {})
  data, _status_code, _headers = get_agent_optimization_with_http_info(project_key, optimization_key, opts)
  data
end

#get_agent_optimization_with_http_info(project_key, optimization_key, opts = {}) ⇒ Array<(AgentOptimization, Integer, Hash)>

Get an agent optimization Retrieve a specific agent optimization by its key.

Parameters:

  • project_key (String)
  • optimization_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    AgentOptimization data, response status code and response headers



782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 782

def get_agent_optimization_with_http_info(project_key, optimization_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentControlApi.get_agent_optimization ...'
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AgentControlApi.get_agent_optimization"
  end
  # verify the required parameter 'optimization_key' is set
  if @api_client.config.client_side_validation && optimization_key.nil?
    fail ArgumentError, "Missing the required parameter 'optimization_key' when calling AgentControlApi.get_agent_optimization"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/agent-optimizations/{optimizationKey}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'optimizationKey' + '}', CGI.escape(optimization_key.to_s))

  # 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']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

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

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

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

#get_ai_config(project_key, config_key, opts = {}) ⇒ AIConfig

Get AI Config Retrieve a specific AI Config by its key.

Parameters:

  • project_key (String)
  • config_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



840
841
842
843
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 840

def get_ai_config(project_key, config_key, opts = {})
  data, _status_code, _headers = get_ai_config_with_http_info(project_key, config_key, opts)
  data
end

#get_ai_config_metrics(project_key, config_key, from, to, env, opts = {}) ⇒ Metrics

Get AI Config metrics Retrieve usage metrics for an AI Config by config key.

Parameters:

  • project_key (String)
  • config_key (String)
  • from (Integer)

    The starting time, as milliseconds since epoch (inclusive).

  • to (Integer)

    The ending time, as milliseconds since epoch (exclusive). May not be more than 100 days after `from`.

  • env (String)

    An environment key. Only metrics from this environment will be included.

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

    the optional parameters

Options Hash (opts):

  • :context_kind (String)

    A context kind. Only metrics from events that include a context of this kind are included. Required if `contextKey` is provided.

  • :context_key (String)

    A context key. Only metrics from events whose context of the `contextKind` kind has this key are included. Requires `contextKind`.

Returns:



914
915
916
917
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 914

def get_ai_config_metrics(project_key, config_key, from, to, env, opts = {})
  data, _status_code, _headers = get_ai_config_metrics_with_http_info(project_key, config_key, from, to, env, opts)
  data
end

#get_ai_config_metrics_by_variation(project_key, config_key, from, to, env, opts = {}) ⇒ Array<MetricByVariation>

Get AI Config metrics by variation Retrieve usage metrics for an AI Config by config key, with results split by variation.

Parameters:

  • project_key (String)
  • config_key (String)
  • from (Integer)

    The starting time, as milliseconds since epoch (inclusive).

  • to (Integer)

    The ending time, as milliseconds since epoch (exclusive). May not be more than 100 days after `from`.

  • env (String)

    An environment key. Only metrics from this environment will be included.

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

    the optional parameters

Options Hash (opts):

  • :context_kind (String)

    A context kind. Only metrics from events that include a context of this kind are included. Required if `contextKey` is provided.

  • :context_key (String)

    A context key. Only metrics from events whose context of the `contextKind` kind has this key are included. Requires `contextKind`.

Returns:



1010
1011
1012
1013
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 1010

def get_ai_config_metrics_by_variation(project_key, config_key, from, to, env, opts = {})
  data, _status_code, _headers = get_ai_config_metrics_by_variation_with_http_info(project_key, config_key, from, to, env, opts)
  data
end

#get_ai_config_metrics_by_variation_with_http_info(project_key, config_key, from, to, env, opts = {}) ⇒ Array<(Array<MetricByVariation>, Integer, Hash)>

Get AI Config metrics by variation Retrieve usage metrics for an AI Config by config key, with results split by variation.

Parameters:

  • project_key (String)
  • config_key (String)
  • from (Integer)

    The starting time, as milliseconds since epoch (inclusive).

  • to (Integer)

    The ending time, as milliseconds since epoch (exclusive). May not be more than 100 days after `from`.

  • env (String)

    An environment key. Only metrics from this environment will be included.

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

    the optional parameters

Options Hash (opts):

  • :context_kind (String)

    A context kind. Only metrics from events that include a context of this kind are included. Required if `contextKey` is provided.

  • :context_key (String)

    A context key. Only metrics from events whose context of the `contextKind` kind has this key are included. Requires `contextKind`.

Returns:

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

    Array data, response status code and response headers



1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 1026

def get_ai_config_metrics_by_variation_with_http_info(project_key, config_key, from, to, env, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentControlApi.get_ai_config_metrics_by_variation ...'
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AgentControlApi.get_ai_config_metrics_by_variation"
  end
  # verify the required parameter 'config_key' is set
  if @api_client.config.client_side_validation && config_key.nil?
    fail ArgumentError, "Missing the required parameter 'config_key' when calling AgentControlApi.get_ai_config_metrics_by_variation"
  end
  # verify the required parameter 'from' is set
  if @api_client.config.client_side_validation && from.nil?
    fail ArgumentError, "Missing the required parameter 'from' when calling AgentControlApi.get_ai_config_metrics_by_variation"
  end
  # verify the required parameter 'to' is set
  if @api_client.config.client_side_validation && to.nil?
    fail ArgumentError, "Missing the required parameter 'to' when calling AgentControlApi.get_ai_config_metrics_by_variation"
  end
  # verify the required parameter 'env' is set
  if @api_client.config.client_side_validation && env.nil?
    fail ArgumentError, "Missing the required parameter 'env' when calling AgentControlApi.get_ai_config_metrics_by_variation"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/ai-configs/{configKey}/metrics-by-variation'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'configKey' + '}', CGI.escape(config_key.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'from'] = from
  query_params[:'to'] = to
  query_params[:'env'] = env
  query_params[:'contextKind'] = opts[:'context_kind'] if !opts[:'context_kind'].nil?
  query_params[:'contextKey'] = opts[:'context_key'] if !opts[:'context_key'].nil?

  # 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']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Array<MetricByVariation>'

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

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

#get_ai_config_metrics_with_http_info(project_key, config_key, from, to, env, opts = {}) ⇒ Array<(Metrics, Integer, Hash)>

Get AI Config metrics Retrieve usage metrics for an AI Config by config key.

Parameters:

  • project_key (String)
  • config_key (String)
  • from (Integer)

    The starting time, as milliseconds since epoch (inclusive).

  • to (Integer)

    The ending time, as milliseconds since epoch (exclusive). May not be more than 100 days after `from`.

  • env (String)

    An environment key. Only metrics from this environment will be included.

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

    the optional parameters

Options Hash (opts):

  • :context_kind (String)

    A context kind. Only metrics from events that include a context of this kind are included. Required if `contextKey` is provided.

  • :context_key (String)

    A context key. Only metrics from events whose context of the `contextKind` kind has this key are included. Requires `contextKind`.

Returns:

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

    Metrics data, response status code and response headers



930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 930

def get_ai_config_metrics_with_http_info(project_key, config_key, from, to, env, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentControlApi.get_ai_config_metrics ...'
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AgentControlApi.get_ai_config_metrics"
  end
  # verify the required parameter 'config_key' is set
  if @api_client.config.client_side_validation && config_key.nil?
    fail ArgumentError, "Missing the required parameter 'config_key' when calling AgentControlApi.get_ai_config_metrics"
  end
  # verify the required parameter 'from' is set
  if @api_client.config.client_side_validation && from.nil?
    fail ArgumentError, "Missing the required parameter 'from' when calling AgentControlApi.get_ai_config_metrics"
  end
  # verify the required parameter 'to' is set
  if @api_client.config.client_side_validation && to.nil?
    fail ArgumentError, "Missing the required parameter 'to' when calling AgentControlApi.get_ai_config_metrics"
  end
  # verify the required parameter 'env' is set
  if @api_client.config.client_side_validation && env.nil?
    fail ArgumentError, "Missing the required parameter 'env' when calling AgentControlApi.get_ai_config_metrics"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/ai-configs/{configKey}/metrics'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'configKey' + '}', CGI.escape(config_key.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'from'] = from
  query_params[:'to'] = to
  query_params[:'env'] = env
  query_params[:'contextKind'] = opts[:'context_kind'] if !opts[:'context_kind'].nil?
  query_params[:'contextKey'] = opts[:'context_key'] if !opts[:'context_key'].nil?

  # 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']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

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

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

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

#get_ai_config_quick_stats(project_key, env, opts = {}) ⇒ QuickStats

Get AI Config quick stats Retrieve aggregate quick stats for AI Configs in a project.

Parameters:

  • project_key (String)
  • env (String)

    An environment key. Only metrics from this environment will be included.

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

    the optional parameters

Returns:



1101
1102
1103
1104
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 1101

def get_ai_config_quick_stats(project_key, env, opts = {})
  data, _status_code, _headers = get_ai_config_quick_stats_with_http_info(project_key, env, opts)
  data
end

#get_ai_config_quick_stats_with_http_info(project_key, env, opts = {}) ⇒ Array<(QuickStats, Integer, Hash)>

Get AI Config quick stats Retrieve aggregate quick stats for AI Configs in a project.

Parameters:

  • project_key (String)
  • env (String)

    An environment key. Only metrics from this environment will be included.

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

    the optional parameters

Returns:

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

    QuickStats data, response status code and response headers



1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 1112

def get_ai_config_quick_stats_with_http_info(project_key, env, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentControlApi.get_ai_config_quick_stats ...'
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AgentControlApi.get_ai_config_quick_stats"
  end
  # verify the required parameter 'env' is set
  if @api_client.config.client_side_validation && env.nil?
    fail ArgumentError, "Missing the required parameter 'env' when calling AgentControlApi.get_ai_config_quick_stats"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/ai-configs/quick-stats'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'env'] = env

  # 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']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

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

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

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

#get_ai_config_targeting(project_key, config_key, opts = {}) ⇒ AIConfigTargeting

Show an AI Config's targeting Retrieves a specific AI Config's targeting by its key

Parameters:

  • project_key (String)
  • config_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1171
1172
1173
1174
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 1171

def get_ai_config_targeting(project_key, config_key, opts = {})
  data, _status_code, _headers = get_ai_config_targeting_with_http_info(project_key, config_key, opts)
  data
end

#get_ai_config_targeting_with_http_info(project_key, config_key, opts = {}) ⇒ Array<(AIConfigTargeting, Integer, Hash)>

Show an AI Config's targeting Retrieves a specific AI Config's targeting by its key

Parameters:

  • project_key (String)
  • config_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    AIConfigTargeting data, response status code and response headers



1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 1182

def get_ai_config_targeting_with_http_info(project_key, config_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentControlApi.get_ai_config_targeting ...'
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AgentControlApi.get_ai_config_targeting"
  end
  # verify the required parameter 'config_key' is set
  if @api_client.config.client_side_validation && config_key.nil?
    fail ArgumentError, "Missing the required parameter 'config_key' when calling AgentControlApi.get_ai_config_targeting"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/ai-configs/{configKey}/targeting'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'configKey' + '}', CGI.escape(config_key.to_s))

  # 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']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

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

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

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

#get_ai_config_variation(project_key, config_key, variation_key, opts = {}) ⇒ AIConfigVariationsResponse

Get AI Config variation Get an AI Config variation by key. The response includes all variation versions for the given variation key.

Parameters:

  • project_key (String)
  • config_key (String)
  • variation_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1241
1242
1243
1244
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 1241

def get_ai_config_variation(project_key, config_key, variation_key, opts = {})
  data, _status_code, _headers = get_ai_config_variation_with_http_info(project_key, config_key, variation_key, opts)
  data
end

#get_ai_config_variation_with_http_info(project_key, config_key, variation_key, opts = {}) ⇒ Array<(AIConfigVariationsResponse, Integer, Hash)>

Get AI Config variation Get an AI Config variation by key. The response includes all variation versions for the given variation key.

Parameters:

  • project_key (String)
  • config_key (String)
  • variation_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    AIConfigVariationsResponse data, response status code and response headers



1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 1253

def get_ai_config_variation_with_http_info(project_key, config_key, variation_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentControlApi.get_ai_config_variation ...'
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AgentControlApi.get_ai_config_variation"
  end
  # verify the required parameter 'config_key' is set
  if @api_client.config.client_side_validation && config_key.nil?
    fail ArgumentError, "Missing the required parameter 'config_key' when calling AgentControlApi.get_ai_config_variation"
  end
  # verify the required parameter 'variation_key' is set
  if @api_client.config.client_side_validation && variation_key.nil?
    fail ArgumentError, "Missing the required parameter 'variation_key' when calling AgentControlApi.get_ai_config_variation"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/ai-configs/{configKey}/variations/{variationKey}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'configKey' + '}', CGI.escape(config_key.to_s)).sub('{' + 'variationKey' + '}', CGI.escape(variation_key.to_s))

  # 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']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

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

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

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

#get_ai_config_with_http_info(project_key, config_key, opts = {}) ⇒ Array<(AIConfig, Integer, Hash)>

Get AI Config Retrieve a specific AI Config by its key.

Parameters:

  • project_key (String)
  • config_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    AIConfig data, response status code and response headers



851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 851

def get_ai_config_with_http_info(project_key, config_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentControlApi.get_ai_config ...'
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AgentControlApi.get_ai_config"
  end
  # verify the required parameter 'config_key' is set
  if @api_client.config.client_side_validation && config_key.nil?
    fail ArgumentError, "Missing the required parameter 'config_key' when calling AgentControlApi.get_ai_config"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/ai-configs/{configKey}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'configKey' + '}', CGI.escape(config_key.to_s))

  # 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']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

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

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

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

#get_ai_configs(project_key, opts = {}) ⇒ AIConfigs

List AI Configs Get a list of all AI Configs in the given project.

Parameters:

  • project_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :sort (String)

    A sort to apply to the list of AgentControl configs.

  • :limit (Integer)

    The number of resources to return.

  • :offset (Integer)

    Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.

  • :filter (String)

    A filter to apply to the list.

Returns:



1318
1319
1320
1321
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 1318

def get_ai_configs(project_key, opts = {})
  data, _status_code, _headers = get_ai_configs_with_http_info(project_key, opts)
  data
end

#get_ai_configs_with_http_info(project_key, opts = {}) ⇒ Array<(AIConfigs, Integer, Hash)>

List AI Configs Get a list of all AI Configs in the given project.

Parameters:

  • project_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :sort (String)

    A sort to apply to the list of AgentControl configs.

  • :limit (Integer)

    The number of resources to return.

  • :offset (Integer)

    Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.

  • :filter (String)

    A filter to apply to the list.

Returns:

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

    AIConfigs data, response status code and response headers



1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 1332

def get_ai_configs_with_http_info(project_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentControlApi.get_ai_configs ...'
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AgentControlApi.get_ai_configs"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/ai-configs'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?

  # 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']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

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

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

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

#get_ai_tool(project_key, tool_key, opts = {}) ⇒ AITool

Get AI tool Retrieve a specific AI tool by its key.

Parameters:

  • project_key (String)
  • tool_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1390
1391
1392
1393
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 1390

def get_ai_tool(project_key, tool_key, opts = {})
  data, _status_code, _headers = get_ai_tool_with_http_info(project_key, tool_key, opts)
  data
end

#get_ai_tool_with_http_info(project_key, tool_key, opts = {}) ⇒ Array<(AITool, Integer, Hash)>

Get AI tool Retrieve a specific AI tool by its key.

Parameters:

  • project_key (String)
  • tool_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    AITool data, response status code and response headers



1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 1401

def get_ai_tool_with_http_info(project_key, tool_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentControlApi.get_ai_tool ...'
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AgentControlApi.get_ai_tool"
  end
  # verify the required parameter 'tool_key' is set
  if @api_client.config.client_side_validation && tool_key.nil?
    fail ArgumentError, "Missing the required parameter 'tool_key' when calling AgentControlApi.get_ai_tool"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/ai-tools/{toolKey}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'toolKey' + '}', CGI.escape(tool_key.to_s))

  # 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']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

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

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

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

#get_model_config(project_key, model_config_key, opts = {}) ⇒ ModelConfig

Get AI model config Get an AI model config by key.

Parameters:

  • project_key (String)
  • model_config_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1459
1460
1461
1462
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 1459

def get_model_config(project_key, model_config_key, opts = {})
  data, _status_code, _headers = get_model_config_with_http_info(project_key, model_config_key, opts)
  data
end

#get_model_config_with_http_info(project_key, model_config_key, opts = {}) ⇒ Array<(ModelConfig, Integer, Hash)>

Get AI model config Get an AI model config by key.

Parameters:

  • project_key (String)
  • model_config_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    ModelConfig data, response status code and response headers



1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 1470

def get_model_config_with_http_info(project_key, model_config_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentControlApi.get_model_config ...'
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AgentControlApi.get_model_config"
  end
  # verify the required parameter 'model_config_key' is set
  if @api_client.config.client_side_validation && model_config_key.nil?
    fail ArgumentError, "Missing the required parameter 'model_config_key' when calling AgentControlApi.get_model_config"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/ai-configs/model-configs/{modelConfigKey}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'modelConfigKey' + '}', CGI.escape(model_config_key.to_s))

  # 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']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

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

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

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

#get_prompt_snippet(project_key, snippet_key, opts = {}) ⇒ PromptSnippet

Get a prompt snippet Retrieve a specific prompt snippet by its key.

Parameters:

  • project_key (String)
  • snippet_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1528
1529
1530
1531
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 1528

def get_prompt_snippet(project_key, snippet_key, opts = {})
  data, _status_code, _headers = get_prompt_snippet_with_http_info(project_key, snippet_key, opts)
  data
end

#get_prompt_snippet_with_http_info(project_key, snippet_key, opts = {}) ⇒ Array<(PromptSnippet, Integer, Hash)>

Get a prompt snippet Retrieve a specific prompt snippet by its key.

Parameters:

  • project_key (String)
  • snippet_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    PromptSnippet data, response status code and response headers



1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 1539

def get_prompt_snippet_with_http_info(project_key, snippet_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentControlApi.get_prompt_snippet ...'
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AgentControlApi.get_prompt_snippet"
  end
  # verify the required parameter 'snippet_key' is set
  if @api_client.config.client_side_validation && snippet_key.nil?
    fail ArgumentError, "Missing the required parameter 'snippet_key' when calling AgentControlApi.get_prompt_snippet"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/ai-configs/prompt-snippets/{snippetKey}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'snippetKey' + '}', CGI.escape(snippet_key.to_s))

  # 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']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

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

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

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

#list_agent_graphs(ld_api_version, project_key, opts = {}) ⇒ AgentGraphs

List agent graphs Get a list of all agent graphs in the given project. Returns metadata only, without edge data.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    The number of resources to return.

  • :offset (Integer)

    Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.

  • :filter (String)

    A filter to apply to the list.

Returns:



1600
1601
1602
1603
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 1600

def list_agent_graphs(ld_api_version, project_key, opts = {})
  data, _status_code, _headers = list_agent_graphs_with_http_info(ld_api_version, project_key, opts)
  data
end

#list_agent_graphs_with_http_info(ld_api_version, project_key, opts = {}) ⇒ Array<(AgentGraphs, Integer, Hash)>

List agent graphs Get a list of all agent graphs in the given project. Returns metadata only, without edge data.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    The number of resources to return.

  • :offset (Integer)

    Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.

  • :filter (String)

    A filter to apply to the list.

Returns:

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

    AgentGraphs data, response status code and response headers



1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 1614

def list_agent_graphs_with_http_info(ld_api_version, project_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentControlApi.list_agent_graphs ...'
  end
  # verify the required parameter 'ld_api_version' is set
  if @api_client.config.client_side_validation && ld_api_version.nil?
    fail ArgumentError, "Missing the required parameter 'ld_api_version' when calling AgentControlApi.list_agent_graphs"
  end
  # verify enum value
  allowable_values = ["beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(ld_api_version)
    fail ArgumentError, "invalid value for \"ld_api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AgentControlApi.list_agent_graphs"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/agent-graphs'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?

  # 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']
  header_params[:'LD-API-Version'] = ld_api_version

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

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

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

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

#list_agent_optimization_results(project_key, optimization_key, opts = {}) ⇒ AgentOptimizationResults

List agent optimization runs Get the most recent result for each unique run of an agent optimization.

Parameters:

  • project_key (String)
  • optimization_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    The number of resources to return.

  • :offset (Integer)

    Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.

Returns:



1683
1684
1685
1686
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 1683

def list_agent_optimization_results(project_key, optimization_key, opts = {})
  data, _status_code, _headers = list_agent_optimization_results_with_http_info(project_key, optimization_key, opts)
  data
end

#list_agent_optimization_results_by_run_id(project_key, optimization_key, run_id, opts = {}) ⇒ AgentOptimizationResults

List agent optimization results for a run Get all results for a specific run of an agent optimization, sorted by iteration descending.

Parameters:

  • project_key (String)
  • optimization_key (String)
  • run_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1757
1758
1759
1760
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 1757

def list_agent_optimization_results_by_run_id(project_key, optimization_key, run_id, opts = {})
  data, _status_code, _headers = list_agent_optimization_results_by_run_id_with_http_info(project_key, optimization_key, run_id, opts)
  data
end

#list_agent_optimization_results_by_run_id_with_http_info(project_key, optimization_key, run_id, opts = {}) ⇒ Array<(AgentOptimizationResults, Integer, Hash)>

List agent optimization results for a run Get all results for a specific run of an agent optimization, sorted by iteration descending.

Parameters:

  • project_key (String)
  • optimization_key (String)
  • run_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    AgentOptimizationResults data, response status code and response headers



1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 1769

def list_agent_optimization_results_by_run_id_with_http_info(project_key, optimization_key, run_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentControlApi.list_agent_optimization_results_by_run_id ...'
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AgentControlApi.list_agent_optimization_results_by_run_id"
  end
  # verify the required parameter 'optimization_key' is set
  if @api_client.config.client_side_validation && optimization_key.nil?
    fail ArgumentError, "Missing the required parameter 'optimization_key' when calling AgentControlApi.list_agent_optimization_results_by_run_id"
  end
  # verify the required parameter 'run_id' is set
  if @api_client.config.client_side_validation && run_id.nil?
    fail ArgumentError, "Missing the required parameter 'run_id' when calling AgentControlApi.list_agent_optimization_results_by_run_id"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/agent-optimizations/{optimizationKey}/runs/{runId}/results'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'optimizationKey' + '}', CGI.escape(optimization_key.to_s)).sub('{' + 'runId' + '}', CGI.escape(run_id.to_s))

  # 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']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

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

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

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

#list_agent_optimization_results_with_http_info(project_key, optimization_key, opts = {}) ⇒ Array<(AgentOptimizationResults, Integer, Hash)>

List agent optimization runs Get the most recent result for each unique run of an agent optimization.

Parameters:

  • project_key (String)
  • optimization_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    The number of resources to return.

  • :offset (Integer)

    Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.

Returns:

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

    AgentOptimizationResults data, response status code and response headers



1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 1696

def list_agent_optimization_results_with_http_info(project_key, optimization_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentControlApi.list_agent_optimization_results ...'
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AgentControlApi.list_agent_optimization_results"
  end
  # verify the required parameter 'optimization_key' is set
  if @api_client.config.client_side_validation && optimization_key.nil?
    fail ArgumentError, "Missing the required parameter 'optimization_key' when calling AgentControlApi.list_agent_optimization_results"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/agent-optimizations/{optimizationKey}/results'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'optimizationKey' + '}', CGI.escape(optimization_key.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?

  # 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']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

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

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

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

#list_agent_optimizations(project_key, opts = {}) ⇒ AgentOptimizations

List agent optimizations Get a list of all agent optimizations in the given project.

Parameters:

  • project_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    The number of resources to return.

  • :offset (Integer)

    Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.

  • :filter (String)

    A filter to apply to the list.

Returns:



1833
1834
1835
1836
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 1833

def list_agent_optimizations(project_key, opts = {})
  data, _status_code, _headers = list_agent_optimizations_with_http_info(project_key, opts)
  data
end

#list_agent_optimizations_with_http_info(project_key, opts = {}) ⇒ Array<(AgentOptimizations, Integer, Hash)>

List agent optimizations Get a list of all agent optimizations in the given project.

Parameters:

  • project_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    The number of resources to return.

  • :offset (Integer)

    Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.

  • :filter (String)

    A filter to apply to the list.

Returns:

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

    AgentOptimizations data, response status code and response headers



1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 1846

def list_agent_optimizations_with_http_info(project_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentControlApi.list_agent_optimizations ...'
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AgentControlApi.list_agent_optimizations"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/agent-optimizations'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?

  # 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']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

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

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

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

#list_ai_tool_versions(project_key, tool_key, opts = {}) ⇒ AITools

List AI tool versions Get a list of all versions of an AI tool in the given project.

Parameters:

  • project_key (String)
  • tool_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :sort (String)

    A sort to apply to the list of AgentControl configs.

  • :limit (Integer)

    The number of resources to return.

  • :offset (Integer)

    Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.

Returns:



1906
1907
1908
1909
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 1906

def list_ai_tool_versions(project_key, tool_key, opts = {})
  data, _status_code, _headers = list_ai_tool_versions_with_http_info(project_key, tool_key, opts)
  data
end

#list_ai_tool_versions_with_http_info(project_key, tool_key, opts = {}) ⇒ Array<(AITools, Integer, Hash)>

List AI tool versions Get a list of all versions of an AI tool in the given project.

Parameters:

  • project_key (String)
  • tool_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :sort (String)

    A sort to apply to the list of AgentControl configs.

  • :limit (Integer)

    The number of resources to return.

  • :offset (Integer)

    Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.

Returns:

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

    AITools data, response status code and response headers



1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 1920

def list_ai_tool_versions_with_http_info(project_key, tool_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentControlApi.list_ai_tool_versions ...'
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AgentControlApi.list_ai_tool_versions"
  end
  # verify the required parameter 'tool_key' is set
  if @api_client.config.client_side_validation && tool_key.nil?
    fail ArgumentError, "Missing the required parameter 'tool_key' when calling AgentControlApi.list_ai_tool_versions"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/ai-tools/{toolKey}/versions'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'toolKey' + '}', CGI.escape(tool_key.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?

  # 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']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

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

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

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

#list_ai_tools(project_key, opts = {}) ⇒ AITools

List AI tools Get a list of all AI tools in the given project.

Parameters:

  • project_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :sort (String)

    A sort to apply to the list of AgentControl configs.

  • :limit (Integer)

    The number of resources to return.

  • :offset (Integer)

    Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.

  • :filter (String)

    A filter to apply to the list.

Returns:



1984
1985
1986
1987
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 1984

def list_ai_tools(project_key, opts = {})
  data, _status_code, _headers = list_ai_tools_with_http_info(project_key, opts)
  data
end

#list_ai_tools_with_http_info(project_key, opts = {}) ⇒ Array<(AITools, Integer, Hash)>

List AI tools Get a list of all AI tools in the given project.

Parameters:

  • project_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :sort (String)

    A sort to apply to the list of AgentControl configs.

  • :limit (Integer)

    The number of resources to return.

  • :offset (Integer)

    Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.

  • :filter (String)

    A filter to apply to the list.

Returns:

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

    AITools data, response status code and response headers



1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 1998

def list_ai_tools_with_http_info(project_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentControlApi.list_ai_tools ...'
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AgentControlApi.list_ai_tools"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/ai-tools'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?

  # 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']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

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

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

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

#list_all_agent_optimization_results(project_key, optimization_key, opts = {}) ⇒ AgentOptimizationResults

List all agent optimization results across versions Get all results across all versions of an agent optimization.

Parameters:

  • project_key (String)
  • optimization_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    The number of resources to return.

  • :offset (Integer)

    Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.

Returns:



2058
2059
2060
2061
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 2058

def list_all_agent_optimization_results(project_key, optimization_key, opts = {})
  data, _status_code, _headers = list_all_agent_optimization_results_with_http_info(project_key, optimization_key, opts)
  data
end

#list_all_agent_optimization_results_with_http_info(project_key, optimization_key, opts = {}) ⇒ Array<(AgentOptimizationResults, Integer, Hash)>

List all agent optimization results across versions Get all results across all versions of an agent optimization.

Parameters:

  • project_key (String)
  • optimization_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    The number of resources to return.

  • :offset (Integer)

    Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.

Returns:

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

    AgentOptimizationResults data, response status code and response headers



2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 2071

def list_all_agent_optimization_results_with_http_info(project_key, optimization_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentControlApi.list_all_agent_optimization_results ...'
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AgentControlApi.list_all_agent_optimization_results"
  end
  # verify the required parameter 'optimization_key' is set
  if @api_client.config.client_side_validation && optimization_key.nil?
    fail ArgumentError, "Missing the required parameter 'optimization_key' when calling AgentControlApi.list_all_agent_optimization_results"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/agent-optimizations/{optimizationKey}/all-results'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'optimizationKey' + '}', CGI.escape(optimization_key.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?

  # 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']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

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

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

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

#list_model_configs(project_key, opts = {}) ⇒ Array<ModelConfig>

List AI model configs Get all AI model configs for a project.

Parameters:

  • project_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :restricted (Boolean)

    Whether to return only restricted models

Returns:



2131
2132
2133
2134
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 2131

def list_model_configs(project_key, opts = {})
  data, _status_code, _headers = list_model_configs_with_http_info(project_key, opts)
  data
end

#list_model_configs_with_http_info(project_key, opts = {}) ⇒ Array<(Array<ModelConfig>, Integer, Hash)>

List AI model configs Get all AI model configs for a project.

Parameters:

  • project_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :restricted (Boolean)

    Whether to return only restricted models

Returns:

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

    Array data, response status code and response headers



2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 2142

def list_model_configs_with_http_info(project_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentControlApi.list_model_configs ...'
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AgentControlApi.list_model_configs"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/ai-configs/model-configs'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'restricted'] = opts[:'restricted'] if !opts[:'restricted'].nil?

  # 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']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Array<ModelConfig>'

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

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

#list_prompt_snippet_references(project_key, snippet_key, opts = {}) ⇒ SnippetReferences

List prompt snippet references Get all config variations that currently reference this prompt snippet.

Parameters:

  • project_key (String)
  • snippet_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    The number of resources to return.

  • :offset (Integer)

    Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.

Returns:



2199
2200
2201
2202
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 2199

def list_prompt_snippet_references(project_key, snippet_key, opts = {})
  data, _status_code, _headers = list_prompt_snippet_references_with_http_info(project_key, snippet_key, opts)
  data
end

#list_prompt_snippet_references_with_http_info(project_key, snippet_key, opts = {}) ⇒ Array<(SnippetReferences, Integer, Hash)>

List prompt snippet references Get all config variations that currently reference this prompt snippet.

Parameters:

  • project_key (String)
  • snippet_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    The number of resources to return.

  • :offset (Integer)

    Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.

Returns:

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

    SnippetReferences data, response status code and response headers



2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 2212

def list_prompt_snippet_references_with_http_info(project_key, snippet_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentControlApi.list_prompt_snippet_references ...'
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AgentControlApi.list_prompt_snippet_references"
  end
  # verify the required parameter 'snippet_key' is set
  if @api_client.config.client_side_validation && snippet_key.nil?
    fail ArgumentError, "Missing the required parameter 'snippet_key' when calling AgentControlApi.list_prompt_snippet_references"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/ai-configs/prompt-snippets/{snippetKey}/references'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'snippetKey' + '}', CGI.escape(snippet_key.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?

  # 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']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

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

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

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

#list_prompt_snippet_versions(project_key, snippet_key, opts = {}) ⇒ PromptSnippets

List prompt snippet versions Get all versions of a prompt snippet in the given project, ordered by version descending.

Parameters:

  • project_key (String)
  • snippet_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    The number of resources to return.

  • :offset (Integer)

    Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.

Returns:



2274
2275
2276
2277
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 2274

def list_prompt_snippet_versions(project_key, snippet_key, opts = {})
  data, _status_code, _headers = list_prompt_snippet_versions_with_http_info(project_key, snippet_key, opts)
  data
end

#list_prompt_snippet_versions_with_http_info(project_key, snippet_key, opts = {}) ⇒ Array<(PromptSnippets, Integer, Hash)>

List prompt snippet versions Get all versions of a prompt snippet in the given project, ordered by version descending.

Parameters:

  • project_key (String)
  • snippet_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    The number of resources to return.

  • :offset (Integer)

    Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.

Returns:

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

    PromptSnippets data, response status code and response headers



2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 2287

def list_prompt_snippet_versions_with_http_info(project_key, snippet_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentControlApi.list_prompt_snippet_versions ...'
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AgentControlApi.list_prompt_snippet_versions"
  end
  # verify the required parameter 'snippet_key' is set
  if @api_client.config.client_side_validation && snippet_key.nil?
    fail ArgumentError, "Missing the required parameter 'snippet_key' when calling AgentControlApi.list_prompt_snippet_versions"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/ai-configs/prompt-snippets/{snippetKey}/versions'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'snippetKey' + '}', CGI.escape(snippet_key.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?

  # 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']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

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

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

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

#list_prompt_snippets(project_key, opts = {}) ⇒ PromptSnippets

List prompt snippets Get a list of all prompt snippets in the given project.

Parameters:

  • project_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    The number of resources to return.

  • :offset (Integer)

    Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.

  • :filter (String)

    A filter to apply to the list.

Returns:



2349
2350
2351
2352
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 2349

def list_prompt_snippets(project_key, opts = {})
  data, _status_code, _headers = list_prompt_snippets_with_http_info(project_key, opts)
  data
end

#list_prompt_snippets_with_http_info(project_key, opts = {}) ⇒ Array<(PromptSnippets, Integer, Hash)>

List prompt snippets Get a list of all prompt snippets in the given project.

Parameters:

  • project_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    The number of resources to return.

  • :offset (Integer)

    Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.

  • :filter (String)

    A filter to apply to the list.

Returns:

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

    PromptSnippets data, response status code and response headers



2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 2362

def list_prompt_snippets_with_http_info(project_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentControlApi.list_prompt_snippets ...'
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AgentControlApi.list_prompt_snippets"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/ai-configs/prompt-snippets'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?

  # 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']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

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

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

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

#patch_agent_graph(ld_api_version, project_key, graph_key, opts = {}) ⇒ AgentGraph

Update agent graph Edit an existing agent graph. The request body must be a JSON object of the fields to update. The values you include replace the existing values for the fields. If the update includes rootConfigKey or edges, both must be present and will be treated as full replacements.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • graph_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:



2421
2422
2423
2424
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 2421

def patch_agent_graph(ld_api_version, project_key, graph_key, opts = {})
  data, _status_code, _headers = patch_agent_graph_with_http_info(ld_api_version, project_key, graph_key, opts)
  data
end

#patch_agent_graph_with_http_info(ld_api_version, project_key, graph_key, opts = {}) ⇒ Array<(AgentGraph, Integer, Hash)>

Update agent graph Edit an existing agent graph. The request body must be a JSON object of the fields to update. The values you include replace the existing values for the fields. If the update includes `rootConfigKey` or `edges`, both must be present and will be treated as full replacements.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • graph_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:

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

    AgentGraph data, response status code and response headers



2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 2434

def patch_agent_graph_with_http_info(ld_api_version, project_key, graph_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentControlApi.patch_agent_graph ...'
  end
  # verify the required parameter 'ld_api_version' is set
  if @api_client.config.client_side_validation && ld_api_version.nil?
    fail ArgumentError, "Missing the required parameter 'ld_api_version' when calling AgentControlApi.patch_agent_graph"
  end
  # verify enum value
  allowable_values = ["beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(ld_api_version)
    fail ArgumentError, "invalid value for \"ld_api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AgentControlApi.patch_agent_graph"
  end
  # verify the required parameter 'graph_key' is set
  if @api_client.config.client_side_validation && graph_key.nil?
    fail ArgumentError, "Missing the required parameter 'graph_key' when calling AgentControlApi.patch_agent_graph"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/agent-graphs/{graphKey}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'graphKey' + '}', CGI.escape(graph_key.to_s))

  # 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[:'LD-API-Version'] = ld_api_version

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'agent_graph_patch'])

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

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

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

#patch_agent_optimization(project_key, optimization_key, agent_optimization_patch, opts = {}) ⇒ AgentOptimization

Update an agent optimization Update an existing agent optimization. Creates a new version of the optimization.

Parameters:

  • project_key (String)
  • optimization_key (String)
  • agent_optimization_patch (AgentOptimizationPatch)

    Agent optimization fields to update

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

    the optional parameters

Returns:



2508
2509
2510
2511
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 2508

def patch_agent_optimization(project_key, optimization_key, agent_optimization_patch, opts = {})
  data, _status_code, _headers = patch_agent_optimization_with_http_info(project_key, optimization_key, agent_optimization_patch, opts)
  data
end

#patch_agent_optimization_result(project_key, optimization_key, result_id, agent_optimization_result_patch, opts = {}) ⇒ AgentOptimizationResult

Update an agent optimization result Update status, activity, and AI request metadata fields on an agent optimization result.

Parameters:

  • project_key (String)
  • optimization_key (String)
  • result_id (String)
  • agent_optimization_result_patch (AgentOptimizationResultPatch)

    Agent optimization result fields to update

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

    the optional parameters

Returns:



2589
2590
2591
2592
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 2589

def patch_agent_optimization_result(project_key, optimization_key, result_id, agent_optimization_result_patch, opts = {})
  data, _status_code, _headers = patch_agent_optimization_result_with_http_info(project_key, optimization_key, result_id, agent_optimization_result_patch, opts)
  data
end

#patch_agent_optimization_result_with_http_info(project_key, optimization_key, result_id, agent_optimization_result_patch, opts = {}) ⇒ Array<(AgentOptimizationResult, Integer, Hash)>

Update an agent optimization result Update status, activity, and AI request metadata fields on an agent optimization result.

Parameters:

  • project_key (String)
  • optimization_key (String)
  • result_id (String)
  • agent_optimization_result_patch (AgentOptimizationResultPatch)

    Agent optimization result fields to update

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

    the optional parameters

Returns:

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

    AgentOptimizationResult data, response status code and response headers



2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 2602

def patch_agent_optimization_result_with_http_info(project_key, optimization_key, result_id, agent_optimization_result_patch, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentControlApi.patch_agent_optimization_result ...'
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AgentControlApi.patch_agent_optimization_result"
  end
  # verify the required parameter 'optimization_key' is set
  if @api_client.config.client_side_validation && optimization_key.nil?
    fail ArgumentError, "Missing the required parameter 'optimization_key' when calling AgentControlApi.patch_agent_optimization_result"
  end
  # verify the required parameter 'result_id' is set
  if @api_client.config.client_side_validation && result_id.nil?
    fail ArgumentError, "Missing the required parameter 'result_id' when calling AgentControlApi.patch_agent_optimization_result"
  end
  # verify the required parameter 'agent_optimization_result_patch' is set
  if @api_client.config.client_side_validation && agent_optimization_result_patch.nil?
    fail ArgumentError, "Missing the required parameter 'agent_optimization_result_patch' when calling AgentControlApi.patch_agent_optimization_result"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/agent-optimizations/{optimizationKey}/results/{resultId}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'optimizationKey' + '}', CGI.escape(optimization_key.to_s)).sub('{' + 'resultId' + '}', CGI.escape(result_id.to_s))

  # 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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(agent_optimization_result_patch)

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

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

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

#patch_agent_optimization_with_http_info(project_key, optimization_key, agent_optimization_patch, opts = {}) ⇒ Array<(AgentOptimization, Integer, Hash)>

Update an agent optimization Update an existing agent optimization. Creates a new version of the optimization.

Parameters:

  • project_key (String)
  • optimization_key (String)
  • agent_optimization_patch (AgentOptimizationPatch)

    Agent optimization fields to update

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

    the optional parameters

Returns:

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

    AgentOptimization data, response status code and response headers



2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 2520

def patch_agent_optimization_with_http_info(project_key, optimization_key, agent_optimization_patch, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentControlApi.patch_agent_optimization ...'
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AgentControlApi.patch_agent_optimization"
  end
  # verify the required parameter 'optimization_key' is set
  if @api_client.config.client_side_validation && optimization_key.nil?
    fail ArgumentError, "Missing the required parameter 'optimization_key' when calling AgentControlApi.patch_agent_optimization"
  end
  # verify the required parameter 'agent_optimization_patch' is set
  if @api_client.config.client_side_validation && agent_optimization_patch.nil?
    fail ArgumentError, "Missing the required parameter 'agent_optimization_patch' when calling AgentControlApi.patch_agent_optimization"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/agent-optimizations/{optimizationKey}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'optimizationKey' + '}', CGI.escape(optimization_key.to_s))

  # 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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(agent_optimization_patch)

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

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

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

#patch_ai_config(project_key, config_key, opts = {}) ⇒ AIConfig

Update AI Config Edit an existing AI Config. The request body must be a JSON object of the fields to update. The values you include replace the existing values for the fields. Here's an example: { \"description\": \"Example updated description\", \"tags\": [\"new-tag\"] }

Parameters:

  • project_key (String)
  • config_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :ai_config_patch (AIConfigPatch)

    AI Config object to update

Returns:



2674
2675
2676
2677
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 2674

def patch_ai_config(project_key, config_key, opts = {})
  data, _status_code, _headers = patch_ai_config_with_http_info(project_key, config_key, opts)
  data
end

#patch_ai_config_targeting(project_key, config_key, opts = {}) ⇒ AIConfigTargeting

Update AI Config targeting Perform a partial update to an AI Config's targeting. The request body must be a valid semantic patch. ### Using semantic patches on an AI Config To make a semantic patch request, you must append domain-model=launchdarkly.semanticpatch to your Content-Type header. To learn more, read Updates using semantic patch. The body of a semantic patch request for updating an AI Config's targeting takes the following properties: * comment (string): (Optional) A description of the update. * environmentKey (string): The key of the LaunchDarkly environment. * instructions (array): (Required) A list of actions the update should perform. Each action in the list must be an object with a kind property that indicates the instruction. If the action requires parameters, you must include those parameters as additional fields in the object. The body of a single semantic patch can contain many different instructions. ### Instructions Semantic patch requests support the following kind instructions for updating AI Configs.

Click to expand instructions for working with targeting and variations for AI Configs #### addClauses Adds the given clauses to the rule indicated by ruleId. ##### Parameters - ruleId: ID of a rule in the AI Config. - clauses: Array of clause objects, with contextKind (string), attribute (string), op (string), negate (boolean), and values (array of strings, numbers, or dates) properties. The contextKind, attribute, and values are case sensitive. The op must be lower-case. Here's an example: json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [{ \"kind\": \"addClauses\", \"ruleId\": \"a902ef4a-2faf-4eaf-88e1-ecc356708a29\", \"clauses\": [{ \"contextKind\": \"user\", \"attribute\": \"country\", \"op\": \"in\", \"negate\": false, \"values\": [\"USA\", \"Canada\"] }] }] } #### addRule Adds a new targeting rule to the AI Config. The rule may contain clauses and serve the variation that variationId indicates, or serve a percentage rollout that rolloutWeights, rolloutBucketBy, and rolloutContextKind indicate. If you set beforeRuleId, this adds the new rule before the indicated rule. Otherwise, adds the new rule to the end of the list. ##### Parameters - clauses: Array of clause objects, with contextKind (string), attribute (string), op (string), negate (boolean), and values (array of strings, numbers, or dates) properties. The contextKind, attribute, and values are case sensitive. The op must be lower-case. - beforeRuleId: (Optional) ID of a rule. - Either - variationId: ID of a variation. or - rolloutWeights: (Optional) Map of variationId to weight, in thousandths of a percent (0-100000). - rolloutBucketBy: (Optional) Context attribute available in the specified rolloutContextKind. - rolloutContextKind: (Optional) Context kind, defaults to user Here's an example that uses a variationId: json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [{ \"kind\": \"addRule\", \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\", \"clauses\": [{ \"contextKind\": \"organization\", \"attribute\": \"located_in\", \"op\": \"in\", \"negate\": false, \"values\": [\"Sweden\", \"Norway\"] }] }] } Here's an example that uses a percentage rollout: json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [{ \"kind\": \"addRule\", \"clauses\": [{ \"contextKind\": \"organization\", \"attribute\": \"located_in\", \"op\": \"in\", \"negate\": false, \"values\": [\"Sweden\", \"Norway\"] }], \"rolloutContextKind\": \"organization\", \"rolloutWeights\": { \"2f43f67c-3e4e-4945-a18a-26559378ca00\": 15000, // serve 15% this variation \"e5830889-1ec5-4b0c-9cc9-c48790090c43\": 85000 // serve 85% this variation } }] } #### addTargets Adds context keys to the individual context targets for the context kind that contextKind specifies and the variation that variationId specifies. Returns an error if this causes the AI Config to target the same context key in multiple variations. ##### Parameters - values: List of context keys. - contextKind: (Optional) Context kind to target, defaults to user - variationId: ID of a variation. Here's an example: json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [{ \"kind\": \"addTargets\", \"values\": [\"context-key-123abc\", \"context-key-456def\"], \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\" }] } #### addValuesToClause Adds values to the values of the clause that ruleId and clauseId indicate. Does not update the context kind, attribute, or operator. ##### Parameters - ruleId: ID of a rule in the AI Config. - clauseId: ID of a clause in that rule. - values: Array of strings, case sensitive. Here's an example: json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [{ \"kind\": \"addValuesToClause\", \"ruleId\": \"a902ef4a-2faf-4eaf-88e1-ecc356708a29\", \"clauseId\": \"10a58772-3121-400f-846b-b8a04e8944ed\", \"values\": [\"beta_testers\"] }] } #### clearTargets Removes all individual targets from the variation that variationId specifies. This includes both user and non-user targets. ##### Parameters - variationId: ID of a variation. Here's an example: json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [ { \"kind\": \"clearTargets\", \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\" } ] } #### removeClauses Removes the clauses specified by clauseIds from the rule indicated by ruleId. ##### Parameters - ruleId: ID of a rule. - clauseIds: Array of IDs of clauses in the rule. Here's an example: json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [{ \"kind\": \"removeClauses\", \"ruleId\": \"a902ef4a-2faf-4eaf-88e1-ecc356708a29\", \"clauseIds\": [\"10a58772-3121-400f-846b-b8a04e8944ed\", \"36a461dc-235e-4b08-97b9-73ce9365873e\"] }] } #### removeRule Removes the targeting rule specified by ruleId. Does nothing if the rule does not exist. ##### Parameters - ruleId: ID of a rule. Here's an example: json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [ { \"kind\": \"removeRule\", \"ruleId\": \"a902ef4a-2faf-4eaf-88e1-ecc356708a29\" } ] } #### removeTargets Removes context keys from the individual context targets for the context kind that contextKind specifies and the variation that variationId specifies. Does nothing if the flag does not target the context keys. ##### Parameters - values: List of context keys. - contextKind: (Optional) Context kind to target, defaults to user - variationId: ID of a variation. Here's an example: json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [{ \"kind\": \"removeTargets\", \"values\": [\"context-key-123abc\", \"context-key-456def\"], \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\" }] } #### removeValuesFromClause Removes values from the values of the clause indicated by ruleId and clauseId. Does not update the context kind, attribute, or operator. ##### Parameters - ruleId: ID of a rule. - clauseId: ID of a clause in that rule. - values: Array of strings, case sensitive. Here's an example: json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [{ \"kind\": \"removeValuesFromClause\", \"ruleId\": \"a902ef4a-2faf-4eaf-88e1-ecc356708a29\", \"clauseId\": \"10a58772-3121-400f-846b-b8a04e8944ed\", \"values\": [\"beta_testers\"] }] } #### reorderRules Rearranges the rules to match the order given in ruleIds. Returns an error if ruleIds does not match the current set of rules on the AI Config. ##### Parameters - ruleIds: Array of IDs of all rules. Here's an example: json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [{ \"kind\": \"reorderRules\", \"ruleIds\": [\"a902ef4a-2faf-4eaf-88e1-ecc356708a29\", \"63c238d1-835d-435e-8f21-c8d5e40b2a3d\"] }] } #### replaceRules Removes all targeting rules for the AI Config and replaces them with the list you provide. ##### Parameters - rules: A list of rules. Here's an example: json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [ { \"kind\": \"replaceRules\", \"rules\": [ { \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\", \"description\": \"My new rule\", \"clauses\": [ { \"contextKind\": \"user\", \"attribute\": \"segmentMatch\", \"op\": \"segmentMatch\", \"values\": [\"test\"] } ] } ] } ] } #### replaceTargets Removes all existing targeting and replaces it with the list of targets you provide. ##### Parameters - targets: A list of context targeting. Each item in the list includes an optional contextKind that defaults to user, a required variationId, and a required list of values. Here's an example: json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [ { \"kind\": \"replaceTargets\", \"targets\": [ { \"contextKind\": \"user\", \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\", \"values\": [\"user-key-123abc\"] }, { \"contextKind\": \"device\", \"variationId\": \"e5830889-1ec5-4b0c-9cc9-c48790090c43\", \"values\": [\"device-key-456def\"] } ] } ] } #### updateClause Replaces the clause indicated by ruleId and clauseId with clause. ##### Parameters - ruleId: ID of a rule. - clauseId: ID of a clause in that rule. - clause: New clause object, with contextKind (string), attribute (string), op (string), negate (boolean), and values (array of strings, numbers, or dates) properties. The contextKind, attribute, and values are case sensitive. The op must be lower-case. Here's an example: json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [{ \"kind\": \"updateClause\", \"ruleId\": \"a902ef4a-2faf-4eaf-88e1-ecc356708a29\", \"clauseId\": \"10c7462a-2062-45ba-a8bb-dfb3de0f8af5\", \"clause\": { \"contextKind\": \"user\", \"attribute\": \"country\", \"op\": \"in\", \"negate\": false, \"values\": [\"Mexico\", \"Canada\"] } }] } #### updateDefaultVariation Updates the default on or off variation of the AI Config. ##### Parameters - onVariationValue: (Optional) The value of the variation of the new on variation. - offVariationValue: (Optional) The value of the variation of the new off variation Here's an example: json { \"instructions\": [ { \"kind\": \"updateDefaultVariation\", \"OnVariationValue\": true, \"OffVariationValue\": false } ] } #### updateFallthroughVariationOrRollout Updates the default or "fallthrough" rule for the AI Config, which the AI Config serves when a context matches none of the targeting rules. The rule can serve either the variation that variationId indicates, or a percentage rollout that rolloutWeights and rolloutBucketBy indicate. ##### Parameters - variationId: ID of a variation. or - rolloutWeights: Map of variationId to weight, in thousandths of a percent (0-100000). - rolloutBucketBy: (Optional) Context attribute available in the specified rolloutContextKind. - rolloutContextKind: (Optional) Context kind, defaults to user Here's an example that uses a variationId: json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [{ \"kind\": \"updateFallthroughVariationOrRollout\", \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\" }] } Here's an example that uses a percentage rollout: json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [{ \"kind\": \"updateFallthroughVariationOrRollout\", \"rolloutContextKind\": \"user\", \"rolloutWeights\": { \"2f43f67c-3e4e-4945-a18a-26559378ca00\": 15000, // serve 15% this variation \"e5830889-1ec5-4b0c-9cc9-c48790090c43\": 85000 // serve 85% this variation } }] } #### updateOffVariation Updates the default off variation to variationId. The AI Config serves the default off variation when the AI Config's targeting is Off. ##### Parameters - variationId: ID of a variation. Here's an example: json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [ { \"kind\": \"updateOffVariation\", \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\" } ] } #### updateRuleDescription Updates the description of the targeting rule. ##### Parameters - description: The new human-readable description for this rule. - ruleId: The ID of the rule. You can retrieve this by making a GET request for the AI Config. Here's an example: json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [{ \"kind\": \"updateRuleDescription\", \"description\": \"New rule description\", \"ruleId\": \"a902ef4a-2faf-4eaf-88e1-ecc356708a29\" }] } #### updateRuleTrackEvents Updates whether or not LaunchDarkly tracks events for the AI Config associated with this rule. ##### Parameters - ruleId: The ID of the rule. You can retrieve this by making a GET request for the AI Config. - trackEvents: Whether or not events are tracked. Here's an example: json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [{ \"kind\": \"updateRuleTrackEvents\", \"ruleId\": \"a902ef4a-2faf-4eaf-88e1-ecc356708a29\", \"trackEvents\": true }] } #### updateRuleVariationOrRollout Updates what ruleId serves when its clauses evaluate to true. The rule can serve either the variation that variationId indicates, or a percent rollout that rolloutWeights and rolloutBucketBy indicate. ##### Parameters - ruleId: ID of a rule. - variationId: ID of a variation. or - rolloutWeights: Map of variationId to weight, in thousandths of a percent (0-100000). - rolloutBucketBy: (Optional) Context attribute available in the specified rolloutContextKind. - rolloutContextKind: (Optional) Context kind, defaults to user Here's an example: json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [{ \"kind\": \"updateRuleVariationOrRollout\", \"ruleId\": \"a902ef4a-2faf-4eaf-88e1-ecc356708a29\", \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\" }] } #### updateTrackEvents Updates whether or not LaunchDarkly tracks events for the AI Config, for all rules. ##### Parameters - trackEvents: Whether or not events are tracked. Here's an example: json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [ { \"kind\": \"updateTrackEvents\", \"trackEvents\": true } ] } #### updateTrackEventsFallthrough Updates whether or not LaunchDarkly tracks events for the AI Config, for the default rule. ##### Parameters - trackEvents: Whether or not events are tracked. Here's an example: json { \"environmentKey\": \"environment-key-123abc\", \"instructions\": [ { \"kind\": \"updateTrackEventsFallthrough\", \"trackEvents\": true } ] }

Parameters:

  • project_key (String)
  • config_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:



2750
2751
2752
2753
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 2750

def patch_ai_config_targeting(project_key, config_key, opts = {})
  data, _status_code, _headers = patch_ai_config_targeting_with_http_info(project_key, config_key, opts)
  data
end

#patch_ai_config_targeting_with_http_info(project_key, config_key, opts = {}) ⇒ Array<(AIConfigTargeting, Integer, Hash)>

Update AI Config targeting Perform a partial update to an AI Config's targeting. The request body must be a valid semantic patch. ### Using semantic patches on an AI Config To make a semantic patch request, you must append `domain-model=launchdarkly.semanticpatch` to your `Content-Type` header. To learn more, read Updates using semantic patch. The body of a semantic patch request for updating an AI Config's targeting takes the following properties: * `comment` (string): (Optional) A description of the update. * `environmentKey` (string): The key of the LaunchDarkly environment. * `instructions` (array): (Required) A list of actions the update should perform. Each action in the list must be an object with a `kind` property that indicates the instruction. If the action requires parameters, you must include those parameters as additional fields in the object. The body of a single semantic patch can contain many different instructions. ### Instructions Semantic patch requests support the following `kind` instructions for updating AI Configs. <details> <summary>Click to expand instructions for <strong>working with targeting and variations</strong> for AI Configs</summary> #### addClauses Adds the given clauses to the rule indicated by `ruleId`. ##### Parameters - `ruleId`: ID of a rule in the AI Config. - `clauses`: Array of clause objects, with `contextKind` (string), `attribute` (string), `op` (string), `negate` (boolean), and `values` (array of strings, numbers, or dates) properties. The `contextKind`, `attribute`, and `values` are case sensitive. The `op` must be lower-case. Here's an example: ```json { &quot;environmentKey&quot;: &quot;environment-key-123abc&quot;, &quot;instructions&quot;: [{ &quot;kind&quot;: &quot;addClauses&quot;, &quot;ruleId&quot;: &quot;a902ef4a-2faf-4eaf-88e1-ecc356708a29&quot;, &quot;clauses&quot;: [{ &quot;contextKind&quot;: &quot;user&quot;, &quot;attribute&quot;: &quot;country&quot;, &quot;op&quot;: &quot;in&quot;, &quot;negate&quot;: false, &quot;values&quot;: [&quot;USA&quot;, &quot;Canada&quot;] }] }] } ``` #### addRule Adds a new targeting rule to the AI Config. The rule may contain `clauses` and serve the variation that `variationId` indicates, or serve a percentage rollout that `rolloutWeights`, `rolloutBucketBy`, and `rolloutContextKind` indicate. If you set `beforeRuleId`, this adds the new rule before the indicated rule. Otherwise, adds the new rule to the end of the list. ##### Parameters - `clauses`: Array of clause objects, with `contextKind` (string), `attribute` (string), `op` (string), `negate` (boolean), and `values` (array of strings, numbers, or dates) properties. The `contextKind`, `attribute`, and `values` are case sensitive. The `op` must be lower-case. - `beforeRuleId`: (Optional) ID of a rule. - Either - `variationId`: ID of a variation. or - `rolloutWeights`: (Optional) Map of `variationId` to weight, in thousandths of a percent (0-100000). - `rolloutBucketBy`: (Optional) Context attribute available in the specified `rolloutContextKind`. - `rolloutContextKind`: (Optional) Context kind, defaults to `user` Here's an example that uses a `variationId`: ```json { &quot;environmentKey&quot;: &quot;environment-key-123abc&quot;, &quot;instructions&quot;: [{ &quot;kind&quot;: &quot;addRule&quot;, &quot;variationId&quot;: &quot;2f43f67c-3e4e-4945-a18a-26559378ca00&quot;, &quot;clauses&quot;: [{ &quot;contextKind&quot;: &quot;organization&quot;, &quot;attribute&quot;: &quot;located_in&quot;, &quot;op&quot;: &quot;in&quot;, &quot;negate&quot;: false, &quot;values&quot;: [&quot;Sweden&quot;, &quot;Norway&quot;] }] }] } ``` Here's an example that uses a percentage rollout: ```json { &quot;environmentKey&quot;: &quot;environment-key-123abc&quot;, &quot;instructions&quot;: [{ &quot;kind&quot;: &quot;addRule&quot;, &quot;clauses&quot;: [{ &quot;contextKind&quot;: &quot;organization&quot;, &quot;attribute&quot;: &quot;located_in&quot;, &quot;op&quot;: &quot;in&quot;, &quot;negate&quot;: false, &quot;values&quot;: [&quot;Sweden&quot;, &quot;Norway&quot;] }], &quot;rolloutContextKind&quot;: &quot;organization&quot;, &quot;rolloutWeights&quot;: { &quot;2f43f67c-3e4e-4945-a18a-26559378ca00&quot;: 15000, // serve 15% this variation &quot;e5830889-1ec5-4b0c-9cc9-c48790090c43&quot;: 85000 // serve 85% this variation } }] } ``` #### addTargets Adds context keys to the individual context targets for the context kind that `contextKind` specifies and the variation that `variationId` specifies. Returns an error if this causes the AI Config to target the same context key in multiple variations. ##### Parameters - `values`: List of context keys. - `contextKind`: (Optional) Context kind to target, defaults to `user` - `variationId`: ID of a variation. Here's an example: ```json { &quot;environmentKey&quot;: &quot;environment-key-123abc&quot;, &quot;instructions&quot;: [{ &quot;kind&quot;: &quot;addTargets&quot;, &quot;values&quot;: [&quot;context-key-123abc&quot;, &quot;context-key-456def&quot;], &quot;variationId&quot;: &quot;2f43f67c-3e4e-4945-a18a-26559378ca00&quot; }] } ``` #### addValuesToClause Adds `values` to the values of the clause that `ruleId` and `clauseId` indicate. Does not update the context kind, attribute, or operator. ##### Parameters - `ruleId`: ID of a rule in the AI Config. - `clauseId`: ID of a clause in that rule. - `values`: Array of strings, case sensitive. Here's an example: ```json { &quot;environmentKey&quot;: &quot;environment-key-123abc&quot;, &quot;instructions&quot;: [{ &quot;kind&quot;: &quot;addValuesToClause&quot;, &quot;ruleId&quot;: &quot;a902ef4a-2faf-4eaf-88e1-ecc356708a29&quot;, &quot;clauseId&quot;: &quot;10a58772-3121-400f-846b-b8a04e8944ed&quot;, &quot;values&quot;: [&quot;beta_testers&quot;] }] } ``` #### clearTargets Removes all individual targets from the variation that `variationId` specifies. This includes both user and non-user targets. ##### Parameters - `variationId`: ID of a variation. Here's an example: ```json { &quot;environmentKey&quot;: &quot;environment-key-123abc&quot;, &quot;instructions&quot;: [ { &quot;kind&quot;: &quot;clearTargets&quot;, &quot;variationId&quot;: &quot;2f43f67c-3e4e-4945-a18a-26559378ca00&quot; } ] } ``` #### removeClauses Removes the clauses specified by `clauseIds` from the rule indicated by `ruleId`. ##### Parameters - `ruleId`: ID of a rule. - `clauseIds`: Array of IDs of clauses in the rule. Here's an example: ```json { &quot;environmentKey&quot;: &quot;environment-key-123abc&quot;, &quot;instructions&quot;: [{ &quot;kind&quot;: &quot;removeClauses&quot;, &quot;ruleId&quot;: &quot;a902ef4a-2faf-4eaf-88e1-ecc356708a29&quot;, &quot;clauseIds&quot;: [&quot;10a58772-3121-400f-846b-b8a04e8944ed&quot;, &quot;36a461dc-235e-4b08-97b9-73ce9365873e&quot;] }] } ``` #### removeRule Removes the targeting rule specified by `ruleId`. Does nothing if the rule does not exist. ##### Parameters - `ruleId`: ID of a rule. Here's an example: ```json { &quot;environmentKey&quot;: &quot;environment-key-123abc&quot;, &quot;instructions&quot;: [ { &quot;kind&quot;: &quot;removeRule&quot;, &quot;ruleId&quot;: &quot;a902ef4a-2faf-4eaf-88e1-ecc356708a29&quot; } ] } ``` #### removeTargets Removes context keys from the individual context targets for the context kind that `contextKind` specifies and the variation that `variationId` specifies. Does nothing if the flag does not target the context keys. ##### Parameters - `values`: List of context keys. - `contextKind`: (Optional) Context kind to target, defaults to `user` - `variationId`: ID of a variation. Here's an example: ```json { &quot;environmentKey&quot;: &quot;environment-key-123abc&quot;, &quot;instructions&quot;: [{ &quot;kind&quot;: &quot;removeTargets&quot;, &quot;values&quot;: [&quot;context-key-123abc&quot;, &quot;context-key-456def&quot;], &quot;variationId&quot;: &quot;2f43f67c-3e4e-4945-a18a-26559378ca00&quot; }] } ``` #### removeValuesFromClause Removes `values` from the values of the clause indicated by `ruleId` and `clauseId`. Does not update the context kind, attribute, or operator. ##### Parameters - `ruleId`: ID of a rule. - `clauseId`: ID of a clause in that rule. - `values`: Array of strings, case sensitive. Here's an example: ```json { &quot;environmentKey&quot;: &quot;environment-key-123abc&quot;, &quot;instructions&quot;: [{ &quot;kind&quot;: &quot;removeValuesFromClause&quot;, &quot;ruleId&quot;: &quot;a902ef4a-2faf-4eaf-88e1-ecc356708a29&quot;, &quot;clauseId&quot;: &quot;10a58772-3121-400f-846b-b8a04e8944ed&quot;, &quot;values&quot;: [&quot;beta_testers&quot;] }] } ``` #### reorderRules Rearranges the rules to match the order given in `ruleIds`. Returns an error if `ruleIds` does not match the current set of rules on the AI Config. ##### Parameters - `ruleIds`: Array of IDs of all rules. Here's an example: ```json { &quot;environmentKey&quot;: &quot;environment-key-123abc&quot;, &quot;instructions&quot;: [{ &quot;kind&quot;: &quot;reorderRules&quot;, &quot;ruleIds&quot;: [&quot;a902ef4a-2faf-4eaf-88e1-ecc356708a29&quot;, &quot;63c238d1-835d-435e-8f21-c8d5e40b2a3d&quot;] }] } ``` #### replaceRules Removes all targeting rules for the AI Config and replaces them with the list you provide. ##### Parameters - `rules`: A list of rules. Here's an example: ```json { &quot;environmentKey&quot;: &quot;environment-key-123abc&quot;, &quot;instructions&quot;: [ { &quot;kind&quot;: &quot;replaceRules&quot;, &quot;rules&quot;: [ { &quot;variationId&quot;: &quot;2f43f67c-3e4e-4945-a18a-26559378ca00&quot;, &quot;description&quot;: &quot;My new rule&quot;, &quot;clauses&quot;: [ { &quot;contextKind&quot;: &quot;user&quot;, &quot;attribute&quot;: &quot;segmentMatch&quot;, &quot;op&quot;: &quot;segmentMatch&quot;, &quot;values&quot;: [&quot;test&quot;] } ] } ] } ] } ``` #### replaceTargets Removes all existing targeting and replaces it with the list of targets you provide. ##### Parameters - `targets`: A list of context targeting. Each item in the list includes an optional `contextKind` that defaults to `user`, a required `variationId`, and a required list of `values`. Here's an example: ```json { &quot;environmentKey&quot;: &quot;environment-key-123abc&quot;, &quot;instructions&quot;: [ { &quot;kind&quot;: &quot;replaceTargets&quot;, &quot;targets&quot;: [ { &quot;contextKind&quot;: &quot;user&quot;, &quot;variationId&quot;: &quot;2f43f67c-3e4e-4945-a18a-26559378ca00&quot;, &quot;values&quot;: [&quot;user-key-123abc&quot;] }, { &quot;contextKind&quot;: &quot;device&quot;, &quot;variationId&quot;: &quot;e5830889-1ec5-4b0c-9cc9-c48790090c43&quot;, &quot;values&quot;: [&quot;device-key-456def&quot;] } ] } ] } ``` #### updateClause Replaces the clause indicated by `ruleId` and `clauseId` with `clause`. ##### Parameters - `ruleId`: ID of a rule. - `clauseId`: ID of a clause in that rule. - `clause`: New `clause` object, with `contextKind` (string), `attribute` (string), `op` (string), `negate` (boolean), and `values` (array of strings, numbers, or dates) properties. The `contextKind`, `attribute`, and `values` are case sensitive. The `op` must be lower-case. Here's an example: ```json { &quot;environmentKey&quot;: &quot;environment-key-123abc&quot;, &quot;instructions&quot;: [{ &quot;kind&quot;: &quot;updateClause&quot;, &quot;ruleId&quot;: &quot;a902ef4a-2faf-4eaf-88e1-ecc356708a29&quot;, &quot;clauseId&quot;: &quot;10c7462a-2062-45ba-a8bb-dfb3de0f8af5&quot;, &quot;clause&quot;: { &quot;contextKind&quot;: &quot;user&quot;, &quot;attribute&quot;: &quot;country&quot;, &quot;op&quot;: &quot;in&quot;, &quot;negate&quot;: false, &quot;values&quot;: [&quot;Mexico&quot;, &quot;Canada&quot;] } }] } ``` #### updateDefaultVariation Updates the default on or off variation of the AI Config. ##### Parameters - `onVariationValue`: (Optional) The value of the variation of the new on variation. - `offVariationValue`: (Optional) The value of the variation of the new off variation Here's an example: ```json { &quot;instructions&quot;: [ { &quot;kind&quot;: &quot;updateDefaultVariation&quot;, &quot;OnVariationValue&quot;: true, &quot;OffVariationValue&quot;: false } ] } ``` #### updateFallthroughVariationOrRollout Updates the default or &quot;fallthrough&quot; rule for the AI Config, which the AI Config serves when a context matches none of the targeting rules. The rule can serve either the variation that `variationId` indicates, or a percentage rollout that `rolloutWeights` and `rolloutBucketBy` indicate. ##### Parameters - `variationId`: ID of a variation. or - `rolloutWeights`: Map of `variationId` to weight, in thousandths of a percent (0-100000). - `rolloutBucketBy`: (Optional) Context attribute available in the specified `rolloutContextKind`. - `rolloutContextKind`: (Optional) Context kind, defaults to `user` Here's an example that uses a `variationId`: ```json { &quot;environmentKey&quot;: &quot;environment-key-123abc&quot;, &quot;instructions&quot;: [{ &quot;kind&quot;: &quot;updateFallthroughVariationOrRollout&quot;, &quot;variationId&quot;: &quot;2f43f67c-3e4e-4945-a18a-26559378ca00&quot; }] } ``` Here's an example that uses a percentage rollout: ```json { &quot;environmentKey&quot;: &quot;environment-key-123abc&quot;, &quot;instructions&quot;: [{ &quot;kind&quot;: &quot;updateFallthroughVariationOrRollout&quot;, &quot;rolloutContextKind&quot;: &quot;user&quot;, &quot;rolloutWeights&quot;: { &quot;2f43f67c-3e4e-4945-a18a-26559378ca00&quot;: 15000, // serve 15% this variation &quot;e5830889-1ec5-4b0c-9cc9-c48790090c43&quot;: 85000 // serve 85% this variation } }] } ``` #### updateOffVariation Updates the default off variation to `variationId`. The AI Config serves the default off variation when the AI Config's targeting is Off. ##### Parameters - `variationId`: ID of a variation. Here's an example: ```json { &quot;environmentKey&quot;: &quot;environment-key-123abc&quot;, &quot;instructions&quot;: [ { &quot;kind&quot;: &quot;updateOffVariation&quot;, &quot;variationId&quot;: &quot;2f43f67c-3e4e-4945-a18a-26559378ca00&quot; } ] } ``` #### updateRuleDescription Updates the description of the targeting rule. ##### Parameters - `description`: The new human-readable description for this rule. - `ruleId`: The ID of the rule. You can retrieve this by making a GET request for the AI Config. Here's an example: ```json { &quot;environmentKey&quot;: &quot;environment-key-123abc&quot;, &quot;instructions&quot;: [{ &quot;kind&quot;: &quot;updateRuleDescription&quot;, &quot;description&quot;: &quot;New rule description&quot;, &quot;ruleId&quot;: &quot;a902ef4a-2faf-4eaf-88e1-ecc356708a29&quot; }] } ``` #### updateRuleTrackEvents Updates whether or not LaunchDarkly tracks events for the AI Config associated with this rule. ##### Parameters - `ruleId`: The ID of the rule. You can retrieve this by making a GET request for the AI Config. - `trackEvents`: Whether or not events are tracked. Here's an example: ```json { &quot;environmentKey&quot;: &quot;environment-key-123abc&quot;, &quot;instructions&quot;: [{ &quot;kind&quot;: &quot;updateRuleTrackEvents&quot;, &quot;ruleId&quot;: &quot;a902ef4a-2faf-4eaf-88e1-ecc356708a29&quot;, &quot;trackEvents&quot;: true }] } ``` #### updateRuleVariationOrRollout Updates what `ruleId` serves when its clauses evaluate to true. The rule can serve either the variation that `variationId` indicates, or a percent rollout that `rolloutWeights` and `rolloutBucketBy` indicate. ##### Parameters - `ruleId`: ID of a rule. - `variationId`: ID of a variation. or - `rolloutWeights`: Map of `variationId` to weight, in thousandths of a percent (0-100000). - `rolloutBucketBy`: (Optional) Context attribute available in the specified `rolloutContextKind`. - `rolloutContextKind`: (Optional) Context kind, defaults to `user` Here's an example: ```json { &quot;environmentKey&quot;: &quot;environment-key-123abc&quot;, &quot;instructions&quot;: [{ &quot;kind&quot;: &quot;updateRuleVariationOrRollout&quot;, &quot;ruleId&quot;: &quot;a902ef4a-2faf-4eaf-88e1-ecc356708a29&quot;, &quot;variationId&quot;: &quot;2f43f67c-3e4e-4945-a18a-26559378ca00&quot; }] } ``` #### updateTrackEvents Updates whether or not LaunchDarkly tracks events for the AI Config, for all rules. ##### Parameters - `trackEvents`: Whether or not events are tracked. Here's an example: ```json { &quot;environmentKey&quot;: &quot;environment-key-123abc&quot;, &quot;instructions&quot;: [ { &quot;kind&quot;: &quot;updateTrackEvents&quot;, &quot;trackEvents&quot;: true } ] } ``` #### updateTrackEventsFallthrough Updates whether or not LaunchDarkly tracks events for the AI Config, for the default rule. ##### Parameters - `trackEvents`: Whether or not events are tracked. Here's an example: ```json { &quot;environmentKey&quot;: &quot;environment-key-123abc&quot;, &quot;instructions&quot;: [ { &quot;kind&quot;: &quot;updateTrackEventsFallthrough&quot;, &quot;trackEvents&quot;: true } ] } ``` </details>

Parameters:

  • project_key (String)
  • config_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:

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

    AIConfigTargeting data, response status code and response headers



2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 2762

def patch_ai_config_targeting_with_http_info(project_key, config_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentControlApi.patch_ai_config_targeting ...'
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AgentControlApi.patch_ai_config_targeting"
  end
  # verify the required parameter 'config_key' is set
  if @api_client.config.client_side_validation && config_key.nil?
    fail ArgumentError, "Missing the required parameter 'config_key' when calling AgentControlApi.patch_ai_config_targeting"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/ai-configs/{configKey}/targeting'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'configKey' + '}', CGI.escape(config_key.to_s))

  # 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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'ai_config_targeting_patch'])

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

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

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

#patch_ai_config_variation(project_key, config_key, variation_key, opts = {}) ⇒ AIConfigVariation

Update AI Config variation Edit an existing variation of an AI Config. This creates a new version of the variation. The request body must be a JSON object of the fields to update. The values you include replace the existing values for the fields. Here's an example: { \"messages\": [ { \"role\": \"system\", \"content\": \"The new message\" } ] }

Parameters:

  • project_key (String)
  • config_key (String)
  • variation_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:



2827
2828
2829
2830
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 2827

def patch_ai_config_variation(project_key, config_key, variation_key, opts = {})
  data, _status_code, _headers = patch_ai_config_variation_with_http_info(project_key, config_key, variation_key, opts)
  data
end

#patch_ai_config_variation_with_http_info(project_key, config_key, variation_key, opts = {}) ⇒ Array<(AIConfigVariation, Integer, Hash)>

Update AI Config variation Edit an existing variation of an AI Config. This creates a new version of the variation. The request body must be a JSON object of the fields to update. The values you include replace the existing values for the fields. Here's an example: ``` { &quot;messages&quot;: [ { &quot;role&quot;: &quot;system&quot;, &quot;content&quot;: &quot;The new message&quot; } ] } ```

Parameters:

  • project_key (String)
  • config_key (String)
  • variation_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:

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

    AIConfigVariation data, response status code and response headers



2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 2840

def patch_ai_config_variation_with_http_info(project_key, config_key, variation_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentControlApi.patch_ai_config_variation ...'
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AgentControlApi.patch_ai_config_variation"
  end
  # verify the required parameter 'config_key' is set
  if @api_client.config.client_side_validation && config_key.nil?
    fail ArgumentError, "Missing the required parameter 'config_key' when calling AgentControlApi.patch_ai_config_variation"
  end
  # verify the required parameter 'variation_key' is set
  if @api_client.config.client_side_validation && variation_key.nil?
    fail ArgumentError, "Missing the required parameter 'variation_key' when calling AgentControlApi.patch_ai_config_variation"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/ai-configs/{configKey}/variations/{variationKey}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'configKey' + '}', CGI.escape(config_key.to_s)).sub('{' + 'variationKey' + '}', CGI.escape(variation_key.to_s))

  # 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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'ai_config_variation_patch'])

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

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

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

#patch_ai_config_with_http_info(project_key, config_key, opts = {}) ⇒ Array<(AIConfig, Integer, Hash)>

Update AI Config Edit an existing AI Config. The request body must be a JSON object of the fields to update. The values you include replace the existing values for the fields. Here's an example: ``` { &quot;description&quot;: &quot;Example updated description&quot;, &quot;tags&quot;: [&quot;new-tag&quot;] } ```

Parameters:

  • project_key (String)
  • config_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :ai_config_patch (AIConfigPatch)

    AI Config object to update

Returns:

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

    AIConfig data, response status code and response headers



2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 2686

def patch_ai_config_with_http_info(project_key, config_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentControlApi.patch_ai_config ...'
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AgentControlApi.patch_ai_config"
  end
  # verify the required parameter 'config_key' is set
  if @api_client.config.client_side_validation && config_key.nil?
    fail ArgumentError, "Missing the required parameter 'config_key' when calling AgentControlApi.patch_ai_config"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/ai-configs/{configKey}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'configKey' + '}', CGI.escape(config_key.to_s))

  # 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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'ai_config_patch'])

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

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

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

#patch_ai_tool(project_key, tool_key, opts = {}) ⇒ AITool

Update AI tool Edit an existing AI tool.

Parameters:

  • project_key (String)
  • tool_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :ai_tool_patch (AIToolPatch)

    AI tool object to update

Returns:



2908
2909
2910
2911
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 2908

def patch_ai_tool(project_key, tool_key, opts = {})
  data, _status_code, _headers = patch_ai_tool_with_http_info(project_key, tool_key, opts)
  data
end

#patch_ai_tool_with_http_info(project_key, tool_key, opts = {}) ⇒ Array<(AITool, Integer, Hash)>

Update AI tool Edit an existing AI tool.

Parameters:

  • project_key (String)
  • tool_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :ai_tool_patch (AIToolPatch)

    AI tool object to update

Returns:

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

    AITool data, response status code and response headers



2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 2920

def patch_ai_tool_with_http_info(project_key, tool_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentControlApi.patch_ai_tool ...'
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AgentControlApi.patch_ai_tool"
  end
  # verify the required parameter 'tool_key' is set
  if @api_client.config.client_side_validation && tool_key.nil?
    fail ArgumentError, "Missing the required parameter 'tool_key' when calling AgentControlApi.patch_ai_tool"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/ai-tools/{toolKey}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'toolKey' + '}', CGI.escape(tool_key.to_s))

  # 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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'ai_tool_patch'])

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

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

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

#patch_prompt_snippet(project_key, snippet_key, prompt_snippet_patch, opts = {}) ⇒ PromptSnippet

Update a prompt snippet Update an existing prompt snippet. Creates a new version of the snippet.

Parameters:

  • project_key (String)
  • snippet_key (String)
  • prompt_snippet_patch (PromptSnippetPatch)

    Prompt snippet fields to update

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

    the optional parameters

Returns:



2984
2985
2986
2987
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 2984

def patch_prompt_snippet(project_key, snippet_key, prompt_snippet_patch, opts = {})
  data, _status_code, _headers = patch_prompt_snippet_with_http_info(project_key, snippet_key, prompt_snippet_patch, opts)
  data
end

#patch_prompt_snippet_with_http_info(project_key, snippet_key, prompt_snippet_patch, opts = {}) ⇒ Array<(PromptSnippet, Integer, Hash)>

Update a prompt snippet Update an existing prompt snippet. Creates a new version of the snippet.

Parameters:

  • project_key (String)
  • snippet_key (String)
  • prompt_snippet_patch (PromptSnippetPatch)

    Prompt snippet fields to update

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

    the optional parameters

Returns:

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

    PromptSnippet data, response status code and response headers



2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 2996

def patch_prompt_snippet_with_http_info(project_key, snippet_key, prompt_snippet_patch, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentControlApi.patch_prompt_snippet ...'
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AgentControlApi.patch_prompt_snippet"
  end
  # verify the required parameter 'snippet_key' is set
  if @api_client.config.client_side_validation && snippet_key.nil?
    fail ArgumentError, "Missing the required parameter 'snippet_key' when calling AgentControlApi.patch_prompt_snippet"
  end
  # verify the required parameter 'prompt_snippet_patch' is set
  if @api_client.config.client_side_validation && prompt_snippet_patch.nil?
    fail ArgumentError, "Missing the required parameter 'prompt_snippet_patch' when calling AgentControlApi.patch_prompt_snippet"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/ai-configs/prompt-snippets/{snippetKey}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'snippetKey' + '}', CGI.escape(snippet_key.to_s))

  # 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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(prompt_snippet_patch)

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

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

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

#post_agent_graph(ld_api_version, project_key, agent_graph_post, opts = {}) ⇒ AgentGraph

Create new agent graph Create a new agent graph within the given project.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • agent_graph_post (AgentGraphPost)

    Agent graph object to create

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

    the optional parameters

Returns:



3064
3065
3066
3067
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 3064

def post_agent_graph(ld_api_version, project_key, agent_graph_post, opts = {})
  data, _status_code, _headers = post_agent_graph_with_http_info(ld_api_version, project_key, agent_graph_post, opts)
  data
end

#post_agent_graph_with_http_info(ld_api_version, project_key, agent_graph_post, opts = {}) ⇒ Array<(AgentGraph, Integer, Hash)>

Create new agent graph Create a new agent graph within the given project.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • agent_graph_post (AgentGraphPost)

    Agent graph object to create

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

    the optional parameters

Returns:

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

    AgentGraph data, response status code and response headers



3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 3076

def post_agent_graph_with_http_info(ld_api_version, project_key, agent_graph_post, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentControlApi.post_agent_graph ...'
  end
  # verify the required parameter 'ld_api_version' is set
  if @api_client.config.client_side_validation && ld_api_version.nil?
    fail ArgumentError, "Missing the required parameter 'ld_api_version' when calling AgentControlApi.post_agent_graph"
  end
  # verify enum value
  allowable_values = ["beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(ld_api_version)
    fail ArgumentError, "invalid value for \"ld_api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AgentControlApi.post_agent_graph"
  end
  # verify the required parameter 'agent_graph_post' is set
  if @api_client.config.client_side_validation && agent_graph_post.nil?
    fail ArgumentError, "Missing the required parameter 'agent_graph_post' when calling AgentControlApi.post_agent_graph"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/agent-graphs'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s))

  # 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[:'LD-API-Version'] = ld_api_version

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(agent_graph_post)

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

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

  new_options = opts.merge(
    :operation => :"AgentControlApi.post_agent_graph",
    :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: AgentControlApi#post_agent_graph\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_agent_optimization(project_key, agent_optimization_post, opts = {}) ⇒ AgentOptimization

Create agent optimization Create a new agent optimization within the given project.

Parameters:

  • project_key (String)
  • agent_optimization_post (AgentOptimizationPost)

    Agent optimization object to create

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

    the optional parameters

Returns:



3149
3150
3151
3152
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 3149

def post_agent_optimization(project_key, agent_optimization_post, opts = {})
  data, _status_code, _headers = post_agent_optimization_with_http_info(project_key, agent_optimization_post, opts)
  data
end

#post_agent_optimization_result(project_key, optimization_key, agent_optimization_result_post, opts = {}) ⇒ AgentOptimizationResult

Create agent optimization result Create a new result for an agent optimization run.

Parameters:

  • project_key (String)
  • optimization_key (String)
  • agent_optimization_result_post (AgentOptimizationResultPost)

    Agent optimization result to create

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

    the optional parameters

Returns:



3224
3225
3226
3227
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 3224

def post_agent_optimization_result(project_key, optimization_key, agent_optimization_result_post, opts = {})
  data, _status_code, _headers = post_agent_optimization_result_with_http_info(project_key, optimization_key, agent_optimization_result_post, opts)
  data
end

#post_agent_optimization_result_with_http_info(project_key, optimization_key, agent_optimization_result_post, opts = {}) ⇒ Array<(AgentOptimizationResult, Integer, Hash)>

Create agent optimization result Create a new result for an agent optimization run.

Parameters:

  • project_key (String)
  • optimization_key (String)
  • agent_optimization_result_post (AgentOptimizationResultPost)

    Agent optimization result to create

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

    the optional parameters

Returns:

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

    AgentOptimizationResult data, response status code and response headers



3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 3236

def post_agent_optimization_result_with_http_info(project_key, optimization_key, agent_optimization_result_post, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentControlApi.post_agent_optimization_result ...'
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AgentControlApi.post_agent_optimization_result"
  end
  # verify the required parameter 'optimization_key' is set
  if @api_client.config.client_side_validation && optimization_key.nil?
    fail ArgumentError, "Missing the required parameter 'optimization_key' when calling AgentControlApi.post_agent_optimization_result"
  end
  # verify the required parameter 'agent_optimization_result_post' is set
  if @api_client.config.client_side_validation && agent_optimization_result_post.nil?
    fail ArgumentError, "Missing the required parameter 'agent_optimization_result_post' when calling AgentControlApi.post_agent_optimization_result"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/agent-optimizations/{optimizationKey}/results'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'optimizationKey' + '}', CGI.escape(optimization_key.to_s))

  # 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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(agent_optimization_result_post)

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

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

  new_options = opts.merge(
    :operation => :"AgentControlApi.post_agent_optimization_result",
    :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: AgentControlApi#post_agent_optimization_result\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_agent_optimization_with_http_info(project_key, agent_optimization_post, opts = {}) ⇒ Array<(AgentOptimization, Integer, Hash)>

Create agent optimization Create a new agent optimization within the given project.

Parameters:

  • project_key (String)
  • agent_optimization_post (AgentOptimizationPost)

    Agent optimization object to create

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

    the optional parameters

Returns:

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

    AgentOptimization data, response status code and response headers



3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 3160

def post_agent_optimization_with_http_info(project_key, agent_optimization_post, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentControlApi.post_agent_optimization ...'
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AgentControlApi.post_agent_optimization"
  end
  # verify the required parameter 'agent_optimization_post' is set
  if @api_client.config.client_side_validation && agent_optimization_post.nil?
    fail ArgumentError, "Missing the required parameter 'agent_optimization_post' when calling AgentControlApi.post_agent_optimization"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/agent-optimizations'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s))

  # 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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(agent_optimization_post)

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

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

  new_options = opts.merge(
    :operation => :"AgentControlApi.post_agent_optimization",
    :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: AgentControlApi#post_agent_optimization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_ai_config(project_key, ai_config_post, opts = {}) ⇒ AIConfig

Create new AI Config Create a new AI Config within the given project.

Parameters:

  • project_key (String)
  • ai_config_post (AIConfigPost)

    AI Config object to create

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

    the optional parameters

Returns:



3303
3304
3305
3306
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 3303

def post_ai_config(project_key, ai_config_post, opts = {})
  data, _status_code, _headers = post_ai_config_with_http_info(project_key, ai_config_post, opts)
  data
end

#post_ai_config_variation(project_key, config_key, ai_config_variation_post, opts = {}) ⇒ AIConfigVariation

Create AI Config variation Create a new variation for a given AI Config. The model in the request body requires a modelName and parameters, for example: \"model\": { \"modelName\": \"claude-3-opus-20240229\", \"parameters\": { \"max_tokens\": 1024 } }

Parameters:

  • project_key (String)
  • config_key (String)
  • ai_config_variation_post (AIConfigVariationPost)

    AI Config variation object to create

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

    the optional parameters

Returns:



3378
3379
3380
3381
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 3378

def post_ai_config_variation(project_key, config_key, ai_config_variation_post, opts = {})
  data, _status_code, _headers = post_ai_config_variation_with_http_info(project_key, config_key, ai_config_variation_post, opts)
  data
end

#post_ai_config_variation_with_http_info(project_key, config_key, ai_config_variation_post, opts = {}) ⇒ Array<(AIConfigVariation, Integer, Hash)>

Create AI Config variation Create a new variation for a given AI Config. The <code>model</code> in the request body requires a <code>modelName</code> and <code>parameters</code>, for example: ``` &quot;model&quot;: { &quot;modelName&quot;: &quot;claude-3-opus-20240229&quot;, &quot;parameters&quot;: { &quot;max_tokens&quot;: 1024 } } ```

Parameters:

  • project_key (String)
  • config_key (String)
  • ai_config_variation_post (AIConfigVariationPost)

    AI Config variation object to create

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

    the optional parameters

Returns:

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

    AIConfigVariation data, response status code and response headers



3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 3390

def post_ai_config_variation_with_http_info(project_key, config_key, ai_config_variation_post, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentControlApi.post_ai_config_variation ...'
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AgentControlApi.post_ai_config_variation"
  end
  # verify the required parameter 'config_key' is set
  if @api_client.config.client_side_validation && config_key.nil?
    fail ArgumentError, "Missing the required parameter 'config_key' when calling AgentControlApi.post_ai_config_variation"
  end
  # verify the required parameter 'ai_config_variation_post' is set
  if @api_client.config.client_side_validation && ai_config_variation_post.nil?
    fail ArgumentError, "Missing the required parameter 'ai_config_variation_post' when calling AgentControlApi.post_ai_config_variation"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/ai-configs/{configKey}/variations'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'configKey' + '}', CGI.escape(config_key.to_s))

  # 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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(ai_config_variation_post)

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

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

  new_options = opts.merge(
    :operation => :"AgentControlApi.post_ai_config_variation",
    :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: AgentControlApi#post_ai_config_variation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_ai_config_with_http_info(project_key, ai_config_post, opts = {}) ⇒ Array<(AIConfig, Integer, Hash)>

Create new AI Config Create a new AI Config within the given project.

Parameters:

  • project_key (String)
  • ai_config_post (AIConfigPost)

    AI Config object to create

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

    the optional parameters

Returns:

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

    AIConfig data, response status code and response headers



3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 3314

def post_ai_config_with_http_info(project_key, ai_config_post, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentControlApi.post_ai_config ...'
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AgentControlApi.post_ai_config"
  end
  # verify the required parameter 'ai_config_post' is set
  if @api_client.config.client_side_validation && ai_config_post.nil?
    fail ArgumentError, "Missing the required parameter 'ai_config_post' when calling AgentControlApi.post_ai_config"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/ai-configs'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s))

  # 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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(ai_config_post)

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

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

  new_options = opts.merge(
    :operation => :"AgentControlApi.post_ai_config",
    :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: AgentControlApi#post_ai_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_ai_tool(project_key, ai_tool_post, opts = {}) ⇒ AITool

Create an AI tool Create an AI tool

Parameters:

  • project_key (String)
  • ai_tool_post (AIToolPost)

    AI tool object to create

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

    the optional parameters

Returns:



3457
3458
3459
3460
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 3457

def post_ai_tool(project_key, ai_tool_post, opts = {})
  data, _status_code, _headers = post_ai_tool_with_http_info(project_key, ai_tool_post, opts)
  data
end

#post_ai_tool_with_http_info(project_key, ai_tool_post, opts = {}) ⇒ Array<(AITool, Integer, Hash)>

Create an AI tool Create an AI tool

Parameters:

  • project_key (String)
  • ai_tool_post (AIToolPost)

    AI tool object to create

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

    the optional parameters

Returns:

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

    AITool data, response status code and response headers



3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 3468

def post_ai_tool_with_http_info(project_key, ai_tool_post, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentControlApi.post_ai_tool ...'
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AgentControlApi.post_ai_tool"
  end
  # verify the required parameter 'ai_tool_post' is set
  if @api_client.config.client_side_validation && ai_tool_post.nil?
    fail ArgumentError, "Missing the required parameter 'ai_tool_post' when calling AgentControlApi.post_ai_tool"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/ai-tools'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s))

  # 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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(ai_tool_post)

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

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

  new_options = opts.merge(
    :operation => :"AgentControlApi.post_ai_tool",
    :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: AgentControlApi#post_ai_tool\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_model_config(project_key, model_config_post, opts = {}) ⇒ ModelConfig

Create an AI model config Create an AI model config. You can use this in any variation for any config in your project.

Parameters:

  • project_key (String)
  • model_config_post (ModelConfigPost)

    AI model config object to create

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

    the optional parameters

Returns:



3531
3532
3533
3534
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 3531

def post_model_config(project_key, model_config_post, opts = {})
  data, _status_code, _headers = post_model_config_with_http_info(project_key, model_config_post, opts)
  data
end

#post_model_config_with_http_info(project_key, model_config_post, opts = {}) ⇒ Array<(ModelConfig, Integer, Hash)>

Create an AI model config Create an AI model config. You can use this in any variation for any config in your project.

Parameters:

  • project_key (String)
  • model_config_post (ModelConfigPost)

    AI model config object to create

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

    the optional parameters

Returns:

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

    ModelConfig data, response status code and response headers



3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 3542

def post_model_config_with_http_info(project_key, model_config_post, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentControlApi.post_model_config ...'
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AgentControlApi.post_model_config"
  end
  # verify the required parameter 'model_config_post' is set
  if @api_client.config.client_side_validation && model_config_post.nil?
    fail ArgumentError, "Missing the required parameter 'model_config_post' when calling AgentControlApi.post_model_config"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/ai-configs/model-configs'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s))

  # 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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(model_config_post)

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

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

  new_options = opts.merge(
    :operation => :"AgentControlApi.post_model_config",
    :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: AgentControlApi#post_model_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_prompt_snippet(project_key, prompt_snippet_post, opts = {}) ⇒ PromptSnippet

Create a prompt snippet Create a new prompt snippet within the given project.

Parameters:

  • project_key (String)
  • prompt_snippet_post (PromptSnippetPost)

    Prompt snippet object to create

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

    the optional parameters

Returns:



3605
3606
3607
3608
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 3605

def post_prompt_snippet(project_key, prompt_snippet_post, opts = {})
  data, _status_code, _headers = post_prompt_snippet_with_http_info(project_key, prompt_snippet_post, opts)
  data
end

#post_prompt_snippet_with_http_info(project_key, prompt_snippet_post, opts = {}) ⇒ Array<(PromptSnippet, Integer, Hash)>

Create a prompt snippet Create a new prompt snippet within the given project.

Parameters:

  • project_key (String)
  • prompt_snippet_post (PromptSnippetPost)

    Prompt snippet object to create

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

    the optional parameters

Returns:

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

    PromptSnippet data, response status code and response headers



3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 3616

def post_prompt_snippet_with_http_info(project_key, prompt_snippet_post, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentControlApi.post_prompt_snippet ...'
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AgentControlApi.post_prompt_snippet"
  end
  # verify the required parameter 'prompt_snippet_post' is set
  if @api_client.config.client_side_validation && prompt_snippet_post.nil?
    fail ArgumentError, "Missing the required parameter 'prompt_snippet_post' when calling AgentControlApi.post_prompt_snippet"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/ai-configs/prompt-snippets'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s))

  # 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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(prompt_snippet_post)

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

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

  new_options = opts.merge(
    :operation => :"AgentControlApi.post_prompt_snippet",
    :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: AgentControlApi#post_prompt_snippet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_restricted_models(project_key, restricted_models_request, opts = {}) ⇒ RestrictedModelsResponse

Add AI models to the restricted list Add AI models, by key, to the restricted list. Keys are included in the response from the List AI model configs endpoint.

Parameters:

  • project_key (String)
  • restricted_models_request (RestrictedModelsRequest)

    List of AI model keys to add to the restricted list.

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

    the optional parameters

Returns:



3679
3680
3681
3682
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 3679

def post_restricted_models(project_key, restricted_models_request, opts = {})
  data, _status_code, _headers = post_restricted_models_with_http_info(project_key, restricted_models_request, opts)
  data
end

#post_restricted_models_with_http_info(project_key, restricted_models_request, opts = {}) ⇒ Array<(RestrictedModelsResponse, Integer, Hash)>

Add AI models to the restricted list Add AI models, by key, to the restricted list. Keys are included in the response from the List AI model configs endpoint.

Parameters:

  • project_key (String)
  • restricted_models_request (RestrictedModelsRequest)

    List of AI model keys to add to the restricted list.

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

    the optional parameters

Returns:

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

    RestrictedModelsResponse data, response status code and response headers



3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
# File 'lib/launchdarkly_api/api/agent_control_api.rb', line 3690

def post_restricted_models_with_http_info(project_key, restricted_models_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentControlApi.post_restricted_models ...'
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AgentControlApi.post_restricted_models"
  end
  # verify the required parameter 'restricted_models_request' is set
  if @api_client.config.client_side_validation && restricted_models_request.nil?
    fail ArgumentError, "Missing the required parameter 'restricted_models_request' when calling AgentControlApi.post_restricted_models"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/ai-configs/model-configs/restricted'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s))

  # 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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(restricted_models_request)

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

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

  new_options = opts.merge(
    :operation => :"AgentControlApi.post_restricted_models",
    :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: AgentControlApi#post_restricted_models\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end