Class: LiteLLMClient::BatchApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ BatchApi

Returns a new instance of BatchApi.



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

def api_client
  @api_client
end

Instance Method Details

#cancel_batch_batches_batch_id_cancel_post(batch_id, opts = {}) ⇒ Object

Cancel Batch Cancel a batch. This is the equivalent of POST api.openai.com/v1/batches/batch_id/cancel Supports Identical Params as: platform.openai.com/docs/api-reference/batch/cancel Example Curl “‘ curl localhost:4000/v1/batches/batch_abc123/cancel -H "Authorization: Bearer sk-1234" -H "Content-Type: application/json" -X POST “`

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :provider (String)

Returns:

  • (Object)


28
29
30
31
# File 'lib/litellm_client/api/batch_api.rb', line 28

def cancel_batch_batches_batch_id_cancel_post(batch_id, opts = {})
  data, _status_code, _headers = cancel_batch_batches_batch_id_cancel_post_with_http_info(batch_id, opts)
  data
end

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

Cancel Batch Cancel a batch. This is the equivalent of POST api.openai.com/v1/batches/batch_id/cancel Supports Identical Params as: platform.openai.com/docs/api-reference/batch/cancel Example Curl &#x60;&#x60;&#x60; curl localhost:4000/v1/batches/batch_abc123/cancel -H &quot;Authorization: Bearer sk-1234&quot; -H &quot;Content-Type: application/json&quot; -X POST &#x60;&#x60;&#x60;

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :provider (String)

Returns:

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

    Object data, response status code and response headers



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

def cancel_batch_batches_batch_id_cancel_post_with_http_info(batch_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BatchApi.cancel_batch_batches_batch_id_cancel_post ...'
  end
  # verify the required parameter 'batch_id' is set
  if @api_client.config.client_side_validation && batch_id.nil?
    fail ArgumentError, "Missing the required parameter 'batch_id' when calling BatchApi.cancel_batch_batches_batch_id_cancel_post"
  end
  # resource path
  local_var_path = '/batches/{batch_id}/cancel'.sub('{' + 'batch_id' + '}', CGI.escape(batch_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'provider'] = opts[:'provider'] if !opts[:'provider'].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] || 'Object'

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

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

#cancel_batch_provider_v1_batches_batch_id_cancel_post(batch_id, provider, opts = {}) ⇒ Object

Cancel Batch Cancel a batch. This is the equivalent of POST api.openai.com/v1/batches/batch_id/cancel Supports Identical Params as: platform.openai.com/docs/api-reference/batch/cancel Example Curl “‘ curl localhost:4000/v1/batches/batch_abc123/cancel -H "Authorization: Bearer sk-1234" -H "Content-Type: application/json" -X POST “`

Parameters:

  • batch_id (String)
  • provider (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Object)


94
95
96
97
# File 'lib/litellm_client/api/batch_api.rb', line 94

def cancel_batch_provider_v1_batches_batch_id_cancel_post(batch_id, provider, opts = {})
  data, _status_code, _headers = cancel_batch_provider_v1_batches_batch_id_cancel_post_with_http_info(batch_id, provider, opts)
  data
end

#cancel_batch_provider_v1_batches_batch_id_cancel_post_with_http_info(batch_id, provider, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Cancel Batch Cancel a batch. This is the equivalent of POST api.openai.com/v1/batches/batch_id/cancel Supports Identical Params as: platform.openai.com/docs/api-reference/batch/cancel Example Curl &#x60;&#x60;&#x60; curl localhost:4000/v1/batches/batch_abc123/cancel -H &quot;Authorization: Bearer sk-1234&quot; -H &quot;Content-Type: application/json&quot; -X POST &#x60;&#x60;&#x60;

Parameters:

  • batch_id (String)
  • provider (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    Object data, response status code and response headers



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
# File 'lib/litellm_client/api/batch_api.rb', line 105

def cancel_batch_provider_v1_batches_batch_id_cancel_post_with_http_info(batch_id, provider, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BatchApi.cancel_batch_provider_v1_batches_batch_id_cancel_post ...'
  end
  # verify the required parameter 'batch_id' is set
  if @api_client.config.client_side_validation && batch_id.nil?
    fail ArgumentError, "Missing the required parameter 'batch_id' when calling BatchApi.cancel_batch_provider_v1_batches_batch_id_cancel_post"
  end
  # resource path
  local_var_path = '/{provider}/v1/batches/{batch_id}/cancel'.sub('{' + 'batch_id' + '}', CGI.escape(batch_id.to_s)).sub('{' + 'provider' + '}', CGI.escape(provider.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 => :"BatchApi.cancel_batch_provider_v1_batches_batch_id_cancel_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: BatchApi#cancel_batch_provider_v1_batches_batch_id_cancel_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#cancel_batch_v1_batches_batch_id_cancel_post(batch_id, opts = {}) ⇒ Object

Cancel Batch Cancel a batch. This is the equivalent of POST api.openai.com/v1/batches/batch_id/cancel Supports Identical Params as: platform.openai.com/docs/api-reference/batch/cancel Example Curl “‘ curl localhost:4000/v1/batches/batch_abc123/cancel -H "Authorization: Bearer sk-1234" -H "Content-Type: application/json" -X POST “`

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :provider (String)

Returns:

  • (Object)


159
160
161
162
# File 'lib/litellm_client/api/batch_api.rb', line 159

def cancel_batch_v1_batches_batch_id_cancel_post(batch_id, opts = {})
  data, _status_code, _headers = cancel_batch_v1_batches_batch_id_cancel_post_with_http_info(batch_id, opts)
  data
end

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

Cancel Batch Cancel a batch. This is the equivalent of POST api.openai.com/v1/batches/batch_id/cancel Supports Identical Params as: platform.openai.com/docs/api-reference/batch/cancel Example Curl &#x60;&#x60;&#x60; curl localhost:4000/v1/batches/batch_abc123/cancel -H &quot;Authorization: Bearer sk-1234&quot; -H &quot;Content-Type: application/json&quot; -X POST &#x60;&#x60;&#x60;

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :provider (String)

Returns:

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

    Object data, response status code and response headers



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

def cancel_batch_v1_batches_batch_id_cancel_post_with_http_info(batch_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BatchApi.cancel_batch_v1_batches_batch_id_cancel_post ...'
  end
  # verify the required parameter 'batch_id' is set
  if @api_client.config.client_side_validation && batch_id.nil?
    fail ArgumentError, "Missing the required parameter 'batch_id' when calling BatchApi.cancel_batch_v1_batches_batch_id_cancel_post"
  end
  # resource path
  local_var_path = '/v1/batches/{batch_id}/cancel'.sub('{' + 'batch_id' + '}', CGI.escape(batch_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'provider'] = opts[:'provider'] if !opts[:'provider'].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] || 'Object'

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

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

#create_batch_batches_post(opts = {}) ⇒ Object

Create Batch Create large batches of API requests for asynchronous processing. This is the equivalent of POST api.openai.com/v1/batch Supports Identical Params as: platform.openai.com/docs/api-reference/batch Example Curl “‘ curl localhost:4000/v1/batches -H "Authorization: Bearer sk-1234" -H "Content-Type: application/json" -d ’{ "input_file_id": "file-abc123", "endpoint": "/v1/chat/completions", "completion_window": "24h" }‘ “`

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :provider (String)

Returns:

  • (Object)


224
225
226
227
# File 'lib/litellm_client/api/batch_api.rb', line 224

def create_batch_batches_post(opts = {})
  data, _status_code, _headers = create_batch_batches_post_with_http_info(opts)
  data
end

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

Create Batch Create large batches of API requests for asynchronous processing. This is the equivalent of POST api.openai.com/v1/batch Supports Identical Params as: platform.openai.com/docs/api-reference/batch Example Curl &#x60;&#x60;&#x60; curl localhost:4000/v1/batches -H &quot;Authorization: Bearer sk-1234&quot; -H &quot;Content-Type: application/json&quot; -d &#39;{ &quot;input_file_id&quot;: &quot;file-abc123&quot;, &quot;endpoint&quot;: &quot;/v1/chat/completions&quot;, &quot;completion_window&quot;: &quot;24h&quot; }&#39; &#x60;&#x60;&#x60;

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :provider (String)

Returns:

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

    Object data, response status code and response headers



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

def create_batch_batches_post_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BatchApi.create_batch_batches_post ...'
  end
  # resource path
  local_var_path = '/batches'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'provider'] = opts[:'provider'] if !opts[:'provider'].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] || 'Object'

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

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

#create_batch_provider_v1_batches_post(provider, opts = {}) ⇒ Object

Create Batch Create large batches of API requests for asynchronous processing. This is the equivalent of POST api.openai.com/v1/batch Supports Identical Params as: platform.openai.com/docs/api-reference/batch Example Curl “‘ curl localhost:4000/v1/batches -H "Authorization: Bearer sk-1234" -H "Content-Type: application/json" -d ’{ "input_file_id": "file-abc123", "endpoint": "/v1/chat/completions", "completion_window": "24h" }‘ “`

Parameters:

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

    the optional parameters

Returns:

  • (Object)


284
285
286
287
# File 'lib/litellm_client/api/batch_api.rb', line 284

def create_batch_provider_v1_batches_post(provider, opts = {})
  data, _status_code, _headers = create_batch_provider_v1_batches_post_with_http_info(provider, opts)
  data
end

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

Create Batch Create large batches of API requests for asynchronous processing. This is the equivalent of POST api.openai.com/v1/batch Supports Identical Params as: platform.openai.com/docs/api-reference/batch Example Curl &#x60;&#x60;&#x60; curl localhost:4000/v1/batches -H &quot;Authorization: Bearer sk-1234&quot; -H &quot;Content-Type: application/json&quot; -d &#39;{ &quot;input_file_id&quot;: &quot;file-abc123&quot;, &quot;endpoint&quot;: &quot;/v1/chat/completions&quot;, &quot;completion_window&quot;: &quot;24h&quot; }&#39; &#x60;&#x60;&#x60;

Parameters:

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

    the optional parameters

Returns:

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

    Object data, response status code and response headers



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
327
328
329
330
331
332
333
334
335
336
# File 'lib/litellm_client/api/batch_api.rb', line 294

def create_batch_provider_v1_batches_post_with_http_info(provider, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BatchApi.create_batch_provider_v1_batches_post ...'
  end
  # resource path
  local_var_path = '/{provider}/v1/batches'.sub('{' + 'provider' + '}', CGI.escape(provider.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 => :"BatchApi.create_batch_provider_v1_batches_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: BatchApi#create_batch_provider_v1_batches_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_batch_v1_batches_post(opts = {}) ⇒ Object

Create Batch Create large batches of API requests for asynchronous processing. This is the equivalent of POST api.openai.com/v1/batch Supports Identical Params as: platform.openai.com/docs/api-reference/batch Example Curl “‘ curl localhost:4000/v1/batches -H "Authorization: Bearer sk-1234" -H "Content-Type: application/json" -d ’{ "input_file_id": "file-abc123", "endpoint": "/v1/chat/completions", "completion_window": "24h" }‘ “`

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :provider (String)

Returns:

  • (Object)


343
344
345
346
# File 'lib/litellm_client/api/batch_api.rb', line 343

def create_batch_v1_batches_post(opts = {})
  data, _status_code, _headers = create_batch_v1_batches_post_with_http_info(opts)
  data
end

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

Create Batch Create large batches of API requests for asynchronous processing. This is the equivalent of POST api.openai.com/v1/batch Supports Identical Params as: platform.openai.com/docs/api-reference/batch Example Curl &#x60;&#x60;&#x60; curl localhost:4000/v1/batches -H &quot;Authorization: Bearer sk-1234&quot; -H &quot;Content-Type: application/json&quot; -d &#39;{ &quot;input_file_id&quot;: &quot;file-abc123&quot;, &quot;endpoint&quot;: &quot;/v1/chat/completions&quot;, &quot;completion_window&quot;: &quot;24h&quot; }&#39; &#x60;&#x60;&#x60;

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :provider (String)

Returns:

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

    Object data, response status code and response headers



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
# File 'lib/litellm_client/api/batch_api.rb', line 353

def create_batch_v1_batches_post_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BatchApi.create_batch_v1_batches_post ...'
  end
  # resource path
  local_var_path = '/v1/batches'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'provider'] = opts[:'provider'] if !opts[:'provider'].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] || 'Object'

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

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

#list_batches_batches_get(opts = {}) ⇒ Object

List Batches Lists This is the equivalent of GET api.openai.com/v1/batches/ Supports Identical Params as: platform.openai.com/docs/api-reference/batch/list Example Curl “‘ curl localhost:4000/v1/batches?limit=2 -H "Authorization: Bearer sk-1234" -H "Content-Type: application/json" “`

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :provider (String)
  • :limit (Integer)
  • :after (String)

Returns:

  • (Object)


405
406
407
408
# File 'lib/litellm_client/api/batch_api.rb', line 405

def list_batches_batches_get(opts = {})
  data, _status_code, _headers = list_batches_batches_get_with_http_info(opts)
  data
end

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

List Batches Lists This is the equivalent of GET api.openai.com/v1/batches/ Supports Identical Params as: platform.openai.com/docs/api-reference/batch/list Example Curl &#x60;&#x60;&#x60; curl localhost:4000/v1/batches?limit&#x3D;2 -H &quot;Authorization: Bearer sk-1234&quot; -H &quot;Content-Type: application/json&quot; &#x60;&#x60;&#x60;

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :provider (String)
  • :limit (Integer)
  • :after (String)

Returns:

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

    Object data, response status code and response headers



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
460
461
462
# File 'lib/litellm_client/api/batch_api.rb', line 417

def list_batches_batches_get_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BatchApi.list_batches_batches_get ...'
  end
  # resource path
  local_var_path = '/batches'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'provider'] = opts[:'provider'] if !opts[:'provider'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'after'] = opts[:'after'] if !opts[:'after'].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] || 'Object'

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

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

#list_batches_provider_v1_batches_get(provider, opts = {}) ⇒ Object

List Batches Lists This is the equivalent of GET api.openai.com/v1/batches/ Supports Identical Params as: platform.openai.com/docs/api-reference/batch/list Example Curl “‘ curl localhost:4000/v1/batches?limit=2 -H "Authorization: Bearer sk-1234" -H "Content-Type: application/json" “`

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)
  • :after (String)

Returns:

  • (Object)


471
472
473
474
# File 'lib/litellm_client/api/batch_api.rb', line 471

def list_batches_provider_v1_batches_get(provider, opts = {})
  data, _status_code, _headers = list_batches_provider_v1_batches_get_with_http_info(provider, opts)
  data
end

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

List Batches Lists This is the equivalent of GET api.openai.com/v1/batches/ Supports Identical Params as: platform.openai.com/docs/api-reference/batch/list Example Curl &#x60;&#x60;&#x60; curl localhost:4000/v1/batches?limit&#x3D;2 -H &quot;Authorization: Bearer sk-1234&quot; -H &quot;Content-Type: application/json&quot; &#x60;&#x60;&#x60;

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)
  • :after (String)

Returns:

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

    Object data, response status code and response headers



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
517
518
519
520
521
522
523
524
525
526
527
# File 'lib/litellm_client/api/batch_api.rb', line 483

def list_batches_provider_v1_batches_get_with_http_info(provider, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BatchApi.list_batches_provider_v1_batches_get ...'
  end
  # resource path
  local_var_path = '/{provider}/v1/batches'.sub('{' + 'provider' + '}', CGI.escape(provider.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'after'] = opts[:'after'] if !opts[:'after'].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] || 'Object'

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

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

#list_batches_v1_batches_get(opts = {}) ⇒ Object

List Batches Lists This is the equivalent of GET api.openai.com/v1/batches/ Supports Identical Params as: platform.openai.com/docs/api-reference/batch/list Example Curl “‘ curl localhost:4000/v1/batches?limit=2 -H "Authorization: Bearer sk-1234" -H "Content-Type: application/json" “`

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :provider (String)
  • :limit (Integer)
  • :after (String)

Returns:

  • (Object)


536
537
538
539
# File 'lib/litellm_client/api/batch_api.rb', line 536

def list_batches_v1_batches_get(opts = {})
  data, _status_code, _headers = list_batches_v1_batches_get_with_http_info(opts)
  data
end

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

List Batches Lists This is the equivalent of GET api.openai.com/v1/batches/ Supports Identical Params as: platform.openai.com/docs/api-reference/batch/list Example Curl &#x60;&#x60;&#x60; curl localhost:4000/v1/batches?limit&#x3D;2 -H &quot;Authorization: Bearer sk-1234&quot; -H &quot;Content-Type: application/json&quot; &#x60;&#x60;&#x60;

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :provider (String)
  • :limit (Integer)
  • :after (String)

Returns:

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

    Object data, response status code and response headers



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
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
# File 'lib/litellm_client/api/batch_api.rb', line 548

def list_batches_v1_batches_get_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BatchApi.list_batches_v1_batches_get ...'
  end
  # resource path
  local_var_path = '/v1/batches'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'provider'] = opts[:'provider'] if !opts[:'provider'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'after'] = opts[:'after'] if !opts[:'after'].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] || 'Object'

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

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

#retrieve_batch_batches_batch_id_get(batch_id, opts = {}) ⇒ Object

Retrieve Batch Retrieves a batch. This is the equivalent of GET api.openai.com/v1/batches/batch_id Supports Identical Params as: platform.openai.com/docs/api-reference/batch/retrieve Example Curl “‘ curl localhost:4000/v1/batches/batch_abc123 -H "Authorization: Bearer sk-1234" -H "Content-Type: application/json" “`

Parameters:

  • batch_id (String)

    The ID of the batch to retrieve

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

    the optional parameters

Options Hash (opts):

  • :provider (String)

Returns:

  • (Object)


601
602
603
604
# File 'lib/litellm_client/api/batch_api.rb', line 601

def retrieve_batch_batches_batch_id_get(batch_id, opts = {})
  data, _status_code, _headers = retrieve_batch_batches_batch_id_get_with_http_info(batch_id, opts)
  data
end

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

Retrieve Batch Retrieves a batch. This is the equivalent of GET api.openai.com/v1/batches/batch_id Supports Identical Params as: platform.openai.com/docs/api-reference/batch/retrieve Example Curl &#x60;&#x60;&#x60; curl localhost:4000/v1/batches/batch_abc123 -H &quot;Authorization: Bearer sk-1234&quot; -H &quot;Content-Type: application/json&quot; &#x60;&#x60;&#x60;

Parameters:

  • batch_id (String)

    The ID of the batch to retrieve

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

    the optional parameters

Options Hash (opts):

  • :provider (String)

Returns:

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

    Object data, response status code and response headers



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
648
649
650
651
652
653
654
655
656
657
658
659
# File 'lib/litellm_client/api/batch_api.rb', line 612

def retrieve_batch_batches_batch_id_get_with_http_info(batch_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BatchApi.retrieve_batch_batches_batch_id_get ...'
  end
  # verify the required parameter 'batch_id' is set
  if @api_client.config.client_side_validation && batch_id.nil?
    fail ArgumentError, "Missing the required parameter 'batch_id' when calling BatchApi.retrieve_batch_batches_batch_id_get"
  end
  # resource path
  local_var_path = '/batches/{batch_id}'.sub('{' + 'batch_id' + '}', CGI.escape(batch_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'provider'] = opts[:'provider'] if !opts[:'provider'].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] || 'Object'

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

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

#retrieve_batch_provider_v1_batches_batch_id_get(provider, batch_id, opts = {}) ⇒ Object

Retrieve Batch Retrieves a batch. This is the equivalent of GET api.openai.com/v1/batches/batch_id Supports Identical Params as: platform.openai.com/docs/api-reference/batch/retrieve Example Curl “‘ curl localhost:4000/v1/batches/batch_abc123 -H "Authorization: Bearer sk-1234" -H "Content-Type: application/json" “`

Parameters:

  • provider (String)
  • batch_id (String)

    The ID of the batch to retrieve

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

    the optional parameters

Returns:

  • (Object)


667
668
669
670
# File 'lib/litellm_client/api/batch_api.rb', line 667

def retrieve_batch_provider_v1_batches_batch_id_get(provider, batch_id, opts = {})
  data, _status_code, _headers = retrieve_batch_provider_v1_batches_batch_id_get_with_http_info(provider, batch_id, opts)
  data
end

#retrieve_batch_provider_v1_batches_batch_id_get_with_http_info(provider, batch_id, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Retrieve Batch Retrieves a batch. This is the equivalent of GET api.openai.com/v1/batches/batch_id Supports Identical Params as: platform.openai.com/docs/api-reference/batch/retrieve Example Curl &#x60;&#x60;&#x60; curl localhost:4000/v1/batches/batch_abc123 -H &quot;Authorization: Bearer sk-1234&quot; -H &quot;Content-Type: application/json&quot; &#x60;&#x60;&#x60;

Parameters:

  • provider (String)
  • batch_id (String)

    The ID of the batch to retrieve

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

    the optional parameters

Returns:

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

    Object data, response status code and response headers



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
722
723
724
# File 'lib/litellm_client/api/batch_api.rb', line 678

def retrieve_batch_provider_v1_batches_batch_id_get_with_http_info(provider, batch_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BatchApi.retrieve_batch_provider_v1_batches_batch_id_get ...'
  end
  # verify the required parameter 'batch_id' is set
  if @api_client.config.client_side_validation && batch_id.nil?
    fail ArgumentError, "Missing the required parameter 'batch_id' when calling BatchApi.retrieve_batch_provider_v1_batches_batch_id_get"
  end
  # resource path
  local_var_path = '/{provider}/v1/batches/{batch_id}'.sub('{' + 'provider' + '}', CGI.escape(provider.to_s)).sub('{' + 'batch_id' + '}', CGI.escape(batch_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 => :"BatchApi.retrieve_batch_provider_v1_batches_batch_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: BatchApi#retrieve_batch_provider_v1_batches_batch_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#retrieve_batch_v1_batches_batch_id_get(batch_id, opts = {}) ⇒ Object

Retrieve Batch Retrieves a batch. This is the equivalent of GET api.openai.com/v1/batches/batch_id Supports Identical Params as: platform.openai.com/docs/api-reference/batch/retrieve Example Curl “‘ curl localhost:4000/v1/batches/batch_abc123 -H "Authorization: Bearer sk-1234" -H "Content-Type: application/json" “`

Parameters:

  • batch_id (String)

    The ID of the batch to retrieve

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

    the optional parameters

Options Hash (opts):

  • :provider (String)

Returns:

  • (Object)


732
733
734
735
# File 'lib/litellm_client/api/batch_api.rb', line 732

def retrieve_batch_v1_batches_batch_id_get(batch_id, opts = {})
  data, _status_code, _headers = retrieve_batch_v1_batches_batch_id_get_with_http_info(batch_id, opts)
  data
end

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

Retrieve Batch Retrieves a batch. This is the equivalent of GET api.openai.com/v1/batches/batch_id Supports Identical Params as: platform.openai.com/docs/api-reference/batch/retrieve Example Curl &#x60;&#x60;&#x60; curl localhost:4000/v1/batches/batch_abc123 -H &quot;Authorization: Bearer sk-1234&quot; -H &quot;Content-Type: application/json&quot; &#x60;&#x60;&#x60;

Parameters:

  • batch_id (String)

    The ID of the batch to retrieve

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

    the optional parameters

Options Hash (opts):

  • :provider (String)

Returns:

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

    Object data, response status code and response headers



743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
# File 'lib/litellm_client/api/batch_api.rb', line 743

def retrieve_batch_v1_batches_batch_id_get_with_http_info(batch_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BatchApi.retrieve_batch_v1_batches_batch_id_get ...'
  end
  # verify the required parameter 'batch_id' is set
  if @api_client.config.client_side_validation && batch_id.nil?
    fail ArgumentError, "Missing the required parameter 'batch_id' when calling BatchApi.retrieve_batch_v1_batches_batch_id_get"
  end
  # resource path
  local_var_path = '/v1/batches/{batch_id}'.sub('{' + 'batch_id' + '}', CGI.escape(batch_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'provider'] = opts[:'provider'] if !opts[:'provider'].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] || 'Object'

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

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