Class: LiteLLMClient::GuardrailsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/litellm_client/api/guardrails_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ GuardrailsApi



19
20
21
# File 'lib/litellm_client/api/guardrails_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/litellm_client/api/guardrails_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#apply_guardrail_guardrails_apply_guardrail_post(apply_guardrail_request, opts = {}) ⇒ ApplyGuardrailResponse

Apply Guardrail Mask PII from a given text, requires a guardrail to be added to litellm.



27
28
29
30
# File 'lib/litellm_client/api/guardrails_api.rb', line 27

def apply_guardrail_guardrails_apply_guardrail_post(apply_guardrail_request, opts = {})
  data, _status_code, _headers = apply_guardrail_guardrails_apply_guardrail_post_with_http_info(apply_guardrail_request, opts)
  data
end

#apply_guardrail_guardrails_apply_guardrail_post_with_http_info(apply_guardrail_request, opts = {}) ⇒ Array<(ApplyGuardrailResponse, Integer, Hash)>

Apply Guardrail Mask PII from a given text, requires a guardrail to be added to litellm.



37
38
39
40
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
# File 'lib/litellm_client/api/guardrails_api.rb', line 37

def apply_guardrail_guardrails_apply_guardrail_post_with_http_info(apply_guardrail_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: GuardrailsApi.apply_guardrail_guardrails_apply_guardrail_post ...'
  end
  # verify the required parameter 'apply_guardrail_request' is set
  if @api_client.config.client_side_validation && apply_guardrail_request.nil?
    fail ArgumentError, "Missing the required parameter 'apply_guardrail_request' when calling GuardrailsApi.apply_guardrail_guardrails_apply_guardrail_post"
  end
  # resource path
  local_var_path = '/guardrails/apply_guardrail'

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

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

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

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

#create_guardrail_guardrails_post(create_guardrail_request, opts = {}) ⇒ Object

Create Guardrail Create a new guardrail 👉 [Guardrail docs](docs.litellm.ai/docs/proxy/guardrails/quick_start) Example Request: “‘bash curl -X POST "localhost:4000/guardrails" \ -H "Authorization: Bearer <your_api_key>" \ -H "Content-Type: application/json" \ -d ’{ "guardrail": { "guardrail_name": "my-bedrock-guard", "litellm_params": { "guardrail": "bedrock", "mode": "pre_call", "guardrailIdentifier": "ff6ujrregl1q", "guardrailVersion": "DRAFT", "default_on": true }, "guardrail_info": { "description": "Bedrock content moderation guardrail" } } }‘ “` Example Response: “`json { "guardrail_id": "123e4567-e89b-12d3-a456-426614174000", "guardrail_name": "my-bedrock-guard", "litellm_params": { "guardrail": "bedrock", "mode": "pre_call", "guardrailIdentifier": "ff6ujrregl1q", "guardrailVersion": "DRAFT", "default_on": true }, "guardrail_info": { "description": "Bedrock content moderation guardrail" }, "created_at": "2023-11-09T12:34:56.789Z", "updated_at": "2023-11-09T12:34:56.789Z" } “`



95
96
97
98
# File 'lib/litellm_client/api/guardrails_api.rb', line 95

def create_guardrail_guardrails_post(create_guardrail_request, opts = {})
  data, _status_code, _headers = create_guardrail_guardrails_post_with_http_info(create_guardrail_request, opts)
  data
end

#create_guardrail_guardrails_post_with_http_info(create_guardrail_request, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Create Guardrail Create a new guardrail 👉 [Guardrail docs](docs.litellm.ai/docs/proxy/guardrails/quick_start) Example Request: &#x60;&#x60;&#x60;bash curl -X POST &quot;localhost:4000/guardrails&quot; \ -H &quot;Authorization: Bearer &lt;your_api_key&gt;&quot; \ -H &quot;Content-Type: application/json&quot; \ -d &#39;{ &quot;guardrail&quot;: { &quot;guardrail_name&quot;: &quot;my-bedrock-guard&quot;, &quot;litellm_params&quot;: { &quot;guardrail&quot;: &quot;bedrock&quot;, &quot;mode&quot;: &quot;pre_call&quot;, &quot;guardrailIdentifier&quot;: &quot;ff6ujrregl1q&quot;, &quot;guardrailVersion&quot;: &quot;DRAFT&quot;, &quot;default_on&quot;: true }, &quot;guardrail_info&quot;: { &quot;description&quot;: &quot;Bedrock content moderation guardrail&quot; } } }&#39; &#x60;&#x60;&#x60; Example Response: &#x60;&#x60;&#x60;json { &quot;guardrail_id&quot;: &quot;123e4567-e89b-12d3-a456-426614174000&quot;, &quot;guardrail_name&quot;: &quot;my-bedrock-guard&quot;, &quot;litellm_params&quot;: { &quot;guardrail&quot;: &quot;bedrock&quot;, &quot;mode&quot;: &quot;pre_call&quot;, &quot;guardrailIdentifier&quot;: &quot;ff6ujrregl1q&quot;, &quot;guardrailVersion&quot;: &quot;DRAFT&quot;, &quot;default_on&quot;: true }, &quot;guardrail_info&quot;: { &quot;description&quot;: &quot;Bedrock content moderation guardrail&quot; }, &quot;created_at&quot;: &quot;2023-11-09T12:34:56.789Z&quot;, &quot;updated_at&quot;: &quot;2023-11-09T12:34:56.789Z&quot; } &#x60;&#x60;&#x60;



105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
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
# File 'lib/litellm_client/api/guardrails_api.rb', line 105

def create_guardrail_guardrails_post_with_http_info(create_guardrail_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: GuardrailsApi.create_guardrail_guardrails_post ...'
  end
  # verify the required parameter 'create_guardrail_request' is set
  if @api_client.config.client_side_validation && create_guardrail_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_guardrail_request' when calling GuardrailsApi.create_guardrail_guardrails_post"
  end
  # resource path
  local_var_path = '/guardrails'

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

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

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

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

#delete_guardrail_guardrails_guardrail_id_delete(guardrail_id, opts = {}) ⇒ Object

Delete Guardrail Delete a guardrail 👉 [Guardrail docs](docs.litellm.ai/docs/proxy/guardrails/quick_start) Example Request: “‘bash curl -X DELETE "localhost:4000/guardrails/123e4567-e89b-12d3-a456-426614174000" \ -H "Authorization: Bearer <your_api_key>" “` Example Response: “`json { "message": "Guardrail 123e4567-e89b-12d3-a456-426614174000 deleted successfully" } “`



163
164
165
166
# File 'lib/litellm_client/api/guardrails_api.rb', line 163

def delete_guardrail_guardrails_guardrail_id_delete(guardrail_id, opts = {})
  data, _status_code, _headers = delete_guardrail_guardrails_guardrail_id_delete_with_http_info(guardrail_id, opts)
  data
end

#delete_guardrail_guardrails_guardrail_id_delete_with_http_info(guardrail_id, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Delete Guardrail Delete a guardrail 👉 [Guardrail docs](docs.litellm.ai/docs/proxy/guardrails/quick_start) Example Request: &#x60;&#x60;&#x60;bash curl -X DELETE &quot;localhost:4000/guardrails/123e4567-e89b-12d3-a456-426614174000&quot; \ -H &quot;Authorization: Bearer &lt;your_api_key&gt;&quot; &#x60;&#x60;&#x60; Example Response: &#x60;&#x60;&#x60;json { &quot;message&quot;: &quot;Guardrail 123e4567-e89b-12d3-a456-426614174000 deleted successfully&quot; } &#x60;&#x60;&#x60;



173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
# File 'lib/litellm_client/api/guardrails_api.rb', line 173

def delete_guardrail_guardrails_guardrail_id_delete_with_http_info(guardrail_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: GuardrailsApi.delete_guardrail_guardrails_guardrail_id_delete ...'
  end
  # verify the required parameter 'guardrail_id' is set
  if @api_client.config.client_side_validation && guardrail_id.nil?
    fail ArgumentError, "Missing the required parameter 'guardrail_id' when calling GuardrailsApi.delete_guardrail_guardrails_guardrail_id_delete"
  end
  # resource path
  local_var_path = '/guardrails/{guardrail_id}'.sub('{' + 'guardrail_id' + '}', CGI.escape(guardrail_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] || 'Object'

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

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

#get_guardrail_guardrails_guardrail_id_get(guardrail_id, opts = {}) ⇒ Object

Get Guardrail Get a guardrail by ID 👉 [Guardrail docs](docs.litellm.ai/docs/proxy/guardrails/quick_start) Example Request: “‘bash curl -X GET "localhost:4000/guardrails/123e4567-e89b-12d3-a456-426614174000" \ -H "Authorization: Bearer <your_api_key>" “` Example Response: “`json { "guardrail_id": "123e4567-e89b-12d3-a456-426614174000", "guardrail_name": "my-bedrock-guard", "litellm_params": { "guardrail": "bedrock", "mode": "pre_call", "guardrailIdentifier": "ff6ujrregl1q", "guardrailVersion": "DRAFT", "default_on": true }, "guardrail_info": { "description": "Bedrock content moderation guardrail" }, "created_at": "2023-11-09T12:34:56.789Z", "updated_at": "2023-11-09T12:34:56.789Z" } “`



226
227
228
229
# File 'lib/litellm_client/api/guardrails_api.rb', line 226

def get_guardrail_guardrails_guardrail_id_get(guardrail_id, opts = {})
  data, _status_code, _headers = get_guardrail_guardrails_guardrail_id_get_with_http_info(guardrail_id, opts)
  data
end

#get_guardrail_guardrails_guardrail_id_get_with_http_info(guardrail_id, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Get Guardrail Get a guardrail by ID 👉 [Guardrail docs](docs.litellm.ai/docs/proxy/guardrails/quick_start) Example Request: &#x60;&#x60;&#x60;bash curl -X GET &quot;localhost:4000/guardrails/123e4567-e89b-12d3-a456-426614174000&quot; \ -H &quot;Authorization: Bearer &lt;your_api_key&gt;&quot; &#x60;&#x60;&#x60; Example Response: &#x60;&#x60;&#x60;json { &quot;guardrail_id&quot;: &quot;123e4567-e89b-12d3-a456-426614174000&quot;, &quot;guardrail_name&quot;: &quot;my-bedrock-guard&quot;, &quot;litellm_params&quot;: { &quot;guardrail&quot;: &quot;bedrock&quot;, &quot;mode&quot;: &quot;pre_call&quot;, &quot;guardrailIdentifier&quot;: &quot;ff6ujrregl1q&quot;, &quot;guardrailVersion&quot;: &quot;DRAFT&quot;, &quot;default_on&quot;: true }, &quot;guardrail_info&quot;: { &quot;description&quot;: &quot;Bedrock content moderation guardrail&quot; }, &quot;created_at&quot;: &quot;2023-11-09T12:34:56.789Z&quot;, &quot;updated_at&quot;: &quot;2023-11-09T12:34:56.789Z&quot; } &#x60;&#x60;&#x60;



236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
# File 'lib/litellm_client/api/guardrails_api.rb', line 236

def get_guardrail_guardrails_guardrail_id_get_with_http_info(guardrail_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: GuardrailsApi.get_guardrail_guardrails_guardrail_id_get ...'
  end
  # verify the required parameter 'guardrail_id' is set
  if @api_client.config.client_side_validation && guardrail_id.nil?
    fail ArgumentError, "Missing the required parameter 'guardrail_id' when calling GuardrailsApi.get_guardrail_guardrails_guardrail_id_get"
  end
  # resource path
  local_var_path = '/guardrails/{guardrail_id}'.sub('{' + 'guardrail_id' + '}', CGI.escape(guardrail_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] || 'Object'

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

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

#get_guardrail_info_guardrails_guardrail_id_info_get(guardrail_id, opts = {}) ⇒ Object

Get Guardrail Info Get detailed information about a specific guardrail by ID 👉 [Guardrail docs](docs.litellm.ai/docs/proxy/guardrails/quick_start) Example Request: “‘bash curl -X GET "localhost:4000/guardrails/123e4567-e89b-12d3-a456-426614174000/info" \ -H "Authorization: Bearer <your_api_key>" “` Example Response: “`json { "guardrail_id": "123e4567-e89b-12d3-a456-426614174000", "guardrail_name": "my-bedrock-guard", "litellm_params": { "guardrail": "bedrock", "mode": "pre_call", "guardrailIdentifier": "ff6ujrregl1q", "guardrailVersion": "DRAFT", "default_on": true }, "guardrail_info": { "description": "Bedrock content moderation guardrail" }, "created_at": "2023-11-09T12:34:56.789Z", "updated_at": "2023-11-09T12:34:56.789Z" } “`



289
290
291
292
# File 'lib/litellm_client/api/guardrails_api.rb', line 289

def get_guardrail_info_guardrails_guardrail_id_info_get(guardrail_id, opts = {})
  data, _status_code, _headers = get_guardrail_info_guardrails_guardrail_id_info_get_with_http_info(guardrail_id, opts)
  data
end

#get_guardrail_info_guardrails_guardrail_id_info_get_with_http_info(guardrail_id, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Get Guardrail Info Get detailed information about a specific guardrail by ID 👉 [Guardrail docs](docs.litellm.ai/docs/proxy/guardrails/quick_start) Example Request: &#x60;&#x60;&#x60;bash curl -X GET &quot;localhost:4000/guardrails/123e4567-e89b-12d3-a456-426614174000/info&quot; \ -H &quot;Authorization: Bearer &lt;your_api_key&gt;&quot; &#x60;&#x60;&#x60; Example Response: &#x60;&#x60;&#x60;json { &quot;guardrail_id&quot;: &quot;123e4567-e89b-12d3-a456-426614174000&quot;, &quot;guardrail_name&quot;: &quot;my-bedrock-guard&quot;, &quot;litellm_params&quot;: { &quot;guardrail&quot;: &quot;bedrock&quot;, &quot;mode&quot;: &quot;pre_call&quot;, &quot;guardrailIdentifier&quot;: &quot;ff6ujrregl1q&quot;, &quot;guardrailVersion&quot;: &quot;DRAFT&quot;, &quot;default_on&quot;: true }, &quot;guardrail_info&quot;: { &quot;description&quot;: &quot;Bedrock content moderation guardrail&quot; }, &quot;created_at&quot;: &quot;2023-11-09T12:34:56.789Z&quot;, &quot;updated_at&quot;: &quot;2023-11-09T12:34:56.789Z&quot; } &#x60;&#x60;&#x60;



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
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
# File 'lib/litellm_client/api/guardrails_api.rb', line 299

def get_guardrail_info_guardrails_guardrail_id_info_get_with_http_info(guardrail_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: GuardrailsApi.get_guardrail_info_guardrails_guardrail_id_info_get ...'
  end
  # verify the required parameter 'guardrail_id' is set
  if @api_client.config.client_side_validation && guardrail_id.nil?
    fail ArgumentError, "Missing the required parameter 'guardrail_id' when calling GuardrailsApi.get_guardrail_info_guardrails_guardrail_id_info_get"
  end
  # resource path
  local_var_path = '/guardrails/{guardrail_id}/info'.sub('{' + 'guardrail_id' + '}', CGI.escape(guardrail_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] || 'Object'

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

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

#get_guardrail_ui_settings_guardrails_ui_add_guardrail_settings_get(opts = {}) ⇒ Object

Get Guardrail Ui Settings Get the UI settings for the guardrails Returns: - Supported entities for guardrails - Supported modes for guardrails - PII entity categories for UI organization



351
352
353
354
# File 'lib/litellm_client/api/guardrails_api.rb', line 351

def get_guardrail_ui_settings_guardrails_ui_add_guardrail_settings_get(opts = {})
  data, _status_code, _headers = get_guardrail_ui_settings_guardrails_ui_add_guardrail_settings_get_with_http_info(opts)
  data
end

#get_guardrail_ui_settings_guardrails_ui_add_guardrail_settings_get_with_http_info(opts = {}) ⇒ Array<(Object, Integer, Hash)>

Get Guardrail Ui Settings Get the UI settings for the guardrails Returns: - Supported entities for guardrails - Supported modes for guardrails - PII entity categories for UI organization



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
402
# File 'lib/litellm_client/api/guardrails_api.rb', line 360

def get_guardrail_ui_settings_guardrails_ui_add_guardrail_settings_get_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: GuardrailsApi.get_guardrail_ui_settings_guardrails_ui_add_guardrail_settings_get ...'
  end
  # resource path
  local_var_path = '/guardrails/ui/add_guardrail_settings'

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

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

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

#get_provider_specific_params_guardrails_ui_provider_specific_params_get(opts = {}) ⇒ Object

Get Provider Specific Params Get provider-specific parameters for different guardrail types. Returns a dictionary mapping guardrail providers to their specific parameters, including parameter names, descriptions, and whether they are required. Example Response: “‘json { "bedrock": [ { "param": "guardrailIdentifier", "description": "The ID of your guardrail on Bedrock", "required": true }, { "param": "guardrailVersion", "description": "The version of your Bedrock guardrail (e.g., DRAFT or version number)", "required": true } ], "presidio": [ { "param": "presidio_analyzer_api_base", "description": "Base URL for the Presidio analyzer API", "required": true }, { "param": "presidio_anonymizer_api_base", "description": "Base URL for the Presidio anonymizer API", "required": true }, { "param": "output_parse_pii", "description": "Whether to parse PII in model outputs", "required": false, "type": "bool" } ] } “`



408
409
410
411
# File 'lib/litellm_client/api/guardrails_api.rb', line 408

def get_provider_specific_params_guardrails_ui_provider_specific_params_get(opts = {})
  data, _status_code, _headers = get_provider_specific_params_guardrails_ui_provider_specific_params_get_with_http_info(opts)
  data
end

#get_provider_specific_params_guardrails_ui_provider_specific_params_get_with_http_info(opts = {}) ⇒ Array<(Object, Integer, Hash)>

Get Provider Specific Params Get provider-specific parameters for different guardrail types. Returns a dictionary mapping guardrail providers to their specific parameters, including parameter names, descriptions, and whether they are required. Example Response: &#x60;&#x60;&#x60;json { &quot;bedrock&quot;: [ { &quot;param&quot;: &quot;guardrailIdentifier&quot;, &quot;description&quot;: &quot;The ID of your guardrail on Bedrock&quot;, &quot;required&quot;: true }, { &quot;param&quot;: &quot;guardrailVersion&quot;, &quot;description&quot;: &quot;The version of your Bedrock guardrail (e.g., DRAFT or version number)&quot;, &quot;required&quot;: true } ], &quot;presidio&quot;: [ { &quot;param&quot;: &quot;presidio_analyzer_api_base&quot;, &quot;description&quot;: &quot;Base URL for the Presidio analyzer API&quot;, &quot;required&quot;: true }, { &quot;param&quot;: &quot;presidio_anonymizer_api_base&quot;, &quot;description&quot;: &quot;Base URL for the Presidio anonymizer API&quot;, &quot;required&quot;: true }, { &quot;param&quot;: &quot;output_parse_pii&quot;, &quot;description&quot;: &quot;Whether to parse PII in model outputs&quot;, &quot;required&quot;: false, &quot;type&quot;: &quot;bool&quot; } ] } &#x60;&#x60;&#x60;



417
418
419
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
# File 'lib/litellm_client/api/guardrails_api.rb', line 417

def get_provider_specific_params_guardrails_ui_provider_specific_params_get_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: GuardrailsApi.get_provider_specific_params_guardrails_ui_provider_specific_params_get ...'
  end
  # resource path
  local_var_path = '/guardrails/ui/provider_specific_params'

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

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

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

#list_guardrails_guardrails_list_get(opts = {}) ⇒ ListGuardrailsResponse

List Guardrails List the guardrails that are available on the proxy server 👉 [Guardrail docs](docs.litellm.ai/docs/proxy/guardrails/quick_start) Example Request: “‘bash curl -X GET "localhost:4000/guardrails/list" -H "Authorization: Bearer <your_api_key>" “` Example Response: “`json { "guardrails": [ { "guardrail_name": "bedrock-pre-guard", "guardrail_info": { "params": [ { "name": "toxicity_score", "type": "float", "description": "Score between 0-1 indicating content toxicity level" }, { "name": "pii_detection", "type": "boolean" } ] } } ] } “`



465
466
467
468
# File 'lib/litellm_client/api/guardrails_api.rb', line 465

def list_guardrails_guardrails_list_get(opts = {})
  data, _status_code, _headers = list_guardrails_guardrails_list_get_with_http_info(opts)
  data
end

#list_guardrails_guardrails_list_get_with_http_info(opts = {}) ⇒ Array<(ListGuardrailsResponse, Integer, Hash)>

List Guardrails List the guardrails that are available on the proxy server 👉 [Guardrail docs](docs.litellm.ai/docs/proxy/guardrails/quick_start) Example Request: &#x60;&#x60;&#x60;bash curl -X GET &quot;localhost:4000/guardrails/list&quot; -H &quot;Authorization: Bearer &lt;your_api_key&gt;&quot; &#x60;&#x60;&#x60; Example Response: &#x60;&#x60;&#x60;json { &quot;guardrails&quot;: [ { &quot;guardrail_name&quot;: &quot;bedrock-pre-guard&quot;, &quot;guardrail_info&quot;: { &quot;params&quot;: [ { &quot;name&quot;: &quot;toxicity_score&quot;, &quot;type&quot;: &quot;float&quot;, &quot;description&quot;: &quot;Score between 0-1 indicating content toxicity level&quot; }, { &quot;name&quot;: &quot;pii_detection&quot;, &quot;type&quot;: &quot;boolean&quot; } ] } } ] } &#x60;&#x60;&#x60;



474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
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
# File 'lib/litellm_client/api/guardrails_api.rb', line 474

def list_guardrails_guardrails_list_get_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: GuardrailsApi.list_guardrails_guardrails_list_get ...'
  end
  # resource path
  local_var_path = '/guardrails/list'

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

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

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

#list_guardrails_v2_v2_guardrails_list_get(opts = {}) ⇒ ListGuardrailsResponse

List Guardrails V2 List the guardrails that are available in the database using GuardrailRegistry 👉 [Guardrail docs](docs.litellm.ai/docs/proxy/guardrails/quick_start) Example Request: “‘bash curl -X GET "localhost:4000/v2/guardrails/list" -H "Authorization: Bearer <your_api_key>" “` Example Response: “`json { "guardrails": [ { "guardrail_id": "123e4567-e89b-12d3-a456-426614174000", "guardrail_name": "my-bedrock-guard", "litellm_params": { "guardrail": "bedrock", "mode": "pre_call", "guardrailIdentifier": "ff6ujrregl1q", "guardrailVersion": "DRAFT", "default_on": true }, "guardrail_info": { "description": "Bedrock content moderation guardrail" } } ] } “`



522
523
524
525
# File 'lib/litellm_client/api/guardrails_api.rb', line 522

def list_guardrails_v2_v2_guardrails_list_get(opts = {})
  data, _status_code, _headers = list_guardrails_v2_v2_guardrails_list_get_with_http_info(opts)
  data
end

#list_guardrails_v2_v2_guardrails_list_get_with_http_info(opts = {}) ⇒ Array<(ListGuardrailsResponse, Integer, Hash)>

List Guardrails V2 List the guardrails that are available in the database using GuardrailRegistry 👉 [Guardrail docs](docs.litellm.ai/docs/proxy/guardrails/quick_start) Example Request: &#x60;&#x60;&#x60;bash curl -X GET &quot;localhost:4000/v2/guardrails/list&quot; -H &quot;Authorization: Bearer &lt;your_api_key&gt;&quot; &#x60;&#x60;&#x60; Example Response: &#x60;&#x60;&#x60;json { &quot;guardrails&quot;: [ { &quot;guardrail_id&quot;: &quot;123e4567-e89b-12d3-a456-426614174000&quot;, &quot;guardrail_name&quot;: &quot;my-bedrock-guard&quot;, &quot;litellm_params&quot;: { &quot;guardrail&quot;: &quot;bedrock&quot;, &quot;mode&quot;: &quot;pre_call&quot;, &quot;guardrailIdentifier&quot;: &quot;ff6ujrregl1q&quot;, &quot;guardrailVersion&quot;: &quot;DRAFT&quot;, &quot;default_on&quot;: true }, &quot;guardrail_info&quot;: { &quot;description&quot;: &quot;Bedrock content moderation guardrail&quot; } } ] } &#x60;&#x60;&#x60;



531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
# File 'lib/litellm_client/api/guardrails_api.rb', line 531

def list_guardrails_v2_v2_guardrails_list_get_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: GuardrailsApi.list_guardrails_v2_v2_guardrails_list_get ...'
  end
  # resource path
  local_var_path = '/v2/guardrails/list'

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

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

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

#patch_guardrail_guardrails_guardrail_id_patch(guardrail_id, patch_guardrail_request, opts = {}) ⇒ Object

Patch Guardrail Partially update an existing guardrail 👉 [Guardrail docs](docs.litellm.ai/docs/proxy/guardrails/quick_start) This endpoint allows updating specific fields of a guardrail without sending the entire object. Only the following fields can be updated: - guardrail_name: The name of the guardrail - default_on: Whether the guardrail is enabled by default - guardrail_info: Additional information about the guardrail Example Request: “‘bash curl -X PATCH "localhost:4000/guardrails/123e4567-e89b-12d3-a456-426614174000" \ -H "Authorization: Bearer <your_api_key>" \ -H "Content-Type: application/json" \ -d ’{ "guardrail_name": "updated-name", "default_on": true, "guardrail_info": { "description": "Updated description" } }‘ “` Example Response: “`json { "guardrail_id": "123e4567-e89b-12d3-a456-426614174000", "guardrail_name": "updated-name", "litellm_params": { "guardrail": "bedrock", "mode": "pre_call", "guardrailIdentifier": "ff6ujrregl1q", "guardrailVersion": "DRAFT", "default_on": true }, "guardrail_info": { "description": "Updated description" }, "created_at": "2023-11-09T12:34:56.789Z", "updated_at": "2023-11-09T14:22:33.456Z" } “`



581
582
583
584
# File 'lib/litellm_client/api/guardrails_api.rb', line 581

def patch_guardrail_guardrails_guardrail_id_patch(guardrail_id, patch_guardrail_request, opts = {})
  data, _status_code, _headers = patch_guardrail_guardrails_guardrail_id_patch_with_http_info(guardrail_id, patch_guardrail_request, opts)
  data
end

#patch_guardrail_guardrails_guardrail_id_patch_with_http_info(guardrail_id, patch_guardrail_request, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Patch Guardrail Partially update an existing guardrail 👉 [Guardrail docs](docs.litellm.ai/docs/proxy/guardrails/quick_start) This endpoint allows updating specific fields of a guardrail without sending the entire object. Only the following fields can be updated: - guardrail_name: The name of the guardrail - default_on: Whether the guardrail is enabled by default - guardrail_info: Additional information about the guardrail Example Request: &#x60;&#x60;&#x60;bash curl -X PATCH &quot;localhost:4000/guardrails/123e4567-e89b-12d3-a456-426614174000&quot; \ -H &quot;Authorization: Bearer &lt;your_api_key&gt;&quot; \ -H &quot;Content-Type: application/json&quot; \ -d &#39;{ &quot;guardrail_name&quot;: &quot;updated-name&quot;, &quot;default_on&quot;: true, &quot;guardrail_info&quot;: { &quot;description&quot;: &quot;Updated description&quot; } }&#39; &#x60;&#x60;&#x60; Example Response: &#x60;&#x60;&#x60;json { &quot;guardrail_id&quot;: &quot;123e4567-e89b-12d3-a456-426614174000&quot;, &quot;guardrail_name&quot;: &quot;updated-name&quot;, &quot;litellm_params&quot;: { &quot;guardrail&quot;: &quot;bedrock&quot;, &quot;mode&quot;: &quot;pre_call&quot;, &quot;guardrailIdentifier&quot;: &quot;ff6ujrregl1q&quot;, &quot;guardrailVersion&quot;: &quot;DRAFT&quot;, &quot;default_on&quot;: true }, &quot;guardrail_info&quot;: { &quot;description&quot;: &quot;Updated description&quot; }, &quot;created_at&quot;: &quot;2023-11-09T12:34:56.789Z&quot;, &quot;updated_at&quot;: &quot;2023-11-09T14:22:33.456Z&quot; } &#x60;&#x60;&#x60;



592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
# File 'lib/litellm_client/api/guardrails_api.rb', line 592

def patch_guardrail_guardrails_guardrail_id_patch_with_http_info(guardrail_id, patch_guardrail_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: GuardrailsApi.patch_guardrail_guardrails_guardrail_id_patch ...'
  end
  # verify the required parameter 'guardrail_id' is set
  if @api_client.config.client_side_validation && guardrail_id.nil?
    fail ArgumentError, "Missing the required parameter 'guardrail_id' when calling GuardrailsApi.patch_guardrail_guardrails_guardrail_id_patch"
  end
  # verify the required parameter 'patch_guardrail_request' is set
  if @api_client.config.client_side_validation && patch_guardrail_request.nil?
    fail ArgumentError, "Missing the required parameter 'patch_guardrail_request' when calling GuardrailsApi.patch_guardrail_guardrails_guardrail_id_patch"
  end
  # resource path
  local_var_path = '/guardrails/{guardrail_id}'.sub('{' + 'guardrail_id' + '}', CGI.escape(guardrail_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(patch_guardrail_request)

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

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

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

#update_guardrail_guardrails_guardrail_id_put(guardrail_id, update_guardrail_request, opts = {}) ⇒ Object

Update Guardrail Update an existing guardrail 👉 [Guardrail docs](docs.litellm.ai/docs/proxy/guardrails/quick_start) Example Request: “‘bash curl -X PUT "localhost:4000/guardrails/123e4567-e89b-12d3-a456-426614174000" \ -H "Authorization: Bearer <your_api_key>" \ -H "Content-Type: application/json" \ -d ’{ "guardrail": { "guardrail_name": "updated-bedrock-guard", "litellm_params": { "guardrail": "bedrock", "mode": "pre_call", "guardrailIdentifier": "ff6ujrregl1q", "guardrailVersion": "1.0", "default_on": true }, "guardrail_info": { "description": "Updated Bedrock content moderation guardrail" } } }‘ “` Example Response: “`json { "guardrail_id": "123e4567-e89b-12d3-a456-426614174000", "guardrail_name": "updated-bedrock-guard", "litellm_params": { "guardrail": "bedrock", "mode": "pre_call", "guardrailIdentifier": "ff6ujrregl1q", "guardrailVersion": "1.0", "default_on": true }, "guardrail_info": { "description": "Updated Bedrock content moderation guardrail" }, "created_at": "2023-11-09T12:34:56.789Z", "updated_at": "2023-11-09T13:45:12.345Z" } “`



655
656
657
658
# File 'lib/litellm_client/api/guardrails_api.rb', line 655

def update_guardrail_guardrails_guardrail_id_put(guardrail_id, update_guardrail_request, opts = {})
  data, _status_code, _headers = update_guardrail_guardrails_guardrail_id_put_with_http_info(guardrail_id, update_guardrail_request, opts)
  data
end

#update_guardrail_guardrails_guardrail_id_put_with_http_info(guardrail_id, update_guardrail_request, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Update Guardrail Update an existing guardrail 👉 [Guardrail docs](docs.litellm.ai/docs/proxy/guardrails/quick_start) Example Request: &#x60;&#x60;&#x60;bash curl -X PUT &quot;localhost:4000/guardrails/123e4567-e89b-12d3-a456-426614174000&quot; \ -H &quot;Authorization: Bearer &lt;your_api_key&gt;&quot; \ -H &quot;Content-Type: application/json&quot; \ -d &#39;{ &quot;guardrail&quot;: { &quot;guardrail_name&quot;: &quot;updated-bedrock-guard&quot;, &quot;litellm_params&quot;: { &quot;guardrail&quot;: &quot;bedrock&quot;, &quot;mode&quot;: &quot;pre_call&quot;, &quot;guardrailIdentifier&quot;: &quot;ff6ujrregl1q&quot;, &quot;guardrailVersion&quot;: &quot;1.0&quot;, &quot;default_on&quot;: true }, &quot;guardrail_info&quot;: { &quot;description&quot;: &quot;Updated Bedrock content moderation guardrail&quot; } } }&#39; &#x60;&#x60;&#x60; Example Response: &#x60;&#x60;&#x60;json { &quot;guardrail_id&quot;: &quot;123e4567-e89b-12d3-a456-426614174000&quot;, &quot;guardrail_name&quot;: &quot;updated-bedrock-guard&quot;, &quot;litellm_params&quot;: { &quot;guardrail&quot;: &quot;bedrock&quot;, &quot;mode&quot;: &quot;pre_call&quot;, &quot;guardrailIdentifier&quot;: &quot;ff6ujrregl1q&quot;, &quot;guardrailVersion&quot;: &quot;1.0&quot;, &quot;default_on&quot;: true }, &quot;guardrail_info&quot;: { &quot;description&quot;: &quot;Updated Bedrock content moderation guardrail&quot; }, &quot;created_at&quot;: &quot;2023-11-09T12:34:56.789Z&quot;, &quot;updated_at&quot;: &quot;2023-11-09T13:45:12.345Z&quot; } &#x60;&#x60;&#x60;



666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
# File 'lib/litellm_client/api/guardrails_api.rb', line 666

def update_guardrail_guardrails_guardrail_id_put_with_http_info(guardrail_id, update_guardrail_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: GuardrailsApi.update_guardrail_guardrails_guardrail_id_put ...'
  end
  # verify the required parameter 'guardrail_id' is set
  if @api_client.config.client_side_validation && guardrail_id.nil?
    fail ArgumentError, "Missing the required parameter 'guardrail_id' when calling GuardrailsApi.update_guardrail_guardrails_guardrail_id_put"
  end
  # verify the required parameter 'update_guardrail_request' is set
  if @api_client.config.client_side_validation && update_guardrail_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_guardrail_request' when calling GuardrailsApi.update_guardrail_guardrails_guardrail_id_put"
  end
  # resource path
  local_var_path = '/guardrails/{guardrail_id}'.sub('{' + 'guardrail_id' + '}', CGI.escape(guardrail_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(update_guardrail_request)

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

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

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